Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Remove a span from an array, returning undefined if no spans are left (we don't store arrays for lines without spans).
function removeMarkedSpan(spans, span) { var r; for (var i = 0; i < spans.length; ++i) { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } return r }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeMarkedSpan(spans, span) {\n\t\t for (var r, i = 0; i < spans.length; ++i)\n\t\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t\t return r;\n\t\t }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n for (var r, i = 0; i < spans.length; ++i)\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\n return r;\n }", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\n\t for (var r, i = 0; i < spans.length; ++i)\n\t if (spans[i] != span) (r || (r = [])).push(spans[i]);\n\t return r;\n\t }", "function removeMarkedSpan(spans, span) {\r\n for (var r, i = 0; i < spans.length; ++i)\r\n if (spans[i] != span) (r || (r = [])).push(spans[i]);\r\n return r;\r\n }", "function removeMarkedSpan(spans, span) {\n\t\t var r;\n\t\t for (var i = 0; i < spans.length; ++i)\n\t\t { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n\t\t return r\n\t\t }", "function removeMarkedSpan(spans, span) {\n var r;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i] != span) {\n (r || (r = [])).push(spans[i]);\n }\n }\n\n return r;\n } // Add a span to a line.", "function removeMarkedSpan(spans, span) {\r\n var r;\r\n for (var i = 0; i < spans.length; ++i)\r\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\r\n return r\r\n}", "function removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\r\n if (!spans) { return null }\r\n var out;\r\n for (var i = 0; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\r\n else if (out) { out.push(spans[i]); }\r\n }\r\n return !out ? spans : out.length ? out : null\r\n}", "function removeClearedSpans(spans) {\n if (!spans) {\n return null;\n }\n\n var out;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) {\n if (!out) {\n out = spans.slice(0, i);\n }\n } else if (out) {\n out.push(spans[i]);\n }\n }\n\n return !out ? spans : out.length ? out : null;\n } // Retrieve and filter the old marked spans stored in a change event.", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n\t\t if (!spans) { return null }\n\t\t var out;\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n\t\t else if (out) { out.push(spans[i]); }\n\t\t }\n\t\t return !out ? spans : out.length ? out : null\n\t\t }", "function removeClearedSpans(spans) {\r\n if (!spans) return null;\r\n for (var i = 0, out; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\r\n else if (out) out.push(spans[i]);\r\n }\r\n return !out ? spans : out.length ? out : null;\r\n }", "function removeClearedSpans(spans) {\n\t\t if (!spans) return null;\n\t\t for (var i = 0, out; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t\t else if (out) out.push(spans[i]);\n\t\t }\n\t\t return !out ? spans : out.length ? out : null;\n\t\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeSpan(id) {\n for( var i=0; i<spans.length; i++){ \n if ( spans[i].id === id) { spans.splice(i,1); }\n }\n}", "function clearEmptySpans(spans) {\r\n for (var i = 0; i < spans.length; ++i) {\r\n var span = spans[i];\r\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\r\n { spans.splice(i--, 1); }\r\n }\r\n if (!spans.length) { return null }\r\n return spans\r\n}", "function clearEmptySpans(spans) {\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t\t { spans.splice(i--, 1); }\n\t\t }\n\t\t if (!spans.length) { return null }\n\t\t return spans\n\t\t }", "function removeSpans(start, end){\n // spans must be ordered\n // normalize span\n if (start > end) {\n var tmp = start;\n start = end;\n end = tmp;\n }\n start = Math.max(0, start);\n end = Math.min(textLength, end);\n if (start === end) { return; }\n // find insertion point\n var n = spans.length,\n i, span,\n iLeft = 0,\n iRight = n;\n while (iLeft < iRight) {\n i = iLeft + iRight >> 1;\n if (end <= spans[i].start) { iRight = i; }\n else if (start >= spans[i].end) { iLeft = i + 1; }\n else { iRight = i; }\n }\n // exclude spans which intersect\n var toremove_start,\n toremove_end;\n while (iRight < n) {\n span = spans[iRight];\n if (span.start > end) {\n break;\n }\n toremove_start = Math.max(span.start, start);\n toremove_end = Math.min(span.end, end);\n // remove span within span\n if (toremove_start > span.start && toremove_end < span.end) {\n spans.splice(iRight + 1, 0, { start: toremove_end, end: span.end });\n span.end = toremove_start;\n iRight += 2;\n n++;\n }\n // remove span from start\n else if (toremove_start === span.start && toremove_end < span.end) {\n span.start = toremove_end;\n iRight++;\n }\n // remove span from end\n else if (toremove_start > span.start && toremove_end === span.end) {\n span.end = toremove_start;\n iRight++;\n }\n // remove span\n else {\n spans.splice(iRight, 1);\n n--;\n }\n }\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }" ]
[ "0.74046427", "0.7398266", "0.7398266", "0.7398266", "0.7398266", "0.7398266", "0.7398266", "0.7398266", "0.73859435", "0.73859435", "0.73859435", "0.736235", "0.7315828", "0.7315045", "0.7235346", "0.7223111", "0.7223111", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.72049785", "0.6918599", "0.6918599", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.69034827", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68971264", "0.68930143", "0.6858238", "0.68428636", "0.68428636", "0.68428636", "0.68428636", "0.68428636", "0.68428636", "0.68428636", "0.68157315", "0.6812375", "0.68006665", "0.677906", "0.677906", "0.677906", "0.647962", "0.59739953", "0.59663475", "0.59485376", "0.5922272", "0.5922272", "0.5922272", "0.5922272", "0.5922272", "0.5922272", "0.5922272" ]
0.72939557
27
Add a span to a line.
function addMarkedSpan(line, span) { line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; span.marker.attachLine(line); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t\t span.marker.attachLine(line);\n\t\t }", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span, op) {\n\t\t var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n\t\t if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n\t\t line.markedSpans.push(span);\n\t\t } else {\n\t\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t\t if (inThisOp) { inThisOp.add(line.markedSpans); }\n\t\t }\n\t\t span.marker.attachLine(line);\n\t\t }", "function createLine() {\n\t\tlet element = document.createElement('span')\n\t\telement.className = 'line'\n\t\treturn element\n\t}", "function addMarksToLine(tr, state, node, pos, boldSentence) {\n const markType = state.schema.marks[MARK_STRONG];\n let textContent = getNodeText(node);\n const endPos = textContent.length;\n let content = '';\n let counter = 0;\n if (boldSentence) {\n content = textContent.split('.');\n } else {\n content = textContent.split(' ');\n }\n if ('' !== content[0]) {\n textContent = content[0];\n } else {\n if (content.length > 1) {\n for (let index = 0; index < content.length; index++) {\n if ('' === content[index]) {\n counter++;\n } else {\n textContent = content[index];\n index = content.length;\n }\n }\n }\n }\n tr = tr.addMark(\n pos,\n pos + textContent.length + 1 + counter,\n markType.create(null)\n );\n if (content.length > 1) {\n tr = tr.removeMark(\n pos + textContent.length + 1 + counter,\n pos + endPos + 1,\n markType\n );\n }\n return tr;\n}", "function addSpan(start, end){\n // spans must be ordered\n // normalize span\n if (start > end) {\n var tmp = start;\n start = end;\n end = tmp;\n }\n start = Math.max(0, start);\n end = Math.min(textLength, end);\n if (start === end) { return; }\n // find insertion point\n var n = spans.length,\n i, span,\n iLeft = 0,\n iRight = n;//alert(n);\n while (iLeft < iRight) {\n i = iLeft + iRight >> 1;\n if (end < spans[i].start) { iRight = i; }\n else if (start > spans[i].end) { iLeft = i + 1; }\n else { iRight = i; }\n }\n // merge spans which intersect\n while (iRight < n) {\n span = spans[iRight];\n if (span.start > end) {\n break;\n }\n start = Math.min(span.start, start);\n end = Math.max(span.end, end);\n iRight++;\n }\n // insert\n spans.splice(iLeft, iRight - iLeft, { start: start, end: end });\n}", "function addTextline(element, word, additionalClass) {\n if (element === undefined || word === undefined) {\n return;\n }\n element\n .append('tspan')\n .attr('class', additionalClass)\n .classed('text', true)\n .attr('x', 0)\n .attr('y', function() {\n return (element.property('childNodes').length - 1) * SPACE_BETWEEN_SPANS;\n })\n .text(word);\n }", "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function makeLine(text, markedSpans, height) {\n var line = {text: text, height: height};\n attachMarkedSpans(line, markedSpans);\n if (lineIsHidden(line)) line.height = 0;\n return line;\n }", "function makeLine(text, markedSpans, height) {\n var line = {text: text, height: height};\n attachMarkedSpans(line, markedSpans);\n if (lineIsHidden(line)) line.height = 0;\n return line;\n }", "function makeLine(text, markedSpans, height) {\n var line = {text: text, height: height};\n attachMarkedSpans(line, markedSpans);\n if (lineIsHidden(line)) line.height = 0;\n return line;\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans,\n allText = line.text,\n at = 0;\n\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1 += 2) {\n builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options));\n }\n\n return;\n }\n\n var len = allText.length,\n pos = 0,\n i = 1,\n text = \"\",\n style,\n css;\n var nextChange = 0,\n spanStyle,\n spanEndStyle,\n spanStartStyle,\n collapsed,\n attributes;\n\n for (;;) {\n if (nextChange == pos) {\n // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null;\n nextChange = Infinity;\n var foundBookmarks = [],\n endStyles = void 0;\n\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j],\n m = sp.marker;\n\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n\n if (m.className) {\n spanStyle += \" \" + m.className;\n }\n\n if (m.css) {\n css = (css ? css + \";\" : \"\") + m.css;\n }\n\n if (m.startStyle && sp.from == pos) {\n spanStartStyle += \" \" + m.startStyle;\n }\n\n if (m.endStyle && sp.to == nextChange) {\n (endStyles || (endStyles = [])).push(m.endStyle, sp.to);\n } // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n\n\n if (m.title) {\n (attributes || (attributes = {})).title = m.title;\n }\n\n if (m.attributes) {\n for (var attr in m.attributes) {\n (attributes || (attributes = {}))[attr] = m.attributes[attr];\n }\n }\n\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) {\n collapsed = sp;\n }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n\n if (endStyles) {\n for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) {\n if (endStyles[j$1 + 1] == nextChange) {\n spanEndStyle += \" \" + endStyles[j$1];\n }\n }\n }\n\n if (!collapsed || collapsed.from == pos) {\n for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) {\n buildCollapsedSpan(builder, 0, foundBookmarks[j$2]);\n }\n }\n\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null);\n\n if (collapsed.to == null) {\n return;\n }\n\n if (collapsed.to == pos) {\n collapsed = false;\n }\n }\n }\n\n if (pos >= len) {\n break;\n }\n\n var upto = Math.min(len, nextChange);\n\n while (true) {\n if (text) {\n var end = pos + text.length;\n\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n\n if (end >= upto) {\n text = text.slice(upto - pos);\n pos = upto;\n break;\n }\n\n pos = end;\n spanStartStyle = \"\";\n }\n\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n } // These objects are used to represent the visible (currently drawn)", "function trace(text) {\n d3.select(\"#trace1\").append(\"span\").text(text).append(\"br\");\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t\t if (!spans) {\n\t\t for (var i = 1; i < styles.length; i+=2)\n\t\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t\t return;\n\t\t }\n\t\t\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t\t collapsed = null; nextChange = Infinity;\n\t\t var foundBookmarks = [], endStyles\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker;\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m);\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to;\n\t\t spanEndStyle = \"\";\n\t\t }\n\t\t if (m.className) spanStyle += \" \" + m.className;\n\t\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t\t if (m.title && !title) title = m.title;\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t collapsed = sp;\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from;\n\t\t }\n\t\t }\n\t\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\t\t\n\t\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null);\n\t\t if (collapsed.to == null) return;\n\t\t if (collapsed.to == pos) collapsed = false;\n\t\t }\n\t\t }\n\t\t if (pos >= len) break;\n\t\t\n\t\t var upto = Math.min(len, nextChange);\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length;\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t\t pos = end;\n\t\t spanStartStyle = \"\";\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++]);\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t\t }\n\t\t }\n\t\t }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\r\n var spans = line.markedSpans, allText = line.text, at = 0;\r\n if (!spans) {\r\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\r\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\r\n return\r\n }\r\n\r\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\r\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\r\n for (;;) {\r\n if (nextChange == pos) { // Update current marker set\r\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\r\n collapsed = null; nextChange = Infinity;\r\n var foundBookmarks = [], endStyles = (void 0);\r\n for (var j = 0; j < spans.length; ++j) {\r\n var sp = spans[j], m = sp.marker;\r\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\r\n foundBookmarks.push(m);\r\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\r\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\r\n nextChange = sp.to;\r\n spanEndStyle = \"\";\r\n }\r\n if (m.className) { spanStyle += \" \" + m.className; }\r\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\r\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\r\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\r\n if (m.title && !title) { title = m.title; }\r\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\r\n { collapsed = sp; }\r\n } else if (sp.from > pos && nextChange > sp.from) {\r\n nextChange = sp.from;\r\n }\r\n }\r\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\r\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\r\n\r\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\r\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\r\n if (collapsed && (collapsed.from || 0) == pos) {\r\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\r\n collapsed.marker, collapsed.from == null);\r\n if (collapsed.to == null) { return }\r\n if (collapsed.to == pos) { collapsed = false; }\r\n }\r\n }\r\n if (pos >= len) { break }\r\n\r\n var upto = Math.min(len, nextChange);\r\n while (true) {\r\n if (text) {\r\n var end = pos + text.length;\r\n if (!collapsed) {\r\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\r\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\r\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\r\n }\r\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\r\n pos = end;\r\n spanStartStyle = \"\";\r\n }\r\n text = allText.slice(at, at = styles[i++]);\r\n style = interpretTokenStyle(styles[i++], builder.cm.options);\r\n }\r\n }\r\n}", "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t }\n\t if (pos >= len) break;\n\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function createTagline(text) {\n var span = $(\"span#tagline\");\n span.append(text);\n span.css(\"font-family: Courier, monospace; font-size: 100%;\");\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\t\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\t\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\t\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t\t if (!spans) {\n\t\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n\t\t return\n\t\t }\n\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n\t\t attributes = null;\n\t\t collapsed = null; nextChange = Infinity;\n\t\t var foundBookmarks = [], endStyles = (void 0);\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker;\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m);\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to;\n\t\t spanEndStyle = \"\";\n\t\t }\n\t\t if (m.className) { spanStyle += \" \" + m.className; }\n\t\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n\t\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n\t\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n\t\t // support for the old title property\n\t\t // https://github.com/codemirror/CodeMirror/pull/5673\n\t\t if (m.title) { (attributes || (attributes = {})).title = m.title; }\n\t\t if (m.attributes) {\n\t\t for (var attr in m.attributes)\n\t\t { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n\t\t }\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t { collapsed = sp; }\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from;\n\t\t }\n\t\t }\n\t\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n\t\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null);\n\t\t if (collapsed.to == null) { return }\n\t\t if (collapsed.to == pos) { collapsed = false; }\n\t\t }\n\t\t }\n\t\t if (pos >= len) { break }\n\n\t\t var upto = Math.min(len, nextChange);\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length;\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t\t pos = end;\n\t\t spanStartStyle = \"\";\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++]);\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t\t }\n\t\t }\n\t\t }", "function setSpan(context, span) {\n return api.trace.setSpan(context, span);\n}", "function setSpan(context, span) {\n return api.trace.setSpan(context, span);\n}", "function makeSpan(cl, text) {\n var sp = document.createElement('span');\n sp.appendChild(document.createTextNode(text));\n sp.classList.add(cl);\n return sp;\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmark = m;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = styleToClass(styles[i++]);\n }\n }\n }", "annotateLine(annotationId, lineNum, columnStart, columnEnd) {\n let line = this.source_lines[lineNum];\n\n // Add the annotation\n line.glow(\n annotationId,\n columnStart,\n columnEnd,\n event => {\n this.displayTextsForLine(lineNum, event, event.pageX, event.pageY);\n },\n () => {\n this.annotation_text_displayer.hide();\n },\n this.annotations[annotationId].is_remark\n );\n }" ]
[ "0.76911736", "0.7679438", "0.7679438", "0.76691914", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.76642555", "0.7613118", "0.7613118", "0.7613118", "0.7579766", "0.70806646", "0.7062127", "0.7062127", "0.6976656", "0.6659264", "0.645952", "0.6399512", "0.6333873", "0.6220569", "0.6192013", "0.6192013", "0.6192013", "0.6175417", "0.61365134", "0.61126554", "0.61126554", "0.6109657", "0.6109657", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.60972756", "0.6092743", "0.60902256", "0.60871124", "0.60871124", "0.60871124", "0.6086755", "0.6086539", "0.607168", "0.607168", "0.6064264", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6062576", "0.6049386", "0.6042768", "0.60189617", "0.60189617", "0.6011611", "0.59997123", "0.59904987" ]
0.7690837
15
Used for the algorithm that adjusts markers for a change in the document. These functions cut an array of spans at a given character position, returning an array of remaining chunks (or undefined if nothing remains).
function markedSpansBefore(old, startCh, isInsert) { var nw; if (old) { for (var i = 0; i < old.length; ++i) { var span = old[i], marker = span.marker; var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); } } } return nw }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOldSpans(doc, change) {\n\t\t var found = change[\"spans_\" + doc.id];\n\t\t if (!found) return null;\n\t\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t\t nw.push(removeClearedSpans(found[i]));\n\t\t return nw;\n\t\t }", "function removeClearedSpans(spans) {\n if (!spans) {\n return null;\n }\n\n var out;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) {\n if (!out) {\n out = spans.slice(0, i);\n }\n } else if (out) {\n out.push(spans[i]);\n }\n }\n\n return !out ? spans : out.length ? out : null;\n } // Retrieve and filter the old marked spans stored in a change event.", "function getOldSpans(doc, change) {\n\t\t var found = change[\"spans_\" + doc.id];\n\t\t if (!found) { return null }\n\t\t var nw = [];\n\t\t for (var i = 0; i < change.text.length; ++i)\n\t\t { nw.push(removeClearedSpans(found[i])); }\n\t\t return nw\n\t\t }", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\r\n var found = change[\"spans_\" + doc.id];\r\n if (!found) return null;\r\n for (var i = 0, nw = []; i < change.text.length; ++i)\r\n nw.push(removeClearedSpans(found[i]));\r\n return nw;\r\n }", "function getOldSpans(doc, change) {\r\n var found = change[\"spans_\" + doc.id];\r\n if (!found) { return null }\r\n var nw = [];\r\n for (var i = 0; i < change.text.length; ++i)\r\n { nw.push(removeClearedSpans(found[i])); }\r\n return nw\r\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}", "function getOffsetsAfterAccountingForSomeSpecialSelectionCases(allText, offsets) {\n var newOffs = oldOffs = offsets;\n \n // strip leading and trailing white space\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n \n //remove trailing &nbsp; tag if there\n // this can happen if a user shift down-clicks and the following line\n // is empty; dw expands the selection to include the \"<p>nbsp;\"\n // on the next line\n var selStr = allText.substring(newOffs[0],newOffs[1]);\n var chunk = \"&nbsp;\";\n var chunkPos = selStr.lastIndexOf(chunk);\n if (chunkPos!=-1 && chunkPos == (selStr.length - chunk.length)) \n newOffs[1] -= chunk.length;\n\n // remove last tag if it is an opening block tag\n // this can happen if a user shift down-clicks; dw selects the\n // opening block tag on the next paragraph, resulting in a selection like:\n // <p>|some text</p>\n // <p>|more text</p>\n selStr = allText.substring(newOffs[0], newOffs[1]);\n var pattern = /<([^>]*)>$/;\n var result = selStr.match(pattern);\n if (result != null){\n if ( isAContainerTag(result[1]) ){\n newOffs[1] -= result[0].length;\n }\n }\n\n // if selection starts with a closing block tag, remove it\n // this can happen if a user puts the mouse at the end of a line and\n // presses shift-up-arrow to select it\n selStr = allText.substring(newOffs[0],newOffs[1]);\n pattern = /^<\\/([^>]*)>/;\n result = selStr.match(pattern);\n if (result != null){\n if ( isAContainerTag(result[1]) ){\n newOffs[0] += result[0].length;\n }\n }\n\n // strip leading and trailing white space if offsets have changed\n if (newOffs != oldOffs){\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n oldOffs = newOffs;\n }\n\n // account for special list case: selecting the first item in a list\n // can select the opening <ol> or <ul> as well. Strip it.\n newOffs = getOffsetsAfterListCheck(allText,newOffs[0],newOffs[1]);\n\n // strip leading and trailing white space if offsets have changed\n if (newOffs != oldOffs){\n newOffs = getOffsetsAfterStrippingWhiteSpace(allText,newOffs[0],newOffs[1]);\n }\n \n return newOffs;\n\n}", "function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n\n if (currentStart === 0 && oldStart === 0) {\n prefixCount = sharedPrefix(current, old, minLength);\n }\n\n if (currentEnd === current.length && oldEnd === old.length) {\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n }\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) {\n return emptyArray;\n }\n\n if (currentStart === currentEnd) {\n const splice = newSplice(currentStart, [], 0);\n\n while (oldStart < oldEnd) {\n splice.removed.push(old[oldStart++]);\n }\n\n return [splice];\n } else if (oldStart === oldEnd) {\n return [newSplice(currentStart, [], currentEnd - currentStart)];\n }\n\n const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));\n const splices = [];\n let splice = void 0;\n let index = currentStart;\n let oldIndex = oldStart;\n\n for (let i = 0; i < ops.length; ++i) {\n switch (ops[i]) {\n case EDIT_LEAVE:\n if (splice !== void 0) {\n splices.push(splice);\n splice = void 0;\n }\n\n index++;\n oldIndex++;\n break;\n\n case EDIT_UPDATE:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n\n splice.addedCount++;\n index++;\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n\n case EDIT_ADD:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n\n splice.addedCount++;\n index++;\n break;\n\n case EDIT_DELETE:\n if (splice === void 0) {\n splice = newSplice(index, [], 0);\n }\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n // no default\n }\n }\n\n if (splice !== void 0) {\n splices.push(splice);\n }\n\n return splices;\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\r\n if (!spans) return null;\r\n for (var i = 0, out; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\r\n else if (out) out.push(spans[i]);\r\n }\r\n return !out ? spans : out.length ? out : null;\r\n }", "function removeClearedSpans(spans) {\r\n if (!spans) { return null }\r\n var out;\r\n for (var i = 0; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\r\n else if (out) { out.push(spans[i]); }\r\n }\r\n return !out ? spans : out.length ? out : null\r\n}", "function cutFirstLastChars() {\n function readCheckValues() {\n let enteredText = document.getElementById('textToCut').value;\n let removePos = document.getElementById('cutSelect').options[select.selectedIndex].value;\n let noChars = document.getElementById('noChars').value;\n\n checkInput();\n\n function checkInput() {\n // ensuring that text was entered\n try {\n if (enteredText.length == 0) {\n msg = \"Text cutter: You have to enter a text\";\n alert(msg);\n console.error(msg);\n throw msg;\n }\n } catch (error) {}\n\n // checking for too low number of characters entered\n try {\n if (enteredText.length < noChars) {\n msg = \"Text cutter: The text entered cannot be shortened because it is shorter than the entered number of characters\";\n alert(msg);\n console.error(msg);\n throw msg;\n }\n } catch (error) {}\n\n // checking if entered number of characters equals text length\n try {\n if (enteredText.length == noChars) {\n msg = \"Text cutter: The result of the shortening would be nothing because the text length equals the entered number of characters\";\n alert(msg);\n console.error(msg);\n throw msg;\n }\n } catch (error) {}\n\n //checking for unselected option\n try {\n if (removePos == \"choose\") {\n msg = \"Text cutter: You have to choose an option\";\n alert(msg);\n console.error(msg);\n throw msg;\n }\n } catch (error) {}\n }\n\n return [enteredText, select, removePos, noChars];\n }\n\n let enteredText = readCheckValues()[0];\n let removePos = readCheckValues()[2];\n let noChars = readCheckValues()[3];\n let output = document.getElementById('cutOutput');\n\n let numberOfLineBreaks = (enteredText.match(/\\n/g) || []).length; // matches all newlines in the global scope\n if (numberOfLineBreaks > 0) { // entered text contains multiple lines\n let outputLines = [];\n let enteredTextArray = enteredText.split(\"\\n\"); // split lines into array\n for (let i = 0; i < enteredTextArray.length; i++) {\n outputLines[i] = RemoveText(enteredTextArray[i], noChars);\n }\n // format output to be properly displayed in textarea\n for (let i = 0; i < outputLines.length; i++) {\n let pElem = document.createElement('p');\n pElem.appendChild(document.createTextNode(outputLines[i]));\n output.appendChild(pElem);\n }\n } else { // entered text contains only one line\n let outputText = RemoveText(enteredText, noChars);\n let pElem = document.createElement('p');\n pElem.appendChild(document.createTextNode(outputText));\n output.appendChild(pElem);\n }\n\n /**\n * Remove specified number of character from line\n * @param {String} line - entered line\n * @param {Number} noChars - number of characters to cut from line\n * @returns line - cut line\n */\n function RemoveText(line, noChars) {\n let line1 = line;\n if (removePos == \"start\") { // remove from start\n line1 = line.substring(noChars, line.length);\n } else { // remove from end\n line1 = line.substring(0, line.length - noChars);\n }\n return line1;\n }\n\n}", "function removeClearedSpans(spans) {\n\t\t if (!spans) return null;\n\t\t for (var i = 0, out; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t\t else if (out) out.push(spans[i]);\n\t\t }\n\t\t return !out ? spans : out.length ? out : null;\n\t\t }", "function stretchSpansOverChange(doc, change) {\n if (change.full) {\n return null;\n }\n\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\n if (!oldFirst && !oldLast) {\n return null;\n }\n\n var startCh = change.from.ch,\n endCh = change.to.ch,\n isInsert = cmp(change.from, change.to) == 0; // Get the spans that 'stick out' on both sides\n\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert); // Next, merge those two ends\n\n var sameLine = change.text.length == 1,\n offset = lst(change.text).length + (sameLine ? startCh : 0);\n\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n\n if (!found) {\n span.to = startCh;\n } else if (sameLine) {\n span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n }\n\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n\n if (span$1.to != null) {\n span$1.to += offset;\n }\n\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n\n if (!found$1) {\n span$1.from = offset;\n\n if (sameLine) {\n (first || (first = [])).push(span$1);\n }\n }\n } else {\n span$1.from += offset;\n\n if (sameLine) {\n (first || (first = [])).push(span$1);\n }\n }\n }\n } // Make sure we didn't create any zero-length spans\n\n\n if (first) {\n first = clearEmptySpans(first);\n }\n\n if (last && last != first) {\n last = clearEmptySpans(last);\n }\n\n var newMarkers = [first];\n\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2,\n gapMarkers;\n\n if (gap > 0 && first) {\n for (var i$2 = 0; i$2 < first.length; ++i$2) {\n if (first[i$2].to == null) {\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null));\n }\n }\n }\n\n for (var i$3 = 0; i$3 < gap; ++i$3) {\n newMarkers.push(gapMarkers);\n }\n\n newMarkers.push(last);\n }\n\n return newMarkers;\n } // Remove spans that are empty and don't have a clearWhenEmpty", "function splitAt_(insertPosition) {\n \n}", "function removeClearedSpans(spans) {\n\t\t if (!spans) { return null }\n\t\t var out;\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n\t\t else if (out) { out.push(spans[i]); }\n\t\t }\n\t\t return !out ? spans : out.length ? out : null\n\t\t }", "function stretchSpansOverChange(doc, change) {\n\t\t if (change.full) return null;\n\t\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t\t if (!oldFirst && !oldLast) return null;\n\t\t\n\t\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t\t // Get the spans that 'stick out' on both sides\n\t\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\t\t\n\t\t // Next, merge those two ends\n\t\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t\t if (first) {\n\t\t // Fix up .to properties of first\n\t\t for (var i = 0; i < first.length; ++i) {\n\t\t var span = first[i];\n\t\t if (span.to == null) {\n\t\t var found = getMarkedSpanFor(last, span.marker);\n\t\t if (!found) span.to = startCh;\n\t\t else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n\t\t }\n\t\t }\n\t\t }\n\t\t if (last) {\n\t\t // Fix up .from in last (or move them into first in case of sameLine)\n\t\t for (var i = 0; i < last.length; ++i) {\n\t\t var span = last[i];\n\t\t if (span.to != null) span.to += offset;\n\t\t if (span.from == null) {\n\t\t var found = getMarkedSpanFor(first, span.marker);\n\t\t if (!found) {\n\t\t span.from = offset;\n\t\t if (sameLine) (first || (first = [])).push(span);\n\t\t }\n\t\t } else {\n\t\t span.from += offset;\n\t\t if (sameLine) (first || (first = [])).push(span);\n\t\t }\n\t\t }\n\t\t }\n\t\t // Make sure we didn't create any zero-length spans\n\t\t if (first) first = clearEmptySpans(first);\n\t\t if (last && last != first) last = clearEmptySpans(last);\n\t\t\n\t\t var newMarkers = [first];\n\t\t if (!sameLine) {\n\t\t // Fill gap with whole-line-spans\n\t\t var gap = change.text.length - 2, gapMarkers;\n\t\t if (gap > 0 && first)\n\t\t for (var i = 0; i < first.length; ++i)\n\t\t if (first[i].to == null)\n\t\t (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n\t\t for (var i = 0; i < gap; ++i)\n\t\t newMarkers.push(gapMarkers);\n\t\t newMarkers.push(last);\n\t\t }\n\t\t return newMarkers;\n\t\t }", "function doChunk() {\n\t var origStart = start;\n\t var box, pos = text.substr(start).search(/\\S/);\n\t start += pos;\n\t if (pos < 0 || start >= end) {\n\t return true;\n\t }\n\t\n\t // Select a single character to determine the height of a line of text. The box.bottom\n\t // will be essential for us to figure out where the next line begins.\n\t range.setStart(node, start);\n\t range.setEnd(node, start + 1);\n\t box = actuallyGetRangeBoundingRect(range);\n\t\n\t // for justified text we must split at each space, because space has variable width.\n\t var found = false;\n\t if (isJustified || columnCount > 1) {\n\t pos = text.substr(start).search(/\\s/);\n\t if (pos >= 0) {\n\t // we can only split there if it's on the same line, otherwise we'll fall back\n\t // to the default mechanism (see findEOL below).\n\t range.setEnd(node, start + pos);\n\t var r = actuallyGetRangeBoundingRect(range);\n\t if (r.bottom == box.bottom) {\n\t box = r;\n\t found = true;\n\t start += pos;\n\t }\n\t }\n\t }\n\t\n\t if (!found) {\n\t // This code does three things: (1) it selects one line of text in `range`, (2) it\n\t // leaves the bounding rect of that line in `box` and (3) it returns the position\n\t // just after the EOL. We know where the line starts (`start`) but we don't know\n\t // where it ends. To figure this out, we select a piece of text and look at the\n\t // bottom of the bounding box. If it changes, we have more than one line selected\n\t // and should retry with a smaller selection.\n\t //\n\t // To speed things up, we first try to select all text in the node (`start` ->\n\t // `end`). If there's more than one line there, then select only half of it. And\n\t // so on. When we find a value for `end` that fits in one line, we try increasing\n\t // it (also in halves) until we get to the next line. The algorithm stops when the\n\t // right side of the bounding box does not change.\n\t //\n\t // One more thing to note is that everything happens in a single Text DOM node.\n\t // There's no other tags inside it, therefore the left/top coordinates of the\n\t // bounding box will not change.\n\t pos = (function findEOL(min, eol, max){\n\t range.setEnd(node, eol);\n\t var r = actuallyGetRangeBoundingRect(range);\n\t if (r.bottom != box.bottom && min < eol) {\n\t return findEOL(min, (min + eol) >> 1, eol);\n\t } else if (r.right != box.right) {\n\t box = r;\n\t if (eol < max) {\n\t return findEOL(eol, (eol + max) >> 1, max);\n\t } else {\n\t return eol;\n\t }\n\t } else {\n\t return eol;\n\t }\n\t })(start, Math.min(end, start + estimateLineLength), end);\n\t\n\t if (pos == start) {\n\t // if EOL is at the start, then no more text fits on this line. Skip the\n\t // remainder of this node entirely to avoid a stack overflow.\n\t return true;\n\t }\n\t start = pos;\n\t\n\t pos = range.toString().search(/\\s+$/);\n\t if (pos === 0) {\n\t return false; // whitespace only; we should not get here.\n\t }\n\t if (pos > 0) {\n\t // eliminate trailing whitespace\n\t range.setEnd(node, range.startOffset + pos);\n\t box = actuallyGetRangeBoundingRect(range);\n\t }\n\t }\n\t\n\t // another workaround for IE: if we rely on getBoundingClientRect() we'll overlap with the bullet for LI\n\t // elements. Calling getClientRects() and using the *first* rect appears to give us the correct location.\n\t // Note: not to be used in Chrome as it randomly returns a zero-width rectangle from the previous line.\n\t if (microsoft) {\n\t box = range.getClientRects()[0];\n\t }\n\t\n\t var str = range.toString();\n\t if (!/^(?:pre|pre-wrap)$/i.test(whiteSpace)) {\n\t // node with non-significant space -- collapse whitespace.\n\t str = str.replace(/\\s+/g, \" \");\n\t }\n\t else if (/\\t/.test(str)) {\n\t // with significant whitespace we need to do something about literal TAB characters.\n\t // There's no TAB glyph in a font so they would be rendered in PDF as an empty box,\n\t // and the whole text will stretch to fill the original width. The core PDF lib\n\t // does not have sufficient context to deal with it.\n\t\n\t // calculate the starting column here, since we initially discarded any whitespace.\n\t var cc = 0;\n\t for (pos = origStart; pos < range.startOffset; ++pos) {\n\t var code = text.charCodeAt(pos);\n\t if (code == 9) {\n\t // when we meet a TAB we must round up to the next tab stop.\n\t // in all browsers TABs seem to be 8 characters.\n\t cc += 8 - cc % 8;\n\t } else if (code == 10 || code == 13) {\n\t // just in case we meet a newline we must restart.\n\t cc = 0;\n\t } else {\n\t // ordinary character --> advance one column\n\t cc++;\n\t }\n\t }\n\t\n\t // based on starting column, replace any TAB characters in the string we actually\n\t // have to display with spaces so that they align to columns multiple of 8.\n\t while ((pos = str.search(\"\\t\")) >= 0) {\n\t var indent = \" \".substr(0, 8 - (cc + pos) % 8);\n\t str = str.substr(0, pos) + indent + str.substr(pos + 1);\n\t }\n\t }\n\t\n\t if (!found) {\n\t prevLineBottom = box.bottom;\n\t }\n\t drawText(str, box);\n\t }", "function removeSpans(start, end){\n // spans must be ordered\n // normalize span\n if (start > end) {\n var tmp = start;\n start = end;\n end = tmp;\n }\n start = Math.max(0, start);\n end = Math.min(textLength, end);\n if (start === end) { return; }\n // find insertion point\n var n = spans.length,\n i, span,\n iLeft = 0,\n iRight = n;\n while (iLeft < iRight) {\n i = iLeft + iRight >> 1;\n if (end <= spans[i].start) { iRight = i; }\n else if (start >= spans[i].end) { iLeft = i + 1; }\n else { iRight = i; }\n }\n // exclude spans which intersect\n var toremove_start,\n toremove_end;\n while (iRight < n) {\n span = spans[iRight];\n if (span.start > end) {\n break;\n }\n toremove_start = Math.max(span.start, start);\n toremove_end = Math.min(span.end, end);\n // remove span within span\n if (toremove_start > span.start && toremove_end < span.end) {\n spans.splice(iRight + 1, 0, { start: toremove_end, end: span.end });\n span.end = toremove_start;\n iRight += 2;\n n++;\n }\n // remove span from start\n else if (toremove_start === span.start && toremove_end < span.end) {\n span.start = toremove_end;\n iRight++;\n }\n // remove span from end\n else if (toremove_start > span.start && toremove_end === span.end) {\n span.end = toremove_start;\n iRight++;\n }\n // remove span\n else {\n spans.splice(iRight, 1);\n n--;\n }\n }\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function sliceText(text, offsets) {\n return text.slice(offsets.start, text.length - offsets.end);\n}", "function slice_Method() {\n var Sentence = \"All work and no play makes Jonny a dull boy.\";\n var Section = Sentence.slice(27,33);\n document.getElementById(\"Slice\").innerHTML = Section;\n}", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }" ]
[ "0.5492667", "0.5491162", "0.54809946", "0.5466656", "0.5466656", "0.5466656", "0.5458964", "0.5458964", "0.5458964", "0.5458964", "0.5458964", "0.5458964", "0.5458964", "0.54447305", "0.54423624", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.5423312", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.53959846", "0.5372807", "0.5372807", "0.5370018", "0.5268384", "0.5246903", "0.5246903", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.51862", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5184545", "0.5182863", "0.5182863", "0.5182863", "0.5182863", "0.5182863", "0.5182863", "0.5182863", "0.5178768", "0.5177522", "0.5173684", "0.5161798", "0.51504713", "0.51463765", "0.51391965", "0.5132297", "0.51304746", "0.5124788", "0.51131076", "0.51131076", "0.51131076", "0.51131076", "0.5096248", "0.50916874", "0.5090134" ]
0.0
-1
Given a change object, compute the new set of marker spans that cover the line in which the change took place. Removes spans entirely within the change, reconnects spans belonging to the same marker that appear on both sides of the change, and cuts off spans partially within the change. Returns an array of span arrays with one element for each line in (after) the change.
function stretchSpansOverChange(doc, change) { if (change.full) { return null } var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; if (!oldFirst && !oldLast) { return null } var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; // Get the spans that 'stick out' on both sides var first = markedSpansBefore(oldFirst, startCh, isInsert); var last = markedSpansAfter(oldLast, endCh, isInsert); // Next, merge those two ends var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); if (first) { // Fix up .to properties of first for (var i = 0; i < first.length; ++i) { var span = first[i]; if (span.to == null) { var found = getMarkedSpanFor(last, span.marker); if (!found) { span.to = startCh; } else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } } } } if (last) { // Fix up .from in last (or move them into first in case of sameLine) for (var i$1 = 0; i$1 < last.length; ++i$1) { var span$1 = last[i$1]; if (span$1.to != null) { span$1.to += offset; } if (span$1.from == null) { var found$1 = getMarkedSpanFor(first, span$1.marker); if (!found$1) { span$1.from = offset; if (sameLine) { (first || (first = [])).push(span$1); } } } else { span$1.from += offset; if (sameLine) { (first || (first = [])).push(span$1); } } } } // Make sure we didn't create any zero-length spans if (first) { first = clearEmptySpans(first); } if (last && last != first) { last = clearEmptySpans(last); } var newMarkers = [first]; if (!sameLine) { // Fill gap with whole-line-spans var gap = change.text.length - 2, gapMarkers; if (gap > 0 && first) { for (var i$2 = 0; i$2 < first.length; ++i$2) { if (first[i$2].to == null) { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } for (var i$3 = 0; i$3 < gap; ++i$3) { newMarkers.push(gapMarkers); } newMarkers.push(last); } return newMarkers }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) return null;\n for (var i = 0, nw = []; i < change.text.length; ++i)\n nw.push(removeClearedSpans(found[i]));\n return nw;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) {\n return null;\n }\n\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\n if (!oldFirst && !oldLast) {\n return null;\n }\n\n var startCh = change.from.ch,\n endCh = change.to.ch,\n isInsert = cmp(change.from, change.to) == 0; // Get the spans that 'stick out' on both sides\n\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert); // Next, merge those two ends\n\n var sameLine = change.text.length == 1,\n offset = lst(change.text).length + (sameLine ? startCh : 0);\n\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n\n if (!found) {\n span.to = startCh;\n } else if (sameLine) {\n span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n }\n\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n\n if (span$1.to != null) {\n span$1.to += offset;\n }\n\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n\n if (!found$1) {\n span$1.from = offset;\n\n if (sameLine) {\n (first || (first = [])).push(span$1);\n }\n }\n } else {\n span$1.from += offset;\n\n if (sameLine) {\n (first || (first = [])).push(span$1);\n }\n }\n }\n } // Make sure we didn't create any zero-length spans\n\n\n if (first) {\n first = clearEmptySpans(first);\n }\n\n if (last && last != first) {\n last = clearEmptySpans(last);\n }\n\n var newMarkers = [first];\n\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2,\n gapMarkers;\n\n if (gap > 0 && first) {\n for (var i$2 = 0; i$2 < first.length; ++i$2) {\n if (first[i$2].to == null) {\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null));\n }\n }\n }\n\n for (var i$3 = 0; i$3 < gap; ++i$3) {\n newMarkers.push(gapMarkers);\n }\n\n newMarkers.push(last);\n }\n\n return newMarkers;\n } // Remove spans that are empty and don't have a clearWhenEmpty", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\n\t var found = change[\"spans_\" + doc.id];\n\t if (!found) return null;\n\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t nw.push(removeClearedSpans(found[i]));\n\t return nw;\n\t }", "function getOldSpans(doc, change) {\r\n var found = change[\"spans_\" + doc.id];\r\n if (!found) return null;\r\n for (var i = 0, nw = []; i < change.text.length; ++i)\r\n nw.push(removeClearedSpans(found[i]));\r\n return nw;\r\n }", "function getOldSpans(doc, change) {\r\n var found = change[\"spans_\" + doc.id];\r\n if (!found) { return null }\r\n var nw = [];\r\n for (var i = 0; i < change.text.length; ++i)\r\n { nw.push(removeClearedSpans(found[i])); }\r\n return nw\r\n}", "function getOldSpans(doc, change) {\n\t\t var found = change[\"spans_\" + doc.id];\n\t\t if (!found) { return null }\n\t\t var nw = [];\n\t\t for (var i = 0; i < change.text.length; ++i)\n\t\t { nw.push(removeClearedSpans(found[i])); }\n\t\t return nw\n\t\t }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n if (change.full) return null;\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n}", "function stretchSpansOverChange(doc, change) {\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function stretchSpansOverChange(doc, change) {\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) return null;\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) span.to = startCh;\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i = 0; i < last.length; ++i) {\n var span = last[i];\n if (span.to != null) span.to += offset;\n if (span.from == null) {\n var found = getMarkedSpanFor(first, span.marker);\n if (!found) {\n span.from = offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n } else {\n span.from += offset;\n if (sameLine) (first || (first = [])).push(span);\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) first = clearEmptySpans(first);\n if (last && last != first) last = clearEmptySpans(last);\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n for (var i = 0; i < first.length; ++i)\n if (first[i].to == null)\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n for (var i = 0; i < gap; ++i)\n newMarkers.push(gapMarkers);\n newMarkers.push(last);\n }\n return newMarkers;\n }", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}", "function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id]\n if (!found) { return null }\n var nw = []\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])) }\n return nw\n}", "function stretchSpansOverChange(doc, change) {\n\t if (change.full) return null;\n\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t if (!oldFirst && !oldLast) return null;\n\n\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t // Get the spans that 'stick out' on both sides\n\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n\t // Next, merge those two ends\n\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t if (first) {\n\t // Fix up .to properties of first\n\t for (var i = 0; i < first.length; ++i) {\n\t var span = first[i];\n\t if (span.to == null) {\n\t var found = getMarkedSpanFor(last, span.marker);\n\t if (!found) span.to = startCh;\n\t else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n\t }\n\t }\n\t }\n\t if (last) {\n\t // Fix up .from in last (or move them into first in case of sameLine)\n\t for (var i = 0; i < last.length; ++i) {\n\t var span = last[i];\n\t if (span.to != null) span.to += offset;\n\t if (span.from == null) {\n\t var found = getMarkedSpanFor(first, span.marker);\n\t if (!found) {\n\t span.from = offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t } else {\n\t span.from += offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t }\n\t }\n\t // Make sure we didn't create any zero-length spans\n\t if (first) first = clearEmptySpans(first);\n\t if (last && last != first) last = clearEmptySpans(last);\n\n\t var newMarkers = [first];\n\t if (!sameLine) {\n\t // Fill gap with whole-line-spans\n\t var gap = change.text.length - 2, gapMarkers;\n\t if (gap > 0 && first)\n\t for (var i = 0; i < first.length; ++i)\n\t if (first[i].to == null)\n\t (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n\t for (var i = 0; i < gap; ++i)\n\t newMarkers.push(gapMarkers);\n\t newMarkers.push(last);\n\t }\n\t return newMarkers;\n\t }", "function stretchSpansOverChange(doc, change) {\n\t if (change.full) return null;\n\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t if (!oldFirst && !oldLast) return null;\n\n\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t // Get the spans that 'stick out' on both sides\n\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n\t // Next, merge those two ends\n\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t if (first) {\n\t // Fix up .to properties of first\n\t for (var i = 0; i < first.length; ++i) {\n\t var span = first[i];\n\t if (span.to == null) {\n\t var found = getMarkedSpanFor(last, span.marker);\n\t if (!found) span.to = startCh;\n\t else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n\t }\n\t }\n\t }\n\t if (last) {\n\t // Fix up .from in last (or move them into first in case of sameLine)\n\t for (var i = 0; i < last.length; ++i) {\n\t var span = last[i];\n\t if (span.to != null) span.to += offset;\n\t if (span.from == null) {\n\t var found = getMarkedSpanFor(first, span.marker);\n\t if (!found) {\n\t span.from = offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t } else {\n\t span.from += offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t }\n\t }\n\t // Make sure we didn't create any zero-length spans\n\t if (first) first = clearEmptySpans(first);\n\t if (last && last != first) last = clearEmptySpans(last);\n\n\t var newMarkers = [first];\n\t if (!sameLine) {\n\t // Fill gap with whole-line-spans\n\t var gap = change.text.length - 2, gapMarkers;\n\t if (gap > 0 && first)\n\t for (var i = 0; i < first.length; ++i)\n\t if (first[i].to == null)\n\t (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n\t for (var i = 0; i < gap; ++i)\n\t newMarkers.push(gapMarkers);\n\t newMarkers.push(last);\n\t }\n\t return newMarkers;\n\t }", "function getOldSpans(doc, change) {\n\t\t var found = change[\"spans_\" + doc.id];\n\t\t if (!found) return null;\n\t\t for (var i = 0, nw = []; i < change.text.length; ++i)\n\t\t nw.push(removeClearedSpans(found[i]));\n\t\t return nw;\n\t\t }", "function stretchSpansOverChange(doc, change) {\n\t\t if (change.full) return null;\n\t\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t\t if (!oldFirst && !oldLast) return null;\n\t\t\n\t\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t\t // Get the spans that 'stick out' on both sides\n\t\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\t\t\n\t\t // Next, merge those two ends\n\t\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t\t if (first) {\n\t\t // Fix up .to properties of first\n\t\t for (var i = 0; i < first.length; ++i) {\n\t\t var span = first[i];\n\t\t if (span.to == null) {\n\t\t var found = getMarkedSpanFor(last, span.marker);\n\t\t if (!found) span.to = startCh;\n\t\t else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n\t\t }\n\t\t }\n\t\t }\n\t\t if (last) {\n\t\t // Fix up .from in last (or move them into first in case of sameLine)\n\t\t for (var i = 0; i < last.length; ++i) {\n\t\t var span = last[i];\n\t\t if (span.to != null) span.to += offset;\n\t\t if (span.from == null) {\n\t\t var found = getMarkedSpanFor(first, span.marker);\n\t\t if (!found) {\n\t\t span.from = offset;\n\t\t if (sameLine) (first || (first = [])).push(span);\n\t\t }\n\t\t } else {\n\t\t span.from += offset;\n\t\t if (sameLine) (first || (first = [])).push(span);\n\t\t }\n\t\t }\n\t\t }\n\t\t // Make sure we didn't create any zero-length spans\n\t\t if (first) first = clearEmptySpans(first);\n\t\t if (last && last != first) last = clearEmptySpans(last);\n\t\t\n\t\t var newMarkers = [first];\n\t\t if (!sameLine) {\n\t\t // Fill gap with whole-line-spans\n\t\t var gap = change.text.length - 2, gapMarkers;\n\t\t if (gap > 0 && first)\n\t\t for (var i = 0; i < first.length; ++i)\n\t\t if (first[i].to == null)\n\t\t (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n\t\t for (var i = 0; i < gap; ++i)\n\t\t newMarkers.push(gapMarkers);\n\t\t newMarkers.push(last);\n\t\t }\n\t\t return newMarkers;\n\t\t }", "function stretchSpansOverChange(doc, change) {\r\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\r\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\r\n if (!oldFirst && !oldLast) return null;\r\n\r\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\r\n // Get the spans that 'stick out' on both sides\r\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\r\n var last = markedSpansAfter(oldLast, endCh, isInsert);\r\n\r\n // Next, merge those two ends\r\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\r\n if (first) {\r\n // Fix up .to properties of first\r\n for (var i = 0; i < first.length; ++i) {\r\n var span = first[i];\r\n if (span.to == null) {\r\n var found = getMarkedSpanFor(last, span.marker);\r\n if (!found) span.to = startCh;\r\n else if (sameLine) span.to = found.to == null ? null : found.to + offset;\r\n }\r\n }\r\n }\r\n if (last) {\r\n // Fix up .from in last (or move them into first in case of sameLine)\r\n for (var i = 0; i < last.length; ++i) {\r\n var span = last[i];\r\n if (span.to != null) span.to += offset;\r\n if (span.from == null) {\r\n var found = getMarkedSpanFor(first, span.marker);\r\n if (!found) {\r\n span.from = offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n } else {\r\n span.from += offset;\r\n if (sameLine) (first || (first = [])).push(span);\r\n }\r\n }\r\n }\r\n // Make sure we didn't create any zero-length spans\r\n if (first) first = clearEmptySpans(first);\r\n if (last && last != first) last = clearEmptySpans(last);\r\n\r\n var newMarkers = [first];\r\n if (!sameLine) {\r\n // Fill gap with whole-line-spans\r\n var gap = change.text.length - 2, gapMarkers;\r\n if (gap > 0 && first)\r\n for (var i = 0; i < first.length; ++i)\r\n if (first[i].to == null)\r\n (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\r\n for (var i = 0; i < gap; ++i)\r\n newMarkers.push(gapMarkers);\r\n newMarkers.push(last);\r\n }\r\n return newMarkers;\r\n }", "function stretchSpansOverChange(doc, change) {\n\t if (change.full) return null;\n\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t if (!oldFirst && !oldLast) return null;\n\t\n\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t // Get the spans that 'stick out' on both sides\n\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\t\n\t // Next, merge those two ends\n\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t if (first) {\n\t // Fix up .to properties of first\n\t for (var i = 0; i < first.length; ++i) {\n\t var span = first[i];\n\t if (span.to == null) {\n\t var found = getMarkedSpanFor(last, span.marker);\n\t if (!found) span.to = startCh;\n\t else if (sameLine) span.to = found.to == null ? null : found.to + offset;\n\t }\n\t }\n\t }\n\t if (last) {\n\t // Fix up .from in last (or move them into first in case of sameLine)\n\t for (var i = 0; i < last.length; ++i) {\n\t var span = last[i];\n\t if (span.to != null) span.to += offset;\n\t if (span.from == null) {\n\t var found = getMarkedSpanFor(first, span.marker);\n\t if (!found) {\n\t span.from = offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t } else {\n\t span.from += offset;\n\t if (sameLine) (first || (first = [])).push(span);\n\t }\n\t }\n\t }\n\t // Make sure we didn't create any zero-length spans\n\t if (first) first = clearEmptySpans(first);\n\t if (last && last != first) last = clearEmptySpans(last);\n\t\n\t var newMarkers = [first];\n\t if (!sameLine) {\n\t // Fill gap with whole-line-spans\n\t var gap = change.text.length - 2, gapMarkers;\n\t if (gap > 0 && first)\n\t for (var i = 0; i < first.length; ++i)\n\t if (first[i].to == null)\n\t (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null));\n\t for (var i = 0; i < gap; ++i)\n\t newMarkers.push(gapMarkers);\n\t newMarkers.push(last);\n\t }\n\t return newMarkers;\n\t }", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert)\n var last = markedSpansAfter(oldLast, endCh, isInsert)\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i]\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker)\n if (!found) { span.to = startCh }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1]\n if (span$1.to != null) { span$1.to += offset }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker)\n if (!found$1) {\n span$1.from = offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n } else {\n span$1.from += offset\n if (sameLine) { (first || (first = [])).push(span$1) }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first) }\n if (last && last != first) { last = clearEmptySpans(last) }\n\n var newMarkers = [first]\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers) }\n newMarkers.push(last)\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n}", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n\n if (!old) {\n return stretched;\n }\n\n if (!stretched) {\n return old;\n }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i],\n stretchCur = stretched[i];\n\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n\n for (var k = 0; k < oldCur.length; ++k) {\n if (oldCur[k].marker == span.marker) {\n continue spans;\n }\n }\n\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n\n return old;\n } // Used both to provide a JSON-safe object in .getHistory, and, when", "function stretchSpansOverChange(doc, change) {\r\n if (change.full) { return null }\r\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\r\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\r\n if (!oldFirst && !oldLast) { return null }\r\n\r\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\r\n // Get the spans that 'stick out' on both sides\r\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\r\n var last = markedSpansAfter(oldLast, endCh, isInsert);\r\n\r\n // Next, merge those two ends\r\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\r\n if (first) {\r\n // Fix up .to properties of first\r\n for (var i = 0; i < first.length; ++i) {\r\n var span = first[i];\r\n if (span.to == null) {\r\n var found = getMarkedSpanFor(last, span.marker);\r\n if (!found) { span.to = startCh; }\r\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\r\n }\r\n }\r\n }\r\n if (last) {\r\n // Fix up .from in last (or move them into first in case of sameLine)\r\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\r\n var span$1 = last[i$1];\r\n if (span$1.to != null) { span$1.to += offset; }\r\n if (span$1.from == null) {\r\n var found$1 = getMarkedSpanFor(first, span$1.marker);\r\n if (!found$1) {\r\n span$1.from = offset;\r\n if (sameLine) { (first || (first = [])).push(span$1); }\r\n }\r\n } else {\r\n span$1.from += offset;\r\n if (sameLine) { (first || (first = [])).push(span$1); }\r\n }\r\n }\r\n }\r\n // Make sure we didn't create any zero-length spans\r\n if (first) { first = clearEmptySpans(first); }\r\n if (last && last != first) { last = clearEmptySpans(last); }\r\n\r\n var newMarkers = [first];\r\n if (!sameLine) {\r\n // Fill gap with whole-line-spans\r\n var gap = change.text.length - 2, gapMarkers;\r\n if (gap > 0 && first)\r\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\r\n { if (first[i$2].to == null)\r\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\r\n for (var i$3 = 0; i$3 < gap; ++i$3)\r\n { newMarkers.push(gapMarkers); }\r\n newMarkers.push(last);\r\n }\r\n return newMarkers\r\n}", "function stretchSpansOverChange(doc, change) {\n\t\t if (change.full) { return null }\n\t\t var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n\t\t var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n\t\t if (!oldFirst && !oldLast) { return null }\n\n\t\t var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n\t\t // Get the spans that 'stick out' on both sides\n\t\t var first = markedSpansBefore(oldFirst, startCh, isInsert);\n\t\t var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n\t\t // Next, merge those two ends\n\t\t var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n\t\t if (first) {\n\t\t // Fix up .to properties of first\n\t\t for (var i = 0; i < first.length; ++i) {\n\t\t var span = first[i];\n\t\t if (span.to == null) {\n\t\t var found = getMarkedSpanFor(last, span.marker);\n\t\t if (!found) { span.to = startCh; }\n\t\t else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n\t\t }\n\t\t }\n\t\t }\n\t\t if (last) {\n\t\t // Fix up .from in last (or move them into first in case of sameLine)\n\t\t for (var i$1 = 0; i$1 < last.length; ++i$1) {\n\t\t var span$1 = last[i$1];\n\t\t if (span$1.to != null) { span$1.to += offset; }\n\t\t if (span$1.from == null) {\n\t\t var found$1 = getMarkedSpanFor(first, span$1.marker);\n\t\t if (!found$1) {\n\t\t span$1.from = offset;\n\t\t if (sameLine) { (first || (first = [])).push(span$1); }\n\t\t }\n\t\t } else {\n\t\t span$1.from += offset;\n\t\t if (sameLine) { (first || (first = [])).push(span$1); }\n\t\t }\n\t\t }\n\t\t }\n\t\t // Make sure we didn't create any zero-length spans\n\t\t if (first) { first = clearEmptySpans(first); }\n\t\t if (last && last != first) { last = clearEmptySpans(last); }\n\n\t\t var newMarkers = [first];\n\t\t if (!sameLine) {\n\t\t // Fill gap with whole-line-spans\n\t\t var gap = change.text.length - 2, gapMarkers;\n\t\t if (gap > 0 && first)\n\t\t { for (var i$2 = 0; i$2 < first.length; ++i$2)\n\t\t { if (first[i$2].to == null)\n\t\t { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n\t\t for (var i$3 = 0; i$3 < gap; ++i$3)\n\t\t { newMarkers.push(gapMarkers); }\n\t\t newMarkers.push(last);\n\t\t }\n\t\t return newMarkers\n\t\t }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) return stretched;\n if (!stretched) return old;\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n if (oldCur[k].marker == span.marker) continue spans;\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old;\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }", "function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }" ]
[ "0.68045187", "0.68045187", "0.68045187", "0.68045187", "0.68045187", "0.68045187", "0.68045187", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67977136", "0.67735964", "0.6769596", "0.6769596", "0.6769596", "0.67688906", "0.6765389", "0.6757368", "0.67570734", "0.67570734", "0.67570734", "0.67570734", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.6751967", "0.67512923", "0.67512923", "0.67512923", "0.674111", "0.674111", "0.67397094", "0.67397094", "0.6732614", "0.67284346", "0.6699601", "0.6690728", "0.66490656", "0.66490656", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.6607747", "0.65922195", "0.65910554", "0.6551569", "0.6432298", "0.6432298", "0.6432298", "0.6432298", "0.6432298", "0.6432298", "0.6432298", "0.6421532", "0.6421532", "0.6421532", "0.6421532" ]
0.66411275
71
Remove spans that are empty and don't have a clearWhenEmpty option of false.
function clearEmptySpans(spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) { spans.splice(i--, 1); } } if (!spans.length) { return null } return spans }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearEmptySpans(spans) {\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t\t spans.splice(i--, 1);\n\t\t }\n\t\t if (!spans.length) return null;\n\t\t return spans;\n\t\t }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n spans.splice(i--, 1);\n }\n if (!spans.length) return null;\n return spans;\n }", "function clearEmptySpans(spans) {\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t\t { spans.splice(i--, 1); }\n\t\t }\n\t\t if (!spans.length) { return null }\n\t\t return spans\n\t\t }", "function clearEmptySpans(spans) {\r\n for (var i = 0; i < spans.length; ++i) {\r\n var span = spans[i];\r\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\r\n spans.splice(i--, 1);\r\n }\r\n if (!spans.length) return null;\r\n return spans;\r\n }", "function clearEmptySpans(spans) {\n\t for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t spans.splice(i--, 1);\n\t }\n\t if (!spans.length) return null;\n\t return spans;\n\t }", "function clearEmptySpans(spans) {\n\t for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t spans.splice(i--, 1);\n\t }\n\t if (!spans.length) return null;\n\t return spans;\n\t }", "function clearEmptySpans(spans) {\n\t for (var i = 0; i < spans.length; ++i) {\n\t var span = spans[i];\n\t if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n\t spans.splice(i--, 1);\n\t }\n\t if (!spans.length) return null;\n\t return spans;\n\t }", "function clearEmptySpans(spans) {\r\n for (var i = 0; i < spans.length; ++i) {\r\n var span = spans[i];\r\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\r\n { spans.splice(i--, 1); }\r\n }\r\n if (!spans.length) { return null }\r\n return spans\r\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i]\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1) }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n}", "function emptySpans() {\n let spans = document.getElementsByTagName(\"SPAN\");\n if (spans.length > 0) {\n for (let i = 0; i < spans.length; i++) {\n spans[i].innerHTML=\"\";\n \n }\n }\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\n if (!spans) return null;\n for (var i = 0, out; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n else if (out) out.push(spans[i]);\n }\n return !out ? spans : out.length ? out : null;\n }", "function removeClearedSpans(spans) {\r\n if (!spans) return null;\r\n for (var i = 0, out; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\r\n else if (out) out.push(spans[i]);\r\n }\r\n return !out ? spans : out.length ? out : null;\r\n }", "function removeClearedSpans(spans) {\r\n if (!spans) { return null }\r\n var out;\r\n for (var i = 0; i < spans.length; ++i) {\r\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\r\n else if (out) { out.push(spans[i]); }\r\n }\r\n return !out ? spans : out.length ? out : null\r\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }\n else if (out) { out.push(spans[i]) }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n\t\t if (!spans) return null;\n\t\t for (var i = 0, out; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t\t else if (out) out.push(spans[i]);\n\t\t }\n\t\t return !out ? spans : out.length ? out : null;\n\t\t }", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n}", "function removeClearedSpans(spans) {\n\t\t if (!spans) { return null }\n\t\t var out;\n\t\t for (var i = 0; i < spans.length; ++i) {\n\t\t if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n\t\t else if (out) { out.push(spans[i]); }\n\t\t }\n\t\t return !out ? spans : out.length ? out : null\n\t\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeClearedSpans(spans) {\n\t if (!spans) return null;\n\t for (var i = 0, out; i < spans.length; ++i) {\n\t if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }\n\t else if (out) out.push(spans[i]);\n\t }\n\t return !out ? spans : out.length ? out : null;\n\t }", "function removeClearedSpans(spans) {\n if (!spans) {\n return null;\n }\n\n var out;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) {\n if (!out) {\n out = spans.slice(0, i);\n }\n } else if (out) {\n out.push(spans[i]);\n }\n }\n\n return !out ? spans : out.length ? out : null;\n } // Retrieve and filter the old marked spans stored in a change event.", "function hideEmptyEle() {\n\t\tjQuery( '.frm-hide-empty' ).each( function() {\n\t\t if ( jQuery( this ).text().trim().length == 0 ) {\n\t\t jQuery( this ).remove();\n\t\t }\n\t\t});\n\t}", "function clearAllSpans(arr){\n arr.forEach(ar => {\n ar.name = clearSpan(ar.name);\n ar.summary = clearSpan(ar.summary);\n })\n}", "function removeEmpty(){\n $j('dt').filter(function(){\n var t = ($j(this).next().is('dd'));\n if (t){\n var a =$j(this).next().text();\n if (a === '' || a === ' ' || a === '\\xa0'){ //&nbsp;\n $j(this).next().remove();\n return true;\n }\n return false;\n }\n }).remove();\n}", "function clear(){\n for (var i=0;i<grid.length;i++){\n grid[i].textContent === '';\n }\n}", "function removeEmptyNodes() {\r\n const HTML_Content = document.querySelector(\"#HTML-Content\");\r\n var treeWalker = document.createTreeWalker(HTML_Content, NodeFilter.SHOW_ELEMENT);\r\n var currentNode = treeWalker.currentNode\r\n var emptyNodes = []\r\n\r\n // test if a node has no text, regardless of whitespaces\r\n var isNodeEmpty = node => !node.textContent.trim()\r\n\r\n // find all empty nodes\r\n while(currentNode) {\r\n isNodeEmpty(currentNode) && emptyNodes.push(currentNode)\r\n currentNode = treeWalker.nextNode()\r\n }\r\n\r\n // remove found empty nodes\r\n emptyNodes.forEach(node => node.parentNode.removeChild(node))\r\n return;\r\n}", "function removeEmptySongs(){\r\n $(\".EMPTY_SONG\").remove();\r\n}", "_removeEmptyHiddenDivs(ast) {\n for (const div of dom5.queryAll(ast, matchers.hiddenDiv)) {\n if (parse5_1.serialize(div).trim() === '') {\n dom5.remove(div);\n }\n }\n }", "removeEmptyElements() {\n this.elements = this.elements.filter(({quantity}) => quantity > 0);\n }", "toggleEmptyText() {\n const me = this;\n\n if (me.bodyContainer) {\n DomHelper.toggleClasses(me.bodyContainer, 'b-grid-empty', !(me.rowManager.rowCount || me.project.isLoadingOrSyncing));\n }\n }", "function clearSpan(str){\n if (str != null){\n let tempStr = str;\n \n if (tempStr.includes(\"span\")){\n tempStr = tempStr.replace(\"<span>\",\"\");\n tempStr = tempStr.replace(\"</span>\", \"\");\n }\n return tempStr;\n }\n}", "empty() {\n return this.forEach((el => el.innerHTML = \"\")), this;\n }" ]
[ "0.7583394", "0.75742966", "0.75742966", "0.75742966", "0.75742966", "0.75742966", "0.75742966", "0.75742966", "0.7569507", "0.7569052", "0.7549425", "0.7549425", "0.7549425", "0.7535491", "0.7530014", "0.7530014", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.75171536", "0.73798865", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.69649637", "0.6939903", "0.6939903", "0.6939903", "0.6939903", "0.6939903", "0.6939903", "0.6939903", "0.6914844", "0.6904702", "0.69044214", "0.69044214", "0.68938136", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.6887742", "0.68853", "0.685587", "0.685587", "0.685587", "0.6760065", "0.6466615", "0.61780363", "0.61621505", "0.61562777", "0.61233276", "0.6050763", "0.5975518", "0.59491605", "0.5929331", "0.59241045", "0.5865747" ]
0.758082
17
Used to 'clip' out readOnly ranges when making a change.
function removeReadOnlyRanges(doc, from, to) { var markers = null; doc.iter(from.line, to.line + 1, function (line) { if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { var mark = line.markedSpans[i].marker; if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) { (markers || (markers = [])).push(mark); } } } }); if (!markers) { return null } var parts = [{from: from, to: to}]; for (var i = 0; i < markers.length; ++i) { var mk = markers[i], m = mk.find(0); for (var j = 0; j < parts.length; ++j) { var p = parts[j]; if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) { newParts.push({from: p.from, to: m.from}); } if (dto > 0 || !mk.inclusiveRight && !dto) { newParts.push({from: m.to, to: p.to}); } parts.splice.apply(parts, newParts); j += newParts.length - 3; } } return parts }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clipRange(range, min, max) {\n return range\n .filter(segment => segment[1] >= min && segment[0] <= max)\n .map(segment => [Math.max(segment[0], min), Math.min(segment[1], max)]);\n}", "function removeReadOnlyRanges(doc, from, to) {\n\t\t var markers = null;\n\t\t doc.iter(from.line, to.line + 1, function(line) {\n\t\t if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n\t\t var mark = line.markedSpans[i].marker;\n\t\t if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n\t\t (markers || (markers = [])).push(mark);\n\t\t }\n\t\t });\n\t\t if (!markers) return null;\n\t\t var parts = [{from: from, to: to}];\n\t\t for (var i = 0; i < markers.length; ++i) {\n\t\t var mk = markers[i], m = mk.find(0);\n\t\t for (var j = 0; j < parts.length; ++j) {\n\t\t var p = parts[j];\n\t\t if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n\t\t var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n\t\t if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n\t\t newParts.push({from: p.from, to: m.from});\n\t\t if (dto > 0 || !mk.inclusiveRight && !dto)\n\t\t newParts.push({from: m.to, to: p.to});\n\t\t parts.splice.apply(parts, newParts);\n\t\t j += newParts.length - 1;\n\t\t }\n\t\t }\n\t\t return parts;\n\t\t }", "function removeReadOnlyRanges(doc, from, to) {\n\t\t var markers = null;\n\t\t doc.iter(from.line, to.line + 1, function (line) {\n\t\t if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n\t\t var mark = line.markedSpans[i].marker;\n\t\t if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n\t\t { (markers || (markers = [])).push(mark); }\n\t\t } }\n\t\t });\n\t\t if (!markers) { return null }\n\t\t var parts = [{from: from, to: to}];\n\t\t for (var i = 0; i < markers.length; ++i) {\n\t\t var mk = markers[i], m = mk.find(0);\n\t\t for (var j = 0; j < parts.length; ++j) {\n\t\t var p = parts[j];\n\t\t if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n\t\t var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n\t\t if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n\t\t { newParts.push({from: p.from, to: m.from}); }\n\t\t if (dto > 0 || !mk.inclusiveRight && !dto)\n\t\t { newParts.push({from: m.to, to: p.to}); }\n\t\t parts.splice.apply(parts, newParts);\n\t\t j += newParts.length - 3;\n\t\t }\n\t\t }\n\t\t return parts\n\t\t }", "function removeReadOnlyRanges(doc, from, to) {\n\t var markers = null;\n\t doc.iter(from.line, to.line + 1, function(line) {\n\t if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n\t var mark = line.markedSpans[i].marker;\n\t if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n\t (markers || (markers = [])).push(mark);\n\t }\n\t });\n\t if (!markers) return null;\n\t var parts = [{from: from, to: to}];\n\t for (var i = 0; i < markers.length; ++i) {\n\t var mk = markers[i], m = mk.find(0);\n\t for (var j = 0; j < parts.length; ++j) {\n\t var p = parts[j];\n\t if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n\t var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n\t if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n\t newParts.push({from: p.from, to: m.from});\n\t if (dto > 0 || !mk.inclusiveRight && !dto)\n\t newParts.push({from: m.to, to: p.to});\n\t parts.splice.apply(parts, newParts);\n\t j += newParts.length - 1;\n\t }\n\t }\n\t return parts;\n\t }", "function removeReadOnlyRanges(doc, from, to) {\n\t var markers = null;\n\t doc.iter(from.line, to.line + 1, function(line) {\n\t if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n\t var mark = line.markedSpans[i].marker;\n\t if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n\t (markers || (markers = [])).push(mark);\n\t }\n\t });\n\t if (!markers) return null;\n\t var parts = [{from: from, to: to}];\n\t for (var i = 0; i < markers.length; ++i) {\n\t var mk = markers[i], m = mk.find(0);\n\t for (var j = 0; j < parts.length; ++j) {\n\t var p = parts[j];\n\t if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n\t var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n\t if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n\t newParts.push({from: p.from, to: m.from});\n\t if (dto > 0 || !mk.inclusiveRight && !dto)\n\t newParts.push({from: m.to, to: p.to});\n\t parts.splice.apply(parts, newParts);\n\t j += newParts.length - 1;\n\t }\n\t }\n\t return parts;\n\t }", "function removeReadOnlyRanges(doc, from, to) {\n\t var markers = null;\n\t doc.iter(from.line, to.line + 1, function(line) {\n\t if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n\t var mark = line.markedSpans[i].marker;\n\t if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n\t (markers || (markers = [])).push(mark);\n\t }\n\t });\n\t if (!markers) return null;\n\t var parts = [{from: from, to: to}];\n\t for (var i = 0; i < markers.length; ++i) {\n\t var mk = markers[i], m = mk.find(0);\n\t for (var j = 0; j < parts.length; ++j) {\n\t var p = parts[j];\n\t if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n\t var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n\t if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n\t newParts.push({from: p.from, to: m.from});\n\t if (dto > 0 || !mk.inclusiveRight && !dto)\n\t newParts.push({from: m.to, to: p.to});\n\t parts.splice.apply(parts, newParts);\n\t j += newParts.length - 1;\n\t }\n\t }\n\t return parts;\n\t }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function(line) {\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n (markers || (markers = [])).push(mark);\n }\n });\n if (!markers) return null;\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n newParts.push({from: p.from, to: m.from});\n if (dto > 0 || !mk.inclusiveRight && !dto)\n newParts.push({from: m.to, to: p.to});\n parts.splice.apply(parts, newParts);\n j += newParts.length - 1;\n }\n }\n return parts;\n }", "function removeReadOnlyRanges(doc, from, to) {\r\n var markers = null;\r\n doc.iter(from.line, to.line + 1, function(line) {\r\n if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {\r\n var mark = line.markedSpans[i].marker;\r\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\r\n (markers || (markers = [])).push(mark);\r\n }\r\n });\r\n if (!markers) return null;\r\n var parts = [{from: from, to: to}];\r\n for (var i = 0; i < markers.length; ++i) {\r\n var mk = markers[i], m = mk.find(0);\r\n for (var j = 0; j < parts.length; ++j) {\r\n var p = parts[j];\r\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue;\r\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\r\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\r\n newParts.push({from: p.from, to: m.from});\r\n if (dto > 0 || !mk.inclusiveRight && !dto)\r\n newParts.push({from: m.to, to: p.to});\r\n parts.splice.apply(parts, newParts);\r\n j += newParts.length - 1;\r\n }\r\n }\r\n return parts;\r\n }", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 1\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\r\n var markers = null;\r\n doc.iter(from.line, to.line + 1, function (line) {\r\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\r\n var mark = line.markedSpans[i].marker;\r\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\r\n { (markers || (markers = [])).push(mark); }\r\n } }\r\n });\r\n if (!markers) { return null }\r\n var parts = [{from: from, to: to}];\r\n for (var i = 0; i < markers.length; ++i) {\r\n var mk = markers[i], m = mk.find(0);\r\n for (var j = 0; j < parts.length; ++j) {\r\n var p = parts[j];\r\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\r\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\r\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\r\n { newParts.push({from: p.from, to: m.from}); }\r\n if (dto > 0 || !mk.inclusiveRight && !dto)\r\n { newParts.push({from: m.to, to: p.to}); }\r\n parts.splice.apply(parts, newParts);\r\n j += newParts.length - 3;\r\n }\r\n }\r\n return parts\r\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n}", "function removeReadOnlyRanges(doc, from, to) {\n var markers = null\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark) }\n } }\n })\n if (!markers) { return null }\n var parts = [{from: from, to: to}]\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0)\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j]\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}) }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}) }\n parts.splice.apply(parts, newParts)\n j += newParts.length - 3\n }\n }\n return parts\n}", "set clip(value) {}", "_clipPeriod()\n {\n let dist = (this._periodEnd-this._periodStart);\n let periodStart = Math.max(this._periodStart, this._minYear);\n let periodEnd = Math.min(this._periodEnd, this._maxYear);\n\n // Maintain period length\n while ((periodEnd-periodStart) < dist)\n {\n if (periodEnd < this._maxYear)\n periodEnd++;\n else if (periodStart > this._minYear)\n periodStart--;\n else // There is no space to extend the period any more => keep it\n break\n }\n\n this.setPeriod((periodEnd-periodStart), periodEnd)\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "set originalClip(value) {}", "function removeRange(ranges, range) {\n const newRange = ranges.filter(r => !_.isEqual(r, range));\n if (newRange.length === 0) {\n return [{\n from: null,\n to: null,\n }];\n }\n return newRange;\n }", "RemoveRange() {\n\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "clone() {\n const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));\n if (this.range)\n copy.range = this.range.slice();\n return copy;\n }", "function prepareRanges($scope) {\n if (!$scope.hideCustomRange && $scope.ranges[$scope.ranges.length - 1].range !== CUSTOM)\n $scope.ranges.push({ label: 'Custom Range', range: CUSTOM });\n\n $scope.resetRangeClass();\n\n if (!$scope.hideCustomRange && $scope.ranges[$scope.ranges.length - 1].active)\n $scope.showCalendars = true;\n }", "set overrideClip(value) {}", "_setRangeDebouced() {\n var range;\n if(this.orientation === 'vertical') {\n var h = Math.max(this._height, 0);\n range = [h, 0];\n\n } else {\n var w = Math.max(this._width, 0);\n range = [0, w];\n }\n\n this._scale.range(range);\n\n // force a recalc\n this._scaleChanged = !this._scaleChanged;\n }", "getMemento() {\n return this._hiddenRanges.map(r => ({ startLineNumber: r.startLineNumber - 1, endLineNumber: r.endLineNumber }));\n }", "function filterRange(arr, min, max) {\n for (var i = 0; i < arr.length - 1; i++) {\n if (arr[i] < min || arr[i] > max) {\n for (var j = i + 1; j<arr.length; j++) {\n arr[j - 1] = arr[j]\n }\n arr.length--;\n i--;\n }\n }\n console.log(arr)\n}", "exclude(r) {\n r = cobalt.range(r); // make sure r has only nonconsecutive, nonoverlapping singlerange subranges, ordered\n var ri = 0;\n var si = 0;\n var result = this.ranges.slice().filter(function(CobaltSingleRange) {\n return CobaltSingleRange.start!=CobaltSingleRange.end;\n });\n while (ri<r.ranges.length && si<result.length) {\n if (r.ranges[ri].leftOf(result[si]) || r.ranges[ri].end==result[si].start) {\n ri++;\n } else if (r.ranges[ri].rightOf(result[si]) || r.ranges[ri].start==result[si].end) {\n si++;\n } else {\n var t1 = result[si].exclude(r.ranges[ri]);\n if (t1.length) {\n result = result.slice(0,si).concat(t1).concat(result.slice(si+1));\n //if (t1.size>1) {\n si++;\n //}\n } else {\n result.splice(si,1);\n }\n }\n }\n return new CobaltRange(result);\n }", "function clip(value, low_limit, high_limit)\r {\r \tif(value < low_limit)\r \t\treturn low_limit;\r \telse if(value > high_limit)\r \t\treturn high_limit;\r \telse\r \t\treturn value;\r }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n\n var i;\n var dateRange; // ranges need to be in order. required for our date-walking algorithm\n\n ranges.sort(compareRanges);\n\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i]; // add the span of time before the event (if there is any)\n\n if (dateRange.start > start) {\n // compare millisecond time (skip any ambig logic)\n invertedRanges.push({\n start: start,\n end: dateRange.start\n });\n }\n\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n } // add the span of time after the last event (if there is any)\n\n\n if (start < constraintRange.end) {\n // compare millisecond time (skip any ambig logic)\n invertedRanges.push({\n start: start,\n end: constraintRange.end\n });\n }\n\n return invertedRanges;\n }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i += 1) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }", "updateRange(start, end) {\n this.range.start = start\n this.range.end = end\n this.range.paddingTop = this.getPaddingTop()\n this.range.paddingBottom = this.getPaddingBottom()\n this.callUpdate(this.getRange())\n }", "function filterRangeInPlace(array, from, to) {\r\n for (var i = 0; i < array.length; i++) {\r\n if ((from > array[i]) || (array[i] > to)) {\r\n var index = array.indexOf(array[i]);\r\n array.splice(index, 1);\r\n }\r\n }\r\n return array;\r\n}", "function clampRange(range, min, max) {\n var lo = range[0],\n hi = range[1],\n span;\n\n if (hi < lo) {\n span = hi;\n hi = lo;\n lo = span;\n }\n span = hi - lo;\n\n return span >= (max - min)\n ? [min, max]\n : [\n (lo = Math.min(Math.max(lo, min), max - span)),\n lo + span\n ];\n }", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n}", "function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n\n var i;\n var dateRange; // ranges need to be in order. required for our date-walking algorithm\n\n ranges.sort(compareRanges);\n\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i]; // add the span of time before the event (if there is any)\n\n if (dateRange.start > start) {\n // compare millisecond time (skip any ambig logic)\n invertedRanges.push({\n start: start,\n end: dateRange.start\n });\n }\n\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n } // add the span of time after the last event (if there is any)\n\n\n if (start < constraintRange.end) {\n // compare millisecond time (skip any ambig logic)\n invertedRanges.push({\n start: start,\n end: constraintRange.end\n });\n }\n\n return invertedRanges;\n }", "function disableClipping(clip) {\n if (clip.clipping) {\n context.restore();\n clip.clipping = false;\n }\n }", "function invertRanges$1(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges$1);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }", "extendToCover(min, max) {\r\n let x = this.min;\r\n while (min < x) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, -this.interval, this.unit);\r\n this.sequence.splice(0, 0, x);\r\n }\r\n this.min = x;\r\n x = this.max;\r\n while (x < max) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, this.interval, this.unit);\r\n this.sequence.push(x);\r\n }\r\n this.max = x;\r\n }", "restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }", "SetRange() {\n\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function filterSelectionChange(doc, sel) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head));\n }\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj);\n if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1);\n else return sel;\n }", "function makeChange(doc, change, ignoreReadOnly) {\n\t\t if (doc.cm) {\n\t\t if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n\t\t if (doc.cm.state.suppressEdits) { return }\n\t\t }\n\n\t\t if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n\t\t change = filterChange(doc, change, true);\n\t\t if (!change) { return }\n\t\t }\n\n\t\t // Possibly split or suppress the update based on the presence\n\t\t // of read-only spans in its range.\n\t\t var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\t\t if (split) {\n\t\t for (var i = split.length - 1; i >= 0; --i)\n\t\t { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n\t\t } else {\n\t\t makeChangeInner(doc, change);\n\t\t }\n\t\t }", "function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) {\n return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);\n }\n\n if (doc.cm.state.suppressEdits) {\n return;\n }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n\n if (!change) {\n return;\n }\n } // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n\n\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n\n if (split) {\n for (var i = split.length - 1; i >= 0; --i) {\n makeChangeInner(doc, {\n from: split[i].from,\n to: split[i].to,\n text: i ? [\"\"] : change.text,\n origin: change.origin\n });\n }\n } else {\n makeChangeInner(doc, change);\n }\n }" ]
[ "0.65478814", "0.6416192", "0.6400395", "0.62816346", "0.62816346", "0.62816346", "0.6155756", "0.6155756", "0.6155756", "0.6155756", "0.6155756", "0.6155756", "0.6155756", "0.61422807", "0.61293954", "0.61236465", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.61043614", "0.6103628", "0.5952232", "0.57866704", "0.57505536", "0.5680449", "0.566154", "0.5651146", "0.5631401", "0.5631401", "0.5581431", "0.55262476", "0.55071276", "0.5507034", "0.54802424", "0.5448877", "0.54378015", "0.5403531", "0.5403531", "0.5403531", "0.5393804", "0.5388981", "0.5385708", "0.5380456", "0.536874", "0.53572917", "0.5355645", "0.53528893", "0.5348021", "0.53476053", "0.53345376", "0.5317304", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.53137684", "0.5303823", "0.5303823", "0.5303823", "0.5303823", "0.5303823", "0.5303823", "0.5303823", "0.53028333", "0.52938557" ]
0.6156207
20
Connect or disconnect spans from a line.
function detachMarkedSpans(line) { var spans = line.markedSpans; if (!spans) { return } for (var i = 0; i < spans.length; ++i) { spans[i].marker.detachLine(line); } line.markedSpans = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n }", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n\t\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t\t span.marker.attachLine(line);\n\t\t }", "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "setLineCoordinates() {\n if (this.shown) {\n //if not self link && not linker modified pep\n if (!this.crosslink.isSelfLink() && this.crosslink.toProtein) {\n let x, y;\n const source = this.renderedFromProtein.getRenderedInteractor();\n const target = this.renderedToProtein.getRenderedInteractor();\n if (!source.ix || !source.iy) {\n console.log(\"NOT\");\n }\n // from end\n if (source.type === \"group\" || !source.expanded) {\n x = source.ix;\n y = source.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.fromResidue, this.renderedFromProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x1\", x);\n this.line.setAttribute(\"y1\", y);\n this.highlightLine.setAttribute(\"x1\", x);\n this.highlightLine.setAttribute(\"y1\", y);\n\n // to end\n if (target.type === \"group\" || !target.expanded) {\n x = target.ix;\n y = target.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.toResidue, this.renderedToProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x2\", x);\n this.line.setAttribute(\"y2\", y);\n this.highlightLine.setAttribute(\"x2\", x);\n this.highlightLine.setAttribute(\"y2\", y);\n\n }\n }\n }", "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function addMarkedSpan(line, span, op) {\n\t\t var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n\t\t if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n\t\t line.markedSpans.push(span);\n\t\t } else {\n\t\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t\t if (inThisOp) { inThisOp.add(line.markedSpans); }\n\t\t }\n\t\t span.marker.attachLine(line);\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function drawLine(start, end) {\n var points = [];\n points.push(start);\n points.push(end);\n var line = new google.maps.Polyline({\n map: map,\n icons: [{\n icon: lineSymbol,\n offset: '0',\n repeat: '4px'\n }],\n strokeOpacity: 0.0,\n strokeWeight: 50,\n editable: false,\n zIndex: 1\n });\n line.setPath(points);\n\n //listeners\n google.maps.event.addListener(line, 'mousemove', function(event) {\n circle.setPosition(event.latLng);\n var projection = overlay.getProjection();\n var pixel = projection.fromLatLngToContainerPixel(event.latLng);\n $(\"#tooltip\").css(\"display\",\"block\");\n $(\"#tooltip\").css(\"left\",pixel.x+15+\"px\").css(\"top\",pixel.y+125+\"px\");\n hoverLine = line;\n });\n\n google.maps.event.addListener(line, 'mouseout', function(event) {\n circle.setPosition(null);\n $(\"#tooltip\").css(\"display\",\"none\");\n });\n google.maps.event.addListener(line, 'mouseup', function(event) {\n circle.setMap(map);\n dragStart = false;\n if(dragging){\n dragging = false;\n for(var i = 0; i < lines.length; i++){\n if(lines[i] == hovertemp){\n lines.splice(i,1);\n hovertemp.setMap(null);\n break;\n }\n }\n lines.push(lineone);\n lines.push(linetwo);\n var pointcompare = linetwo.getPath().getAt(1);\n for(var i = 0; i < points.length; i++){\n if(points[i] == pointcompare){\n points.splice(i,0,event.latLng);\n break;\n }\n }\n createVertex(event.latLng);\n }\n else{\n lineone.setMap(null);\n linetwo.setMap(null);\n }\n });\n return line;\n}", "function updateMouseHoverLine() {\r\n for (var i=0; i<lineSegments.length; ++i) {\r\n ls = lineSegments[i];\r\n //determine if cursor position is on or very near a line\r\n var TOLERANCE = CELL_SIZE/2;\r\n var mousePos = {x:mouseX,y:mouseY};\r\n var closestPoint = Geometry.getClosestPointOnLineSegment(ls.p1, ls.p2, mousePos, TOLERANCE)\r\n if (closestPoint != false) {\r\n ls.hover = true;\r\n if (debug && currentTool == \"select-line\" || currentTool == \"delete-line\") {\r\n //draw dot for p2\r\n ctx.beginPath();\r\n ctx.arc(closestPoint.x, closestPoint.y, 2, 0, Math.PI*2, true); \r\n ctx.closePath();\r\n ctx.fillStyle = \"purple\";\r\n ctx.fill();\r\n }\r\n } else {\r\n ls.hover = false;\r\n }\r\n }\r\n}", "function setConnectLine(){\r\n\tmap.getSource('connectLine').setData({\r\n\t\t\"type\": \"FeatureCollection\",\r\n\t\t \"features\": [{\r\n\t\t\t \"type\": \"Feature\",\r\n\t\t\t \"properties\": { \"name\": \"Connecting Line\"},\r\n\t\t\t \"geometry\": {\r\n\t\t\t\t \"type\": \"LineString\",\r\n\t\t\t\t \"coordinates\": [[nearStopLng, nearStopLat],[clickLng, clickLat]]\r\n\t\t\t }\r\n\t\t }]\r\n\t});\r\n}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line() {}", "function Line(){}", "function getRemovableLine(start, end, label, color) {\n var line = new LeaderLine(start, end, {\n size: 5,\n middleLabel: LeaderLine.pathLabel({\n text: label\n }),\n startSocket: 'top',\n endSocket: 'top',\n startPlug: 'disc',\n endPlug: 'disc',\n color: color,\n path: 'arc',\n });\n document.querySelector('.leader-line:last-of-type').addEventListener('dblclick', function () {\n let start = parseInt(line.start.id.replace(\"mark-\", \"\"), 10);\n let end = parseInt(line.end.id.replace(\"mark-\", \"\"), 10);\n delete relationRecord[[start, end]];\n line.remove();\n }, false);\n return line;\n}" ]
[ "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.5948326", "0.59336156", "0.59336156", "0.59308994", "0.5930223", "0.5928825", "0.5928825", "0.5921592", "0.5921592", "0.59159845", "0.5913909", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5907481", "0.5900341", "0.5900341", "0.5900341", "0.5846832", "0.5843166", "0.5836052", "0.582395", "0.58233064", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.582191", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5788244", "0.5786953", "0.57402104", "0.57402104", "0.57402104", "0.57402104", "0.57402104", "0.57402104", "0.57402104", "0.573448", "0.57234037", "0.5704114", "0.5704114", "0.5704114", "0.56628865", "0.5656277", "0.5653172", "0.56236756", "0.56236756", "0.56236756", "0.56236756", "0.56236756", "0.5613455", "0.5596786" ]
0.0
-1
Helpers used when computing which overlapping collapsed span counts as the larger one.
function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n\n if (lenDiff != 0) {\n return lenDiff;\n }\n\n var aPos = a.find(),\n bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\n if (fromCmp) {\n return -fromCmp;\n }\n\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\n if (toCmp) {\n return toCmp;\n }\n\n return b.id - a.id;\n } // Find out whether a line ends or starts in a collapsed span. If", "function compareCollapsedMarkers(a, b) {\n\t\t var lenDiff = a.lines.length - b.lines.length;\n\t\t if (lenDiff != 0) return lenDiff;\n\t\t var aPos = a.find(), bPos = b.find();\n\t\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t\t if (fromCmp) return -fromCmp;\n\t\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t\t if (toCmp) return toCmp;\n\t\t return b.id - a.id;\n\t\t }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\r\n var lenDiff = a.lines.length - b.lines.length;\r\n if (lenDiff != 0) return lenDiff;\r\n var aPos = a.find(), bPos = b.find();\r\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\r\n if (fromCmp) return -fromCmp;\r\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\r\n if (toCmp) return toCmp;\r\n return b.id - a.id;\r\n }", "function compareCollapsedMarkers(a, b) {\n\t\t var lenDiff = a.lines.length - b.lines.length;\n\t\t if (lenDiff != 0) { return lenDiff }\n\t\t var aPos = a.find(), bPos = b.find();\n\t\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t\t if (fromCmp) { return -fromCmp }\n\t\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t\t if (toCmp) { return toCmp }\n\t\t return b.id - a.id\n\t\t }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\r\n var lenDiff = a.lines.length - b.lines.length;\r\n if (lenDiff != 0) { return lenDiff }\r\n var aPos = a.find(), bPos = b.find();\r\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\r\n if (fromCmp) { return -fromCmp }\r\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\r\n if (toCmp) { return toCmp }\r\n return b.id - a.id\r\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function size_spans(){\n if(jQuery(window).width() > 767){\n jQuery('.repeated-stories').each(function(){\n\tvar span_height = 0;\n\tvar thisid = jQuery(this).attr('id');\n\tjQuery('#'+thisid).find('.span4').each(function(){\n\t\tvar new_height = jQuery(this).height();\n\t\tif(new_height > span_height){span_height = new_height};\n\t});\n\n\tjQuery('#'+thisid).find('.span4').height(span_height);\n });\n\n \n\n /*jQuery('.repeated-stories').each(function(){\n var thisid = jQuery(this).attr('id');\n var span_height = 0;\n jQuery('#'+thisid).children('span4').each(function(){\n var new_height = jQuery(this).height();\n if(new_height > span_height){span_height = new_height;}\n \n });\n console.log(thisid);\n console.log(span_height);\n jQuery('#'+thisid).find('.span').height(span_height);\n //jQuery(thisid).children('.span4').height(span_height);\n var span_height = 0;\n });*/\n }\n \n}", "function countOverlap(grid) {\n let overlap = 0;\n for (let elem of grid.values()) {\n if (elem.length > 1) overlap++;\n }\n return overlap;\n}", "get width() {\n const noOverlap = this._width\n const overlap = Math.min(100, this._width * 1.7)\n\n // Containers can always grow.\n if (this.rows) {\n return overlap\n }\n\n // Rows can grow if they have leaves.\n if (this.leaves) {\n return this.leaves.length > 0 ? overlap : noOverlap\n }\n\n // Leaves can grow unless they're the last item in a row.\n const { leaves } = this.row\n const index = leaves.indexOf(this)\n return index === leaves.length - 1 ? noOverlap : overlap\n }", "calcMaxLength () {\n let maxima = [0.0, 0.0, 0.0]\n let minima = [0.0, 0.0, 0.0]\n let spans = [0.0, 0.0, 0.0]\n\n function comp (v, i) {\n if (i === 0) return v.x\n if (i === 1) return v.y\n if (i === 2) return v.z\n }\n\n let atom = this.getAtomProxy()\n for (let iDim = 0; iDim < 3; iDim++) {\n for (let iAtom = 0; iAtom < this.getAtomCount(); iAtom += 1) {\n let pos = atom.load(iAtom).pos\n if (minima[iDim] > comp(pos, iDim)) {\n minima[iDim] = comp(pos, iDim)\n }\n if (maxima[iDim] < comp(pos, iDim)) {\n maxima[iDim] = comp(pos, iDim)\n }\n }\n spans[iDim] = maxima[iDim] - minima[iDim]\n }\n this.maxLength = Math.max(spans[0], spans[1], spans[2])\n }", "function he(e,t){var a=Jo&&t.markedSpans;if(a)for(var n=void 0,r=0;r<a.length;++r)if(n=a[r],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&be(e,t,n))return!0}}", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "function check_collapse(sector, incr) {\n var sectors = PLANET.heights.length,\n s = (sector + sectors + incr) % sectors,\n dh = PLANET.heights[s] - PLANET.heights[sector];\n if (dh > PLANET_AMPLITUDE * MAX_DIFF) {\n if (mine_sector(s, Math.random() * 2 * dh)) {\n check_collapse(s, incr);\n }\n }\n }", "function G(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset,a.commonAncestorContainer=a.collapsed?a.startContainer:J.getCommonAncestor(a.startContainer,a.endContainer)}", "_getPartOfCount() {\n\n // 8-neighborhood around\n const n = [\n Point.val(this.x - 1, this.y - 1),\n Point.val(this.x - 1, this.y),\n Point.val(this.x - 1, this.y + 1),\n Point.val(this.x, this.y - 1),\n Point.val(this.x, this.y + 1),\n Point.val(this.x + 1, this.y - 1),\n Point.val(this.x + 1, this.y),\n Point.val(this.x + 1, this.y + 1),\n ];\n\n const edges = n.filter(p => p === '-' || p === '|').length;\n const ind = [];\n for (let i = 0; i < 8; i++) {\n if (n[i] === '-' || n[i] === '|') ind.push(i);\n }\n\n switch (edges) {\n\n case 2:\n switch (ind[0]) {\n case 1: \n return ind[1] === 3 ? (n[0] === n[7] ? 2 : 1) : (n[2] === n[5] ? 2 : 1);\n case 3: \n return n[2] === n[5] ? 2 : 1;\n case 4: \n return n[0] === n[7] ? 2 : 1;\n }\n\n case 3: \n return n.filter(p => p === ' ').length === 5 ? 3 : 2;\n\n case 4:\n return n.filter(p => p === ' ').length;\n }\n }", "function calcSegmentIntersectionStripeCount_old(arcs) {\n var yrange = arcs.getBounds().height(),\n segLen = getAvgSegment2(arcs)[1], // slow\n count = 1;\n if (segLen > 0 && yrange > 0) {\n count = Math.ceil(yrange / segLen / 20);\n }\n return count || 1;\n }", "function maximumCrossoverSubarrayHelper(arr, low, middle, high) {\n console.log(`low: ${low} middle: ${middle} high: ${high}`);\n var lowSum = -100000;\n var lowIndex = 0;\n var sum = 0;\n\n for (var i = middle; i >= low; i--) {\n sum += arr[i];\n\n if (sum > lowSum) {\n lowSum = sum;\n lowIndex = i;\n }\n }\n\n var highSum = -100000;\n var highIndex = 0;\n sum = 0;\n\n for (var i = middle+1; i <= high; i++) {\n sum += arr[i];\n\n if (sum > highSum) {\n highSum = sum;\n highIndex = i;\n }\n }\n\n return [lowIndex, highIndex, lowSum+highSum];\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) continue;\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t return true;\n\t\t }\n\t\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) { for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) { continue }\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t { return true }\n\t\t } }\n\t\t }", "onSubGridCollapse(subGrid) {\n const splitterEl = this.resolveSplitter(subGrid);\n\n splitterEl.classList.add('b-grid-splitter-collapsed');\n // 5 in next 2 lines is the default splitter width as defined in SASS.\n splitterEl.style.width = `${subGrid.collapsedStateWidth + subGrid.splitterWidth}px`;\n splitterEl.style.left = `${Math.max(subGrid.element.offsetLeft - subGrid.splitterWidth, 0)}px`;\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\r\n var line = getLine(doc, lineNo);\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) for (var i = 0; i < sps.length; ++i) {\r\n var sp = sps[i];\r\n if (!sp.marker.collapsed) continue;\r\n var found = sp.marker.find(0);\r\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\r\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\r\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\r\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\r\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\r\n return true;\r\n }\r\n }", "function getNumberOfSurroundingMines(small, large) {\n // Find how many of the small items are in the large array. I think this can be\n // heavily optimized since it does a lot of calculations each time it's called.\n let numberOfMines = 0;\n large.forEach(function(pos) {\n small.forEach(function(pos2) {\n if (pos[0] === pos2[0] && pos[1] === pos2[1]) {\n numberOfMines++;\n }\n });\n });\n\n return numberOfMines;\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function ie(e,t){var a,n=Jo&&e.markedSpans;if(n)for(var r=void 0,f=0;f<n.length;++f)r=n[f],r.marker.collapsed&&null==(t?r.from:r.to)&&(!a||oe(a,r.marker)<0)&&(a=r.marker);return a}", "topColPositions(callback){\n var colSpan = arguments[0]\n var rowIdx = arguments[1] - 1//get offset so not looking at hall\n var board = arguments[2]\n //get top and bottom\n var l = colSpan[0]\n var r = colSpan[1]\n //create copies to check reduction bounds\n var originalL = l\n //counter for a quit if the room cannot be created with the max amount of tries\n var counter = 0\n\n var span = Math.abs(l-r)\n //reduce by more than a half because of offsets\n l = l - Math.floor((span/3))\n r = r - Math.floor(span/3)\n //update the span\n span = Math.abs(l - r)\n try{\n if(board[rowIdx + 1][l].type == 'H' || board[rowIdx + 1][r].type == 'H'){\n return null\n }\n else if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){//checks the bounds to make sure hall is not in the empty spaces\n // console.log('returning original')\n return [l,r]\n }\n else{\n while(((board[l][rowIdx].filled == true || board[r][rowIdx].filled == true) ||\n (board[rowIdx+1][l].type !== 'H' || board[rowIdx+1][r].type !== 'H')) && \n counter < 3 && span > 3){\n // console.log('reducing')\n //top is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][l].filled == true){\n l = l + 1\n }\n //bot is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][r].filled == true){\n r = r - 1\n }\n //return the updated positions if the positions are not filled\n if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false && originalL >= l && l < r && span > 3 &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){\n return [l,r]\n }\n //update the span\n span = Math.abs(l-r)\n //update counter\n counter += 1\n }\n }\n\n }\n catch(e){\n console.log('row position is null with top:${t} and bottom: ${b}')\n return null\n }\n return null\n }", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> span').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> span').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function OverlappingRanges(arr) { \n\t\n\tvar array1 = createSequence(arr[0], arr[1]);\n\tvar array2 = createSequence(arr[2], arr[3]);\n\tvar counterAnswer = compareArrays(array1, array2); \n\t\n\t\n\tfunction createSequence(x,y) {\n\t\tvar newArray = [];\n\t\tfor (var i = x; i <= y; i++) {\n\t\t\tnewArray.push(i);\n\t\t}\n\t\treturn newArray;\n\t}\n\n\tfunction compareArrays(arr1, arr2) {\n\t\tvar counter = 0;\n\t\tfor (var i = 0; i < arr1.length; i++) {\n\t\t\tif (arr2.indexOf(arr1[i]) > -1) {\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\t\treturn counter\n\t}\n\t\n\treturn (counterAnswer >= arr[4]); \n\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\r\n var line = getLine(doc, lineNo$$1);\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) { for (var i = 0; i < sps.length; ++i) {\r\n var sp = sps[i];\r\n if (!sp.marker.collapsed) { continue }\r\n var found = sp.marker.find(0);\r\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\r\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\r\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\r\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\r\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\r\n { return true }\r\n } }\r\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n\n if (sps) {\n for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n\n if (!sp.marker.collapsed) {\n continue;\n }\n\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) {\n continue;\n }\n\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) {\n return true;\n }\n }\n }\n } // A visual line is a line as drawn on the screen. Folding, for", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}" ]
[ "0.6158327", "0.5892967", "0.5875146", "0.5875146", "0.5875146", "0.58443254", "0.58443254", "0.58443254", "0.58443254", "0.58443254", "0.58443254", "0.58443254", "0.58198965", "0.58142793", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5766265", "0.5691033", "0.5691033", "0.5684838", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.56808347", "0.542211", "0.54155207", "0.535959", "0.5346327", "0.5289534", "0.5244182", "0.5233468", "0.5226826", "0.5186475", "0.5151644", "0.51233876", "0.5087633", "0.5087633", "0.5087633", "0.5087633", "0.5087633", "0.5087633", "0.5086194", "0.5086194", "0.5086194", "0.5086194", "0.5086194", "0.5086194", "0.5086194", "0.5086194", "0.5082108", "0.5080669", "0.5080669", "0.5074167", "0.5073166", "0.50710547", "0.50689757", "0.50633657", "0.5044546", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5042828", "0.5030377", "0.5025906", "0.50156474", "0.50156474", "0.5010707", "0.49678913", "0.49678913", "0.49644187", "0.49594143", "0.49436274", "0.49436274", "0.49436274", "0.49436274" ]
0.0
-1
Returns a number indicating which of two overlapping collapsed spans is larger (and thus includes the other). Falls back to comparing ids when the spans cover exactly the same range.
function compareCollapsedMarkers(a, b) { var lenDiff = a.lines.length - b.lines.length; if (lenDiff != 0) { return lenDiff } var aPos = a.find(), bPos = b.find(); var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); if (fromCmp) { return -fromCmp } var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); if (toCmp) { return toCmp } return b.id - a.id }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n\n if (lenDiff != 0) {\n return lenDiff;\n }\n\n var aPos = a.find(),\n bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\n if (fromCmp) {\n return -fromCmp;\n }\n\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\n if (toCmp) {\n return toCmp;\n }\n\n return b.id - a.id;\n } // Find out whether a line ends or starts in a collapsed span. If", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) return lenDiff;\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) return -fromCmp;\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) return toCmp;\n return b.id - a.id;\n }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n\t var lenDiff = a.lines.length - b.lines.length;\n\t if (lenDiff != 0) return lenDiff;\n\t var aPos = a.find(), bPos = b.find();\n\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t if (fromCmp) return -fromCmp;\n\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t if (toCmp) return toCmp;\n\t return b.id - a.id;\n\t }", "function compareCollapsedMarkers(a, b) {\n\t\t var lenDiff = a.lines.length - b.lines.length;\n\t\t if (lenDiff != 0) return lenDiff;\n\t\t var aPos = a.find(), bPos = b.find();\n\t\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t\t if (fromCmp) return -fromCmp;\n\t\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t\t if (toCmp) return toCmp;\n\t\t return b.id - a.id;\n\t\t }", "function compareCollapsedMarkers(a, b) {\r\n var lenDiff = a.lines.length - b.lines.length;\r\n if (lenDiff != 0) return lenDiff;\r\n var aPos = a.find(), bPos = b.find();\r\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\r\n if (fromCmp) return -fromCmp;\r\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\r\n if (toCmp) return toCmp;\r\n return b.id - a.id;\r\n }", "function compareCollapsedMarkers(a, b) {\n\t\t var lenDiff = a.lines.length - b.lines.length;\n\t\t if (lenDiff != 0) { return lenDiff }\n\t\t var aPos = a.find(), bPos = b.find();\n\t\t var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\t\t if (fromCmp) { return -fromCmp }\n\t\t var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\t\t if (toCmp) { return toCmp }\n\t\t return b.id - a.id\n\t\t }", "function compareCollapsedMarkers(a, b) {\r\n var lenDiff = a.lines.length - b.lines.length;\r\n if (lenDiff != 0) { return lenDiff }\r\n var aPos = a.find(), bPos = b.find();\r\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\r\n if (fromCmp) { return -fromCmp }\r\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\r\n if (toCmp) { return toCmp }\r\n return b.id - a.id\r\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find()\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n}", "overlaps(other) {\n return (this.low <= other.high && other.low <= this.high)\n }", "function compareScoreArray(a, b) {\n let i = 0;\n while (i < a.length && i < b.length) {\n const diff = b[i] - a[i];\n // only keep going if diff === 0\n if (diff)\n return diff;\n i++;\n }\n // if the last subsegment was Static, the shorter segments should be sorted first\n // otherwise sort the longest segment first\n if (a.length < b.length) {\n return a.length === 1 && a[0] === 40 /* Static */ + 40 /* Segment */\n ? -1\n : 1;\n }\n else if (a.length > b.length) {\n return b.length === 1 && b[0] === 40 /* Static */ + 40 /* Segment */\n ? 1\n : -1;\n }\n return 0;\n}", "function compareScoreArray(a, b) {\r\n let i = 0;\r\n while (i < a.length && i < b.length) {\r\n const diff = b[i] - a[i];\r\n // only keep going if diff === 0\r\n if (diff)\r\n return diff;\r\n i++;\r\n }\r\n // if the last subsegment was Static, the shorter segments should be sorted first\r\n // otherwise sort the longest segment first\r\n if (a.length < b.length) {\r\n return a.length === 1 && a[0] === 40 /* Static */ + 40 /* Segment */\r\n ? -1\r\n : 1;\r\n }\r\n else if (a.length > b.length) {\r\n return b.length === 1 && b[0] === 40 /* Static */ + 40 /* Segment */\r\n ? 1\r\n : -1;\r\n }\r\n return 0;\r\n}", "function compareScoreArray(a, b) {\r\n let i = 0;\r\n while (i < a.length && i < b.length) {\r\n const diff = b[i] - a[i];\r\n // only keep going if diff === 0\r\n if (diff)\r\n return diff;\r\n i++;\r\n }\r\n // if the last subsegment was Static, the shorter segments should be sorted first\r\n // otherwise sort the longest segment first\r\n if (a.length < b.length) {\r\n return a.length === 1 && a[0] === 40 /* Static */ + 40 /* Segment */\r\n ? -1\r\n : 1;\r\n }\r\n else if (a.length > b.length) {\r\n return b.length === 1 && b[0] === 40 /* Static */ + 40 /* Segment */\r\n ? 1\r\n : -1;\r\n }\r\n return 0;\r\n}", "function compareUnzonedRanges(range1,range2){return range1.startMs-range2.startMs;// earlier ranges go first\n}", "function compareCells(a, b) {\n\t var n = a.length\n\t , t = a.length - b.length\n\t , min = Math.min\n\t if(t) {\n\t return t\n\t }\n\t switch(n) {\n\t case 0:\n\t return 0;\n\t case 1:\n\t return a[0] - b[0];\n\t case 2:\n\t var d = a[0]+a[1]-b[0]-b[1]\n\t if(d) {\n\t return d\n\t }\n\t return min(a[0],a[1]) - min(b[0],b[1])\n\t case 3:\n\t var l1 = a[0]+a[1]\n\t , m1 = b[0]+b[1]\n\t d = l1+a[2] - (m1+b[2])\n\t if(d) {\n\t return d\n\t }\n\t var l0 = min(a[0], a[1])\n\t , m0 = min(b[0], b[1])\n\t , d = min(l0, a[2]) - min(m0, b[2])\n\t if(d) {\n\t return d\n\t }\n\t return min(l0+a[2], l1) - min(m0+b[2], m1)\n\t \n\t //TODO: Maybe optimize n=4 as well?\n\t \n\t default:\n\t var as = a.slice(0)\n\t as.sort()\n\t var bs = b.slice(0)\n\t bs.sort()\n\t for(var i=0; i<n; ++i) {\n\t t = as[i] - bs[i]\n\t if(t) {\n\t return t\n\t }\n\t }\n\t return 0\n\t }\n\t}", "function compareCells(a, b) {\n\t var n = a.length\n\t , t = a.length - b.length\n\t , min = Math.min\n\t if(t) {\n\t return t\n\t }\n\t switch(n) {\n\t case 0:\n\t return 0;\n\t case 1:\n\t return a[0] - b[0];\n\t case 2:\n\t var d = a[0]+a[1]-b[0]-b[1]\n\t if(d) {\n\t return d\n\t }\n\t return min(a[0],a[1]) - min(b[0],b[1])\n\t case 3:\n\t var l1 = a[0]+a[1]\n\t , m1 = b[0]+b[1]\n\t d = l1+a[2] - (m1+b[2])\n\t if(d) {\n\t return d\n\t }\n\t var l0 = min(a[0], a[1])\n\t , m0 = min(b[0], b[1])\n\t , d = min(l0, a[2]) - min(m0, b[2])\n\t if(d) {\n\t return d\n\t }\n\t return min(l0+a[2], l1) - min(m0+b[2], m1)\n\t \n\t //TODO: Maybe optimize n=4 as well?\n\t \n\t default:\n\t var as = a.slice(0)\n\t as.sort()\n\t var bs = b.slice(0)\n\t bs.sort()\n\t for(var i=0; i<n; ++i) {\n\t t = as[i] - bs[i]\n\t if(t) {\n\t return t\n\t }\n\t }\n\t return 0\n\t }\n\t}", "function compareCells(a, b) {\n\t var n = a.length\n\t , t = a.length - b.length\n\t , min = Math.min\n\t if(t) {\n\t return t\n\t }\n\t switch(n) {\n\t case 0:\n\t return 0;\n\t case 1:\n\t return a[0] - b[0];\n\t case 2:\n\t var d = a[0]+a[1]-b[0]-b[1]\n\t if(d) {\n\t return d\n\t }\n\t return min(a[0],a[1]) - min(b[0],b[1])\n\t case 3:\n\t var l1 = a[0]+a[1]\n\t , m1 = b[0]+b[1]\n\t d = l1+a[2] - (m1+b[2])\n\t if(d) {\n\t return d\n\t }\n\t var l0 = min(a[0], a[1])\n\t , m0 = min(b[0], b[1])\n\t , d = min(l0, a[2]) - min(m0, b[2])\n\t if(d) {\n\t return d\n\t }\n\t return min(l0+a[2], l1) - min(m0+b[2], m1)\n\t \n\t //TODO: Maybe optimize n=4 as well?\n\t \n\t default:\n\t var as = a.slice(0)\n\t as.sort()\n\t var bs = b.slice(0)\n\t bs.sort()\n\t for(var i=0; i<n; ++i) {\n\t t = as[i] - bs[i]\n\t if(t) {\n\t return t\n\t }\n\t }\n\t return 0\n\t }\n\t}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function isOverlap(idOne, idTwo) {\n var objOne = $(idOne),\n objTwo = $(idTwo),\n offsetOne = objOne.offset(),\n offsetTwo = objTwo.offset(),\n topOne = ($(idOne).offset() || {\n \"top\": NaN\n }).top,\n topTwo = ($(idTwo).offset() || {\n \"top\": NaN\n }).top,\n leftOne = ($(idOne).offset() || {\n \"left\": NaN\n }).left,\n leftTwo = ($(idTwo).offset() || {\n \"left\": NaN\n }).left,\n widthOne = objOne.width(),\n widthTwo = objTwo.width(),\n heightOne = objOne.height(),\n heightTwo = objTwo.height();\n\n var leftTop = leftTwo > leftOne && leftTwo < leftOne + widthOne && topTwo > topOne && topTwo < topOne + heightOne,\n rightTop = leftTwo + widthTwo > leftOne && leftTwo + widthTwo < leftOne + widthOne && topTwo > topOne && topTwo < topOne + heightOne,\n leftBottom = leftTwo > leftOne && leftTwo < leftOne + widthOne && topTwo + heightTwo > topOne && topTwo + heightTwo < topOne + heightOne,\n rightBottom = leftTwo + widthTwo > leftOne && leftTwo + widthTwo < leftOne + widthOne && topTwo + heightTwo > topOne && topTwo + heightTwo < topOne + heightOne;\n return leftTop || rightTop || leftBottom || rightBottom;\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t return true;\n\t }\n\t }", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function compareCells(a, b) {\n var n = a.length\n , t = a.length - b.length\n , min = Math.min\n if(t) {\n return t\n }\n switch(n) {\n case 0:\n return 0;\n case 1:\n return a[0] - b[0];\n case 2:\n var d = a[0]+a[1]-b[0]-b[1]\n if(d) {\n return d\n }\n return min(a[0],a[1]) - min(b[0],b[1])\n case 3:\n var l1 = a[0]+a[1]\n , m1 = b[0]+b[1]\n d = l1+a[2] - (m1+b[2])\n if(d) {\n return d\n }\n var l0 = min(a[0], a[1])\n , m0 = min(b[0], b[1])\n , d = min(l0, a[2]) - min(m0, b[2])\n if(d) {\n return d\n }\n return min(l0+a[2], l1) - min(m0+b[2], m1)\n \n //TODO: Maybe optimize n=4 as well?\n \n default:\n var as = a.slice(0)\n as.sort()\n var bs = b.slice(0)\n bs.sort()\n for(var i=0; i<n; ++i) {\n t = as[i] - bs[i]\n if(t) {\n return t\n }\n }\n return 0\n }\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\r\n var line = getLine(doc, lineNo);\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) for (var i = 0; i < sps.length; ++i) {\r\n var sp = sps[i];\r\n if (!sp.marker.collapsed) continue;\r\n var found = sp.marker.find(0);\r\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\r\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\r\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\r\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\r\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\r\n return true;\r\n }\r\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) continue;\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t return true;\n\t\t }\n\t\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) { for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) { continue }\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t { return true }\n\t\t } }\n\t\t }", "static gt(sel1, sel2) {\n // Note: voice is not considered b/c it's more of a vertical component\n return sel1.staff > sel2.staff ||\n (sel1.staff === sel2.staff && sel1.measure > sel2.measure) ||\n (sel1.staff === sel2.staff && sel1.measure === sel2.measure && sel1.tick > sel2.tick);\n }", "function lessThanMark(mark1, mark2) {\n for (var i = 0; i < Math.min(mark1.length, mark2.length); i++) {\n if (mark1[i] < mark2[i]) {\n return -1;\n } else if (mark1[i] > mark2[i]) {\n return 1;\n } // else go on.\n }\n // We have gone through all of them, they are all equal.\n if (mark1.length < mark2.length) { return -1;\n } else if (mark1.length > mark2.length) { return 1;\n } else { return 0; }\n}", "function compareHighlights(h1, h2) {\n return h1.characterRange.start - h2.characterRange.start;\n }", "function compareHighlights(h1, h2) {\n return h1.characterRange.start - h2.characterRange.start;\n }", "function compareHighlights(h1, h2) {\n return h1.characterRange.start - h2.characterRange.start;\n }", "function compareHighlights(h1, h2) {\n return h1.characterRange.start - h2.characterRange.start;\n }", "function compareUnzonedRanges(range1, range2) {\n\treturn range1.startMs - range2.startMs; // earlier ranges go first\n}", "function compareUnzonedRanges(range1, range2) {\n\treturn range1.startMs - range2.startMs; // earlier ranges go first\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}" ]
[ "0.7142195", "0.693498", "0.693498", "0.693498", "0.693498", "0.693498", "0.693498", "0.693498", "0.691132", "0.691132", "0.691132", "0.6910217", "0.6895199", "0.68564695", "0.6827457", "0.6819273", "0.6819273", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.68139935", "0.57068807", "0.5413686", "0.5360317", "0.5360317", "0.5336225", "0.5333016", "0.5333016", "0.5333016", "0.5311276", "0.530927", "0.530927", "0.530927", "0.530927", "0.530927", "0.530927", "0.530565", "0.530565", "0.530565", "0.530565", "0.530565", "0.530565", "0.530565", "0.530565", "0.52820086", "0.52790517", "0.52790517", "0.5277681", "0.52762485", "0.52762485", "0.52762485", "0.52762485", "0.52762485", "0.52762485", "0.52762485", "0.52762485", "0.5270952", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.52614236", "0.5255977", "0.52493954", "0.5239848", "0.5225293", "0.52207893", "0.52207893", "0.5208164", "0.5208164", "0.5204806", "0.5204806", "0.5202754" ]
0.6881761
26
Find out whether a line ends or starts in a collapsed span. If so, return the marker for that span.
function collapsedSpanAtSide(line, start) { var sps = sawCollapsedSpans && line.markedSpans, found; if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { sp = sps[i]; if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } } } return found }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapsedSpanAtSide(line, start) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t\t if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t\t { found = sp.marker; }\n\t\t } }\n\t\t return found\n\t\t }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t\t found = sp.marker;\n\t\t }\n\t\t return found;\n\t\t }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans,\n found;\n\n if (sps) {\n for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) {\n found = sp.marker;\n }\n }\n }\n\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "function collapsedSpanAtSide(line, start) {\r\n var sps = sawCollapsedSpans && line.markedSpans, found;\r\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\r\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\r\n found = sp.marker;\r\n }\r\n return found;\r\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\r\n var sps = sawCollapsedSpans && line.markedSpans, found;\r\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\r\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\r\n { found = sp.marker; }\r\n } }\r\n return found\r\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n\n if (lenDiff != 0) {\n return lenDiff;\n }\n\n var aPos = a.find(),\n bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\n if (fromCmp) {\n return -fromCmp;\n }\n\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\n if (toCmp) {\n return toCmp;\n }\n\n return b.id - a.id;\n } // Find out whether a line ends or starts in a collapsed span. If", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n\n if (sps) {\n for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n\n if (!sp.marker.collapsed) {\n continue;\n }\n\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) {\n continue;\n }\n\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) {\n return true;\n }\n }\n }\n } // A visual line is a line as drawn on the screen. Folding, for", "function he(e,t){var a=Jo&&t.markedSpans;if(a)for(var n=void 0,r=0;r<a.length;++r)if(n=a[r],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&be(e,t,n))return!0}}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n\n if (sps) {\n for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n\n if (!sp.marker.collapsed) {\n continue;\n }\n\n if (sp.from == null) {\n return true;\n }\n\n if (sp.marker.widgetNode) {\n continue;\n }\n\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) {\n return true;\n }\n }\n }\n }", "function lineIsHidden(doc, line) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (!sp.marker.collapsed) continue;\n\t\t if (sp.from == null) return true;\n\t\t if (sp.marker.widgetNode) continue;\n\t\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t\t return true;\n\t\t }\n\t\t }", "function lineIsHidden(doc, line) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (!sp.marker.collapsed) { continue }\n\t\t if (sp.from == null) { return true }\n\t\t if (sp.marker.widgetNode) { continue }\n\t\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t\t { return true }\n\t\t } }\n\t\t }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }", "function lineIsHidden(doc, line) {\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (!sp.marker.collapsed) continue;\r\n if (sp.from == null) return true;\r\n if (sp.marker.widgetNode) continue;\r\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\r\n return true;\r\n }\r\n }", "function getMarkedSpanFor(spans, marker) {\n\t\t if (spans) for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.marker == marker) return span;\n\t\t }\n\t\t }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }", "function getMarkedSpanFor(spans, marker) {\n\t\t if (spans) { for (var i = 0; i < spans.length; ++i) {\n\t\t var span = spans[i];\n\t\t if (span.marker == marker) { return span }\n\t\t } }\n\t\t }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }", "function getMarkedSpanFor(spans, marker) {\n if (spans) for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) return span;\n }\n }" ]
[ "0.7781943", "0.77293897", "0.77293897", "0.77293897", "0.77293897", "0.77293897", "0.77293897", "0.77293897", "0.77270275", "0.7724256", "0.7691947", "0.7691947", "0.7691947", "0.7656835", "0.76529074", "0.76529074", "0.76406157", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.76274836", "0.6824262", "0.66445285", "0.6432097", "0.6389298", "0.63561594", "0.63553894", "0.6352129", "0.6352129", "0.6352129", "0.6352129", "0.6352129", "0.6352129", "0.6352129", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.63518476", "0.6328976", "0.6326546", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.63262063", "0.6324495", "0.62993", "0.62993", "0.62993", "0.62993", "0.62993", "0.62993" ]
0.7747473
17
Test whether there exists a collapsed span that partially overlaps (covers the start or end, but not both) of a new span. Such overlap is not allowed.
function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) { var line = getLine(doc, lineNo$$1); var sps = sawCollapsedSpans && line.markedSpans; if (sps) { for (var i = 0; i < sps.length; ++i) { var sp = sps[i]; if (!sp.marker.collapsed) { continue } var found = sp.marker.find(0); var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) { return true } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) continue;\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n return true;\n }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\r\n var line = getLine(doc, lineNo);\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) for (var i = 0; i < sps.length; ++i) {\r\n var sp = sps[i];\r\n if (!sp.marker.collapsed) continue;\r\n var found = sp.marker.find(0);\r\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\r\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\r\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\r\n if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\r\n fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\r\n return true;\r\n }\r\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||\n\t fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) continue;\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t return true;\n\t\t }\n\t\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t var line = getLine(doc, lineNo);\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var i = 0; i < sps.length; ++i) {\n\t var sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t var found = sp.marker.find(0);\n\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;\n\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t return true;\n\t }\n\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n\n if (sps) {\n for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n\n if (!sp.marker.collapsed) {\n continue;\n }\n\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) {\n continue;\n }\n\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) {\n return true;\n }\n }\n }\n } // A visual line is a line as drawn on the screen. Folding, for", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n\t\t var line = getLine(doc, lineNo);\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) { for (var i = 0; i < sps.length; ++i) {\n\t\t var sp = sps[i];\n\t\t if (!sp.marker.collapsed) { continue }\n\t\t var found = sp.marker.find(0);\n\t\t var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n\t\t var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n\t\t if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n\t\t if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n\t\t fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n\t\t { return true }\n\t\t } }\n\t\t }", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo)\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0)\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\r\n var line = getLine(doc, lineNo$$1);\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) { for (var i = 0; i < sps.length; ++i) {\r\n var sp = sps[i];\r\n if (!sp.marker.collapsed) { continue }\r\n var found = sp.marker.find(0);\r\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\r\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\r\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\r\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\r\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\r\n { return true }\r\n } }\r\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n}", "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "overlaps(range) {\n for (let i = 0, j = this.set.length; i < j; i++) {\n const setRange = this.set[i];\n if (setRange.range[1] > range.range[0] &&\n setRange.range[0] < range.range[1]) {\n return true;\n }\n }\n return false;\n }", "function collapsedSpanAtSide(line, start) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t\t if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t\t { found = sp.marker; }\n\t\t } }\n\t\t return found\n\t\t }", "isExpanded(range) {\n return !Range.isCollapsed(range);\n }", "isExpanded(range) {\n return !Range.isCollapsed(range);\n }", "function collapsedSpanAtSide(line, start) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t\t found = sp.marker;\n\t\t }\n\t\t return found;\n\t\t }", "function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n\n if (lenDiff != 0) {\n return lenDiff;\n }\n\n var aPos = a.find(),\n bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n\n if (fromCmp) {\n return -fromCmp;\n }\n\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n\n if (toCmp) {\n return toCmp;\n }\n\n return b.id - a.id;\n } // Find out whether a line ends or starts in a collapsed span. If", "_isOverlap (segA, segB) {\n\t\tvar _isBefore = (segA.end >= segB.start && segA.start <= segB.end + 1);\n\t\tvar _isAfter = (segA.start <= segB.end + 1 && segA.end >= segB.start);\n\t\tvar _isSame = (segA === segB);\n\t\treturn ((_isBefore || _isAfter) && (!_isSame));\n\t}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans,\n found;\n\n if (sps) {\n for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) {\n found = sp.marker;\n }\n }\n }\n\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "function collapsedSpanAtSide(line, start) {\n\t var sps = sawCollapsedSpans && line.markedSpans, found;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n\t (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n\t found = sp.marker;\n\t }\n\t return found;\n\t }", "overlaps(_rect, _insetbyX, _insetByY) {\n return this.intersects(_rect, _insetbyX, _insetByY);\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n found = sp.marker;\n }\n return found;\n }", "function collapsedSpanAtSide(line, start) {\r\n var sps = sawCollapsedSpans && line.markedSpans, found;\r\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\r\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\r\n { found = sp.marker; }\r\n } }\r\n return found\r\n}", "function collapsedSpanAtSide(line, start) {\r\n var sps = sawCollapsedSpans && line.markedSpans, found;\r\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\r\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\r\n found = sp.marker;\r\n }\r\n return found;\r\n }", "function overlap(a, b) {\n if (a.start <= b.start && a.end > b.start) {\n return true;\n } else if (a.start >= b.start && a.start < b.end) {\n return true;\n } else {\n return false;\n }\n }", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}", "function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker }\n } }\n return found\n}", "function G(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset,a.commonAncestorContainer=a.collapsed?a.startContainer:J.getCommonAncestor(a.startContainer,a.endContainer)}" ]
[ "0.68643045", "0.68643045", "0.68643045", "0.68643045", "0.68643045", "0.68643045", "0.68562055", "0.6840906", "0.68402225", "0.68402225", "0.68402225", "0.68402225", "0.68402225", "0.68402225", "0.68402225", "0.68402225", "0.6831287", "0.6831287", "0.6822905", "0.68100256", "0.68058836", "0.67969906", "0.6762716", "0.6762716", "0.67506045", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.671581", "0.63264227", "0.63264227", "0.61070913", "0.6094638", "0.60439324", "0.60439324", "0.6039952", "0.6036545", "0.60325396", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6028286", "0.6006166", "0.6003854", "0.6003854", "0.6003854", "0.599855", "0.59856963", "0.59856963", "0.59856963", "0.59856963", "0.59856963", "0.59856963", "0.59856963", "0.59433496", "0.5942322", "0.5922622", "0.59092134", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.590459", "0.58933026", "0.58933026", "0.5882865" ]
0.6788901
27
A visual line is a line as drawn on the screen. Folding, for example, can cause multiple logical lines to appear on the same visual line. This finds the start of the visual line that the given line is part of (usually that is the line itself).
function visualLine(line) { var merged; while (merged = collapsedSpanAtStart(line)) { line = merged.find(-1, true).line; } return line }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN),\n vis = visualLine(line);\n\n if (line == vis) {\n return lineN;\n }\n\n return lineNo(vis);\n } // Get the line number of the start of the next visual line after", "function find_start_line() {\n // TODO:\n return 0\n}", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line;\n\t\t (lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines;\n\t\t }", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line\n\t\t ;(lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines\n\t\t }", "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "function visualLineContinued(line) {\r\n var merged, lines;\r\n while (merged = collapsedSpanAtEnd(line)) {\r\n line = merged.find(1, true).line\r\n ;(lines || (lines = [])).push(line);\r\n }\r\n return lines\r\n}", "function visualLineContinued(line) {\r\n var merged, lines;\r\n while (merged = collapsedSpanAtEnd(line)) {\r\n line = merged.find(1, true).line;\r\n (lines || (lines = [])).push(line);\r\n }\r\n return lines;\r\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function lineStart(area) {\n area.pos = area.pos || pos(area);\n return pos - linePos(area);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }" ]
[ "0.8250026", "0.82406414", "0.82313603", "0.82313603", "0.82313603", "0.82117206", "0.8178637", "0.8178637", "0.8178637", "0.8178637", "0.8178637", "0.8178637", "0.8178637", "0.8173388", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.81548107", "0.8154344", "0.807574", "0.807574", "0.752594", "0.69233334", "0.6657617", "0.65583634", "0.65468746", "0.65415174", "0.6539381", "0.65281653", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.65271336", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6517311", "0.6512955", "0.6512955", "0.65032053", "0.65032053", "0.65032053", "0.65032053", "0.65032053", "0.65032053", "0.65032053", "0.6501795", "0.6501795", "0.6501795", "0.64945537", "0.6480189", "0.6480189", "0.6468455", "0.6468455", "0.6468455", "0.6468455", "0.6468455" ]
0.81788635
21
Returns an array of logical lines that continue the visual line started by the argument, or undefined if there are no such lines.
function visualLineContinued(line) { var merged, lines; while (merged = collapsedSpanAtEnd(line)) { line = merged.find(1, true).line ;(lines || (lines = [])).push(line); } return lines }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line;\n\t\t (lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines;\n\t\t }", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line\n\t\t ;(lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines\n\t\t }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n return lines;\n }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function visualLineContinued(line) {\n\t var merged, lines;\n\t while (merged = collapsedSpanAtEnd(line)) {\n\t line = merged.find(1, true).line;\n\t (lines || (lines = [])).push(line);\n\t }\n\t return lines;\n\t }", "function visualLineContinued(line) {\r\n var merged, lines;\r\n while (merged = collapsedSpanAtEnd(line)) {\r\n line = merged.find(1, true).line;\r\n (lines || (lines = [])).push(line);\r\n }\r\n return lines;\r\n }", "function visualLineContinued(line) {\r\n var merged, lines;\r\n while (merged = collapsedSpanAtEnd(line)) {\r\n line = merged.find(1, true).line\r\n ;(lines || (lines = [])).push(line);\r\n }\r\n return lines\r\n}", "function visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line)\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n}", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function linesBefore(area) { return beforeLines(area).allButLast(); }", "function singleLineJourney() {\n \n if (startLine === endLine) {\n if (startJourney < endJourney) {\n for (var i = startJourney; i <= endJourney; i++) {\n journey.push(startLine[i])\n }\n } else if (startJourney > endJourney) {\n for (var i = startJourney; i >= endJourney; i--) {\n journey.push(startLine[i])\n }\n }\n }\n \n}", "get horizontalLineVisibility() {\r\n return this.i.pl;\r\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "getStraightLines() {\n\n let points = [];\n\n points.push(this.getLine(-1, 0));\n points.push(this.getLine(1, 0));\n points.push(this.getLine(0, -1));\n points.push(this.getLine(0, 1));\n\n return points;\n\n }", "function beforeLines(area) { return toLines(before(area)); }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function getLines(){\n\tlet lineClass = \"l\" + selCurve;\n\treturn document.getElementsByClassName(lineClass);\n}", "getLines({ start, end, strictIndexing } = { start: 0, end: -1, strictIndexing: true }) {\n const indexing = typeof strictIndexing === 'undefined' ? true : strictIndexing;\n return this.request(`${this.prefix}get_lines`, [\n start,\n end,\n indexing,\n ]);\n }", "function LineString(ls){\n\t\t\t\t// remove tail which should be the same as head\n\t\t\t\tvar reg = ls.slice(0, ls.length - 1);\n\t\t\t\treturn PolyBool.segments({ inverted: false, regions: [reg] });\n\t\t\t}", "function lineBefore(area) { return beforeLines(area).last(); }", "function getLineElementsAtPageOffset(offset) {\n\t\tconst lines = document.getElementsByClassName('code-line');\n\t\tconst position = offset - window.scrollY;\n\t\tlet previous = null;\n\t\tfor (const element of lines) {\n\t\t\tconst line = +element.getAttribute('data-line');\n\t\t\tif (isNaN(line)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bounds = element.getBoundingClientRect();\n\t\t\tconst entry = { element, line };\n\t\t\tif (position < bounds.top) {\n\t\t\t\tif (previous && previous.fractional < 1) {\n\t\t\t\t\tprevious.line += previous.fractional;\n\t\t\t\t\treturn { previous };\n\t\t\t\t}\n\t\t\t\treturn { previous, next: entry };\n\t\t\t}\n\t\t\tentry.fractional = (position - bounds.top) / (bounds.height);\n\t\t\tprevious = entry;\n\t\t}\n\t\treturn { previous };\n\t}", "setLineCoordinates() {\n if (this.shown) {\n //if not self link && not linker modified pep\n if (!this.crosslink.isSelfLink() && this.crosslink.toProtein) {\n let x, y;\n const source = this.renderedFromProtein.getRenderedInteractor();\n const target = this.renderedToProtein.getRenderedInteractor();\n if (!source.ix || !source.iy) {\n console.log(\"NOT\");\n }\n // from end\n if (source.type === \"group\" || !source.expanded) {\n x = source.ix;\n y = source.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.fromResidue, this.renderedFromProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x1\", x);\n this.line.setAttribute(\"y1\", y);\n this.highlightLine.setAttribute(\"x1\", x);\n this.highlightLine.setAttribute(\"y1\", y);\n\n // to end\n if (target.type === \"group\" || !target.expanded) {\n x = target.ix;\n y = target.iy;\n } else {\n const coord = this.getResidueCoordinates(this.crosslink.toResidue, this.renderedToProtein);\n x = coord[0];\n y = coord[1];\n }\n this.line.setAttribute(\"x2\", x);\n this.line.setAttribute(\"y2\", y);\n this.highlightLine.setAttribute(\"x2\", x);\n this.highlightLine.setAttribute(\"y2\", y);\n\n }\n }\n }" ]
[ "0.6936979", "0.6631404", "0.65844053", "0.65823203", "0.65823203", "0.65823203", "0.65823203", "0.65823203", "0.65823203", "0.65823203", "0.6580827", "0.6580827", "0.6580827", "0.6562891", "0.65574646", "0.6548238", "0.6548238", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.6512879", "0.59177226", "0.59136206", "0.58994675", "0.5883115", "0.585426", "0.5821036", "0.5795795", "0.5795795", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.5791646", "0.57852936", "0.57852936", "0.57852936", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.57697064", "0.5752585", "0.5733082", "0.57209504", "0.57209504", "0.57209504", "0.57209504", "0.57209504", "0.57209504", "0.57209504", "0.5696246", "0.56861156", "0.5659008", "0.5625417", "0.5610336", "0.55303603", "0.5526715", "0.5525488" ]
0.6574651
29
Get the line number of the start of the visual line that the given line number is part of.
function visualLineNo(doc, lineN) { var line = getLine(doc, lineN), vis = visualLine(line); if (line == vis) { return lineN } return lineNo(vis) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN),\n vis = visualLine(line);\n\n if (line == vis) {\n return lineN;\n }\n\n return lineNo(vis);\n } // Get the line number of the start of the next visual line after", "function visualLineNo(doc, lineN) {\n\t\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t\t if (line == vis) { return lineN }\n\t\t return lineNo(vis)\n\t\t }", "function visualLineNo(doc, lineN) {\n\t\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t\t if (line == vis) return lineN;\n\t\t return lineNo(vis);\n\t\t }", "function visualLineNo(doc, lineN) {\n\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t if (line == vis) return lineN;\n\t return lineNo(vis);\n\t }", "function visualLineNo(doc, lineN) {\n\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t if (line == vis) return lineN;\n\t return lineNo(vis);\n\t }", "function visualLineNo(doc, lineN) {\n\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t if (line == vis) return lineN;\n\t return lineNo(vis);\n\t }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\r\n var line = getLine(doc, lineN), vis = visualLine(line);\r\n if (line == vis) return lineN;\r\n return lineNo(vis);\r\n }", "function visualLineNo(doc, lineN) {\r\n var line = getLine(doc, lineN), vis = visualLine(line);\r\n if (line == vis) { return lineN }\r\n return lineNo(vis)\r\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "_getStartRefLineNumber(referenceNumber) {\n var refRef = PassageMarkdown.START_REF_PREFIX + referenceNumber;\n var ref = this.refs[refRef];\n\n if (!ref) {\n return null;\n }\n\n var $ref = $$1(ReactDOM$c.findDOMNode(ref)); // We really care about the first text after the ref, not the\n // ref element itself:\n\n var $refText = $ref.next();\n\n if ($refText.length === 0) {\n // But if there are no elements after the ref, just\n // use the ref itself.\n $refText = $ref;\n }\n\n var vPos = $refText.offset().top;\n return this.state.startLineNumbersAfter + 1 + this._convertPosToLineNumber(vPos);\n }", "function find_start_line() {\n // TODO:\n return 0\n}", "line(n) {\n if (n < 1 || n > this.lines)\n throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);\n return this.lineInner(n, true, 1, 0);\n }", "function getTopVisibleLine(editor) {\n if (!editor[\"visibleRanges\"].length) {\n return undefined;\n }\n const firstVisiblePosition = editor[\"visibleRanges\"][0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function code_line(code, line) {\n return code.findIndex(l => l.line === line)\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\r\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\r\n if (lineNumber > 1) {\r\n let lastLineNumber;\r\n let resultLineNumber = -1;\r\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\r\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\r\n return resultLineNumber;\r\n }\r\n let text = model.getLineContent(lastLineNumber);\r\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\r\n resultLineNumber = lastLineNumber;\r\n continue;\r\n }\r\n return lastLineNumber;\r\n }\r\n }\r\n return -1;\r\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function lineStart(area) {\n area.pos = area.pos || pos(area);\n return pos - linePos(area);\n }", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "calculateLineIndex(startPosition){\n\t\tthis.lineIndex = startPosition + this.top;\n\t\tthis.lineCount = Math.ceil((this.title.length +this.value.length + this.titleSpacing) / process.stdout.columns);\n\t\treturn this.lineIndex + this.lineCount+ this.bottom;\n\t}", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "getRealCurrentLineNb() {\n return this.currentLineNb + this.offset;\n }", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "function getLineNumber(pos, el){\n if (pos == null)\n return -1;\n //console.log(caretPos);\n\n var curr_line = 0;\n var text = \"\";\n if (el != undefined){\n text = el.value;\n }\n\n //go through, checking for a newline, adding one for each\n for (var i = 0; i < pos; i++){\n if (text[i] === \"\\n\"){\n curr_line++;\n }\n }\n return curr_line;\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}" ]
[ "0.79714906", "0.7487919", "0.74226594", "0.7406071", "0.7406071", "0.7406071", "0.7403563", "0.7403563", "0.7403563", "0.7403563", "0.7403563", "0.7403563", "0.7403563", "0.73738784", "0.73738784", "0.7371278", "0.7365478", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.73644817", "0.7240377", "0.70148027", "0.68640625", "0.68388903", "0.6788556", "0.67838407", "0.67838407", "0.67838407", "0.67726445", "0.67548895", "0.6703254", "0.6693644", "0.6693644", "0.6693644", "0.6693644", "0.6693644", "0.6693644", "0.6693644", "0.66739047", "0.6661292", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6637996", "0.6633363", "0.6629558", "0.66017336", "0.66014636", "0.66014636", "0.65947574", "0.65947574", "0.65947574", "0.6577518", "0.6577036", "0.65448034", "0.65418637", "0.65418637", "0.65418637", "0.65418637", "0.65418637", "0.65418637", "0.65418637", "0.65418637" ]
0.7455519
16
Get the line number of the start of the next visual line after the given line.
function visualLineEndNo(doc, lineN) { if (lineN > doc.lastLine()) { return lineN } var line = getLine(doc, lineN), merged; if (!lineIsHidden(doc, line)) { return lineN } while (merged = collapsedSpanAtEnd(line)) { line = merged.find(1, true).line; } return lineNo(line) + 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN),\n vis = visualLine(line);\n\n if (line == vis) {\n return lineN;\n }\n\n return lineNo(vis);\n } // Get the line number of the start of the next visual line after", "function nextLine() {\n\t\t_this._compConst('LINE', _this.currentLine+1);\n\t\treturn lines[_this.currentLine++];\n\t}", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function getVisibleLine(editor) {\n if (!editor.visibleRanges.length) {\n return undefined;\n }\n const firstVisiblePosition = editor.visibleRanges[0].start;\n const lineNumber = firstVisiblePosition.line;\n const line = editor.document.lineAt(lineNumber);\n const progress = firstVisiblePosition.character / (line.text.length + 2);\n return lineNumber + progress;\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineNo(doc, lineN) {\n\t\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t\t if (line == vis) { return lineN }\n\t\t return lineNo(vis)\n\t\t }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) return lineN;\n return lineNo(vis);\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n\t\t var line = getLine(doc, lineN), vis = visualLine(line);\n\t\t if (line == vis) return lineN;\n\t\t return lineNo(vis);\n\t\t }", "function visualLineEndNo(doc, lineN) {\r\n if (lineN > doc.lastLine()) return lineN;\r\n var line = getLine(doc, lineN), merged;\r\n if (!lineIsHidden(doc, line)) return lineN;\r\n while (merged = collapsedSpanAtEnd(line))\r\n line = merged.find(1, true).line;\r\n return lineNo(line) + 1;\r\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}" ]
[ "0.79053533", "0.73212373", "0.70655745", "0.7048663", "0.70483404", "0.704656", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.70358926", "0.7033989", "0.7033989", "0.7033989", "0.70311517", "0.70311517", "0.70311517", "0.70311517", "0.70311517", "0.70311517", "0.70311517", "0.7020397", "0.7000473", "0.7000473", "0.7000473", "0.7000473", "0.7000473", "0.7000473", "0.7000473", "0.69920456", "0.69897825", "0.6985566", "0.6985566", "0.6985566", "0.6985566", "0.6985566", "0.6985566", "0.6985566", "0.6982312", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6974003", "0.6972056", "0.6972056", "0.696856", "0.69670045", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.6962182", "0.69619524" ]
0.70266366
49
Compute whether a line is hidden. Lines count as hidden when they are part of a visual line that starts with another line, or when they are entirely covered by collapsed, nonwidget span.
function lineIsHidden(doc, line) { var sps = sawCollapsedSpans && line.markedSpans; if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { sp = sps[i]; if (!sp.marker.collapsed) { continue } if (sp.from == null) { return true } if (sp.marker.widgetNode) { continue } if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) { return true } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) continue;\n if (sp.from == null) return true;\n if (sp.marker.widgetNode) continue;\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n return true;\n }\n }", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n\n if (sps) {\n for (var sp = void 0, i = 0; i < sps.length; ++i) {\n sp = sps[i];\n\n if (!sp.marker.collapsed) {\n continue;\n }\n\n if (sp.from == null) {\n return true;\n }\n\n if (sp.marker.widgetNode) {\n continue;\n }\n\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) {\n return true;\n }\n }\n }\n }", "function lineIsHidden(doc, line) {\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) for (var sp, i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (!sp.marker.collapsed) continue;\r\n if (sp.from == null) return true;\r\n if (sp.marker.widgetNode) continue;\r\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\r\n return true;\r\n }\r\n }", "function lineIsHidden(doc, line) {\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t if (sp.from == null) return true;\n\t if (sp.marker.widgetNode) continue;\n\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t return true;\n\t }\n\t }", "function lineIsHidden(doc, line) {\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t if (sp.from == null) return true;\n\t if (sp.marker.widgetNode) continue;\n\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t return true;\n\t }\n\t }", "function lineIsHidden(doc, line) {\n\t var sps = sawCollapsedSpans && line.markedSpans;\n\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t sp = sps[i];\n\t if (!sp.marker.collapsed) continue;\n\t if (sp.from == null) return true;\n\t if (sp.marker.widgetNode) continue;\n\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t return true;\n\t }\n\t }", "function lineIsHidden(doc, line) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) for (var sp, i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (!sp.marker.collapsed) continue;\n\t\t if (sp.from == null) return true;\n\t\t if (sp.marker.widgetNode) continue;\n\t\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t\t return true;\n\t\t }\n\t\t }", "function lineIsHidden(doc, line) {\n\t\t var sps = sawCollapsedSpans && line.markedSpans;\n\t\t if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n\t\t sp = sps[i];\n\t\t if (!sp.marker.collapsed) { continue }\n\t\t if (sp.from == null) { return true }\n\t\t if (sp.marker.widgetNode) { continue }\n\t\t if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n\t\t { return true }\n\t\t } }\n\t\t }", "function lineIsHidden(doc, line) {\r\n var sps = sawCollapsedSpans && line.markedSpans;\r\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\r\n sp = sps[i];\r\n if (!sp.marker.collapsed) { continue }\r\n if (sp.from == null) { return true }\r\n if (sp.marker.widgetNode) { continue }\r\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\r\n { return true }\r\n } }\r\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i]\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n}", "_calcVisibleLines() {\n this._lines.qtMaxVisible = Math.floor(this._matrixHeight / this._cell.heightMin);\n if (this._lines.qtMaxVisible > 3)\n this._lines.qtMinVisible = 3;\n else\n this._lines.qtMinVisible = 1;\n if (this._lines.qtMaxVisible > this._lines.qtTotal)\n this._lines.qtMaxVisible = this._lines.qtTotal;\n if (this._lines.qtMaxVisible < this._lines.qtVisible && this._lines.qtMaxVisible != 0)\n this._lines.qtVisible = this._lines.qtMaxVisible;\n }", "isHide() {\n return this.x < 0\n }", "function lineLabelsVisible() {\n return axesDef.y1.length > 1 &&\n (axesDef.y1.length < 15 || chart.hasHighlight()) &&\n c.w >= theme.minWidth;\n }", "function isRowHidden(row) {\n return _.get(row, '_ng_hidden_', false);\n }", "_shouldDisplayLine(line) {\r\n return line.length > 0 && !this._ignoredLine;\r\n }", "isPartiallyVisible() {\n\t\treturn !this.isVisible() && !this.isHidden();\n\t}", "isHidden() {\n return (this.flags & 0x08) !== 0;\n }", "isVisible() {\n\t\tlet y = this.getY();\n\t\treturn y >= -100 && y <= dh + 100;\n\t}", "function isHidden(el) {\n var style = window.getComputedStyle(el);\n return ((style.display === 'none') || (style.visibility === 'hidden'))\n}", "function shouldHide(data, collapsedSectorPaths) {\n var result = false;\n var hasCollapsedAncestor = areAncestorsCollapsed(data.sectorPath, collapsedSectorPaths);\n var isSummaryRow = !data.isDetail;\n var immediateSectorCollapsed = (collapsedSectorPaths[generateSectorKey(data.sectorPath)] != null);\n if (hasCollapsedAncestor)\n result = true;\n else if (immediateSectorCollapsed && !isSummaryRow)\n result = true;\n return result;\n}", "get verticalLineVisibility() {\r\n return this.i.pm;\r\n }", "function isHidden() {\n return scope[ngHideBinder];\n }", "function hiddenState(vis) {\n return vis === spin.PANEL_HIDDENLEFT ||\n vis === spin.PANEL_HIDDENRIGHT;\n }", "function visualLineContinued(line) {\n var merged, lines;\n\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line;\n (lines || (lines = [])).push(line);\n }\n\n return lines;\n } // Get the line number of the start of the visual line that the", "function isVisibleIndicator() {\n // visibleIndicator\n // if() return false\n // return true;\n }", "function isHidden(element) {\n let style = window.getComputedStyle(element);\n return ((style.display === \"none\") || (style.visibility === \"hidden\"))\n}", "function hidden(el) {\n return matchingAttr('hidden', '')(el) || el.style.display === 'none';\n }", "function isHidden($elem) {\n return $elem.hasAttribute(\"hidden\")\n || ($elem.hasAttribute(\"aria-hidden\") && $elem.getAttribute(\"aria-hidden\") !== \"false\")\n // A quick and dirty way to check whether the element is hidden.\n // For a more fine-grained check we could use \"window.getComputedStyle\" but we don't because of bad performance.\n // If the element has visibility set to \"hidden\" or \"collapse\", display set to \"none\" or opacity set to \"0\" through CSS\n // we won't be able to catch it here. We accept it due to the huge performance benefits.\n || $elem.style.display === `none`\n || $elem.style.opacity === `0`\n || $elem.style.visibility === `hidden`\n || $elem.style.visibility === `collapse`;\n}", "isVisible() {\n return this._visibility === 'visible';\n }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function isDottedSelectionHidden() {\n\t\treturn document.getElementById(this.id).style.visibility == \"hidden\";\n\t}", "function visible(e){return a.a.expr.filters.visible(e)&&!a()(e).parents().addBack().filter(function(){return\"hidden\"===a.a.css(this,\"visibility\")}).length}", "get horizontalLineVisibility() {\r\n return this.i.pl;\r\n }", "function isHidden(node) {\n return !node || node.offsetParent === null;\n}", "function isHidden(node) {\n return !node || node.offsetParent === null;\n}", "get isHide() {\n return this.isStage(STAGE.hidden);\n }", "get _isVisible() {\n return !this.panelElem.hasClass(\"hidden\");\n }", "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "function shouldPreviewElemBeHidden($elem) {\n var thisVisibility = $elem.attr('data-visibility');\n var parentVisibility = $elem.attr('data-parent-visibility');\n return thisVisibility === 'hidden' || thisVisibility === 'unset' && parentVisibility === 'hidden';\n}", "function visualLineContinued(line) {\r\n var merged, lines;\r\n while (merged = collapsedSpanAtEnd(line)) {\r\n line = merged.find(1, true).line;\r\n (lines || (lines = [])).push(line);\r\n }\r\n return lines;\r\n }", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line;\n\t\t (lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines;\n\t\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "isVisible() {\n return this.editorNode.style.visibility == \"visible\";\n }", "function visualLineContinued(line) {\n\t\t var merged, lines;\n\t\t while (merged = collapsedSpanAtEnd(line)) {\n\t\t line = merged.find(1, true).line\n\t\t ;(lines || (lines = [])).push(line);\n\t\t }\n\t\t return lines\n\t\t }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }" ]
[ "0.8505645", "0.8505645", "0.8505645", "0.8505645", "0.8505645", "0.8505645", "0.8505645", "0.8475789", "0.8469844", "0.8453317", "0.8453317", "0.8453317", "0.843991", "0.8433678", "0.8428107", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.8418568", "0.84162855", "0.84162855", "0.6537281", "0.6396155", "0.6385452", "0.6376186", "0.633126", "0.6275808", "0.62103754", "0.6074005", "0.60288393", "0.5994643", "0.59920704", "0.5943368", "0.5932691", "0.59144217", "0.58538264", "0.58209646", "0.5772998", "0.5767487", "0.5732859", "0.5723215", "0.57086575", "0.57039076", "0.5697499", "0.5693838", "0.56845", "0.56845", "0.5677878", "0.5651453", "0.56449103", "0.56449103", "0.56417054", "0.564037", "0.5638121", "0.5637107", "0.5637107", "0.5637107", "0.5630832", "0.562569", "0.5616175", "0.56118226", "0.56118226", "0.56118226", "0.56118226", "0.56118226", "0.56118226", "0.56118226", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927", "0.56072927" ]
0.8501693
23
Find the height above the given line.
function heightAtLine(lineObj) { lineObj = visualLine(lineObj); var h = 0, chunk = lineObj.parent; for (var i = 0; i < chunk.lines.length; ++i) { var line = chunk.lines[i]; if (line == lineObj) { break } else { h += line.height; } } for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { for (var i$1 = 0; i$1 < p.children.length; ++i$1) { var cur = p.children[i$1]; if (cur == chunk) { break } else { h += cur.height; } } } return h }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) { break }\r\n else { h += line.height; }\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\r\n var cur = p.children[i$1];\r\n if (cur == chunk) { break }\r\n else { h += cur.height; }\r\n }\r\n }\r\n return h\r\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "getYForLine(line) {\n const options = this.options;\n const spacing = options.spacing_between_lines_px;\n const headroom = options.space_above_staff_ln;\n\n const y = this.y + (line * spacing) + (headroom * spacing);\n\n return y;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size'), 10) * 1.2;\n }\n return parseInt(lh, 10);\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function lineAtHeight(chunk, h) {\n\t\t var n = chunk.first;\n\t\t outer: do {\n\t\t for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n\t\t var child = chunk.children[i$1], ch = child.height;\n\t\t if (h < ch) { chunk = child; continue outer }\n\t\t h -= ch;\n\t\t n += child.chunkSize();\n\t\t }\n\t\t return n\n\t\t } while (!chunk.lines)\n\t\t var i = 0;\n\t\t for (; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i], lh = line.height;\n\t\t if (h < lh) { break }\n\t\t h -= lh;\n\t\t }\n\t\t return n + i\n\t\t }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\r\n}", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }", "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}" ]
[ "0.7672805", "0.7669036", "0.7598157", "0.7598157", "0.759206", "0.7560561", "0.7560561", "0.7560561", "0.7560561", "0.7560561", "0.7560561", "0.7560561", "0.75525343", "0.7474777", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.746032", "0.74551326", "0.74551326", "0.7411553", "0.7076512", "0.65905035", "0.65748185", "0.6568772", "0.65638417", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6559213", "0.6557111", "0.65540534", "0.65534943", "0.65534943", "0.65534943", "0.65534943", "0.65534943", "0.65534943", "0.65534943", "0.6536946", "0.6536946", "0.6536946", "0.6531552", "0.6522814", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6521187", "0.6510843", "0.65082526", "0.65082526" ]
0.7555887
28
Compute the character length of a line, taking into account collapsed ranges (see markText) that might hide parts, and join other lines onto it.
function lineLength(line) { if (line.height == 0) { return 0 } var len = line.text.length, merged, cur = line; while (merged = collapsedSpanAtStart(cur)) { var found = merged.find(0, true); cur = found.from.line; len += found.from.ch - found.to.ch; } cur = line; while (merged = collapsedSpanAtEnd(cur)) { var found$1 = merged.find(0, true); len -= cur.text.length - found$1.from.ch; cur = found$1.to.line; len += cur.text.length - found$1.to.ch; } return len }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\r\n if (line.height == 0) return 0;\r\n var len = line.text.length, merged, cur = line;\r\n while (merged = collapsedSpanAtStart(cur)) {\r\n var found = merged.find(0, true);\r\n cur = found.from.line;\r\n len += found.from.ch - found.to.ch;\r\n }\r\n cur = line;\r\n while (merged = collapsedSpanAtEnd(cur)) {\r\n var found = merged.find(0, true);\r\n len -= cur.text.length - found.from.ch;\r\n cur = found.to.line;\r\n len += cur.text.length - found.to.ch;\r\n }\r\n return len;\r\n }", "function lineLength(line) {\n\t\t if (line.height == 0) { return 0 }\n\t\t var len = line.text.length, merged, cur = line;\n\t\t while (merged = collapsedSpanAtStart(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t cur = found.from.line;\n\t\t len += found.from.ch - found.to.ch;\n\t\t }\n\t\t cur = line;\n\t\t while (merged = collapsedSpanAtEnd(cur)) {\n\t\t var found$1 = merged.find(0, true);\n\t\t len -= cur.text.length - found$1.from.ch;\n\t\t cur = found$1.to.line;\n\t\t len += cur.text.length - found$1.to.ch;\n\t\t }\n\t\t return len\n\t\t }", "function lineLength(line) {\r\n if (line.height == 0) { return 0 }\r\n var len = line.text.length, merged, cur = line;\r\n while (merged = collapsedSpanAtStart(cur)) {\r\n var found = merged.find(0, true);\r\n cur = found.from.line;\r\n len += found.from.ch - found.to.ch;\r\n }\r\n cur = line;\r\n while (merged = collapsedSpanAtEnd(cur)) {\r\n var found$1 = merged.find(0, true);\r\n len -= cur.text.length - found$1.from.ch;\r\n cur = found$1.to.line;\r\n len += cur.text.length - found$1.to.ch;\r\n }\r\n return len\r\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}", "function lineLength(line) {\n\t\t if (line.height == 0) return 0;\n\t\t var len = line.text.length, merged, cur = line;\n\t\t while (merged = collapsedSpanAtStart(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t cur = found.from.line;\n\t\t len += found.from.ch - found.to.ch;\n\t\t }\n\t\t cur = line;\n\t\t while (merged = collapsedSpanAtEnd(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t len -= cur.text.length - found.from.ch;\n\t\t cur = found.to.line;\n\t\t len += cur.text.length - found.to.ch;\n\t\t }\n\t\t return len;\n\t\t }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\n if (line.height == 0) {\n return 0;\n }\n\n var len = line.text.length,\n merged,\n cur = line;\n\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n\n cur = line;\n\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n\n return len;\n } // Find the longest line in the document.", "get length() {\n // Assume that every newline is a keystroke, and that whitespace is stripped.\n const lines = this.code.split('\\n');\n const total_characters = lines.map(line => line.trim().length).reduce((a, b) => a + b);\n return total_characters + lines.length - 1;\n }", "function lineLength(line){\n return Math.sqrt(Math.pow(line[1][0] - line[0][0], 2) + Math.pow(line[1][1] - line[0][1], 2));\n }", "function getCharsOnLine(editor, line) {\n return getLine(editor, line).length;\n }", "function realLength(value) {\n var length = value.indexOf('\\n')\n return width(length === -1 ? value : value.slice(0, length))\n}", "function _lineLength(str) {\n // The number of actual characters counted.\n var ct = 0;\n // Whether we are inside a color sequence.\n var inSeq = false;\n\n for (var i = 0; i < str.length; i++) {\n if (str[i] === '\\x1B') {\n inSeq = true;\n } else if (inSeq) {\n if (str[i] === 'm') {\n inSeq = false;\n }\n } else {\n ct++;\n }\n }\n\n return ct;\n}", "function foldLine(line, width) {\n\t if (line === '' || line[0] === ' ') return line;\n\n\t // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n\t var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n\t var match;\n\t // start is an inclusive index. end, curr, and next are exclusive.\n\t var start = 0, end, curr = 0, next = 0;\n\t var result = '';\n\n\t // Invariants: 0 <= start <= length-1.\n\t // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n\t // Inside the loop:\n\t // A match implies length >= 2, so curr and next are <= length-2.\n\t while ((match = breakRe.exec(line))) {\n\t next = match.index;\n\t // maintain invariant: curr - start <= width\n\t if (next - start > width) {\n\t end = (curr > start) ? curr : next; // derive end <= length-2\n\t result += '\\n' + line.slice(start, end);\n\t // skip the space that was output as \\n\n\t start = end + 1; // derive start <= length-1\n\t }\n\t curr = next;\n\t }\n\n\t // By the invariants, start <= length-1, so there is something left over.\n\t // It is either the whole string or a part starting from non-whitespace.\n\t result += '\\n';\n\t // Insert a break if the remainder is too long and there is a break available.\n\t if (line.length - start > width && curr > start) {\n\t result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n\t } else {\n\t result += line.slice(start);\n\t }\n\n\t return result.slice(1); // drop extra \\n joiner\n\t}", "function foldLine(line, width) {\n\t if (line === '' || line[0] === ' ') return line;\n\n\t // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n\t var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n\t var match;\n\t // start is an inclusive index. end, curr, and next are exclusive.\n\t var start = 0, end, curr = 0, next = 0;\n\t var result = '';\n\n\t // Invariants: 0 <= start <= length-1.\n\t // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n\t // Inside the loop:\n\t // A match implies length >= 2, so curr and next are <= length-2.\n\t while ((match = breakRe.exec(line))) {\n\t next = match.index;\n\t // maintain invariant: curr - start <= width\n\t if (next - start > width) {\n\t end = (curr > start) ? curr : next; // derive end <= length-2\n\t result += '\\n' + line.slice(start, end);\n\t // skip the space that was output as \\n\n\t start = end + 1; // derive start <= length-1\n\t }\n\t curr = next;\n\t }\n\n\t // By the invariants, start <= length-1, so there is something left over.\n\t // It is either the whole string or a part starting from non-whitespace.\n\t result += '\\n';\n\t // Insert a break if the remainder is too long and there is a break available.\n\t if (line.length - start > width && curr > start) {\n\t result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n\t } else {\n\t result += line.slice(start);\n\t }\n\n\t return result.slice(1); // drop extra \\n joiner\n\t}", "function foldLine(line, width) {\n\t if (line === '' || line[0] === ' ') return line;\n\n\t // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n\t var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n\t var match;\n\t // start is an inclusive index. end, curr, and next are exclusive.\n\t var start = 0, end, curr = 0, next = 0;\n\t var result = '';\n\n\t // Invariants: 0 <= start <= length-1.\n\t // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n\t // Inside the loop:\n\t // A match implies length >= 2, so curr and next are <= length-2.\n\t while ((match = breakRe.exec(line))) {\n\t next = match.index;\n\t // maintain invariant: curr - start <= width\n\t if (next - start > width) {\n\t end = (curr > start) ? curr : next; // derive end <= length-2\n\t result += '\\n' + line.slice(start, end);\n\t // skip the space that was output as \\n\n\t start = end + 1; // derive start <= length-1\n\t }\n\t curr = next;\n\t }\n\n\t // By the invariants, start <= length-1, so there is something left over.\n\t // It is either the whole string or a part starting from non-whitespace.\n\t result += '\\n';\n\t // Insert a break if the remainder is too long and there is a break available.\n\t if (line.length - start > width && curr > start) {\n\t result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n\t } else {\n\t result += line.slice(start);\n\t }\n\n\t return result.slice(1); // drop extra \\n joiner\n\t}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine(line, width) {\n if (line === '' || line[0] === ' ') { return line; }\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function foldLine$1(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n\t\t if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n\t\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t\t var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n\t\t removeChildrenAndAdd(display.measure, pre);\n\t\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t\t if (width > 2) { display.cachedCharWidth = width; }\n\t\t return width || 10\n\t\t }", "function checkNumOfLines (text, font, lineWidth,limit) {\n\t\ttext=text.split(' ')\n\t\tlet sumLine=1\n\t\tlet j=0\n\t\tfor (let i=0; i<text.length; i++) {\n\t\t\tfragment=text.slice(j,i+1).join(' ')\n\t\t\tif(getTextWidth(fragment,font)>lineWidth) {\n\t\t\t\tsumLine++\n\t\t\t\tif (sumLine===limit) {break}\n\t\t\t\tj=i\n\t\t\t\ti--\n\t\t\t}\n\t\t}\n\t\treturn sumLine\n\t}", "function formatLength (geom, sourceProj) {\n const getLineStringLength = function (line) {\n let length = 0\n if ($('#geodesic').is(':checked')) {\n const coordinates = line.clone().transform(sourceProj, 'EPSG:4326').getCoordinates()\n const nCoords = coordinates.length\n for (let i = 0; i < nCoords - 1; i++) {\n length += wgs84Sphere.haversineDistance(coordinates[i], coordinates[i + 1])\n }\n } else {\n length = line.getLength()\n }\n return length\n }\n let length = 0\n if (geom.getType() === 'MultiLineString') {\n geom.getLineStrings().forEach(function (line) {\n length += getLineStringLength(line)\n })\n } else {\n length = getLineStringLength(geom)\n }\n let output\n if (length > 1000) {\n output = (Math.round(length / 1000 * 100) / 100) + ' km'\n } else {\n output = (Math.round(length * 100) / 100) + ' m'\n }\n $('#measure').html(output)\n // return output\n }", "function visualLength(text)\n\t{\n\t\tvar ruler = document.getElementById(\"ruler\");\n\t\truler.innerHTML = text;\n\t\treturn ruler.offsetWidth;\n\t}", "_maxLineHack() {\n var display = this.cm.display, curOp = this.cm.curOp;\n const CLEARANCE = 3; /* space added to the right, in characters */\n display.maxLineChanged = false;\n if (curOp) {\n curOp.updateMaxLine = false;\n curOp.adjustWidthTo = (display.maxLine.text.length + CLEARANCE) *\n this.cm.defaultCharWidth();\n // Force the size using the actual character count.\n // May result in too much horizontal scrolling, but that is\n // better than the alternative.\n }\n }", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "function reflowSmallerGetNewLineLengths(wrappedLines, oldCols, newCols) {\n const newLineLengths = [];\n const cellsNeeded = wrappedLines.map((l, i) => getWrappedLineTrimmedLength(wrappedLines, i, oldCols)).reduce((p, c) => p + c);\n // Use srcCol and srcLine to find the new wrapping point, use that to get the cellsAvailable and\n // linesNeeded\n let srcCol = 0;\n let srcLine = 0;\n let cellsAvailable = 0;\n while (cellsAvailable < cellsNeeded) {\n if (cellsNeeded - cellsAvailable < newCols) {\n // Add the final line and exit the loop\n newLineLengths.push(cellsNeeded - cellsAvailable);\n break;\n }\n srcCol += newCols;\n const oldTrimmedLength = getWrappedLineTrimmedLength(wrappedLines, srcLine, oldCols);\n if (srcCol > oldTrimmedLength) {\n srcCol -= oldTrimmedLength;\n srcLine++;\n }\n const endsWithWide = wrappedLines[srcLine].getWidth(srcCol - 1) === 2;\n if (endsWithWide) {\n srcCol--;\n }\n const lineLength = endsWithWide ? newCols - 1 : newCols;\n newLineLengths.push(lineLength);\n cellsAvailable += lineLength;\n }\n return newLineLengths;\n}", "@computed\n get maxAnnotationLength() {\n if (this.rawAnnotations.length == 0) {\n return 0;\n }\n let maxLen = 0;\n this.rawAnnotations.forEach(d => {\n maxLen = Math.max(maxLen, d.endOffset - d.startOffset + 1);\n });\n return maxLen;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) {\n return display.cachedTextHeight;\n }\n\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\"); // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n\n if (height > 3) {\n display.cachedTextHeight = height;\n }\n\n removeChildren(display.measure);\n return height || 1;\n } // Compute the default character width.", "function findMaxLineLength(txt) {\n \n // Isolate lines\n let lines = txt.split(\"\\n\");\n let result = lines[0].length;\n\n // Find maximum line length\n for (let i = 1; i < lines.length; i++) {\n \tif (lines[i].length > result) {\n \t\tresult = lines[i].length;\n \t}\n }\n return result;\n}" ]
[ "0.7674573", "0.7674573", "0.7674573", "0.7674573", "0.7674573", "0.7674573", "0.7674573", "0.7674573", "0.7654567", "0.76487184", "0.7636831", "0.76268494", "0.76268494", "0.76238084", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.7618696", "0.75952643", "0.75952643", "0.75952643", "0.7338286", "0.6648663", "0.63356376", "0.6324517", "0.6255562", "0.59406006", "0.5906275", "0.5906275", "0.5906275", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5868142", "0.5859138", "0.583118", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5793864", "0.5791783", "0.56818724", "0.5564091", "0.55457556", "0.55185723", "0.53405327", "0.5325309", "0.53136325", "0.5281214", "0.52796775" ]
0.7679532
14
Find the longest line in the document.
function findMaxLine(cm) { var d = cm.display, doc = cm.doc; d.maxLine = getLine(doc, doc.first); d.maxLineLength = lineLength(d.maxLine); d.maxLineChanged = true; doc.iter(function (line) { var len = lineLength(line); if (len > d.maxLineLength) { d.maxLineLength = len; d.maxLine = line; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function(line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc\n d.maxLine = getLine(doc, doc.first)\n d.maxLineLength = lineLength(d.maxLine)\n d.maxLineChanged = true\n doc.iter(function (line) {\n var len = lineLength(line)\n if (len > d.maxLineLength) {\n d.maxLineLength = len\n d.maxLine = line\n }\n })\n}", "function findMaxLine(cm) {\r\n var d = cm.display, doc = cm.doc;\r\n d.maxLine = getLine(doc, doc.first);\r\n d.maxLineLength = lineLength(d.maxLine);\r\n d.maxLineChanged = true;\r\n doc.iter(function(line) {\r\n var len = lineLength(line);\r\n if (len > d.maxLineLength) {\r\n d.maxLineLength = len;\r\n d.maxLine = line;\r\n }\r\n });\r\n }", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n}", "function findMaxLine(cm) {\n\t var d = cm.display, doc = cm.doc;\n\t d.maxLine = getLine(doc, doc.first);\n\t d.maxLineLength = lineLength(d.maxLine);\n\t d.maxLineChanged = true;\n\t doc.iter(function(line) {\n\t var len = lineLength(line);\n\t if (len > d.maxLineLength) {\n\t d.maxLineLength = len;\n\t d.maxLine = line;\n\t }\n\t });\n\t }", "function findMaxLine(cm) {\n\t var d = cm.display, doc = cm.doc;\n\t d.maxLine = getLine(doc, doc.first);\n\t d.maxLineLength = lineLength(d.maxLine);\n\t d.maxLineChanged = true;\n\t doc.iter(function(line) {\n\t var len = lineLength(line);\n\t if (len > d.maxLineLength) {\n\t d.maxLineLength = len;\n\t d.maxLine = line;\n\t }\n\t });\n\t }", "function findMaxLine(cm) {\n\t var d = cm.display, doc = cm.doc;\n\t d.maxLine = getLine(doc, doc.first);\n\t d.maxLineLength = lineLength(d.maxLine);\n\t d.maxLineChanged = true;\n\t doc.iter(function(line) {\n\t var len = lineLength(line);\n\t if (len > d.maxLineLength) {\n\t d.maxLineLength = len;\n\t d.maxLine = line;\n\t }\n\t });\n\t }", "function findMaxLine(cm) {\r\n var d = cm.display, doc = cm.doc;\r\n d.maxLine = getLine(doc, doc.first);\r\n d.maxLineLength = lineLength(d.maxLine);\r\n d.maxLineChanged = true;\r\n doc.iter(function (line) {\r\n var len = lineLength(line);\r\n if (len > d.maxLineLength) {\r\n d.maxLineLength = len;\r\n d.maxLine = line;\r\n }\r\n });\r\n}", "function findMaxLine(cm) {\n\t\t var d = cm.display, doc = cm.doc;\n\t\t d.maxLine = getLine(doc, doc.first);\n\t\t d.maxLineLength = lineLength(d.maxLine);\n\t\t d.maxLineChanged = true;\n\t\t doc.iter(function(line) {\n\t\t var len = lineLength(line);\n\t\t if (len > d.maxLineLength) {\n\t\t d.maxLineLength = len;\n\t\t d.maxLine = line;\n\t\t }\n\t\t });\n\t\t }", "function findMaxLine(cm) {\n\t\t var d = cm.display, doc = cm.doc;\n\t\t d.maxLine = getLine(doc, doc.first);\n\t\t d.maxLineLength = lineLength(d.maxLine);\n\t\t d.maxLineChanged = true;\n\t\t doc.iter(function (line) {\n\t\t var len = lineLength(line);\n\t\t if (len > d.maxLineLength) {\n\t\t d.maxLineLength = len;\n\t\t d.maxLine = line;\n\t\t }\n\t\t });\n\t\t }", "function lineLength(line) {\n if (line.height == 0) {\n return 0;\n }\n\n var len = line.text.length,\n merged,\n cur = line;\n\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n\n cur = line;\n\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n\n return len;\n } // Find the longest line in the document.", "function findMaxLineLength(txt) {\n \n // Isolate lines\n let lines = txt.split(\"\\n\");\n let result = lines[0].length;\n\n // Find maximum line length\n for (let i = 1; i < lines.length; i++) {\n \tif (lines[i].length > result) {\n \t\tresult = lines[i].length;\n \t}\n }\n return result;\n}", "function longestWord(sen) {}", "function longest (l) { // {{{\n\tvar maxlen = 0;\n\tl.shift().forEach( function (s) { if (s && s.length > maxlen) { maxlen = s.length } } );\n\treturn maxlen;\n} // }}}", "function lineLength(line) {\n\t\t if (line.height == 0) return 0;\n\t\t var len = line.text.length, merged, cur = line;\n\t\t while (merged = collapsedSpanAtStart(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t cur = found.from.line;\n\t\t len += found.from.ch - found.to.ch;\n\t\t }\n\t\t cur = line;\n\t\t while (merged = collapsedSpanAtEnd(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t len -= cur.text.length - found.from.ch;\n\t\t cur = found.to.line;\n\t\t len += cur.text.length - found.to.ch;\n\t\t }\n\t\t return len;\n\t\t }", "function lineLength(line) {\n\t\t if (line.height == 0) { return 0 }\n\t\t var len = line.text.length, merged, cur = line;\n\t\t while (merged = collapsedSpanAtStart(cur)) {\n\t\t var found = merged.find(0, true);\n\t\t cur = found.from.line;\n\t\t len += found.from.ch - found.to.ch;\n\t\t }\n\t\t cur = line;\n\t\t while (merged = collapsedSpanAtEnd(cur)) {\n\t\t var found$1 = merged.find(0, true);\n\t\t len -= cur.text.length - found$1.from.ch;\n\t\t cur = found$1.to.line;\n\t\t len += cur.text.length - found$1.to.ch;\n\t\t }\n\t\t return len\n\t\t }", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\n\t if (line.height == 0) return 0;\n\t var len = line.text.length, merged, cur = line;\n\t while (merged = collapsedSpanAtStart(cur)) {\n\t var found = merged.find(0, true);\n\t cur = found.from.line;\n\t len += found.from.ch - found.to.ch;\n\t }\n\t cur = line;\n\t while (merged = collapsedSpanAtEnd(cur)) {\n\t var found = merged.find(0, true);\n\t len -= cur.text.length - found.from.ch;\n\t cur = found.to.line;\n\t len += cur.text.length - found.to.ch;\n\t }\n\t return len;\n\t }", "function lineLength(line) {\r\n if (line.height == 0) return 0;\r\n var len = line.text.length, merged, cur = line;\r\n while (merged = collapsedSpanAtStart(cur)) {\r\n var found = merged.find(0, true);\r\n cur = found.from.line;\r\n len += found.from.ch - found.to.ch;\r\n }\r\n cur = line;\r\n while (merged = collapsedSpanAtEnd(cur)) {\r\n var found = merged.find(0, true);\r\n len -= cur.text.length - found.from.ch;\r\n cur = found.to.line;\r\n len += cur.text.length - found.to.ch;\r\n }\r\n return len;\r\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) return 0;\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found = merged.find(0, true);\n len -= cur.text.length - found.from.ch;\n cur = found.to.line;\n len += cur.text.length - found.to.ch;\n }\n return len;\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }", "findOldestLine() {\r\n let minimum = Number.MAX_VALUE\r\n let lineNumWithMin = null\r\n for(let lineNum = 0; lineNum < this.numberOfCacheLines; lineNum++) {\r\n let line = this.cacheLines[lineNum]\r\n if((line.timeUsed < minimum) && (line.state != States.INVALID)) {\r\n minimum = line.timeUsed\r\n lineNumWithMin = lineNum\r\n }\r\n }\r\n return lineNumWithMin;\r\n }", "function longest(words) {\n\n}", "function lineLength(line) {\r\n if (line.height == 0) { return 0 }\r\n var len = line.text.length, merged, cur = line;\r\n while (merged = collapsedSpanAtStart(cur)) {\r\n var found = merged.find(0, true);\r\n cur = found.from.line;\r\n len += found.from.ch - found.to.ch;\r\n }\r\n cur = line;\r\n while (merged = collapsedSpanAtEnd(cur)) {\r\n var found$1 = merged.find(0, true);\r\n len -= cur.text.length - found$1.from.ch;\r\n cur = found$1.to.line;\r\n len += cur.text.length - found$1.to.ch;\r\n }\r\n return len\r\n}", "function longestRun (string) {\n\n\n\n\n\n}", "function lineWordEnd(area) {\n area.pos = area.pos || pos(area);\n return linePos(area) + wordDist(area);\n }", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true)\n cur = found.from.line\n len += found.from.ch - found.to.ch\n }\n cur = line\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true)\n len -= cur.text.length - found$1.from.ch\n cur = found$1.to.line\n len += cur.text.length - found$1.to.ch\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n}", "function getLongest () {\n var longest = '';\n for (var i = 0; i < strings.length; i++) {\n if (strings[i].length > longest.length) {\n longest = strings[i];\n }\n }return longest;\n}", "function longestString(longStr){\n var mostAmntOfCharacters = longStr.reduce((x,y) => x.length >= y.length ? x : y);\n return mostAmntOfCharacters\n}", "function findLongestWord(sentence){\n // YOUR CODE HERE\n}" ]
[ "0.7557767", "0.7557767", "0.7557767", "0.7557767", "0.7557767", "0.7557767", "0.7557767", "0.7557767", "0.75130606", "0.75130606", "0.75036013", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7496651", "0.7485004", "0.7485004", "0.7485004", "0.74727786", "0.7453769", "0.7452739", "0.7177752", "0.6854581", "0.6580037", "0.6405701", "0.63757133", "0.6321788", "0.63079756", "0.63079756", "0.63079756", "0.62958354", "0.62886566", "0.62886566", "0.62886566", "0.62886566", "0.62886566", "0.62886566", "0.62886566", "0.62886566", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.62612575", "0.623942", "0.62073886", "0.6202309", "0.62003326", "0.6177437", "0.6168492", "0.6168492", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.61665565", "0.6133513", "0.6122608", "0.6099657" ]
0.75558054
24
Get the bidi ordering for the given line (and cache it). Returns false for lines that are fully lefttoright, and an array of BidiSpan objects otherwise.
function getOrder(line, direction) { var order = line.order; if (order == null) { order = line.order = bidiOrdering(line.text, direction); } return order }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrder(line) {\n\t\t var order = line.order;\n\t\t if (order == null) order = line.order = bidiOrdering(line.text);\n\t\t return order;\n\t\t }", "function getOrder(line) {\n\t var order = line.order;\n\t if (order == null) order = line.order = bidiOrdering(line.text);\n\t return order;\n\t }", "function getOrder(line) {\n\t var order = line.order;\n\t if (order == null) order = line.order = bidiOrdering(line.text);\n\t return order;\n\t }", "function getOrder(line) {\n\t var order = line.order;\n\t if (order == null) order = line.order = bidiOrdering(line.text);\n\t return order;\n\t }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\n var order = line.order;\n if (order == null) order = line.order = bidiOrdering(line.text);\n return order;\n }", "function getOrder(line) {\r\n var order = line.order;\r\n if (order == null) order = line.order = bidiOrdering(line.text);\r\n return order;\r\n }", "function getOrder(line) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text) }\n return order\n}", "function getOrder(line, direction) {\n\t\t var order = line.order;\n\t\t if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n\t\t return order\n\t\t }", "function getOrder(line, direction) {\r\n var order = line.order;\r\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\r\n return order\r\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order\n if (order == null) { order = line.order = bidiOrdering(line.text, direction) }\n return order\n}", "function getOrder(line, direction) {\n var order = line.order;\n\n if (order == null) {\n order = line.order = bidiOrdering(line.text, direction);\n }\n\n return order;\n } // EVENT HANDLING", "reArrangeElementsForRtl(line, isParaBidi) {\n if (line.children.length === 0) {\n return;\n }\n let lastAddedElementIsRtl = false;\n let lastAddedRtlElementIndex = -1;\n let tempElements = [];\n for (let i = 0; i < line.children.length; i++) {\n let element = line.children[i];\n let elementCharacterFormat = undefined;\n if (element.characterFormat) {\n elementCharacterFormat = element.characterFormat;\n }\n let isRtl = false;\n let text = '';\n //let containsSpecchrs: boolean = false;\n if (element instanceof BookmarkElementBox) {\n if (isParaBidi) {\n if (lastAddedElementIsRtl || element.bookmarkType === 0 && element.nextElement\n && element.nextElement.nextElement instanceof TextElementBox\n && this.viewer.textHelper.isRTLText(element.nextElement.nextElement.text)\n || element.bookmarkType === 1 && element.nextElement instanceof TextElementBox\n && this.viewer.textHelper.isRTLText(element.nextElement.text)) {\n tempElements.splice(0, 0, element);\n }\n else {\n tempElements.splice(lastAddedElementIsRtl ? lastAddedRtlElementIndex : lastAddedRtlElementIndex + 1, 0, element);\n }\n lastAddedRtlElementIndex = tempElements.indexOf(element);\n }\n else {\n tempElements.push(element);\n }\n continue;\n }\n if (element instanceof TextElementBox) {\n text = element.text;\n }\n // The list element box shold be added in the last position in line widget for the RTL paragraph \n // and first in the line widget for LTR paragrph.\n if (element instanceof ListTextElementBox) {\n isRtl = isParaBidi;\n }\n else { // For Text element box we need to check the character format and unicode of text to detect the RTL text. \n isRtl = this.viewer.textHelper.isRTLText(text) || elementCharacterFormat.bidi\n || elementCharacterFormat.bdo === 'RTL';\n }\n // If the text element box contains only whitespaces, then need to check the previous and next elements.\n if (!isRtl && !isNullOrUndefined(text) && text !== '' && text.trim() === '') {\n let elements = line.children;\n //Checks whether the langugae is RTL.\n if (elementCharacterFormat.bidi) {\n // If the last added element is rtl then current text element box also considered as RTL for WhiteSpaces.\n if (lastAddedElementIsRtl) {\n isRtl = true;\n // Else, Check for next element.\n }\n else if (i + 1 < line.children.length && line.children[i + 1] instanceof TextElementBox) {\n text = elements[i + 1].text;\n isRtl = this.viewer.textHelper.isRTLText(text) || elements[i + 1].characterFormat.bidi\n || elements[i + 1].characterFormat.bdo === 'RTL';\n } // If the last added element is rtl then current text element box also considered as RTL for WhiteSpaces.\n }\n else if (lastAddedElementIsRtl) {\n isRtl = true;\n }\n }\n // Preserve the isRTL value, to reuse it for navigation and selection.\n element.isRightToLeft = isRtl;\n //Adds the text element to the line\n if (isRtl && elementCharacterFormat.bdo !== 'LTR') {\n if (lastAddedElementIsRtl) {\n tempElements.splice(lastAddedRtlElementIndex, 0, element);\n }\n else {\n if (!isParaBidi) {\n tempElements.push(element);\n }\n else {\n tempElements.splice(0, 0, element);\n }\n lastAddedElementIsRtl = true;\n lastAddedRtlElementIndex = tempElements.indexOf(element);\n }\n }\n else {\n if (lastAddedElementIsRtl && element instanceof ImageElementBox) {\n if (elementCharacterFormat.bidi) {\n tempElements.splice(lastAddedRtlElementIndex + 1, 0, element);\n }\n else {\n tempElements.splice(lastAddedRtlElementIndex, 0, element);\n }\n }\n else {\n if (!isParaBidi) {\n tempElements.push(element);\n }\n else {\n if (lastAddedElementIsRtl) {\n tempElements.splice(0, 0, element);\n }\n else {\n tempElements.splice(lastAddedRtlElementIndex + 1, 0, element);\n }\n lastAddedRtlElementIndex = tempElements.indexOf(element);\n }\n lastAddedElementIsRtl = false;\n }\n }\n }\n // Clear the elemnts and reassign the arranged elements.\n line.children = [];\n line.children = tempElements;\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var moveOneUnit = byUnit ? function(pos, dir) {\n do pos += dir;\n while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));\n return pos;\n } : function(pos, dir) { return pos + dir; };\n var linedir = bidi[0].level;\n for (var i = 0; i < bidi.length; ++i) {\n var part = bidi[i], sticky = part.level % 2 == linedir;\n if ((part.from < start && part.to > start) ||\n (sticky && (part.from == start || part.to == start))) break;\n }\n var target = moveOneUnit(start, part.level % 2 ? -dir : dir);\n\n while (target != null) {\n if (part.level % 2 == linedir) {\n if (target < part.from || target > part.to) {\n part = bidi[i += dir];\n target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1));\n } else break;\n } else {\n if (target == bidiLeft(part)) {\n part = bidi[--i];\n target = part && bidiRight(part);\n } else if (target == bidiRight(part)) {\n part = bidi[++i];\n target = part && bidiLeft(part);\n } else break;\n }\n }\n\n return target < 0 || target > line.text.length ? null : target;\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var moveOneUnit = byUnit ? function(pos, dir) {\n do pos += dir;\n while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));\n return pos;\n } : function(pos, dir) { return pos + dir; };\n var linedir = bidi[0].level;\n for (var i = 0; i < bidi.length; ++i) {\n var part = bidi[i], sticky = part.level % 2 == linedir;\n if ((part.from < start && part.to > start) ||\n (sticky && (part.from == start || part.to == start))) break;\n }\n var target = moveOneUnit(start, part.level % 2 ? -dir : dir);\n\n while (target != null) {\n if (part.level % 2 == linedir) {\n if (target < part.from || target > part.to) {\n part = bidi[i += dir];\n target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1));\n } else break;\n } else {\n if (target == bidiLeft(part)) {\n part = bidi[--i];\n target = part && bidiRight(part);\n } else if (target == bidiRight(part)) {\n part = bidi[++i];\n target = part && bidiLeft(part);\n } else break;\n }\n }\n\n return target < 0 || target > line.text.length ? null : target;\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var moveOneUnit = byUnit ? function(pos, dir) {\n do pos += dir;\n while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));\n return pos;\n } : function(pos, dir) { return pos + dir; };\n var linedir = bidi[0].level;\n for (var i = 0; i < bidi.length; ++i) {\n var part = bidi[i], sticky = part.level % 2 == linedir;\n if ((part.from < start && part.to > start) ||\n (sticky && (part.from == start || part.to == start))) break;\n }\n var target = moveOneUnit(start, part.level % 2 ? -dir : dir);\n\n while (target != null) {\n if (part.level % 2 == linedir) {\n if (target < part.from || target > part.to) {\n part = bidi[i += dir];\n target = part && (dir > 0 == part.level % 2 ? moveOneUnit(part.to, -1) : moveOneUnit(part.from, 1));\n } else break;\n } else {\n if (target == bidiLeft(part)) {\n part = bidi[--i];\n target = part && bidiRight(part);\n } else if (target == bidiRight(part)) {\n part = bidi[++i];\n target = part && bidiLeft(part);\n } else break;\n }\n }\n\n return target < 0 || target > line.text.length ? null : target;\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) {\n return range;\n }\n\n var order = getOrder(anchorLine);\n\n if (!order) {\n return range;\n }\n\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky),\n part = order[index];\n\n if (part.from != anchor.ch && part.to != anchor.ch) {\n return range;\n }\n\n var boundary = index + (part.from == anchor.ch == (part.level != 1) ? 0 : 1);\n\n if (boundary == 0 || boundary == order.length) {\n return range;\n } // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n\n\n var leftSide;\n\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n\n if (headIndex == boundary - 1 || headIndex == boundary) {\n leftSide = dir < 0;\n } else {\n leftSide = dir > 0;\n }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to,\n sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head);\n } // Determines whether an event happened in the gutter, and fires the", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function moveVisually(line, start, dir, byUnit) {\n\t\t var bidi = getOrder(line);\n\t\t if (!bidi) return moveLogically(line, start, dir, byUnit);\n\t\t var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n\t\t var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\t\t\n\t\t for (;;) {\n\t\t if (target > part.from && target < part.to) return target;\n\t\t if (target == part.from || target == part.to) {\n\t\t if (getBidiPartAt(bidi, target) == pos) return target;\n\t\t part = bidi[pos += dir];\n\t\t return (dir > 0) == part.level % 2 ? part.to : part.from;\n\t\t } else {\n\t\t part = bidi[pos += dir];\n\t\t if (!part) return null;\n\t\t if ((dir > 0) == part.level % 2)\n\t\t target = moveInLine(line, part.to, -1, byUnit);\n\t\t else\n\t\t target = moveInLine(line, part.from, 1, byUnit);\n\t\t }\n\t\t }\n\t\t }", "function moveVisually(line, start, dir, byUnit) {\n\t var bidi = getOrder(line);\n\t if (!bidi) return moveLogically(line, start, dir, byUnit);\n\t var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n\t var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\t\n\t for (;;) {\n\t if (target > part.from && target < part.to) return target;\n\t if (target == part.from || target == part.to) {\n\t if (getBidiPartAt(bidi, target) == pos) return target;\n\t part = bidi[pos += dir];\n\t return (dir > 0) == part.level % 2 ? part.to : part.from;\n\t } else {\n\t part = bidi[pos += dir];\n\t if (!part) return null;\n\t if ((dir > 0) == part.level % 2)\n\t target = moveInLine(line, part.to, -1, byUnit);\n\t else\n\t target = moveInLine(line, part.from, 1, byUnit);\n\t }\n\t }\n\t }", "function moveVisually(line, start, dir, byUnit) {\n\t var bidi = getOrder(line);\n\t if (!bidi) return moveLogically(line, start, dir, byUnit);\n\t var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n\t var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n\t for (;;) {\n\t if (target > part.from && target < part.to) return target;\n\t if (target == part.from || target == part.to) {\n\t if (getBidiPartAt(bidi, target) == pos) return target;\n\t part = bidi[pos += dir];\n\t return (dir > 0) == part.level % 2 ? part.to : part.from;\n\t } else {\n\t part = bidi[pos += dir];\n\t if (!part) return null;\n\t if ((dir > 0) == part.level % 2)\n\t target = moveInLine(line, part.to, -1, byUnit);\n\t else\n\t target = moveInLine(line, part.from, 1, byUnit);\n\t }\n\t }\n\t }", "function moveVisually(line, start, dir, byUnit) {\n\t var bidi = getOrder(line);\n\t if (!bidi) return moveLogically(line, start, dir, byUnit);\n\t var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n\t var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n\t for (;;) {\n\t if (target > part.from && target < part.to) return target;\n\t if (target == part.from || target == part.to) {\n\t if (getBidiPartAt(bidi, target) == pos) return target;\n\t part = bidi[pos += dir];\n\t return (dir > 0) == part.level % 2 ? part.to : part.from;\n\t } else {\n\t part = bidi[pos += dir];\n\t if (!part) return null;\n\t if ((dir > 0) == part.level % 2)\n\t target = moveInLine(line, part.to, -1, byUnit);\n\t else\n\t target = moveInLine(line, part.from, 1, byUnit);\n\t }\n\t }\n\t }", "function moveVisually(line, start, dir, byUnit) {\r\n var bidi = getOrder(line);\r\n if (!bidi) return moveLogically(line, start, dir, byUnit);\r\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\r\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\r\n\r\n for (;;) {\r\n if (target > part.from && target < part.to) return target;\r\n if (target == part.from || target == part.to) {\r\n if (getBidiPartAt(bidi, target) == pos) return target;\r\n part = bidi[pos += dir];\r\n return (dir > 0) == part.level % 2 ? part.to : part.from;\r\n } else {\r\n part = bidi[pos += dir];\r\n if (!part) return null;\r\n if ((dir > 0) == part.level % 2)\r\n target = moveInLine(line, part.to, -1, byUnit);\r\n else\r\n target = moveInLine(line, part.from, 1, byUnit);\r\n }\r\n }\r\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }", "reLayoutLine(paragraph, lineIndex, isBidi) {\n if (this.viewer.owner.isDocumentLoaded && this.viewer.owner.editorModule) {\n this.viewer.owner.editorModule.updateWholeListItems(paragraph);\n }\n let lineWidget;\n if (paragraph.paragraphFormat.listFormat && paragraph.paragraphFormat.listFormat.listId !== -1) {\n lineWidget = paragraph.getSplitWidgets()[0].firstChild;\n }\n else {\n lineWidget = paragraph.childWidgets[lineIndex];\n }\n if (!this.isBidiReLayout && (paragraph.paragraphFormat.bidi || this.isContainsRtl(lineWidget))) {\n let newLineIndex = lineIndex <= 0 ? 0 : lineIndex - 1;\n for (let i = newLineIndex; i < paragraph.childWidgets.length; i++) {\n if (isBidi || !(paragraph.paragraphFormat.bidi && this.isContainsRtl(lineWidget))) {\n if (i === lineIndex) {\n continue;\n }\n }\n this.reArrangeElementsForRtl(paragraph.childWidgets[i], paragraph.paragraphFormat.bidi);\n }\n }\n let lineToLayout = lineWidget.previousLine;\n if (isNullOrUndefined(lineToLayout)) {\n lineToLayout = lineWidget;\n }\n let currentParagraph = lineToLayout.paragraph;\n let bodyWidget = paragraph.containerWidget;\n bodyWidget.height -= paragraph.height;\n if (this.viewer.owner.enableHeaderAndFooter || paragraph.isInHeaderFooter) {\n paragraph.bodyWidget.isEmpty = false;\n // tslint:disable-next-line:max-line-length\n this.viewer.updateHCFClientAreaWithTop(paragraph.bodyWidget.sectionFormat, this.viewer.isBlockInHeader(paragraph), bodyWidget.page);\n }\n else {\n this.viewer.updateClientArea(bodyWidget.sectionFormat, bodyWidget.page);\n }\n this.viewer.updateClientAreaForBlock(paragraph, true);\n if (lineToLayout.paragraph.isEmpty()) {\n this.viewer.cutFromTop(paragraph.y);\n this.layoutParagraph(paragraph, 0);\n }\n else {\n this.updateClientAreaForLine(lineToLayout.paragraph, lineToLayout, 0);\n this.layoutListItems(lineToLayout.paragraph);\n if (lineToLayout.isFirstLine() && !isNullOrUndefined(paragraph.paragraphFormat)) {\n let firstLineIndent = -HelperMethods.convertPointToPixel(paragraph.paragraphFormat.firstLineIndent);\n this.viewer.updateClientWidth(firstLineIndent);\n }\n do {\n lineToLayout = this.layoutLine(lineToLayout, 0);\n paragraph = lineToLayout.paragraph;\n lineToLayout = lineToLayout.nextLine;\n } while (lineToLayout);\n this.updateWidgetToPage(this.viewer, paragraph);\n this.viewer.updateClientAreaForBlock(paragraph, false);\n }\n this.layoutNextItemsBlock(paragraph, this.viewer);\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line)\n if (!bidi) { return moveLogically(line, start, dir, byUnit) }\n var pos = getBidiPartAt(bidi, start), part = bidi[pos]\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit)\n\n for (;;) {\n if (target > part.from && target < part.to) { return target }\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) { return target }\n part = bidi[pos += dir]\n return (dir > 0) == part.level % 2 ? part.to : part.from\n } else {\n part = bidi[pos += dir]\n if (!part) { return null }\n if ((dir > 0) == part.level % 2)\n { target = moveInLine(line, part.to, -1, byUnit) }\n else\n { target = moveInLine(line, part.from, 1, byUnit) }\n }\n }\n}", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "function moveVisually(line, start, dir, byUnit) {\n var bidi = getOrder(line);\n if (!bidi) return moveLogically(line, start, dir, byUnit);\n var pos = getBidiPartAt(bidi, start), part = bidi[pos];\n var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);\n\n for (;;) {\n if (target > part.from && target < part.to) return target;\n if (target == part.from || target == part.to) {\n if (getBidiPartAt(bidi, target) == pos) return target;\n part = bidi[pos += dir];\n return (dir > 0) == part.level % 2 ? part.to : part.from;\n } else {\n part = bidi[pos += dir];\n if (!part) return null;\n if ((dir > 0) == part.level % 2)\n target = moveInLine(line, part.to, -1, byUnit);\n else\n target = moveInLine(line, part.from, 1, byUnit);\n }\n }\n }", "getElementsBackward(lineWidget, startElement, endElement, bidi) {\n let elements = [];\n while (bidi && startElement && startElement.previousElement && (!startElement.isRightToLeft\n || startElement instanceof TextElementBox && this.viewer.textHelper.isRTLText(startElement.text))) {\n startElement = startElement.previousElement;\n }\n let elementIndex = lineWidget.children.indexOf(startElement);\n while (elementIndex >= 0) {\n for (let i = elementIndex; i > -1 && i < lineWidget.children.length; bidi ? i++ : i--) {\n let inlineElement = lineWidget.children[i];\n if (inlineElement.line === lineWidget) {\n elements.push(inlineElement);\n }\n else {\n elementIndex = -1;\n break;\n }\n }\n // inline = inline !== null && inline.NextNode !== null ? (inline.NextNode as Inline).GetNextRenderedInline() : null;\n elementIndex = -1;\n }\n return elements;\n }", "function bidiSimplify(cm, range) {\n\t\t var anchor = range.anchor;\n\t\t var head = range.head;\n\t\t var anchorLine = getLine(cm.doc, anchor.line);\n\t\t if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n\t\t var order = getOrder(anchorLine);\n\t\t if (!order) { return range }\n\t\t var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n\t\t if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n\t\t var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n\t\t if (boundary == 0 || boundary == order.length) { return range }\n\n\t\t // Compute the relative visual position of the head compared to the\n\t\t // anchor (<0 is to the left, >0 to the right)\n\t\t var leftSide;\n\t\t if (head.line != anchor.line) {\n\t\t leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n\t\t } else {\n\t\t var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n\t\t var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n\t\t if (headIndex == boundary - 1 || headIndex == boundary)\n\t\t { leftSide = dir < 0; }\n\t\t else\n\t\t { leftSide = dir > 0; }\n\t\t }\n\n\t\t var usePart = order[boundary + (leftSide ? -1 : 0)];\n\t\t var from = leftSide == (usePart.level == 1);\n\t\t var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n\t\t return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n\t\t }", "function bidiSimplify(cm, range$$1) {\r\n var anchor = range$$1.anchor;\r\n var head = range$$1.head;\r\n var anchorLine = getLine(cm.doc, anchor.line);\r\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\r\n var order = getOrder(anchorLine);\r\n if (!order) { return range$$1 }\r\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\r\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\r\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\r\n if (boundary == 0 || boundary == order.length) { return range$$1 }\r\n\r\n // Compute the relative visual position of the head compared to the\r\n // anchor (<0 is to the left, >0 to the right)\r\n var leftSide;\r\n if (head.line != anchor.line) {\r\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\r\n } else {\r\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\r\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\r\n if (headIndex == boundary - 1 || headIndex == boundary)\r\n { leftSide = dir < 0; }\r\n else\r\n { leftSide = dir > 0; }\r\n }\r\n\r\n var usePart = order[boundary + (leftSide ? -1 : 0)];\r\n var from = leftSide == (usePart.level == 1);\r\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\r\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\r\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n}", "get bidiLevel() {\n let level = this.flags & 3 /* RangeFlag.BidiLevelMask */;\n return level == 3 ? null : level;\n }", "isContainsRtl(lineWidget) {\n let isContainsRTL = false;\n for (let i = 0; i < lineWidget.children.length; i++) {\n if (lineWidget.children[i] instanceof TextElementBox) {\n isContainsRTL = lineWidget.children[i].characterFormat.bidi || lineWidget.children[i].characterFormat.bdo === 'RTL'\n || this.viewer.textHelper.isRTLText(lineWidget.children[i].text);\n if (isContainsRTL) {\n break;\n }\n }\n }\n return isContainsRTL;\n }", "function cmp(a, b) { return a.line - b.line || a.ch - b.ch }" ]
[ "0.7619211", "0.7584861", "0.7584861", "0.7584861", "0.7578088", "0.7578088", "0.7578088", "0.7578088", "0.7578088", "0.7578088", "0.7578088", "0.75559795", "0.7471816", "0.72242576", "0.7099471", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7074373", "0.7056384", "0.70099336", "0.5763161", "0.55317223", "0.55317223", "0.55317223", "0.5304631", "0.53018254", "0.53018254", "0.53018254", "0.53018254", "0.53018254", "0.53018254", "0.53018254", "0.53018254", "0.5292452", "0.5249991", "0.5239124", "0.5239124", "0.5225846", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.5202021", "0.519201", "0.5187444", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.5172571", "0.51581585", "0.5135128", "0.5127514", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.5116796", "0.49313313", "0.48346636", "0.47217944" ]
0.713547
30
The DOM events that CodeMirror handles can be overridden by registering a (nonDOM) handler on the editor for the event name, and preventDefaulting the event in that handler.
function signalDOMEvent(cm, e, override) { if (typeof e == "string") { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } signal(cm, override || e.type, cm, e); return e_defaultPrevented(e) || e.codemirrorIgnore }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore\n\t\t }", "function signalDOMEvent(cm, e, override) {\n\t\t if (typeof e == \"string\")\n\t\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t\t signal(cm, override || e.type, cm, e);\n\t\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t\t }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }\n signal(cm, override || e.type, cm, e)\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\n\t if (typeof e == \"string\")\n\t e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n\t signal(cm, override || e.type, cm, e);\n\t return e_defaultPrevented(e) || e.codemirrorIgnore;\n\t }", "function signalDOMEvent(cm, e, override) {\r\n if (typeof e == \"string\")\r\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\r\n signal(cm, override || e.type, cm, e);\r\n return e_defaultPrevented(e) || e.codemirrorIgnore\r\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n}", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n e = {type: e, preventDefault: function() { this.defaultPrevented = true; }};\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\r\n signal(cm, override || e.type, cm, e);\r\n return e_defaultPrevented(e) || e.codemirrorIgnore;\r\n }", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\") {\n e = {\n type: e,\n preventDefault: function preventDefault() {\n this.defaultPrevented = true;\n }\n };\n }\n\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore;\n }", "function disableEditorMouseClicks(editor) {\n editor.on(\"mousedown\", (instance, e) => {\n // focus on the editor when it get's clicked\n editor.focus();\n\n // do not allow any other normal click behaviors to happen\n e.preventDefault();\n });\n}", "function Ne(e,t,a){return\"string\"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,a||t.type,e,t),Le(t)||t.codemirrorIgnore}", "handleEvent(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n switch (event.type) {\n case 'keydown':\n this._evtKeydown(event);\n break;\n case 'mousedown':\n this._evtMousedown(event);\n break;\n case 'scroll':\n this._evtScroll(event);\n break;\n default:\n break;\n }\n }", "preventDefault() {\n\t\tthis.domEvent.preventDefault();\n\t}", "preventDefault() {\n\t\tthis.domEvent.preventDefault();\n\t}", "_initEvents() {\n window.addEventListener(\"submitCommand\", event => this._processInput(event.detail));\n this.input.editableNode.onkeypress = () => {\n if (this.mode == Editor.MODE_INSERT)\n this.modificationSaved = false;\n };\n this.input.editableNode.onkeydown = event => {\n let keycode = event.keyCode;\n if (this.mode != Editor.MODE_INSERT && keycode !== 37 && keycode !== 38 && keycode !== 39 && keycode !== 40) {\n if (keycode !== Editor.KEY_TOGGLE_MODE_COMMAND)\n event.preventDefault();\n }\n }\n }", "_editorChanged() {\n this.dispatchEvent(\n new CustomEvent(\"editor-change\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this,\n })\n );\n }", "customeCodeEditEvent() {\n this.menuHandler(MenuChoices.null);\n }", "function _registerHandlers(editor) {\n $(editor).on(\"keyEvent\", _cursorHandler);\n $(editor.document).one(\"change\", _handler);\n editor.document.addRef();\n }", "function keyboardPreventDefault(e) {\n if (e.target.tagName !== 'TEXTAREA') {\n e.preventDefault();\n }\n}", "_editorChange(e,deselect=!1){let root=this,editorChange=root.editor!==e.detail.editor,toolbarChange=root.toolbar!==e.detail.toolbar;if(deselect||editorChange||toolbarChange){let sel=window.getSelection();sel.removeAllRanges();root.editor=e.detail.editor;root.toolbar=e.detail.toolbar;if(root.observer)root.observer.disconnect();if(!deselect&&e.detail.editor){root.observer=new MutationObserver(evt=>{root.range=root.getRange()});root.observer.observe(e.detail.editor,{attributes:!1,childList:!0,subtree:!0,characterData:!1})}}}", "function\n setEditorMode( bEnable )\n {\n document.body[ bEnable? 'addEventListener': 'removeEventListener']( 'click',clickInEditMode,true );\n document.body[ bEnable? 'addEventListener': 'removeEventListener']( 'input',inputInEditMode,true );\n document.body[ bEnable? 'addEventListener': 'removeEventListener']( 'blur' , blurInEditMode,true );\n bEnable || document.body.querySelectorAll('*[contentEditable]').forEach( el=> el.removeAttribute('contentEditable'));\n }", "ready(){super.ready();let root=this;root.addEventListener(\"mousedown\",function(e){e.preventDefault()});root.addEventListener(\"keypress\",function(e){e.preventDefault()})}", "function setEditorSilent(){\n silcentEditorEvents = true;\n aceEditorHtml.setValue($renderedHtml.innerHTML.trim(), -1);\n setTimeout(function(){\n silcentEditorEvents = false;\n },100);\n }", "function preventDefault(ev){ev.preventDefault();}", "function handleClickEvent() {\n event.preventDefault();\n}", "handleKeyDown(ev) {\n const {vimMode} = this.props;\n const _handleKeyDown = vimMode ? this._handleKeyDownVim : this._handleKeyDown;\n\n if (ev.target.tagName === 'INPUT' || ev.metaKey || ev.ctrlKey) {\n return;\n }\n if (_handleKeyDown(ev.key, ev.shiftKey, ev.altKey)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }", "function defaultEventHandler(evt) {\n\t evt.stopPropagation();\n }", "function handleDomEvent () {\n\t \tthis._ractive.binding.handleChange();\n\t }", "activateCodeMirror(event) {\n let target = event.target;\n while (target && target.parentElement) {\n if (target.classList.contains(CODE_SNIPPET_EDITOR_MIRROR)) {\n break;\n }\n target = target.parentElement;\n }\n const editor = document.querySelector(`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} #code-${this._codeSnippetEditorMetaData.id}`);\n if (target.classList.contains(CODE_SNIPPET_EDITOR_MIRROR)) {\n if (!editor.classList.contains('active')) {\n editor.classList.add('active');\n }\n }\n }", "function Browser_BlockEvent(event)\n{\n\t//cancel\n\tevent.cancelBubble = true;\n\t//and block\n\tevent.returnValue = false;\n\t//reset key code\n\tevent.keyCode = 0;\n\t//has prevent default?\n\tif (event.preventDefault)\n\t{\n\t\t//trigger it\n\t\tevent.preventDefault();\n\t}\n\t//has propagation?\n\tif (event.stopPropagation)\n\t{\n\t\t//stop it as well\n\t\tevent.stopPropagation();\n\t}\n\t//if we have designer controller\n\tif (__DESIGNER_CONTROLLER)\n\t{\n\t\t//notify selection\n\t\tWI4_PlugIn_Generic_ForwardEvent(event);\n\t}\n\t//return false\n\treturn false;\n}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Prevent normal selection in the editor (we handle our own)\n on(d.lineSpace, \"selectstart\", function(e) {\n if (!eventInWidget(d, e)) e_preventDefault(e);\n });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n on(d.input, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(d.input, \"input\", function() {\n if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;\n readInput(cm);\n });\n on(d.input, \"keydown\", operation(cm, onKeyDown));\n on(d.input, \"keypress\", operation(cm, onKeyPress));\n on(d.input, \"focus\", bind(onFocus, cm));\n on(d.input, \"blur\", bind(onBlur, cm));\n\n function drag_(e) {\n if (!signalDOMEvent(cm, e)) e_stop(e);\n }\n if (cm.options.dragDrop) {\n on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n on(d.scroller, \"dragenter\", drag_);\n on(d.scroller, \"dragover\", drag_);\n on(d.scroller, \"drop\", operation(cm, onDrop));\n }\n on(d.scroller, \"paste\", function(e) {\n if (eventInWidget(d, e)) return;\n cm.state.pasteIncoming = true;\n focusInput(cm);\n fastPoll(cm);\n });\n on(d.input, \"paste\", function() {\n // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206\n // Add a char to the end of textarea before paste occur so that\n // selection doesn't span to the end of textarea.\n if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {\n var start = d.input.selectionStart, end = d.input.selectionEnd;\n d.input.value += \"$\";\n // The selection end needs to be set before the start, otherwise there\n // can be an intermediate non-empty selection between the two, which\n // can override the middle-click paste buffer on linux and cause the\n // wrong thing to get pasted.\n d.input.selectionEnd = end;\n d.input.selectionStart = start;\n cm.state.fakedLastChar = true;\n }\n cm.state.pasteIncoming = true;\n fastPoll(cm);\n });\n\n function prepareCopyCut(e) {\n if (cm.somethingSelected()) {\n lastCopied = cm.getSelections();\n if (d.inaccurateSelection) {\n d.prevInput = \"\";\n d.inaccurateSelection = false;\n d.input.value = lastCopied.join(\"\\n\");\n selectInput(d.input);\n }\n } else {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n if (e.type == \"cut\") {\n cm.setSelections(ranges, null, sel_dontScroll);\n } else {\n d.prevInput = \"\";\n d.input.value = text.join(\"\\n\");\n selectInput(d.input);\n }\n lastCopied = text;\n }\n if (e.type == \"cut\") cm.state.cutIncoming = true;\n }\n on(d.input, \"cut\", prepareCopyCut);\n on(d.input, \"copy\", prepareCopyCut);\n\n // Needed to handle Tab key in KHTML\n if (khtml) on(d.sizer, \"mouseup\", function() {\n if (activeElt() == d.input) d.input.blur();\n focusInput(cm);\n });\n }", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Prevent normal selection in the editor (we handle our own)\n on(d.lineSpace, \"selectstart\", function(e) {\n if (!eventInWidget(d, e)) e_preventDefault(e);\n });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n on(d.input, \"keyup\", function(e) { onKeyUp.call(cm, e); });\n on(d.input, \"input\", function() {\n if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;\n readInput(cm);\n });\n on(d.input, \"keydown\", operation(cm, onKeyDown));\n on(d.input, \"keypress\", operation(cm, onKeyPress));\n on(d.input, \"focus\", bind(onFocus, cm));\n on(d.input, \"blur\", bind(onBlur, cm));\n\n function drag_(e) {\n if (!signalDOMEvent(cm, e)) e_stop(e);\n }\n if (cm.options.dragDrop) {\n on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n on(d.scroller, \"dragenter\", drag_);\n on(d.scroller, \"dragover\", drag_);\n on(d.scroller, \"drop\", operation(cm, onDrop));\n }\n on(d.scroller, \"paste\", function(e) {\n if (eventInWidget(d, e)) return;\n cm.state.pasteIncoming = true;\n focusInput(cm);\n fastPoll(cm);\n });\n on(d.input, \"paste\", function() {\n // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206\n // Add a char to the end of textarea before paste occur so that\n // selection doesn't span to the end of textarea.\n if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {\n var start = d.input.selectionStart, end = d.input.selectionEnd;\n d.input.value += \"$\";\n // The selection end needs to be set before the start, otherwise there\n // can be an intermediate non-empty selection between the two, which\n // can override the middle-click paste buffer on linux and cause the\n // wrong thing to get pasted.\n d.input.selectionEnd = end;\n d.input.selectionStart = start;\n cm.state.fakedLastChar = true;\n }\n cm.state.pasteIncoming = true;\n fastPoll(cm);\n });\n\n function prepareCopyCut(e) {\n if (cm.somethingSelected()) {\n lastCopied = cm.getSelections();\n if (d.inaccurateSelection) {\n d.prevInput = \"\";\n d.inaccurateSelection = false;\n d.input.value = lastCopied.join(\"\\n\");\n selectInput(d.input);\n }\n } else {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n if (e.type == \"cut\") {\n cm.setSelections(ranges, null, sel_dontScroll);\n } else {\n d.prevInput = \"\";\n d.input.value = text.join(\"\\n\");\n selectInput(d.input);\n }\n lastCopied = text;\n }\n if (e.type == \"cut\") cm.state.cutIncoming = true;\n }\n on(d.input, \"cut\", prepareCopyCut);\n on(d.input, \"copy\", prepareCopyCut);\n\n // Needed to handle Tab key in KHTML\n if (khtml) on(d.sizer, \"mouseup\", function() {\n if (activeElt() == d.input) d.input.blur();\n focusInput(cm);\n });\n }", "_inputChangeHandler(event) {\n event.stopPropagation();\n event.preventDefault();\n }", "onClick_document(event) {\n if(event.defaultPrevented) {\n return\n }\n\n this.onClick_cancel()\n }", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n\tev.preventDefault();\n}", "function preventDefault(ev) {\n ev.preventDefault();\n}", "function preventDefault(ev) {\n ev.preventDefault();\n}", "function preventDefault(ev) {\n ev.preventDefault();\n}", "function preventDefault(ev) {\n ev.preventDefault();\n}", "function preventDefault(ev) {\n ev.preventDefault();\n}", "function preventDefault(e){e.preventDefault();}", "__preventDefaults (e) {\n e.preventDefault();\n e.stopPropagation();\n }", "function preventDefault(){\n\t }", "function preventDefault(ev) {\n ev.preventDefault();\n }", "_initEvent() {\n this.cm.getWrapperElement().addEventListener('click', () => {\n this.eventManager.emit('click', {\n source: 'markdown'\n });\n });\n\n this.cm.on('beforeChange', (cm, ev) => {\n if (ev.origin === 'paste') {\n this.eventManager.emit('pasteBefore', {\n source: 'markdown',\n data: ev\n });\n }\n });\n\n this.cm.on('change', (cm, cmEvent) => {\n this._refreshCodeMirrorMarks(cmEvent);\n this._emitMarkdownEditorChangeEvent(cmEvent);\n });\n\n this.cm.on('focus', () => {\n this.eventManager.emit('focus', {\n source: 'markdown'\n });\n });\n\n this.cm.on('blur', () => {\n this.eventManager.emit('blur', {\n source: 'markdown'\n });\n });\n\n this.cm.on('scroll', (cm, eventData) => {\n this.eventManager.emit('scroll', {\n source: 'markdown',\n data: eventData\n });\n });\n\n this.cm.on('keydown', (cm, keyboardEvent) => {\n this.eventManager.emit('keydown', {\n source: 'markdown',\n data: keyboardEvent\n });\n\n this.eventManager.emit('keyMap', {\n source: 'markdown',\n keyMap: keyMapper.convert(keyboardEvent),\n data: keyboardEvent\n });\n });\n\n this.cm.on('keyup', (cm, keyboardEvent) => {\n this.eventManager.emit('keyup', {\n source: 'markdown',\n data: keyboardEvent\n });\n });\n\n this.cm.on('copy', (cm, ev) => {\n this.eventManager.emit('copy', {\n source: 'markdown',\n data: ev\n });\n });\n\n this.cm.on('cut', (cm, ev) => {\n this.eventManager.emit('cut', {\n source: 'markdown',\n data: ev\n });\n });\n\n this.cm.on('paste', (cm, clipboardEvent) => {\n this.eventManager.emit('paste', {\n source: 'markdown',\n data: clipboardEvent\n });\n });\n\n this.cm.on('drop', (cm, eventData) => {\n eventData.preventDefault();\n\n this.eventManager.emit('drop', {\n source: 'markdown',\n data: eventData\n });\n });\n\n this.cm.on('cursorActivity', () => this._onChangeCursorActivity());\n }", "_documentUpHandler(event) {\n const that = this;\n\n if (!that._pressed || that.readonly) {\n return;\n }\n\n if (that.clickMode === 'press') {\n event.preventDefault();\n event.stopPropagation();\n that._pressed = false;\n return;\n }\n\n super._documentUpHandler(event);\n that.indeterminate = false;\n that._updateHidenInputNameAndValue();\n that._pressed = false;\n }", "_preventDefault(e) {\n e.preventDefault();\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n var helpers = CodeMirror.helpers = {};\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function focus() {\n window.focus();\n this.display.input.focus();\n },\n setOption: function setOption(option, value) {\n var options = this.options,\n old = options[option];\n\n if (options[option] == value && option != \"mode\") {\n return;\n }\n\n options[option] = value;\n\n if (optionHandlers.hasOwnProperty(option)) {\n operation(this, optionHandlers[option])(this, value, old);\n }\n\n signal(this, \"optionChange\", this, option);\n },\n getOption: function getOption(option) {\n return this.options[option];\n },\n getDoc: function getDoc() {\n return this.doc;\n },\n addKeyMap: function addKeyMap(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function removeKeyMap(map) {\n var maps = this.state.keyMaps;\n\n for (var i = 0; i < maps.length; ++i) {\n if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true;\n }\n }\n },\n addOverlay: methodOp(function (spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n\n if (mode.startState) {\n throw new Error(\"Overlays may not be stateful.\");\n }\n\n insertSorted(this.state.overlays, {\n mode: mode,\n modeSpec: spec,\n opaque: options && options.opaque,\n priority: options && options.priority || 0\n }, function (overlay) {\n return overlay.priority;\n });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function (spec) {\n var overlays = this.state.overlays;\n\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return;\n }\n }\n }),\n indentLine: methodOp(function (n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) {\n dir = this.options.smartIndent ? \"smart\" : \"prev\";\n } else {\n dir = dir ? \"add\" : \"subtract\";\n }\n }\n\n if (isLine(this.doc, n)) {\n indentLine(this, n, dir, aggressive);\n }\n }),\n indentSelection: methodOp(function (how) {\n var ranges = this.doc.sel.ranges,\n end = -1;\n\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n\n if (!range.empty()) {\n var from = range.from(),\n to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n\n for (var j = start; j < end; ++j) {\n indentLine(this, j, how);\n }\n\n var newRanges = this.doc.sel.ranges;\n\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) {\n replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll);\n }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n\n if (i == this.doc.sel.primIndex) {\n ensureCursorVisible(this);\n }\n }\n }\n }),\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function getTokenAt(pos, precise) {\n return takeToken(this, pos, precise);\n },\n getLineTokens: function getLineTokens(line, precise) {\n return takeToken(this, Pos(line), precise, true);\n },\n getTokenTypeAt: function getTokenTypeAt(pos) {\n pos = _clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0,\n after = (styles.length - 1) / 2,\n ch = pos.ch;\n var type;\n\n if (ch == 0) {\n type = styles[2];\n } else {\n for (;;) {\n var mid = before + after >> 1;\n\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) {\n after = mid;\n } else if (styles[mid * 2 + 1] < ch) {\n before = mid + 1;\n } else {\n type = styles[mid * 2 + 2];\n break;\n }\n }\n }\n\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1);\n },\n getModeAt: function getModeAt(pos) {\n var mode = this.doc.mode;\n\n if (!mode.innerMode) {\n return mode;\n }\n\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;\n },\n getHelper: function getHelper(pos, type) {\n return this.getHelpers(pos, type)[0];\n },\n getHelpers: function getHelpers(pos, type) {\n var found = [];\n\n if (!helpers.hasOwnProperty(type)) {\n return found;\n }\n\n var help = helpers[type],\n mode = this.getModeAt(pos);\n\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) {\n found.push(help[mode[type]]);\n }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n\n if (val) {\n found.push(val);\n }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) {\n found.push(cur.val);\n }\n }\n\n return found;\n },\n getStateAfter: function getStateAfter(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line);\n return getContextBefore(this, line + 1, precise).state;\n },\n cursorCoords: function cursorCoords(start, mode) {\n var pos,\n range = this.doc.sel.primary();\n\n if (start == null) {\n pos = range.head;\n } else if (_typeof(start) == \"object\") {\n pos = _clipPos(this.doc, start);\n } else {\n pos = start ? range.from() : range.to();\n }\n\n return _cursorCoords(this, pos, mode || \"page\");\n },\n charCoords: function charCoords(pos, mode) {\n return _charCoords(this, _clipPos(this.doc, pos), mode || \"page\");\n },\n coordsChar: function coordsChar(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return _coordsChar(this, coords.left, coords.top);\n },\n lineAtHeight: function lineAtHeight(height, mode) {\n height = fromCoordSystem(this, {\n top: height,\n left: 0\n }, mode || \"page\").top;\n return _lineAtHeight(this.doc, height + this.display.viewOffset);\n },\n heightAtLine: function heightAtLine(line, mode, includeWidgets) {\n var end = false,\n lineObj;\n\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n\n if (line < this.doc.first) {\n line = this.doc.first;\n } else if (line > last) {\n line = last;\n end = true;\n }\n\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n\n return intoCoordSystem(this, lineObj, {\n top: 0,\n left: 0\n }, mode || \"page\", includeWidgets || end).top + (end ? this.doc.height - _heightAtLine(lineObj) : 0);\n },\n defaultTextHeight: function defaultTextHeight() {\n return textHeight(this.display);\n },\n defaultCharWidth: function defaultCharWidth() {\n return charWidth(this.display);\n },\n getViewport: function getViewport() {\n return {\n from: this.display.viewFrom,\n to: this.display.viewTo\n };\n },\n addWidget: function addWidget(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = _cursorCoords(this, _clipPos(this.doc, pos));\n var top = pos.bottom,\n left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); // Default to positioning above (if specified and possible); otherwise default to positioning below\n\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) {\n top = pos.top - node.offsetHeight;\n } else if (pos.bottom + node.offsetHeight <= vspace) {\n top = pos.bottom;\n }\n\n if (left + node.offsetWidth > hspace) {\n left = hspace - node.offsetWidth;\n }\n }\n\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") {\n left = 0;\n } else if (horiz == \"middle\") {\n left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n }\n\n node.style.left = left + \"px\";\n }\n\n if (scroll) {\n scrollIntoView(this, {\n left: left,\n top: top,\n right: left + node.offsetWidth,\n bottom: top + node.offsetHeight\n });\n }\n },\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n execCommand: function execCommand(cmd) {\n if (commands.hasOwnProperty(cmd)) {\n return commands[cmd].call(null, this);\n }\n },\n triggerElectric: methodOp(function (text) {\n triggerElectric(this, text);\n }),\n findPosH: function findPosH(from, amount, unit, visually) {\n var dir = 1;\n\n if (amount < 0) {\n dir = -1;\n amount = -amount;\n }\n\n var cur = _clipPos(this.doc, from);\n\n for (var i = 0; i < amount; ++i) {\n cur = _findPosH(this.doc, cur, dir, unit, visually);\n\n if (cur.hitSide) {\n break;\n }\n }\n\n return cur;\n },\n moveH: methodOp(function (dir, unit) {\n var this$1 = this;\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty()) {\n return _findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually);\n } else {\n return dir < 0 ? range.from() : range.to();\n }\n }, sel_move);\n }),\n deleteH: methodOp(function (dir, unit) {\n var sel = this.doc.sel,\n doc = this.doc;\n\n if (sel.somethingSelected()) {\n doc.replaceSelection(\"\", null, \"+delete\");\n } else {\n deleteNearSelection(this, function (range) {\n var other = _findPosH(doc, range.head, dir, unit, false);\n\n return dir < 0 ? {\n from: other,\n to: range.head\n } : {\n from: range.head,\n to: other\n };\n });\n }\n }),\n findPosV: function findPosV(from, amount, unit, goalColumn) {\n var dir = 1,\n x = goalColumn;\n\n if (amount < 0) {\n dir = -1;\n amount = -amount;\n }\n\n var cur = _clipPos(this.doc, from);\n\n for (var i = 0; i < amount; ++i) {\n var coords = _cursorCoords(this, cur, \"div\");\n\n if (x == null) {\n x = coords.left;\n } else {\n coords.left = x;\n }\n\n cur = _findPosV(this, coords, dir, unit);\n\n if (cur.hitSide) {\n break;\n }\n }\n\n return cur;\n },\n moveV: methodOp(function (dir, unit) {\n var this$1 = this;\n var doc = this.doc,\n goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse) {\n return dir < 0 ? range.from() : range.to();\n }\n\n var headPos = _cursorCoords(this$1, range.head, \"div\");\n\n if (range.goalColumn != null) {\n headPos.left = range.goalColumn;\n }\n\n goals.push(headPos.left);\n\n var pos = _findPosV(this$1, headPos, dir, unit);\n\n if (unit == \"page\" && range == doc.sel.primary()) {\n addToScrollTop(this$1, _charCoords(this$1, pos, \"div\").top - headPos.top);\n }\n\n return pos;\n }, sel_move);\n\n if (goals.length) {\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n doc.sel.ranges[i].goalColumn = goals[i];\n }\n }\n }),\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function findWordAt(pos) {\n var doc = this.doc,\n line = getLine(doc, pos.line).text;\n var start = pos.ch,\n end = pos.ch;\n\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n\n if ((pos.sticky == \"before\" || end == line.length) && start) {\n --start;\n } else {\n ++end;\n }\n\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper) ? function (ch) {\n return isWordChar(ch, helper);\n } : /\\s/.test(startChar) ? function (ch) {\n return /\\s/.test(ch);\n } : function (ch) {\n return !/\\s/.test(ch) && !isWordChar(ch);\n };\n\n while (start > 0 && check(line.charAt(start - 1))) {\n --start;\n }\n\n while (end < line.length && check(line.charAt(end))) {\n ++end;\n }\n }\n\n return new Range(Pos(pos.line, start), Pos(pos.line, end));\n },\n toggleOverwrite: function toggleOverwrite(value) {\n if (value != null && value == this.state.overwrite) {\n return;\n }\n\n if (this.state.overwrite = !this.state.overwrite) {\n addClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n } else {\n rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function hasFocus() {\n return this.display.input.getField() == activeElt();\n },\n isReadOnly: function isReadOnly() {\n return !!(this.options.readOnly || this.doc.cantEdit);\n },\n scrollTo: methodOp(function (x, y) {\n scrollToCoords(this, x, y);\n }),\n getScrollInfo: function getScrollInfo() {\n var scroller = this.display.scroller;\n return {\n left: scroller.scrollLeft,\n top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this),\n clientWidth: displayWidth(this)\n };\n },\n scrollIntoView: methodOp(function (range, margin) {\n if (range == null) {\n range = {\n from: this.doc.sel.primary().head,\n to: null\n };\n\n if (margin == null) {\n margin = this.options.cursorScrollMargin;\n }\n } else if (typeof range == \"number\") {\n range = {\n from: Pos(range, 0),\n to: null\n };\n } else if (range.from == null) {\n range = {\n from: range,\n to: null\n };\n }\n\n if (!range.to) {\n range.to = range.from;\n }\n\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n setSize: methodOp(function (width, height) {\n var this$1 = this;\n\n var interpret = function interpret(val) {\n return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n };\n\n if (width != null) {\n this.display.wrapper.style.width = interpret(width);\n }\n\n if (height != null) {\n this.display.wrapper.style.height = interpret(height);\n }\n\n if (this.options.lineWrapping) {\n clearLineMeasurementCache(this);\n }\n\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].noHScroll) {\n regLineChange(this$1, lineNo, \"widget\");\n break;\n }\n }\n }\n\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n operation: function operation(f) {\n return runInOp(this, f);\n },\n startOperation: function startOperation() {\n return _startOperation(this);\n },\n endOperation: function endOperation() {\n return _endOperation(this);\n },\n refresh: methodOp(function () {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping) {\n estimateLineHeights(this);\n }\n\n signal(this, \"refresh\", this);\n }),\n swapDoc: methodOp(function (doc) {\n var old = this.doc;\n old.cm = null; // Cancel the current text selection if any (#5821)\n\n if (this.state.selectingText) {\n this.state.selectingText();\n }\n\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old;\n }),\n phrase: function phrase(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText;\n },\n getInputField: function getInputField() {\n return this.display.input.getField();\n },\n getWrapperElement: function getWrapperElement() {\n return this.display.wrapper;\n },\n getScrollerElement: function getScrollerElement() {\n return this.display.scroller;\n },\n getGutterElement: function getGutterElement() {\n return this.display.gutters;\n }\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function (type, name, value) {\n if (!helpers.hasOwnProperty(type)) {\n helpers[type] = CodeMirror[type] = {\n _global: []\n };\n }\n\n helpers[type][name] = value;\n };\n\n CodeMirror.registerGlobalHelper = function (type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n\n helpers[type]._global.push({\n pred: predicate,\n val: value\n });\n };\n } // Used for horizontal relative motion. Dir is -1 or 1 (left or", "function preventDefault(ev) {\n ev.preventDefault();\n }", "function preventDefault(ev) {\n ev.preventDefault();\n }", "function preventDefault(ev) {\n ev.preventDefault();\n }", "function preventDefault(ev) {\n ev.preventDefault();\n }", "function handler(e) {\n e.stopPropagation();\n e.preventDefault();\n}", "function preventDefault () {\n this.originalEvent.preventDefault();\n }", "function ContextMenuEvent(ev) {\n\t// Ignore if the cursor isn't locked.\n\tif (!document.pointerLockElement) {\n\t\treturn;\n\t}\n\n\t// Ignore default handlers.\n\tev.preventDefault();\n\tev.stopPropagation();\n}", "_documentDownHandler(event) {\n const that = this,\n target = that.shadowRoot || that.isInShadowDOM ? event.originalEvent.composedPath()[0] : event.originalEvent.target;\n\n if ((target.shadowParent && target.shadowParent.closest('.jqx-input-drop-down-menu')) || target.closest('.jqx-input-drop-down-menu') || that.$.conditionsMenu.contains(target)) {\n return;\n }\n\n const isDropDown = target.closest('.jqx-drop-down');\n\n if (target.getRootNode().host === that || target.closest('jqx-query-builder') === that || (isDropDown && that.contains(isDropDown.ownerElement))) {\n that._clickHandler(event.originalEvent);\n return;\n }\n\n if (that._editorIsOpen && !that._scrollBarDown) {\n that._closeEditor();\n }\n\n delete that._scrollBarDown;\n }", "function preventDefault(ev) {\n\t\tev.preventDefault();\n\t}", "function pseudoDragEvent(editor)\n\t{\n\t\tvar isDrag=false,isTDrag=false,\n\t\t\tdivX,divY,eX,eY,obj,ix=\"\",iy=\"\",\n\t\t\tframeBody=editor.$frame.contents().find(\"body\"),\n\t\t\tframeDocument=editor.$frame.contents();\n\n\t\t//mouse down event\n\t\t$(frameBody).on(\"dblclick\",function(e){\n\t\t\t\t//icon\n\t\t\t\t$(frameDocument).find(e.target).css(\"cursor\",\"move\");\n\n\t\t\t\t//image or text area\n\t\t\t\tif($(e.target).is(\"img\") || $(e.target).is(\"textarea\") ) Mousedown(e,e.target);\n\n\t\t\t\t//decorated text\n\t\t\t\tif($(e.target).is(\"span\") )\n\t\t\t\t{\n\t\t\t\t\tif($(e.target).css(\"position\")==\"static\") \n\t\t\t\t\t\t$(e.target).css(\"position\",editor.options.position);\n\t\t\t\t\tif(e.originalEvent.shiftKey==true)//shift key\n\t\t\t\t\t\tMousedown(e,e.target);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//table\n\t\t\t\tif($(e.target).is(\"table\") || $(e.target).is(\"td\") || $(e.target).is(\"th\")) tdown(e,e.target);\n\t\t\t});\n\t\t\t\n\t\t///textarea///\n\t\t//fire when mouse down\n\t\tfunction Mousedown(e,target) {\n\t\t\tisDrag=true;\n\n\t\t\tif(positionX==\"\" && positionY==\"\")\n\t\t\t{\n\t\t\t\t//get position\n\t\t\t\tpositionX=$(target).css(\"left\")!=\"auto\" ? parseFloat($(target).css(\"left\")) : 0;\n\t\t\t\tpositionY=$(target).css(\"top\")!=\"auto\" ? parseFloat($(target).css(\"top\")) : 0;\n\t\t\t\tx = e.pageX - positionX;\n\t\t\t\ty = e.pageY - positionY;\n\n\t\t\t}\n\t\t\t//move event\n\t\t\t$(frameDocument).off(\"mousemove\").on(\"mousemove\",target,function(e){Mousemove(e,target)});\n\t\t}\n\t\t\n\t\t//fire when mouse move\n\t\tfunction Mousemove(e,target) {\n\t\t\tif(isDrag==true)\n\t\t\t{\n\t\t\t\t//prevent default event\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//trace mouse\n\t\t\t\t$(target).css({\"top\":e.pageY - y + \"px\",\"left\":e.pageX - x + \"px\"});\n\t\t\t\t\n\t\t\t\t//mouse up or mouse leave event\n\t\t\t\t$(frameDocument).off(\"mouseup\").on(\"mouseup\",target,function(e){Mouseup(e,target)});\n\t\t\t\t$(frameDocument).off(\"mouseleave\").on(\"mouseleave\",target,function(e){Mouseup(e,target)});\n\t\t\t}\n\t\t}\n\n\t\t//fire when mouse up\n\t\tfunction Mouseup(e,target) {\n\t\t\t//remove event handler\n\t\t\t$(frameDocument).off(\"mousemove\",target,Mousemove);\n\t\t\t$(frameDocument).off(\"mouseleave\",target,Mouseup);\n\t\t\t$(frameDocument).off(\"mouseup\",target,Mouseup);\n\t\t\tisDrag=false;\n\t\t\tpositionX=positionY=\"\";\n\t\t\t\n\t\t\t//icon\n\t\t\t$(target).css(\"cursor\",\"default\");\n\t\t\t$(frameDocument).css(\"cursor\",\"default\");\n\t\t\ttarget=\"\";\n\t\t\t\n\t\t\teditor.updateTextArea();//update iframe\n\t\t}\n\t\t\n\t\t///table///\n\t\t//fire when mouse down\n\t\tfunction tdown(e,target) {\n\t\t\tisTDrag=true;\n\n\t\t\tif(ix==\"\" || iy==\"\" )\n\t\t\t{\n\t\t\t\tobj=$(target).is(\"table\") ? target : $(target).closest(\"table\");\n\t\t\t\tdivX=$(obj).offset().left;\n\t\t\t\tdivY=$(obj).offset().top;\n\t\t\t\tvar divW=$(obj).width(),\n\t\t\t\t\tdivH=$(obj).height(),\n\t\t\t\t\tdivZ=$(obj).css(\"z-index\");\n\t\t\t\tvar html=\"<div class='divTable' style='position:absolute;top:\"+divY+\"px;left:\"+divX+\"px;width:\"\n\t\t\t\t\t+divW+\"px;height:\"+divH+\"px;border:2px solid blue;opacity:0.6;background-color:blue'></div>\";\n\t\t\t\t$(frameBody).append(html);\n\t\t\t\tif(divZ!=\"auto\") $(frameBody).find(\".divTable\").css(\"z-index\",divZ+1);\n\t\t\t\t\n\t\t\t\t//get relative position\n\t\t\t\tix=$(obj).css(\"left\")!=\"auto\" ? parseInt($(obj).css(\"left\")) : 0;\n\t\t\t\tiy=$(obj).css(\"top\")!=\"auto\" ? parseInt($(obj).css(\"top\")) : 0;\n\t\t\t\tx = e.pageX;\n\t\t\t\ty = e.pageY;\n\t\t\t\t\n\t\t\t}\n\t\t\t//move event\n\t\t\t$(frameDocument).on(\"mousemove\",\".divTable\",function(e){tmove(e,$(frameBody).find(\".divTable\"))});\n\t\t\t\n\t\t}\n\n\t\t//fire when mouse move\n\t\tfunction tmove(e,target) {\n\t\t\tif(isTDrag==true)\n\t\t\t{\n\t\t\t\t//prevent default event\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\t\t\t\t//to prevent display error dialog in ie11\n\t\t\t\tif(iege11) $(obj).trigger('mouseup');\n\n\t\t\t\t//trace mouse\n\t\t\t\t$(target).css({\"top\":e.pageY - y + divY +\"px\",\"left\":e.pageX - x + divX + \"px\"});\n\t\t\t\teX=e.pageX;\n\t\t\t\teY=e.pageY;\n\t\t\t\t\n\t\t\t\t//mouse up or mouse leave event\n\t\t\t\t$(target).on(\"mouseup\",function(e){tup(e,target)});\n\t\t\t\t$(frameDocument).on(\"mouseleave\",\".divTable\",function(e){tup(e,target)});\n\t\t\t}\n\t\t}\n\n\t\t//fire when mouse up\n\t\tfunction tup(e,target) \n\t\t{\n\t\t\tif(isTDrag==true)\n\t\t\t{\n\t\t\t\t//remove event handler\n\t\t\t\t$(frameDocument).off(\"mousemove\",tmove);\n\t\t\t\t$(frameDocument).off(\"mouseleave\",tup);\n\t\t\t\t$(target).off(\"mouseup\",tup);\n\t\t\t\tisTDrag=false;\n\t\t\t\t$(obj).css({\"left\":eX-x+ix+\"px\",\"top\":eY-y+iy+\"px\"});\n\t\t\t\t\n\t\t\t\tix=iy=\"\";\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t$(frameBody).find(\".divTable\").remove();\n\t\t\t\t\t\n\t\t\t\t\teditor.updateTextArea();//update iframe\n\t\t\t\t\t//focusedObj=prevObj=$(obj);\n\t\t\t\t},10);\n\t\t\t}\n\t\t}\n\t}", "function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n on(d.scroller, \"dblclick\", operation(cm, function(e) {\n if (signalDOMEvent(cm, e)) return;\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;\n e_preventDefault(e);\n var word = findWordAt(cm, pos);\n extendSelection(cm.doc, word.anchor, word.head);\n }));\n else\n on(d.scroller, \"dblclick\", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });\n // Prevent normal selection in the editor (we handle our own)\n on(d.lineSpace, \"selectstart\", function(e) {\n if (!eventInWidget(d, e)) e_preventDefault(e);\n });\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n if (!captureRightClick) on(d.scroller, \"contextmenu\", function(e) {onContextMenu(cm, e);});\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function() {\n if (d.scroller.clientHeight) {\n setScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n on(d.scrollbarV, \"scroll\", function() {\n if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);\n });\n on(d.scrollbarH, \"scroll\", function() {\n if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function(e){onScrollWheel(cm, e);});\n on(d.scroller, \"DOMMouseScroll\", function(e){onScrollWheel(cm, e);});\n\n // Prevent clicks in the scrollbars from killing focus\n function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }\n on(d.scrollbarH, \"mousedown\", reFocus);\n on(d.scrollbarV, \"mousedown\", reFocus);\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n on(d.input, \"keyup\", operation(cm, onKeyUp));\n on(d.input, \"input\", function() {\n if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;\n fastPoll(cm);\n });\n on(d.input, \"keydown\", operation(cm, onKeyDown));\n on(d.input, \"keypress\", operation(cm, onKeyPress));\n on(d.input, \"focus\", bind(onFocus, cm));\n on(d.input, \"blur\", bind(onBlur, cm));\n\n function drag_(e) {\n if (!signalDOMEvent(cm, e)) e_stop(e);\n }\n if (cm.options.dragDrop) {\n on(d.scroller, \"dragstart\", function(e){onDragStart(cm, e);});\n on(d.scroller, \"dragenter\", drag_);\n on(d.scroller, \"dragover\", drag_);\n on(d.scroller, \"drop\", operation(cm, onDrop));\n }\n on(d.scroller, \"paste\", function(e) {\n if (eventInWidget(d, e)) return;\n cm.state.pasteIncoming = true;\n focusInput(cm);\n fastPoll(cm);\n });\n on(d.input, \"paste\", function() {\n // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206\n // Add a char to the end of textarea before paste occur so that\n // selection doesn't span to the end of textarea.\n if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) {\n var start = d.input.selectionStart, end = d.input.selectionEnd;\n d.input.value += \"$\";\n // The selection end needs to be set before the start, otherwise there\n // can be an intermediate non-empty selection between the two, which\n // can override the middle-click paste buffer on linux and cause the\n // wrong thing to get pasted.\n d.input.selectionEnd = end;\n d.input.selectionStart = start;\n cm.state.fakedLastChar = true;\n }\n cm.state.pasteIncoming = true;\n fastPoll(cm);\n });\n\n function prepareCopyCut(e) {\n if (cm.somethingSelected()) {\n if (d.inaccurateSelection) {\n d.prevInput = \"\";\n d.inaccurateSelection = false;\n d.input.value = cm.getSelection();\n selectInput(d.input);\n }\n } else {\n var text = \"\", ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text += cm.getRange(lineRange.anchor, lineRange.head);\n }\n if (e.type == \"cut\") {\n cm.setSelections(ranges, null, sel_dontScroll);\n } else {\n d.prevInput = \"\";\n d.input.value = text;\n selectInput(d.input);\n }\n }\n if (e.type == \"cut\") cm.state.cutIncoming = true;\n }\n on(d.input, \"cut\", prepareCopyCut);\n on(d.input, \"copy\", prepareCopyCut);\n\n // Needed to handle Tab key in KHTML\n if (khtml) on(d.sizer, \"mouseup\", function() {\n if (activeElt() == d.input) d.input.blur();\n focusInput(cm);\n });\n }" ]
[ "0.71294665", "0.7111857", "0.6914305", "0.6914305", "0.6911105", "0.6911105", "0.6911105", "0.69020975", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.6878917", "0.68245065", "0.68245065", "0.68245065", "0.68245065", "0.68245065", "0.68182653", "0.6777063", "0.6777063", "0.6766512", "0.6386273", "0.637046", "0.6111557", "0.61062455", "0.61062455", "0.6057498", "0.60551196", "0.59674495", "0.578486", "0.5757233", "0.57169586", "0.56989706", "0.56928205", "0.56645226", "0.5632164", "0.5617873", "0.55993193", "0.55984855", "0.5588474", "0.5585046", "0.55575305", "0.5554571", "0.5554571", "0.5549468", "0.5510381", "0.5482422", "0.5482422", "0.5482422", "0.5482422", "0.5482422", "0.5482422", "0.5482422", "0.546998", "0.546998", "0.546998", "0.546998", "0.546998", "0.5464467", "0.5451873", "0.54397833", "0.5437721", "0.54370075", "0.54325086", "0.5417071", "0.54115427", "0.54114705", "0.54114705", "0.54114705", "0.54114705", "0.5411238", "0.53836864", "0.5377186", "0.5372569", "0.5366147", "0.53546035", "0.53413814" ]
0.6880752
23
Add on and off methods to a constructor's prototype, to make registering events on such objects more convenient.
function eventMixin(ctor) { ctor.prototype.on = function(type, f) {on(this, type, f);}; ctor.prototype.off = function(type, f) {off(this, type, f);}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static mixin(constr) {\n // instance._events = {};\n [\"on\", \"once\", \"off\", \"emit\"].forEach(name => {\n const property = Object.getOwnPropertyDescriptor(Emitter.prototype, name);\n Object.defineProperty(constr.prototype, name, property);\n });\n }", "function eventMixin(ctor) {\n\t\t ctor.prototype.on = function(type, f) {on(this, type, f);};\n\t\t ctor.prototype.off = function(type, f) {off(this, type, f);};\n\t\t }", "function eventMixin(ctor) {\n\t\t ctor.prototype.on = function(type, f) {on(this, type, f);};\n\t\t ctor.prototype.off = function(type, f) {off(this, type, f);};\n\t\t }", "function eventMixin(ctor) {\n\t ctor.prototype.on = function(type, f) {on(this, type, f);};\n\t ctor.prototype.off = function(type, f) {off(this, type, f);};\n\t }", "function eventMixin(ctor) {\n\t ctor.prototype.on = function(type, f) {on(this, type, f);};\n\t ctor.prototype.off = function(type, f) {off(this, type, f);};\n\t }", "function eventMixin(ctor) {\n\t ctor.prototype.on = function(type, f) {on(this, type, f);};\n\t ctor.prototype.off = function(type, f) {off(this, type, f);};\n\t }", "function eventMixin(ctor) {\r\n ctor.prototype.on = function(type, f) {on(this, type, f);};\r\n ctor.prototype.off = function(type, f) {off(this, type, f);};\r\n }", "function eventMixin(ctor) {\r\n ctor.prototype.on = function(type, f) {on(this, type, f);};\r\n ctor.prototype.off = function(type, f) {off(this, type, f);};\r\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function (type, f) {\n on(this, type, f);\n };\n\n ctor.prototype.off = function (type, f) {\n off(this, type, f);\n };\n } // Due to the fact that we still support jurassic IE versions, some", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}", "function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f)}\n ctor.prototype.off = function(type, f) {off(this, type, f)}\n}", "function De(e){e.prototype.on=function(e,t){ni(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}", "function defineOnPrototype(ctor, methods) {\n var proto = ctor.prototype;\n forEachProperty(methods, function(val, key) {\n proto[key] = val;\n });\n }", "on() {\r\n throw new Error('Abstract method \"on\" must be implemented');\r\n }", "static events(...events) {\n return (target) => {\n Object.defineProperty(target.prototype, \"events\", {\n value: events\n });\n };\n }", "function PrototypeBasedClass () {\n}", "function EventClass() {}", "constructor (...args) {\n super(...args);\n\n const { constructor } = this;\n\n // Used for the ready() function so it knows when it can call its callback.\n this[$created] = true;\n\n // TODO refactor to not cater to Safari < 10. This means we can depend on\n // built-in property descriptors.\n // Must be defined on constructor and not from a superclass\n if (!constructor.hasOwnProperty($ctorCreateInitProps)) {\n setCtorNativeProperty(constructor, $ctorCreateInitProps, createInitProps(constructor));\n }\n\n // Set up a renderer that is debounced for property sets to call directly.\n this[$rendererDebounced] = debounce(this[$renderer].bind(this));\n\n // Set up property lifecycle.\n const propDefsCount = getPropNamesAndSymbols(getPropsMap(constructor)).length;\n if (propDefsCount && constructor[$ctorCreateInitProps]) {\n constructor[$ctorCreateInitProps](this);\n }\n\n // DEPRECATED\n //\n // static render()\n // Note that renderCallback is an optional method!\n if (!this.renderCallback && constructor.render) {\n DEBUG && deprecated(this, 'static render', 'renderCallback');\n this.renderCallback = constructor.render.bind(constructor, this);\n }\n\n // DEPRECATED\n //\n // static created()\n //\n // Props should be set up before calling this.\n const { created } = constructor;\n if (isFunction(created)) {\n DEBUG && deprecated(this, 'static created', 'constructor');\n created(this);\n }\n\n // DEPRECATED\n //\n // Feature has rarely been used.\n //\n // Created should be set before invoking the ready listeners.\n const elemData = data(this);\n const readyCallbacks = elemData.readyCallbacks;\n if (readyCallbacks) {\n readyCallbacks.forEach(cb => cb(this));\n delete elemData.readyCallbacks;\n }\n }", "addEventListeners() {\n // Empty in base class.\n }", "constructor (...args) {\n super(...args);\n\n const { constructor } = this;\n\n // Used for the ready() function so it knows when it can call its callback.\n this[created] = true;\n\n // TODO refactor to not cater to Safari < 10. This means we can depend on\n // built-in property descriptors.\n // Must be defined on constructor and not from a superclass\n if (!constructor.hasOwnProperty(ctorCreateInitProps)) {\n setCtorNativeProperty(constructor, ctorCreateInitProps, createInitProps(constructor));\n }\n\n // Set up a renderer that is debounced for property sets to call directly.\n this[rendererDebounced] = debounce(this[renderer].bind(this));\n\n // Set up property lifecycle.\n const propDefsCount = getPropNamesAndSymbols(getPropsMap(constructor)).length;\n if (propDefsCount && constructor[ctorCreateInitProps]) {\n constructor[ctorCreateInitProps](this);\n }\n\n // DEPRECATED\n //\n // static render()\n // Note that renderCallback is an optional method!\n if (!this.renderCallback && constructor.render) {\n deprecated(this, 'static render', 'renderCallback');\n this.renderCallback = constructor.render.bind(constructor, this);\n }\n\n // DEPRECATED\n //\n // static created()\n //\n // Props should be set up before calling this.\n const { created: created$$1 } = constructor;\n if (isFunction(created$$1)) {\n deprecated(this, 'static created', 'constructor');\n created$$1(this);\n }\n\n // DEPRECATED\n //\n // Feature has rarely been used.\n //\n // Created should be set before invoking the ready listeners.\n const elemData = data(this);\n const readyCallbacks = elemData.readyCallbacks;\n if (readyCallbacks) {\n readyCallbacks.forEach(cb => cb(this));\n delete elemData.readyCallbacks;\n }\n }", "function Eventable()\n{\n\n}", "get prototype() {}", "on() {\n control.on.apply(this, [].slice.call(arguments));\n }", "constructor() {\n this._events = Object.create(null)\n }", "set prototype(value) {}", "function Evented() {\n // summary:\n // A class that can be used as a mixin or base class,\n // to add on() and emit() methods to a class\n // for listening for events and emitting events:\n //\n // | define([\"cbtree/Evented\"], function(Evented){\n // | var EventedWidget = dojo.declare([Evented, dijit._Widget], {...});\n // | widget = new EventedWidget();\n // | widget.on(\"open\", function(event){\n // | ... do something with event\n // | });\n // |\n // | widget.emit(\"open\", {name:\"some event\", ...});\n\n this.on = function(type, listener) {\n\n function onMethod( target, type ) {\n\t\t\t\tvar ctor = target.constructor;\n\t\t\t\tvar onMap = ctor._onMap;\n\t\t\t\tif(!onMap){\n\t\t\t\t\tonMap = (ctor._onMap = {});\n\t\t\t\t\tfor(var attr in ctor.prototype){\n\t\t\t\t\t\tif(/^on/.test(attr)){\n\t\t\t\t\t\t\tonMap[attr.replace(/^on/, \"\").toLowerCase()] = attr;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar method = onMap[type.toLowerCase()] || \"on\" + type;\n\t\t\t\treturn method;\n }\n\n return on.parse(this, type, listener, function(target, type){\n return aspect.after(target, onMethod(target, type), listener, true);\n });\n };\n\n this.emit = function(type, event){\n var args = [this];\n if (!event.type) event.type = type;\n args.push.apply(args, arguments);\n return on.emit.apply(on, args);\n };\n\n }", "function constructor(properties) {\n\t\t\t// if no properties are passed, we're creating a prototype for a subclass,\n\t\t\t//\tso just bail immediately\n\t\t\tif (arguments[0] == $.SKIP) return;\n\t\t\t\n\t\t\t// extend the instance with all arguments passed in\n\t\t\tif (arguments.length) {\n\t\t\t\tproperties = this.extend.apply(this, arguments);\n\t\t\t}\n\n\t\t\t// call the initialize routine\n\t\t\tthis.initialize.apply(this, arguments);\n\t\t\t\n\t\t\t// and broadcast that we have been created\n\t\t\tthis.notify(\"onCreate\", properties);\t\n\t\t}", "function on(){return(on=Object.assign||function(g){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(g[A]=e[A])}return g}).apply(this,arguments)}", "static mixInto (Constructor) {\n const target = Constructor.prototype || Constructor;\n const mixin = LifeCycle.prototype;\n for (let prop of Object.getOwnPropertyNames(mixin)) {\n target[prop] = mixin[prop];\n }\n }", "onConstructed() {}", "onConstructed() {}", "constructor(){\n\t\tif (new.target === Observer) {\n\t\t\tthrow new TypeError(\"Cannot construct Interface Classes\");\n\t\t}\n\t}", "static mixInto (Constructor) {\n const target = Constructor.prototype || Constructor\n const mixin = LifeCycle.prototype\n for (let prop of Object.getOwnPropertyNames(mixin)) {\n target[prop] = mixin[prop]\n }\n }", "init() {\n module_utils.patchModule(\n 'bunyan',\n '_emit',\n emitWrapper,\n bunyan => bunyan.prototype\n );\n }", "function mixin(ctor,methods){var keyCopier=function keyCopier(key){ctor.prototype[key]=methods[key];};Object.keys(methods).forEach(keyCopier);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier);return ctor;}", "function mixin(ctor,methods){var keyCopier=function keyCopier(key){ctor.prototype[key]=methods[key];};Object.keys(methods).forEach(keyCopier);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier);return ctor;}", "function mixin(ctor,methods){var keyCopier=function keyCopier(key){ctor.prototype[key]=methods[key];};Object.keys(methods).forEach(keyCopier);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier);return ctor;}", "constructor() {\n super('OBS', ['OnOBSSwitchScenes', 'OnOBSTransitionTo', 'OnOBSStreamStarted', 'OnOBSStreamStopped', 'OnOBSCustomMessage']);\n this.onSwitch = [];\n this.onSwitchTrigger = {};\n this.onTransitionTo = [];\n this.onTransitionToTrigger = {};\n this.onStartTrigger = [];\n this.onStopTrigger = [];\n this.onCustom = [];\n this.onCustomTrigger = {};\n }", "function Prototype() {\n }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "constructor() {\n super(...arguments);\n var prototype = Object.getPrototypeOf(this);\n }", "init (...args) {\n this._super(...args)\n // Initialize the listeners array.\n this.set('listeners', [])\n }", "function Events() {} //", "function Events() {} //", "function Events() {} //", "function Events() {} //", "function Events() {} //", "function Events() {} //", "constructor() {\n this._listeners = {\n // debug: [],\n };\n for (const key in EVENTS) { // eslint-disable-line guard-for-in\n this._listeners[EVENTS[key]] = [];\n }\n\n this.on = this.addListener;\n this.off = this.removeListener;\n\n const indoorAtlasEventEmitter = new NativeEventEmitter(NativeIndoorAtlas);\n\n Object.keys(this._listeners).forEach(eventName => {\n const propertyName = \"_\" + eventName + \"Subscription\";\n const listener = this._handleIndoorAtlasEvent.bind(this, eventName);\n this[propertyName] = indoorAtlasEventEmitter.addListener(eventName, listener);\n });\n }", "function InstanceConstructor(instance_seed) {\n return {\n getElement : _getElement, \t\t\t// method affecting static class vars\n setElement : _setElement, \t\t\t// get the shared static value\n\t\t\tprintElement: function(){ \t\t\t// Sample function to test the code. Just a stub.\n\t\t\t\tvar tElement = new Element;\n\t\t\t\tvar vElement = new Element;\n\t\t\t\ttElement.setElement('Common Element');\n\t\t\t\talert('tElement\\'s: ' + tElement.getElement());\n\t\t\t\talert('vElement\\'s: ' + vElement.getElement());\n\t\t\t\t\n\t\t\t},\n\t\t\tattachClickEvent: attach, \t\t\t// attach click event to mini add-on\n\t\t\tdetachClickEvent: detach, \t\t\t// when disabled remove the click event.\n\t\t\tsetStateOfAddon: _setStateOfAddon,\t// set the state of the add-on whether it be minified or expanded.\n\t\t\tgetStateOfAddon: _getStateOfAddon,\n\t\t\t_toggle: toggle,\n\t\t\tattachHoverEvent : attachhoverevent,\n\t\t\tattachMouseOutEvent: attachmouseoutevent\n\t\t}\n }", "function constructorDecorator(...args) {\n const instance = new OriginalClass(...args);\n\n // Decorator for the _create() method.\n // We save the decorated _create() and we will use it if type != 'auto_segmentation'\n const decoratedCreate = instance._create;\n instance._create = () => {\n if (instance._type !== 'auto_segmentation') {\n decoratedCreate.call(instance);\n return;\n }\n\n instance._drawInstance = instance._frameContent.polyline().draw({ snapToGrid: 0.1 }).addClass('shapeCreation').attr({\n 'stroke-width': 0,\n z_order: Number.MAX_SAFE_INTEGER,\n });\n instance._createPolyEvents();\n\n /* the _createPolyEvents method have added \"drawdone\"\n * event handler which invalid for this case\n * because of that reason we remove the handler and\n * create the valid handler instead\n */\n instance._drawInstance.off('drawdone').on('drawdone', (e) => {\n let actualPoints = window.cvat.translate.points.canvasToActual(e.target.getAttribute('points'));\n actualPoints = PolyShapeModel.convertStringToNumberArray(actualPoints);\n\n if (actualPoints.length < 4) {\n showMessage('It is need to specify minimum four extreme points for an object');\n instance._controller.switchCreateMode(true);\n return;\n }\n\n const { frameWidth } = window.cvat.player.geometry;\n const { frameHeight } = window.cvat.player.geometry;\n for (let idx = 0; idx < actualPoints.length; idx += 1) {\n const point = actualPoints[idx];\n point.x = Math.clamp(point.x, 0, frameWidth);\n point.y = Math.clamp(point.y, 0, frameHeight);\n }\n\n e.target.setAttribute('points',\n window.cvat.translate.points.actualToCanvas(\n PolyShapeModel.convertNumberArrayToString(actualPoints),\n ));\n\n const polybox = e.target.getBBox();\n const area = polybox.width * polybox.height;\n\n if (area > AREA_TRESHOLD) {\n $.ajax({\n url: `/dextr/create/${window.cvat.job.id}`,\n type: 'POST',\n data: JSON.stringify({\n frame: window.cvat.player.frames.current,\n points: actualPoints,\n }),\n contentType: 'application/json',\n success: () => {\n function intervalCallback() {\n $.ajax({\n url: `/dextr/check/${window.cvat.job.id}`,\n type: 'GET',\n success: (jobData) => {\n if (['queued', 'started'].includes(jobData.status)) {\n if (jobData.status === 'queued') {\n dextrCancelButton.prop('disabled', false);\n }\n setTimeout(intervalCallback, 1000);\n } else {\n dextrOverlay.addClass('hidden');\n if (jobData.status === 'finished') {\n if (jobData.result) {\n instance._controller.finish({ points: jobData.result }, 'polygon');\n }\n } else if (jobData.status === 'failed') {\n const message = `Segmentation has fallen. Error: '${jobData.stderr}'`;\n showMessage(message);\n } else {\n let message = `Check segmentation request returned \"${jobData.status}\" status.`;\n if (jobData.stderr) {\n message += ` Error: ${jobData.stderr}`;\n }\n showMessage(message);\n }\n }\n },\n error: (errorData) => {\n dextrOverlay.addClass('hidden');\n const message = `Can not check segmentation. Code: ${errorData.status}.`\n + ` Message: ${errorData.responseText || errorData.statusText}`;\n showMessage(message);\n },\n });\n }\n\n dextrCancelButton.prop('disabled', true);\n dextrOverlay.removeClass('hidden');\n setTimeout(intervalCallback, 1000);\n },\n error: (errorData) => {\n const message = `Can not cancel ReID process. Code: ${errorData.status}.`\n + ` Message: ${errorData.responseText || errorData.statusText}`;\n showMessage(message);\n },\n });\n }\n\n instance._controller.switchCreateMode(true);\n }); // end of \"drawdone\" handler\n }; // end of _create() method\n\n return instance;\n } // end of constructorDecorator()", "off() {\r\n throw new Error('Abstract method \"off\" must be implemented');\r\n }", "constructor(ctor = globalThis.WebSocket) {\n this.reset();\n\n Object.defineProperties(\n this,\n [\n ['ctor', ctor],\n ['receiveDataQueue', []],\n ['receiveCallbacksQueue', []],\n ['closeEvent', null]\n ].reduce(\n (acc, [name, value]) => ({\n ...acc,\n [name]: { value, enumerable: false }\n }),\n {}\n )\n );\n }", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}" ]
[ "0.68004847", "0.67387736", "0.67387736", "0.6706197", "0.6706197", "0.6706197", "0.6694752", "0.6689273", "0.66082335", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65822226", "0.65283036", "0.65283036", "0.6386012", "0.60988665", "0.5978893", "0.58962196", "0.586148", "0.57574344", "0.56665164", "0.5666506", "0.56634164", "0.56027085", "0.5592612", "0.5584941", "0.55797756", "0.557446", "0.55693674", "0.55673283", "0.5547427", "0.55386126", "0.5518706", "0.5518706", "0.551598", "0.54971695", "0.5495971", "0.5472449", "0.5472449", "0.5472449", "0.5465619", "0.5452883", "0.5428294", "0.5428294", "0.5425327", "0.5385628", "0.5385628", "0.5385628", "0.5385628", "0.5385628", "0.5385628", "0.53828186", "0.5370956", "0.535741", "0.53289175", "0.53189486", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235", "0.53114235" ]
0.6659277
31
Due to the fact that we still support jurassic IE versions, some compatibility wrappers are needed.
function e_preventDefault(e) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compIE(){\r\n\tvar agent = navigator.userAgent;\r\n\tif(agent.indexOf(\"MSIE 7.0\") > -1 || agent.indexOf(\"MSIE 8.0\") > - 1 || agent.indexOf(\"Trident 4.0\") > -1 || document.documentMode && document.documentMode <= 5)\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function IEcompatibility() {\n\t// Only do anything if this is IE\n\tif(Browser.ie){\n\t\tvar __fix = $$(\"#kbbcode-size-options\", \"#kbbcode-size-options span\", \n\t\t\t\t\t\t\"#kbbcode-colortable\", \"#kbbcode-colortable td\");\n\t\tif (__fix) {\n\t\t\t__fix.setProperty('unselectable', 'on');\n\t\t}\n\t}\n}", "function mg_is_old_IE() {\r\n\t\tif( navigator.appVersion.indexOf(\"MSIE 8.\") != -1 ) {return true;}\r\n\t\telse {return false;}\r\n\t}", "function podPress_is_modern_ie() {\r\n\t\tif ( -1 != navigator.userAgent.search(/Trident\\/([0-9]+\\.[0-9]+)/gi) && true == podPress_is_v1_gtoreq_v2(RegExp.$1, '5') && -1 != navigator.userAgent.search(/MSIE\\s([0-9]+\\.[0-9]+)/gi) && true == podPress_is_v1_gtoreq_v2(RegExp.$1, '9') ) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function seven_isIE () {\n\t\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t\t}", "function less_IE8() {\n if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {\n return true;\n }\n}", "function supportOldIE() {\n var oldIeVersion = document && (function() {\n var version = 3,\n div = document.createElement('div'),\n iElems = div.getElementsByTagName('i');\n\n // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment\n while (\n div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',\n iElems[0]\n ) {}\n return version > 4 ? version : undefined;\n }());\n\n if (oldIeVersion < 9) {\n // Support old IE by patching ko.components.register to ensure that we have called\n // document.createElement(componentName) at least once before trying to parse any\n // markup that might use a custom element with that name\n var allCustomComponentNames = [];\n ko.components.register = (function(underlyingRegisterFunc) {\n return function(componentName) {\n allCustomComponentNames.push(componentName);\n underlyingRegisterFunc.apply(this, arguments);\n document.createElement(componentName);\n };\n })(ko.components.register);\n\n // Also to enable custom elements on old IE, we have to call document.createElement(name)\n // on every document fragment that ever gets created. This is especially important\n // if you're also using jQuery, because its parseHTML code works by setting .innerHTML\n // on some element inside a temporary document fragment.\n // It would be nicer if jQuery exposed some API for registering custom element names,\n // but it doesn't.\n document.createDocumentFragment = (function(originalDocumentCreateDocumentFragment) {\n return function() {\n // Note that you *can't* do originalDocumentCreateDocumentFragment.apply(this, arguments)\n // because IE6/7 complain \"object doesn't support this method\". Fortunately the function\n // doesn't take any parameters, and doesn't need a \"this\" value.\n var docFrag = originalDocumentCreateDocumentFragment();\n ko.utils.arrayForEach(allCustomComponentNames, docFrag.createElement.bind(docFrag));\n return docFrag;\n };\n })(document.createDocumentFragment);\n }\n }", "function isLowIE9() {\r\n var e = window.navigator.userAgent.toString().toUpperCase();\r\n var flag = false;\r\n if (e.indexOf(\"MSIE\") >= 0) {\r\n\r\n if (e.indexOf(\"MSIE 6.0\") > 0) flag = true;\r\n if (e.indexOf(\"MSIE 7.0\") > 0) flag = true;\r\n if (e.indexOf(\"MSIE 8.0\") > 0) flag = true;\r\n\r\n }\r\n\r\n\r\n return flag;\r\n\r\n }", "function detectIE() {\n\tvar isie = false;\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf('MSIE ');\n\tvar trident = ua.indexOf('Trident/');\n\tvar edge = ua.indexOf('Edge/');\n\tif (msie > 0) {\n\t\t// IE 10 or older\n\t\tisie = true;\n\t\tvar ieVer = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t} else if (trident > 0) {\n\t\t// IE 11\n\t\tisie = true;\n\t\tvar rv = ua.indexOf('rv:');\n\t\tvar ieVer = parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t} else if (edge > 0) {\n\t\t// Edge (IE 12+)\n\t\tisie = true;\n\t\tvar ieVer = parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\tif (isie == true) {\n\t\t$('html').addClass('ie');\n\t\tif (ieVer == 11) $('html').addClass('ie11');\n\t}\n}", "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\n return ieVersion;\n }\n else { return false; }\n }", "function msieversion() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) { \n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n if (ieVersion === 9) {$('body').addClass('no-js ie' + ieVersion);}\n return ieVersion;\n }\n else { return false; }\n }", "function isIE() {\n return navigator.userAgent.toLowerCase().indexOf(\"trident\") > 0;\n }", "function isIE() {\n return navigator.userAgent.toLowerCase().indexOf(\"trident\") > 0;\n }", "function msieversion() {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\r\n var ieVersion = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\r\n if (ieVersion === 9) {\r\n $('body').addClass('no-js ie' + ieVersion);\r\n }\r\n return ieVersion;\r\n } else {\r\n return false;\r\n }\r\n }", "function ie() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./))\n return true;\n else\n return false;\n}", "function detectIE() {\n if (navigator.userAgent.indexOf(\"MSIE\") >= 0) {\n window.location = \"/static/badbrowser.html\";\n }\n return false;\n}", "function checkIeVersion() {\n var ie = gees.tools.internetExplorerVersion();\n if (ie == 7 || ie == 8 || ie == 9) {\n gees.dom.get('name_field').value = 'name';\n gees.dom.get('text_field').value = 'description';\n }\n}", "function fixIE() {\n if (!Array.indexOf) {\n Array.prototype.indexOf = function(arg) {\n var index = -1;\n for (var i = 0; i < this.length; i++){\n var value = this[i];\n if (value == arg) {\n index = i;\n break;\n } \n }\n return index;\n };\n }\n\n if (!window.console) {\n window.console = {};\n window.console.log = window.console.debug = function(message) {\n return;\n var body = document.getElementsByTagName('body')[0];\n var messageDiv = document.createElement('div');\n messageDiv.innerHTML = message;\n body.insertBefore(messageDiv, body.lastChild);\n };\n } \n}", "function isIE() {\n\t\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t\t}", "function needsLayeringShim() {\n return isIE && (isWinXP || isWinVista || isWin7);\n}", "function fixIeFlexbox() {\r\n\t\t\t\t\tvar ua = window.navigator.userAgent,\r\n\t\t\t\t\tmsie = ua.indexOf(\"MSIE \");\r\n\t\t\t\t\t(msie > 0 || navigator.userAgent.match(/Trident.*rv\\:11\\./)) && $(\".vc_row-o-full-height\").each(function () {\r\n\t\t\t\t\t\t\"flex\" === $(this).find('> .span_12').css(\"display\") && $(this).wrap('<div class=\"vc_ie-flexbox-fixer\"></div>')\r\n\t\t\t\t\t})\r\n\t\t\t\t}", "function isIE() {\r\n return (navigator.userAgent.toLowerCase().indexOf('msie ') != -1) || (!!navigator.userAgent.match(/Trident.*rv[:]*11\\./));\r\n}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}", "function isIE() { //ie?\n if (!!window.ActiveXObject || \"ActiveXObject\" in window)\n return true;\n else\n return false;\n}", "function lpPatch_IE8(){\n\tif (typeof Array.prototype.indexOf !== 'function') {\n\t\tArray.prototype.indexOf = function(obj, start) {\n\t\t for (var i = (start || 0), j = this.length; i < j; i++) {\n\t\t if (this[i] === obj) { return i; }\n\t\t }\n\t\t return -1;\n\t\t} \n\t}\n\t\n\tif(typeof String.prototype.trim !== 'function') {\n\t\tString.prototype.trim = function() {\n\t \treturn this.replace(/^\\s+|\\s+$/g, ''); \n\t\t}\n\t}\t\n}", "function isCompatible()\n{\n\tvar ua = window.navigator.userAgent;\n\tvar msie = ua.indexOf(\"MSIE \");\n\tvar isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n\tvar isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);\n\tvar isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n\tvar isMSIE = ((msie > 0) || (!!navigator.userAgent.match(/Trident.*rv\\:11\\./)));\n\t\n\tif(isChrome || isSafari)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function isIE() {\n return (navigator.userAgent.toLowerCase().indexOf('msie ') != -1) || (!!navigator.userAgent.match(/Trident.*rv[:]*11\\./));\n}", "function fixIESelect() {\n return false;\n }", "function vpb_IE_detected()\n{\n var ua = window.navigator.userAgent;\n var old_ie = ua.indexOf('MSIE ');\n var new_ie = ua.indexOf('Trident/');\n\n if ((old_ie > -1) || (new_ie > -1)) \n\t{\n return true;\n } else {\n\t\treturn false;\n\t}\n}", "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n // Test values; Uncomment to check result …\r\n\r\n // IE 10\r\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\r\n\r\n // IE 11\r\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\r\n\r\n // Edge 12 (Spartan)\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\r\n\r\n // Edge 13\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // Edge (IE 12+) => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n }", "function isIE() {\n return (navigator.appName == \"Microsoft Internet Explorer\");\n}", "function is_IE()\n{\n\tif (navigator.userAgent.indexOf(\"MSIE\")>-1) return true;\n\treturn false\n}", "function isMsieSevenOrNewer() {\n\t\tif (typeof window.XMLHttpRequest !== 'undefined') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "isIE() {\n return Boolean(\n (Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, 'ActiveXObject')) ||\n 'ActiveXObject' in window\n )\n }", "function is_IE() {\n return (window.navigator.userAgent.match(/MSIE|Trident/) !== null);\n}", "function isIE()\n{\n return document.all;\n}", "function msieversion() \n{\n\ttry{\n\t var ua = window.navigator.userAgent;\n\t var msie = ua.indexOf(\"MSIE \");\n\t\n\t if (msie > 0) // Check for Internet Explorer\n\t {\n\t \tvar version = parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)));\n\t \tif (version < 9) {\n\t \t\treturn true;\n\t \t}\n\t }\n\t} catch (err) {\n\t\t//ignore any error\n\t}\n return false;\n}", "function isIe678 () {\n\t\tvar IE = eval('\"v\"==\"\\v\"');\n\t\treturn \tIE;\n\t}", "function checkBrowser(){\n\tif(document.getElementById && document.attachEvent){\t\n\t\t//modern IE\n\t\tbrowser = 'modIE';\n\t}\n\telse if(document.getElementById){\t\n\t\t//modern, non-IE\n\t\tbrowser = 'gecko';\n\t}\n\telse{\t\t\n\t\t//ask to download new browser\n\t\twindow.location = \"browser.html\";\n\t}\n}", "function isIE() {\n return Prototype.Browser.IE;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n\n\n var msie11 = ua.indexOf('rv:11');\n if (msie11 > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie11 + 3, ua.indexOf('.', msie11) + 2), 10);\n }\n\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {// IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {// Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }// other browser\n return false;\n }", "function autoComplete_func_isIE55() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 5.5\") > -1;\n}", "function isIE() {\n return jQuery.browser.msie;\n }", "function isIE () {\n var ms_ie = false;\n var ua = window.navigator.userAgent;\n var old_ie = ua.indexOf('MSIE ');\n var new_ie = ua.indexOf('Trident/');\n\n if ((old_ie > -1) || (new_ie > -1)) {\n ms_ie = true;\n }\n\n return ms_ie ;\n}", "function __loadCompatLayer(w) {\n w.Debug = function() {\n };\n w.Debug._fail = function(message) {\n throw new Error(message);\n };\n w.Debug.writeln = function(text) {\n if (window.console) {\n if (window.console.debug) {\n window.console.debug(text);\n return;\n }\n else if (window.console.log) {\n window.console.log(text);\n return;\n }\n }\n else if (window.opera &&\n window.opera.postError) {\n window.opera.postError(text);\n return;\n }\n };\n\n w.__getNonTextNode = function(node) {\n try {\n while (node && (node.nodeType != 1)) {\n node = node.parentNode;\n }\n }\n catch (ex) {\n node = null;\n }\n return node;\n };\n \n w.__getLocation = function(e) {\n var loc = {x : 0, y : 0};\n while (e) {\n loc.x += e.offsetLeft;\n loc.y += e.offsetTop;\n e = e.offsetParent;\n }\n return loc;\n };\n\n // Allow caching regex objects for performance\n RegExp._cacheable = true;\n\n // Skip RegExp.test in String.quote to improve performance.\n String._quoteSkipTest = true;\n\n w.navigate = function(url) {\n window.setTimeout('window.location = \"' + url + '\";', 0);\n };\n\n var attachEventProxy = function(eventName, eventHandler) {\n eventHandler._mozillaEventHandler = function(e) {\n window.event = e;\n eventHandler();\n if (!e.avoidReturn) {\n return e.returnValue;\n }\n };\n this.addEventListener(eventName.slice(2), eventHandler._mozillaEventHandler, false);\n };\n\n var detachEventProxy = function (eventName, eventHandler) {\n if (eventHandler._mozillaEventHandler) {\n var mozillaEventHandler = eventHandler._mozillaEventHandler;\n delete eventHandler._mozillaEventHandler;\n \n this.removeEventListener(eventName.slice(2), mozillaEventHandler, false);\n }\n };\n\n w.attachEvent = attachEventProxy;\n w.detachEvent = detachEventProxy;\n w.HTMLDocument.prototype.attachEvent = attachEventProxy;\n w.HTMLDocument.prototype.detachEvent = detachEventProxy;\n w.HTMLElement.prototype.attachEvent = attachEventProxy;\n w.HTMLElement.prototype.detachEvent = detachEventProxy;\n\n w.Event.prototype.__defineGetter__('srcElement', function() {\n // __getNonTextNode(this.target) is the expected implementation.\n // However script.load has target set to the Document object... so we\n // need to throw in currentTarget as well.\n return __getNonTextNode(this.target) || this.currentTarget;\n });\n w.Event.prototype.__defineGetter__('cancelBubble', function() {\n return this._bubblingCanceled || false;\n });\n w.Event.prototype.__defineSetter__('cancelBubble', function(v) {\n if (v) {\n this._bubblingCanceled = true;\n this.stopPropagation();\n }\n });\n w.Event.prototype.__defineGetter__('returnValue', function() {\n return !this._cancelDefault;\n });\n w.Event.prototype.__defineSetter__('returnValue', function(v) {\n if (!v) {\n this._cancelDefault = true;\n this.preventDefault();\n }\n });\n w.Event.prototype.__defineGetter__('fromElement', function () {\n var n;\n if (this.type == 'mouseover') {\n n = this.relatedTarget;\n }\n else if (this.type == 'mouseout') {\n n = this.target;\n }\n return __getNonTextNode(n);\n });\n w.Event.prototype.__defineGetter__('toElement', function () {\n var n;\n if (this.type == 'mouseout') {\n n = this.relatedTarget;\n }\n else if (this.type == 'mouseover') {\n n = this.target;\n }\n return __getNonTextNode(n);\n });\n w.Event.prototype.__defineGetter__('button', function() {\n return (this.which == 1) ? 1 : (this.which == 3) ? 2 : 0\n });\n w.Event.prototype.__defineGetter__('offsetX', function() {\n return window.pageXOffset + this.clientX - __getLocation(this.srcElement).x;\n });\n w.Event.prototype.__defineGetter__('offsetY', function() {\n return window.pageYOffset + this.clientY - __getLocation(this.srcElement).y;\n });\n\n w.HTMLElement.prototype.__defineGetter__('parentElement', function() {\n return this.parentNode;\n });\n w.HTMLElement.prototype.__defineGetter__('children', function() {\n var children = [];\n var childCount = this.childNodes.length;\n for (var i = 0; i < childCount; i++) {\n var childNode = this.childNodes[i];\n if (childNode.nodeType == 1) {\n children.push(childNode);\n }\n }\n return children;\n });\n w.HTMLElement.prototype.__defineGetter__('innerText', function() { \n try {\n return this.textContent\n } \n catch (ex) {\n var text = '';\n for (var i=0; i < this.childNodes.length; i++) {\n if (this.childNodes[i].nodeType == 3) {\n text += this.childNodes[i].textContent;\n }\n }\n return str;\n }\n });\n w.HTMLElement.prototype.__defineSetter__('innerText', function(v) {\n var textNode = document.createTextNode(v);\n this.innerHTML = '';\n this.appendChild(textNode);\n });\n w.HTMLElement.prototype.__defineGetter__('currentStyle', function() {\n return window.getComputedStyle(this, null);\n });\n w.HTMLElement.prototype.__defineGetter__('runtimeStyle', function() {\n return window.getOverrideStyle(this, null);\n });\n w.HTMLElement.prototype.removeNode = function(b) {\n return this.parentNode.removeChild(this)\n };\n w.HTMLElement.prototype.contains = function(el) {\n while (el != null && el != this) {\n el = el.parentNode;\n }\n return (el!=null)\n };\n\n w.HTMLStyleElement.prototype.__defineGetter__('styleSheet', function() {\n return this.sheet;\n });\n w.CSSStyleSheet.prototype.__defineGetter__('rules', function() {\n return this.cssRules;\n });\n w.CSSStyleSheet.prototype.addRule = function(selector, style, index) {\n this.insertRule(selector + '{' + style + '}', index);\n };\n w.CSSStyleSheet.prototype.removeRule = function(index) {\n this.deleteRule(index);\n };\n w.CSSStyleDeclaration.prototype.__defineGetter__('styleFloat', function() {\n return this.cssFloat;\n });\n w.CSSStyleDeclaration.prototype.__defineSetter__('styleFloat', function(v) {\n this.cssFloat = v;\n });\n DocumentFragment.prototype.getElementById = function(id) {\n var nodeQueue = [];\n var childNodes = this.childNodes;\n var node;\n var c;\n \n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n\n while (nodeQueue.length) {\n node = nodeQueue.dequeue();\n if (node.id == id) {\n return node;\n }\n childNodes = node.childNodes;\n if (childNodes.length != 0) {\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n }\n }\n\n return null;\n };\n\n DocumentFragment.prototype.getElementsByTagName = function(tagName) {\n var elements = [];\n var nodeQueue = [];\n var childNodes = this.childNodes;\n var node;\n var c;\n\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n\n while (nodeQueue.length) {\n node = nodeQueue.dequeue();\n if (node.tagName == tagName) {\n elements.add(node);\n }\n childNodes = node.childNodes;\n if (childNodes.length != 0) {\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n }\n }\n\n return elements;\n };\n\n DocumentFragment.prototype.createElement = function(tagName) {\n return document.createElement(tagName);\n };\n\n var selectNodes = function(doc, path, contextNode) {\n contextNode = contextNode ? contextNode : doc;\n var xpath = new XPathEvaluator();\n var result = xpath.evaluate(path, contextNode,\n doc.createNSResolver(doc.documentElement),\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\n var nodeList = new Array(result.snapshotLength);\n for(var i = 0; i < result.snapshotLength; i++) {\n nodeList[i] = result.snapshotItem(i);\n }\n\n return nodeList;\n };\n\n var selectSingleNode = function(doc, path, contextNode) {\n path += '[1]';\n var nodes = selectNodes(doc, path, contextNode);\n if (nodes.length != 0) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i]) {\n return nodes[i];\n }\n }\n }\n return null;\n };\n\n w.XMLDocument.prototype.selectNodes = function(path, contextNode) {\n return selectNodes(this, path, contextNode);\n };\n\n w.XMLDocument.prototype.selectSingleNode = function(path, contextNode) {\n return selectSingleNode(this, path, contextNode);\n };\n\n w.XMLDocument.prototype.transformNode = function(xsl) {\n var xslProcessor = new XSLTProcessor();\n xslProcessor.importStylesheet(xsl);\n\n var ownerDocument = document.implementation.createDocument(\"\", \"\", null);\n var transformedDoc = xslProcessor.transformToDocument(this);\n \n return transformedDoc.xml;\n };\n\n Node.prototype.selectNodes = function(path) {\n var doc = this.ownerDocument;\n return doc.selectNodes(path, this);\n };\n\n Node.prototype.selectSingleNode = function(path) {\n var doc = this.ownerDocument;\n return doc.selectSingleNode(path, this);\n };\n\n Node.prototype.__defineGetter__('baseName', function() {\n return this.localName;\n });\n\n Node.prototype.__defineGetter__('text', function() {\n return this.textContent;\n });\n Node.prototype.__defineSetter__('text', function(value) {\n this.textContent = value;\n });\n\n Node.prototype.__defineGetter__('xml', function() {\n return (new XMLSerializer()).serializeToString(this);\n });\n}", "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "function detectIE() {\r\n\tvar ua = window.navigator.userAgent;\r\n\tvar msie = ua.indexOf('MSIE ');\r\n\tif (msie > 0) {\r\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n\t}\r\n\tvar trident = ua.indexOf('Trident/');\r\n\tif (trident > 0) {\r\n\t\tvar rv = ua.indexOf('rv:');\r\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n\t}\r\n\tvar edge = ua.indexOf('Edge/');\r\n\tif (edge > 0) {\r\n\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n\t}\r\n\treturn false;\r\n}", "function preIE10Check() {\n if (window.attachEvent && !window.navigator.msPointerEnabled) {\n return true;\n } else {\n return false;\n }\n }", "function nofx_goodBrowser() {\n //IE6 is the bad browser. IE7 is 'mostly' ok.\n //IE8 FF Chrome Safari are good.\n if (BrowserDetect.browser == 'Explorer' && BrowserDetect.version < 7)\n return false;\n else\n return true;\n}", "function isIE(e,i){var t,n=\"IE\",m=document.createElement(\"B\"),o=document.documentElement;return e&&(n+=\" \"+e,i&&(n=i+\" \"+n)),m.innerHTML=\"<!--[if \"+n+']><b id=\"iecctest\"></b><![endif]-->',o.appendChild(m),t=!!document.getElementById(\"iecctest\"),o.removeChild(m),t}", "function iedetect(v) {\n\n\t var r = RegExp('msie' + (!isNaN(v) ? ('\\\\s' + v) : ''), 'i');\n\t\treturn r.test(navigator.userAgent);\n\t\t\t\n\t}", "function checkVersion() {\n\t\tvar msg = \"You're not using Internet Explorer.\";\n\t\tvar ver = getInternetExplorerVersion();\n\t\tif ( ver > -1 ) {\n\t\t\tif ( ver >= 8.0 ) {\n\t\t\t\tmsg = \"You're using a recent copy of Internet Explorer.\"\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmsg = \"You should upgrade your copy of Internet Explorer.\";\n\t\t\t}\n\t\t}\n\t\tconsole.log( msg );\n\t}", "function uTestBrowserIE()\n{\n return (uBrowserID == uIE);\n}", "screwIE () {\n let browser = new Browser();\n if (browser.screwIE === true) {\n this.$toast({\n type: 'warning',\n content: `\n <h4>Unsupported Browser</h4>\n <span>This app may not function properly in Internet Explorer! Please use another browser such as Chrome, Edge, or Firefox.</span>`\n });\n }\n }", "function autoComplete_func_isIE() { // Private method\n return autoComplete_func_isIE5() || autoComplete_func_isIE6() || autoComplete_func_isIE7() ;\n}", "function detectIE() {\n\t\t\t\t var ua = window.navigator.userAgent;\n\n\t\t\t\t var msie = ua.indexOf('MSIE ');\n\t\t\t\t if (msie > 0) {\n\t\t\t\t\t// IE 10 or older => return version number\n\t\t\t\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t\t\t\t }\n\n\t\t\t\t var trident = ua.indexOf('Trident/');\n\t\t\t\t if (trident > 0) {\n\t\t\t\t\t// IE 11 => return version number\n\t\t\t\t\tvar rv = ua.indexOf('rv:');\n\t\t\t\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t\t\t\t }\n\n\t\t\t\t var edge = ua.indexOf('Edge/');\n\t\t\t\t if (edge > 0) {\n\t\t\t\t\t// Edge (IE 12+) => return version number\n\t\t\t\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t\t\t\t }\n\n\t\t\t\t // other browser\n\t\t\t\t return false;\n\t\t\t}", "function isIE () {\n\tvar myNav = navigator.userAgent.toLowerCase();\n\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n}", "function Re(e){return!0===Ie(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function isIE() {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n }", "function isIE () {\n var myNav = navigator.userAgent.toLowerCase();\n return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1], 10) : false;\n }", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }", "function ie(e,r){var n=o(e),a=void 0===w[0]\nr=void 0===r||!!r,t.animate&&!a&&i(_,t.cssClasses.tap,t.animationDuration),E.forEach((function(e){re(e,function(e,r){return null===e||!1===e||void 0===e?w[r]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=D.toStepping(e))||isNaN(e)?w[r]:e)}(n[e],e),!0,!1)})),E.forEach((function(e){re(e,w[e],!0,!0)})),te(),E.forEach((function(e){$(\"update\",e),null!==n[e]&&r&&$(\"set\",e)}))}", "function detectIE() {\r\n var ua = window.navigator.userAgent;\r\n\r\n // Test values; Uncomment to check result …\r\n\r\n // IE 10\r\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\r\n\r\n // IE 11\r\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\r\n\r\n // IE 12 / Spartan\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\r\n\r\n // Edge (IE 12+)\r\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\r\n\r\n var msie = ua.indexOf('MSIE ');\r\n if (msie > 0) {\r\n // IE 10 or older => return version number\r\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\r\n }\r\n\r\n var trident = ua.indexOf('Trident/');\r\n if (trident > 0) {\r\n // IE 11 => return version number\r\n var rv = ua.indexOf('rv:');\r\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\r\n }\r\n\r\n var edge = ua.indexOf('Edge/');\r\n if (edge > 0) {\r\n // Edge (IE 12+) => return version number\r\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\r\n }\r\n\r\n // other browser\r\n return false;\r\n}", "function isInternetExplorerBefore(version) {\n var iematch = /MSIE ([0-9]+)/g.exec(window.navigator.userAgent);\n\n return iematch ? +iematch[1] < version : false;\n}", "function isBrowserIE () {\n var ua = window.navigator.userAgent\n var msie = ua.indexOf('MSIE ')\n var trident = ua.indexOf('Trident/')\n var edge = ua.indexOf('Edge/')\n if (msie > 0 || trident > 0 || edge > 0) {\n return true\n }\n }", "function e(a){var q=(a||u).toLowerCase();var B1=/(webkit)[ \\/]([\\w.]+)/;var C1=/(opera)(?:.*version)?[ \\/]([\\w.]+)/;var D1=/(msie) ([\\w.]+)/;var E1=/(trident)\\/[\\w.]+;.*rv:([\\w.]+)/;var F1=/(edge)[ \\/]([\\w.]+)/;var G1=/(mozilla)(?:.*? rv:([\\w.]+))?/;var H1=F1.exec(q)||E1.exec(q)||B1.exec(q)||C1.exec(q)||D1.exec(q)||q.indexOf(\"compatible\")<0&&G1.exec(q)||[];var I1={browser:H1[1]||\"\",version:H1[2]||\"0\"};I1[I1.browser]=true;return I1;}", "function autoComplete_func_isIE7() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 7\") > -1 && navigator.userAgent.indexOf(\"Opera\") == -1;\n}", "function Browser_DetermineBrowser()\n{\n\t//get user agent\n\tvar userAgent = navigator.userAgent;\n\t//scan for broser\n\tif (userAgent.indexOf(\"MSIE\") != -1)\n\t{\n\t\t//IE!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\t//get browser version\n\t\tvar version = parseFloat(userAgent.substring(userAgent.indexOf(\"MSIE\") + 5));\n\t\t//ie or better?\n\t\twindow.__BROWSER_IE10_OR_LESS = version < 11;\n\t\twindow.__BROWSER_IE9_OR_LESS = version < 10;\n\t\twindow.__BROWSER_IE8_OR_LESS = version < 9;\n\t\twindow.__BROWSER_IE11_OR_LESS = !(window.__BROWSER_IE10_OR_LESS || window.__BROWSER_IE9_OR_LESS || window.__BROWSER_IE8_OR_LESS);\n\t\tif (window.__BROWSER_IE8_OR_LESS)\n\t\t{\n\t\t\t//add special tags to render inline blocks correctly\n\t\t\twindow.__BROWSER_INLINE_BLOCK_CSS += \"zoom:1; *display: inline;\";\n\t\t\t//adjust get client bounds\n\t\t\twindow.__BROWSER_CLIENTRECT_MOD = version < 8 ? -2 : 0;\n\t\t}\n\t\t//correct the menu highlight\n\t\twindow.__MENU_BORDER_MENUBAR_HTML_HIGHLIGHT = __MENU_BORDER_MENUBAR_HTML_HIGHLIGHT_IE;\n\t\t//are we in screenshot mode\n\t\tif (__SCREENSHOTS_ON)\n\t\t{\n\t\t\t//add modifier to client rect\n\t\t\twindow.__BROWSER_CLIENTRECT_MOD += 2;\n\t\t}\n\t\t//mark specific bad resources for IE\n\t\twindow.__CACHE_REGEX_BAD_RESOURCES = __CACHE_REGEX_BAD_RESOURCES_IE11;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 17;\n\t}\n\telse if (userAgent.indexOf(\"Edge\") != -1)\n\t{\n\t\t//Edge!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\twindow.__BROWSER_EDGE = true;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 16;\n\t}\n\telse if (userAgent.indexOf(\"Firefox\") != -1)\n\t{\n\t\t//FireFox!\n\t\twindow.__BROWSER_TYPE = __BROWSER_FF;\n\t\t//rename mouse wheel event\n\t\twindow.__BROWSER_EVENT_MOUSEWHEEL = \"DOMMouseScroll\";\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions\n\t\twindow.Zoom_Register = Zoom_Register_FireFox;\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t}\n\telse if (userAgent.indexOf(\"Chrome\") != -1)\n\t{\n\t\t//Chrome!\n\t\twindow.__BROWSER_TYPE = __BROWSER_CHROME;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions but only for retrieving zoomed scale\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t}\n\telse if (userAgent.indexOf(\"Opera\") != -1)\n\t{\n\t\t//Opera!\n\t\twindow.__BROWSER_TYPE = __BROWSER_OPERA;\n\t}\n\telse if (userAgent.indexOf(\"iPad\") != -1 || userAgent.indexOf(\"iPhone\") != -1)\n\t{\n\t\t//ipad? use safari for now\n\t\twindow.__BROWSER_TYPE = __BROWSER_SAFARI;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t\t//change the zoom functions but only for retrieving zoomed scale\n\t\twindow.Get_ZoomedScale = Get_InterpreterDisplayScaleOnly;\n\t\t//force a transformation for the body\n\t\twindow.document.body.style.transform = \"translate3d(0,0,0)\";\n\t}\n\telse if (userAgent.indexOf(\"Safari\") != -1)\n\t{\n\t\t//Safari!\n\t\twindow.__BROWSER_TYPE = __BROWSER_SAFARI;\n\t\t//its a chromium\n\t\twindow.__BROWSER_CHROMIUM = true;\n\t}\n\telse if (userAgent.indexOf(\"Trident/7.0\") != -1)\n\t{\n\t\t//IE!\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t\twindow.__BROWSER_IE11_OR_LESS = true;\n\t\t//mark specific bad resources for IE\n\t\twindow.__CACHE_REGEX_BAD_RESOURCES = __CACHE_REGEX_BAD_RESOURCES_IE11;\n\t\t//modify the scrollbar size\n\t\twindow.__CAMERA_CMD_SCROLL_BARSIZE = 17;\n\t}\n\telse\n\t{\n\t\t//in trouble!\n\t\tCommon_Error(\"Unable to determine browser\");\n\t\t//use ie\n\t\twindow.__BROWSER_TYPE = __BROWSER_IE;\n\t}\n\t//we have html5?\n\tif (!window.__BROWSER_IE8_OR_LESS)\n\t{\n\t\t//add css variables to the colors map\n\t\t__NEMESIS_COLORS_NAME_MAP[\"currentcolor\"] = \"CurrentColor\";\n\t}\n\t//update ligatures for css\n\tBrowser_SetupLigatures();\n\t//setup on touch\n\tBrowser_SetupOnTouch();\n}", "function detectIE() {\n\tvar ua = navigator.userAgent;\n\tvar msie = ua.indexOf('MSIE ');\n\tif (msie > 0) {\n\t\t// IE 10 or older => return version number\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\n\tvar trident = ua.indexOf('Trident/');\n\tif (trident > 0) {// IE 11 => return version number\n\t\tvar rv = ua.lastIndexOf('rv:');\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\n\tvar edge = ua.indexOf('Edge/');\n\tif (edge > 0) {// Edge (IE 12+) => return version number\n\t\treturn parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}// other browser\n\treturn false;\n}", "function getElementClass(){if(typeof HTMLElement!=='function'){// case of Safari\nvar _BaseElement=function _BaseElement(){};_BaseElement.prototype=document.createElement('div');return _BaseElement;}else{return HTMLElement;}}", "function isMsieSevenOrNewer() {\n if (wind.XMLHttpRequest !== undefined) {\n return true;\n }\n\n return false;\n }", "function detectIE() {\n\tvar ua = window.navigator.userAgent;\n\n\tvar msie = ua.indexOf('MSIE ');\n\tif (msie > 0) {\n\t\t// IE 10 or older => return version number\n\t\treturn parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\t}\n\n\tvar trident = ua.indexOf('Trident/');\n\tif (trident > 0) {\n\t\t// IE 11 => return version number\n\t\tvar rv = ua.indexOf('rv:');\n\t\treturn parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\t}\n\n\tvar edge = ua.indexOf('Edge/');\n\tif (edge > 0) {\n\t // IE 12 => return version number\n\t return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\t}\n\n\t// other browser\n\treturn false;\n}", "function autoComplete_func_isIE6() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 6\") > -1 && navigator.userAgent.indexOf(\"Opera\") == -1;\n}", "function DetectBrowser()\n{\n var browserID = navigator.userAgent.toLowerCase(); \n \n if(browserID.indexOf('msie') != -1)\n {\n IE = true;\n FireFox = false;\n IE7 = false;\n }\n \n if(browserID.indexOf('msie 7.0') != -1)\n { \n IE7 = true;\n }\n \n if(browserID.indexOf('firefox') != -1)\n {\n IE = false;\n FireFox = true; \n IE7 = false;\n } \n \n}", "function isIE() {\n let ua = navigator.userAgent;\n /* MSIE used to detect old browsers and Trident used to newer ones*/\n return ua.indexOf(\"MSIE \") > -1 || ua.indexOf(\"Trident/\") > -1;\n}", "IE ():boolean {\n\n\t\treturn this.agent.match(/Trident/i) ? true : false;\n\t}", "function hasSupport() {\r\n\r\n if (typeof hasSupport.support != \"undefined\")\r\n return hasSupport.support;\r\n \r\n var ie55 = /msie 5\\.[56789]/i.test( navigator.userAgent );\r\n \r\n hasSupport.support = ( typeof document.implementation != \"undefined\" &&\r\n document.implementation.hasFeature( \"html\", \"1.0\" ) || ie55 )\r\n \r\n // IE55 has a serious DOM1 bug... Patch it!\r\n if ( ie55 ) {\r\n document._getElementsByTagName = document.getElementsByTagName;\r\n document.getElementsByTagName = function ( sTagName ) {\r\n if ( sTagName == \"*\" )\r\n return document.all;\r\n else\r\n return document._getElementsByTagName( sTagName );\r\n };\r\n }\r\n\r\n return hasSupport.support;\r\n}", "function classForMacAndIE() {\n \n var ua = window.navigator.userAgent;\n var msie = ua.indexOf('MSIE ');\n\n if (msie > 0) {\n $('body').addClass('only-ie');\n\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n\n }\n\n var trident = ua.indexOf('Trident/');\n\n if (trident > 0) {\n $('body').addClass('only-ie');\n\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n\n if (edge > 0) {\n\n $('body').addClass('only-ie');\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n\n }\n\n\n if (navigator.userAgent.indexOf('Mac') > 0) {\n $('body').addClass('only-mac');\n }\n\n // other browser\n return false;\n\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n // var edge = ua.indexOf('Edge/');\n // if (edge > 0) {\n // // Edge (IE 12+) => return version number\n // return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n // }\n\n // other browser\n return false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n\n }\n var gecko = ua.indexOf('Gecko/');\n\n if (gecko > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf(\"MSIE \");\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf(\".\", msie)), 10);\n }\n\n var trident = ua.indexOf(\"Trident/\");\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf(\"rv:\");\n return parseInt(ua.substring(rv + 3, ua.indexOf(\".\", rv)), 10);\n }\n\n var edge = ua.indexOf(\"Edge/\");\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf(\".\", edge)), 10);\n }\n\n // other browser\n return false;\n}", "function isIE() {\n\tif (navigator.appName.indexOf(\"Explorer\")>0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "_detectBrowserSupport () {\n\t\t\n\t\tvar check = true;\n\n\t\t// nothing below IE9\n\t\tif (!document.addEventListener) check = false;\n\n\t\t// nothing below IE10\n\t\t// if (!window.onpopstate) check = false;\n\n\t\treturn check;\n\t}", "function autoComplete_func_isIE5() { // Private method\n return navigator.userAgent.indexOf(\"MSIE 5\") > -1;\n}", "function isIE8() {\n if (window.attachEvent && !window.addEventListener) {\n return true;\n } else {\n return false;\n }\n }", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function ie(e,n){var r=a(e),o=void 0===x[0];n=void 0===n||!!n,t.animate&&!o&&i(w,t.cssClasses.tap,t.animationDuration),S.forEach((function(e){ne(e,function(e,n){return null===e||!1===e||void 0===e?x[n]:(\"number\"==typeof e&&(e=String(e)),e=t.format.from(e),!1===(e=k.toStepping(e))||isNaN(e)?x[n]:e)}(r[e],e),!0,!1)})),S.forEach((function(e){ne(e,x[e],!0,!0)})),te(),S.forEach((function(e){$(\"update\",e),null!==r[e]&&n&&$(\"set\",e)}))}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n // Test values; Uncomment to check result …\n\n // IE 10\n // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';\n\n // IE 11\n // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';\n\n // Edge 12 (Spartan)\n // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';\n\n // Edge 13\n // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function ie(a,b,c){this.$=a;this.M=[];this.ga=n;this.Fd=b;this.Jb=c}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function detectIE() {\n var ua = window.navigator.userAgent;\n\n var msie = ua.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);\n }\n\n var trident = ua.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = ua.indexOf('rv:');\n return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);\n }\n\n var edge = ua.indexOf('Edge/');\n if (edge > 0) {\n // Edge (IE 12+) => return version number\n return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n}", "function isEnhancedBrowser() {\n var script = document.createElement('script')\n var input = document.createElement('input')\n\n return (\n 'visibilityState' in document && // not supported by old Android (4.0-4.4) without a prefix\n 'indeterminate' in input && // not supported by BB 10\n 'flex' in doc.style && // not supported by old Safari (< 9) or IE 6-10\n 'async' in script // not supported by old Opera (Presto engine < 15)\n )\n }" ]
[ "0.7147347", "0.6929268", "0.68107486", "0.6763516", "0.6701702", "0.6691548", "0.6618857", "0.65820587", "0.6516647", "0.64824015", "0.64824015", "0.6473577", "0.6473577", "0.64497596", "0.6369467", "0.6367046", "0.6363274", "0.63499576", "0.63459855", "0.63325495", "0.63212836", "0.63037443", "0.6293523", "0.6293523", "0.6293523", "0.6293523", "0.6293523", "0.6293523", "0.6293523", "0.62727344", "0.6260862", "0.6260769", "0.6254707", "0.62353724", "0.62157047", "0.6189267", "0.6186495", "0.6184955", "0.6174343", "0.6173217", "0.61610186", "0.61482525", "0.6141821", "0.6139743", "0.613736", "0.6130767", "0.6115741", "0.6096986", "0.60875607", "0.60867184", "0.6071553", "0.60561776", "0.60468906", "0.60424864", "0.6036603", "0.6024591", "0.60133505", "0.6012027", "0.59993434", "0.59958607", "0.59674287", "0.59640497", "0.5963938", "0.59599876", "0.59460515", "0.59399015", "0.5926064", "0.5888382", "0.58860874", "0.5884101", "0.58840805", "0.5875286", "0.5871793", "0.58581305", "0.58560014", "0.5845092", "0.5835014", "0.5834758", "0.5827966", "0.58272445", "0.5822418", "0.581844", "0.58126485", "0.58073777", "0.5806821", "0.5806414", "0.5803696", "0.579716", "0.5791585", "0.5789338", "0.5788458", "0.57706624", "0.57631", "0.5759442", "0.57545745", "0.57531774", "0.57435155", "0.57331795", "0.57331795", "0.57331795", "0.57320184" ]
0.0
-1
Extra arguments are stored as the mode's dependencies, which is used by (legacy) mechanisms like loadmode.js to automatically load a mode. (Preferred mechanism is the require/define calls.)
function defineMode(name, mode) { if (arguments.length > 2) { mode.dependencies = Array.prototype.slice.call(arguments, 2); } modes[name] = mode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineMode(name, mode) {\n\t\t if (arguments.length > 2)\n\t\t { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n\t\t modes[name] = mode;\n\t\t }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}", "function defineMode(name, mode) {\r\n if (arguments.length > 2)\r\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\r\n modes[name] = mode;\r\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2) {\n mode.dependencies = Array.prototype.slice.call(arguments, 2);\n }\n\n modes[name] = mode;\n }", "function requires() {\n if (!conf) {\n alert(\"MRequires: MRequires() used before MRequires.init() called.\");\n return;\n }\n \n for (var i=0; i<arguments.length; i++) {\n \n // We keep track of items by their URL, because different\n // component names can refer to the same URL and we never\n // want to load the same URL twice.\n var url = makeUrl(arguments[i]);\n \n // Load only when not already loaded\n if (!loaded[url]) {\n // mark as loaded\n loaded[url] = true;\n \n if (/\\.js$/.test(url)) {\n loadJavaScript(url);\n }\n else if (/\\.css$/.test(url)) {\n loadCss(url);\n }\n else {\n alert(\"MRequires: Unknown file type '\"+url+\"'.\");\n }\n }\n }\n }", "function module$1(name, options, executeNow) {\n \tif (focused) {\n \t\treturn;\n \t}\n\n \tif (arguments.length === 2) {\n \t\tif (objectType(options) === \"function\") {\n \t\t\texecuteNow = options;\n \t\t\toptions = undefined;\n \t\t}\n \t}\n\n \tprocessModule(name, options, executeNow);\n }", "function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ci[e]=t}", "function setModuleMode(_ref) {\n var mode = _ref.mode,\n libraryType = _ref.libraryType;\n\n moduleMode = mode;\n\n if (typeof libraryType !== \"undefined\") {\n moduleLibraryType = libraryType;\n }\n\n if (moduleLibraryType !== \"v1\") {\n applyMakeupFunctionName = 'createLook';\n pausedFunctionName = 'isPaused';\n }\n}", "loadDependencies(){\n\n }", "function loadAllModes(){\n var modesDir = path.join(appPath, 'node_modules/');\n var files = fs.readdirSync(modesDir);\n var modes = {};\n var modeDirs = [];\n\n // List all files, only add directories\n for(var i in files) {\n if (fs.statSync(modesDir + files[i]).isDirectory()) {\n modeDirs.push(files[i]);\n }\n }\n\n // Move through each mode package JSON file...\n for(var i in modeDirs) {\n var modeDir = path.join(modesDir, modeDirs[i]);\n var package = {};\n\n if (fs.existsSync(path.join(modeDir, 'package.json'))) {\n try {\n package = require(path.join(modeDir, 'package.json'));\n } catch(e) {\n console.error('Problem reading mode package:', e)\n // Silently fail on bad parse!\n continue;\n }\n } else {\n continue;\n }\n\n // This a good file? if so, lets make it ala mode!\n if (package['robopaint-type'] === \"mode\" && _.has(package.robopaint, 'index')) {\n // TODO: Add FS checks to see if its index file actually exists\n package.root = path.join(modesDir, modeDirs[i], '/');\n package.index = path.join(package.root, package.robopaint.index);\n modes[package.robopaint.name] = package;\n\n // Load any persistent scripts into the DOM\n if (package.robopaint.persistentScripts) {\n _.each(package.robopaint.persistentScripts, function(scriptPath){\n $('<script>').attr('src', path.join(package.root, scriptPath)).appendTo('head');\n });\n }\n }\n }\n\n // Calculate correct order for modes based on package weight (reverse)\n var order = Object.keys(modes).sort(function(a, b) {\n return (modes[b].robopaint.weight - modes[a].robopaint.weight)\n });\n\n // Build external robopaint.modes in correct order\n robopaint.modes = _.chain(modes)\n .sortBy(function(mode){ return mode.robopaint.weight; })\n .indexBy(function(mode){ return mode.robopaint.name; })\n .value();\n\n\n // Grab enabled modes\n var set = robopaint.utils.getSettings();\n var enabledModes = {};\n\n if (set && set.enabledmodes) {\n enabledModes = set.enabledmodes;\n }\n\n // Move through all approved modes based on mode weight and add DOM\n for(var i in order) {\n var name = order[i];\n var m = modes[name];\n\n // This is the minimum enabled modes, other modes are enabled during\n // settings load/apply when it gets around to it.\n robopaint.modes[name].enabled = !_.isUndefined(enabledModes[name]) ? enabledModes[name] : (coreModes.indexOf(name) !== -1);\n\n // Add the toolbar link icon\n\n // This monstrosity is to ensure no matter where it lives, we can find the\n // correct relative path to put in the background image location. This is\n // especially picky on windows as the absolute backslashes are mangled on\n // URI encode and will be flipped at the end via the global replace.\n var iconURI = path.relative(\n path.join(appPath, 'resources'),\n path.join(m.root, m.robopaint.graphics.icon)\n ).replace(/\\\\/g, '/');\n\n var i18nStr = \"modes.\" + m.robopaint.name + \".info.\";\n $('#bar-home').after(\n $('<a>')\n .attr('href', m.index)\n .attr('id', 'bar-' + m.robopaint.name)\n .addClass('mode tipped ' + (robopaint.modes[name].enabled ? '' : ' hidden') )\n .css('background-image', \"url('\" + iconURI + \"')\")\n .attr('data-i18n', '[title]' + i18nStr + 'use')\n .attr('title', robopaint.t(i18nStr + 'use'))\n .html('&nbsp;')\n );\n }\n\n // Add every mode to for enabling/disabling\n buildSettingsModeView();\n\n // Trigger modesLoaded for the home screen visualization.\n homeVis.modesLoaded();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "load(...args) {\n console.log(args);\n }", "function loadMode(cm) {\n\t\t cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n\t\t resetModeState(cm);\n\t\t }", "function getMode() {\r\n return import('./jsonMode.js');\r\n}", "function require(name) {\n var mod = ModuleManager.get(name);\n if (!mod) {\n //Only firefox and synchronous, sorry\n var file = ModuleManager.file(name);\n var code = null,\n request = new XMLHttpRequest();\n request.open('GET', file, false); \n try {\n request.send(null);\n } catch (e) {\n throw new LoadError(file);\n }\n if(request.status != 200)\n throw new LoadError(file);\n //Tego el codigo, creo el modulo\n var code = '(function(){ ' + request.responseText + '});';\n mod = ModuleManager.create(name, file, code);\n }\n event.publish('module_loaded', [this, mod]);\n switch (arguments.length) {\n case 1:\n // Returns module\n var names = name.split('.');\n var last = names[names.length - 1];\n this[last] = mod;\n return mod;\n case 2:\n // If all contents were requested returns nothing\n if (arguments[1] == '*') {\n __extend__(false, this, mod);\n return;\n // second arguments is the symbol in the package\n } else {\n var n = arguments[1];\n this[n] = mod[n];\n return mod[n];\n }\n default:\n // every argyment but the first one are a symbol\n // returns nothing\n for (var i = 1, length = arguments.length; i < length; i++) {\n this[arguments[i]] = mod[arguments[i]];\n }\n return;\n }\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "defineKeys() {\n if (arguments.length <= 1) {\n throw new Error('Too few arguments');\n }\n\n if (arguments.length % 3 != 1) {\n throw new Error('Wrong number of arguments');\n }\n\n // key mode is the first arg\n const key = this.key;\n const ext = this.ext;\n const args = Array.prototype.slice.call(arguments);\n const keyMode = args[0];\n\n // the rest are the pair of key bindings\n args.splice(0, 1);\n const makeHandler = function(command){\n return function(args) {\n ext.exec(command, args);\n }\n };\n\n for(var i = 0; i < args.length; i+=3) {\n const keyStroke = args[i];\n const command = args[i+1];\n const desc = args[i+2];\n key.defineKey([keyMode], keyStroke, makeHandler(command), desc);\n }\n }", "function loadDemos() {\n // const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n // files.forEach((file) => {\n // console.log('require file path:' + file)\n // require(file)\n // })\n\n require(path.join(__dirname, 'sugr/consolemanager.js'));\n require(path.join(__dirname, 'sugr/main.js'));\n require(path.join(__dirname, 'sugr/dialog.js'));\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n}", "function require() { return {}; }", "function loadMode(cm) {\n\t\t cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n\t\t resetModeState(cm);\n\t\t }", "static get requires() {\r\n return {\r\n 'LW.Window': 'lw.window.js',\r\n 'LW.Calendar': 'lw.calendar.js',\r\n // 'LW.Menu': 'lw.menu.js',\r\n // 'LW.Tooltip': 'lw.tooltip.js'\r\n }\r\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption)\n resetModeState(cm)\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption)\n resetModeState(cm)\n}", "enableLoad(args) {\n if (args.autoload && typeof args.autoload === 'number') {\n this.count[args.channels] = args.autoload;\n\n args.channels.forEach((channel) => {\n this.count[channel] = args.autoload;\n });\n }\n }", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n\n if (!mfactory) {\n return getMode(options, \"text/plain\");\n }\n\n var modeObj = mfactory(options, spec);\n\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) {\n continue;\n }\n\n if (modeObj.hasOwnProperty(prop)) {\n modeObj[\"_\" + prop] = modeObj[prop];\n }\n\n modeObj[prop] = exts[prop];\n }\n }\n\n modeObj.name = spec.name;\n\n if (spec.helperType) {\n modeObj.helperType = spec.helperType;\n }\n\n if (spec.modeProps) {\n for (var prop$1 in spec.modeProps) {\n modeObj[prop$1] = spec.modeProps[prop$1];\n }\n }\n\n return modeObj;\n } // This can be used to attach properties to mode objects from", "defineSelectionMode(name, args){\n const requiredFuncName = 'getWorldSpaceBoundingBox';\n if(!this._selectionModes){\n this._selectionModes= {};\n }\n if(!!(args && args.constructor && args.call && args.apply)){\n this._selectionModes[name]={};\n this._selectionModes[name][requiredFuncName]=args;\n }else{\n if(!args[requiredFuncName]){\n throw new Error({msg: `Selection mode definition must include ${requiredFuncName} function`, providedArgs: {name: name, args: args}})\n }\n this._selectionModes[name]=args;\n }\n }", "function loadMode(cm) {\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n cm.doc.iter(function(line) {\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n });\n cm.doc.frontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) regChange(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n cm.doc.iter(function(line) {\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n });\n cm.doc.frontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) regChange(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n cm.doc.iter(function(line) {\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n });\n cm.doc.frontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) regChange(cm);\n }", "function loadMode(cm) {\n\t cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n\t resetModeState(cm);\n\t }", "function loadMode(cm) {\n\t cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n\t resetModeState(cm);\n\t }", "function loadMode(cm) {\n\t cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\n\t resetModeState(cm);\n\t }", "function loadMode(cm) {\r\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\r\n resetModeState(cm);\r\n}", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n function ($ocLL, $q) {\n var promise = $q.when(1);\n for (var i = 0, len = _args.length; i < len; i++) {\n promise = promiseThen(_args[i]);\n }\n return promise;\n\n function promiseThen(_arg) {\n if (typeof _arg === 'function')\n return promise.then(_arg);\n else\n return promise.then(function () {\n var nowLoad = requiredData(_arg);\n if (!nowLoad)\n return $.error('Route resolve: Bad resource name [' + _arg + ']');\n return $ocLL.load(nowLoad);\n });\n }\n\n function requiredData(name) {\n if (jsRequires.modules)\n for (var m in jsRequires.modules)\n if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\n return jsRequires.modules[m];\n return jsRequires.scripts && jsRequires.scripts[name];\n }\n }]\n };\n }", "function getMode(){\n return mode;\n}", "function loadSequence() {\r\n var _args = arguments;\r\n return {\r\n deps: ['$ocLazyLoad', '$q',\r\n\t\t\tfunction ($ocLL, $q) {\r\n\t\t\t var promise = $q.when(1);\r\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\r\n\t\t\t promise = promiseThen(_args[i]);\r\n\t\t\t }\r\n\t\t\t return promise;\r\n\r\n\t\t\t function promiseThen(_arg) {\r\n\t\t\t if (typeof _arg == 'function')\r\n\t\t\t return promise.then(_arg);\r\n\t\t\t else\r\n\t\t\t return promise.then(function () {\r\n\t\t\t var nowLoad = requiredData(_arg);\r\n\t\t\t if (!nowLoad)\r\n\t\t\t return $.error('Route resolve: Bad resource name [' + _arg + ']');\r\n\t\t\t return $ocLL.load(nowLoad);\r\n\t\t\t });\r\n\t\t\t }\r\n\r\n\t\t\t function requiredData(name) {\r\n\t\t\t if (jsRequires.modules)\r\n\t\t\t for (var m in jsRequires.modules)\r\n\t\t\t if (jsRequires.modules[m].name && jsRequires.modules[m].name === name)\r\n\t\t\t return jsRequires.modules[m];\r\n\t\t\t return jsRequires.scripts && jsRequires.scripts[name];\r\n\t\t\t }\r\n\t\t\t}]\r\n };\r\n }", "function c(e,t,n){Array.isArray(e)?(n=t,t=e,e=void 0):\"string\"!=typeof e&&(n=e,e=t=void 0),t&&!Array.isArray(t)&&(n=t,t=void 0),t||(t=[\"require\",\"exports\",\"module\"]),\n//Set up properties for this module. If an ID, then use\n//internal cache. If no ID, then use the external variables\n//for this node module.\ne?\n//Put the module in deep freeze until there is a\n//require call for it.\nd[e]=[e,t,n]:l(e,t,n)}", "function loadMode(cm) {\r\n cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);\r\n resetModeState(cm);\r\n }" ]
[ "0.80863816", "0.7878452", "0.7878452", "0.7798622", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.77844185", "0.7740437", "0.580766", "0.56119114", "0.54473126", "0.5401171", "0.53346896", "0.53346044", "0.523104", "0.523104", "0.523104", "0.5228526", "0.52032703", "0.5167717", "0.5116208", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5105013", "0.5090591", "0.5085477", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.5074793", "0.50677603", "0.50676584", "0.50577384", "0.504405", "0.504405", "0.50426346", "0.5042175", "0.5028009", "0.5024629", "0.5024629", "0.5024629", "0.5023764", "0.5023764", "0.5023764", "0.5022202", "0.5011482", "0.49886692", "0.49886692", "0.49886692", "0.49886692", "0.4985343", "0.49846557", "0.49696866", "0.49152038", "0.49126193" ]
0.78369325
18
Given a mode spec (anything that resolveMode accepts), find and initialize an actual mode object.
function getMode(options, spec) { spec = resolveMode(spec); var mfactory = modes[spec.name]; if (!mfactory) { return getMode(options, "text/plain") } var modeObj = mfactory(options, spec); if (modeExtensions.hasOwnProperty(spec.name)) { var exts = modeExtensions[spec.name]; for (var prop in exts) { if (!exts.hasOwnProperty(prop)) { continue } if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } modeObj[prop] = exts[prop]; } } modeObj.name = spec.name; if (spec.helperType) { modeObj.helperType = spec.helperType; } if (spec.modeProps) { for (var prop$1 in spec.modeProps) { modeObj[prop$1] = spec.modeProps[prop$1]; } } return modeObj }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n\n if (typeof found == \"string\") {\n found = {\n name: found\n };\n }\n\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\");\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\");\n }\n\n if (typeof spec == \"string\") {\n return {\n name: spec\n };\n } else {\n return spec || {\n name: \"null\"\n };\n }\n } // Given a mode spec (anything that resolveMode accepts), find and", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n\n if (!mfactory) {\n return getMode(options, \"text/plain\");\n }\n\n var modeObj = mfactory(options, spec);\n\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) {\n continue;\n }\n\n if (modeObj.hasOwnProperty(prop)) {\n modeObj[\"_\" + prop] = modeObj[prop];\n }\n\n modeObj[prop] = exts[prop];\n }\n }\n\n modeObj.name = spec.name;\n\n if (spec.helperType) {\n modeObj.helperType = spec.helperType;\n }\n\n if (spec.modeProps) {\n for (var prop$1 in spec.modeProps) {\n modeObj[prop$1] = spec.modeProps[prop$1];\n }\n }\n\n return modeObj;\n } // This can be used to attach properties to mode objects from", "function getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec)\n var mfactory = modes[spec.name]\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec)\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name]\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop] }\n modeObj[prop] = exts[prop]\n }\n }\n modeObj.name = spec.name\n if (spec.helperType) { modeObj.helperType = spec.helperType }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1] } }\n\n return modeObj\n}", "function getMode(options, spec) {\n\t\t spec = resolveMode(spec);\n\t\t var mfactory = modes[spec.name];\n\t\t if (!mfactory) { return getMode(options, \"text/plain\") }\n\t\t var modeObj = mfactory(options, spec);\n\t\t if (modeExtensions.hasOwnProperty(spec.name)) {\n\t\t var exts = modeExtensions[spec.name];\n\t\t for (var prop in exts) {\n\t\t if (!exts.hasOwnProperty(prop)) { continue }\n\t\t if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n\t\t modeObj[prop] = exts[prop];\n\t\t }\n\t\t }\n\t\t modeObj.name = spec.name;\n\t\t if (spec.helperType) { modeObj.helperType = spec.helperType; }\n\t\t if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n\t\t { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n\t\t return modeObj\n\t\t }", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n}", "function getMode(options, spec) {\r\n spec = resolveMode(spec);\r\n var mfactory = modes[spec.name];\r\n if (!mfactory) { return getMode(options, \"text/plain\") }\r\n var modeObj = mfactory(options, spec);\r\n if (modeExtensions.hasOwnProperty(spec.name)) {\r\n var exts = modeExtensions[spec.name];\r\n for (var prop in exts) {\r\n if (!exts.hasOwnProperty(prop)) { continue }\r\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\r\n modeObj[prop] = exts[prop];\r\n }\r\n }\r\n modeObj.name = spec.name;\r\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\r\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\r\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\r\n\r\n return modeObj\r\n}", "function guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n const parsed = schemaParser(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n console.warn(`The given visualization spec is written in ${NAMES[parsed.library]}, but mode argument sets ${NAMES[providedMode] || providedMode}.`);\n }\n const mode = parsed.library;\n if (!semver_30(VERSION[mode], `^${parsed.version.slice(1)}`)) {\n console.warn(`The input spec uses ${mode} ${parsed.version}, but the current version of ${NAMES[mode]} is ${VERSION[mode]}.`);\n }\n return mode;\n }\n else {\n // try to guess from the provided spec\n if ('mark' in spec ||\n 'encoding' in spec ||\n 'layer' in spec ||\n 'hconcat' in spec ||\n 'vconcat' in spec ||\n 'facet' in spec ||\n 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n }\n return providedMode || 'vega';\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2) {\n mode.dependencies = Array.prototype.slice.call(arguments, 2);\n }\n\n modes[name] = mode;\n }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2) }\n modes[name] = mode\n}", "function defineMode(name, mode) {\n\t\t if (arguments.length > 2)\n\t\t { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n\t\t modes[name] = mode;\n\t\t }", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n}", "function defineMode(name, mode) {\r\n if (arguments.length > 2)\r\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\r\n modes[name] = mode;\r\n}", "function lookupMode(id) {\n return (OPT_MAP[id] || {mode: null}).mode;\n }", "function guessMode(spec, providedMode) {\n // Decide mode\n if (spec.$schema) {\n const parsed = (0,vega_schema_url_parser__WEBPACK_IMPORTED_MODULE_5__.default)(spec.$schema);\n if (providedMode && providedMode !== parsed.library) {\n console.warn(`The given visualization spec is written in ${NAMES[parsed.library]}, but mode argument sets ${NAMES[providedMode] || providedMode}.`);\n }\n const mode = parsed.library;\n if (!(0,semver__WEBPACK_IMPORTED_MODULE_2__.satisfies)(VERSION[mode], `^${parsed.version.slice(1)}`)) {\n console.warn(`The input spec uses ${NAMES[mode]} ${parsed.version}, but the current version of ${NAMES[mode]} is v${VERSION[mode]}.`);\n }\n return mode;\n }\n // try to guess from the provided spec\n if ('mark' in spec ||\n 'encoding' in spec ||\n 'layer' in spec ||\n 'hconcat' in spec ||\n 'vconcat' in spec ||\n 'facet' in spec ||\n 'repeat' in spec) {\n return 'vega-lite';\n }\n if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {\n return 'vega';\n }\n return providedMode || 'vega';\n}", "mode(val) {\n this._mode = val;\n return this;\n }", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "get mode() {}", "function createMode(rulesArray) {\n\n var mode = {\n rules: rulesArray,\n rulesRe: null,\n findIndex: {},\n activeRules: [],\n\n // gets the index of the found capture from the capture array\n getgroupIndex: function (captureArray, startIndex) {\n startIndex = (startIndex || 0);\n\n for (var i = startIndex, il = captureArray.length; i < il; i++) {\n if (captureArray[i] != null) return (i - startIndex);\n }\n return -1;\n },\n\n // uses findIndex to find rule based on captures result.\n getRuleFromCaptures: function (captureArray, startIndex, useFindIndex) {\n if (useFindIndex || useFindIndex == null) {\n return this.findIndex[this.getgroupIndex(captureArray, startIndex)];\n } else {\n return getRuleFromMatch(captureArray[this.getgroupIndex(captureArray, startIndex)]);\n }\n },\n\n // gets the rule from the matched text. slower than using find index. \n getRuleFromMatch: function (text) {\n var match;\n\n if ((match = new RegExp(this.rulesRe.source, 'gm').exec(text)) != null) {\n return this.findIndex[this.getgroupIndex(match, 1)];\n }\n\n },\n // creates the re, based on options\n updateRe: function (options) {\n this.findIndex = {};\n this.activeRules = [];\n\n var regex = '';\n var rule;\n\n var captureOffset = 0;\n var arrayLength = rulesArray.length;\n\n for (var i = 0, il = rulesArray.length; i < il; i++) {\n rule = rulesArray[i];\n\n if (rule.optionsMatch == null || options == null || options.match(rule.optionsMatch)) {\n regex += '(' + rule.regEx + ')|';\n this.activeRules.push(rule);\n this.findIndex[i + captureOffset] = rule;\n captureOffset += rule.capturedCount;\n } else {\n // skip rule\n captureOffset--;\n }\n }\n\n this.rulesRe = RegExp(regex.substr(0, regex.length - 1), 'gm');\n },\n\n clone: function () {\n return createMode(this.rules);\n }\n };\n mode.updateRe('');\n return mode;\n }", "function lookupOptions(mode) {\n if (mode in OPT_MAP) {\n var result = OPT_MAP[mode];\n result.textModeAtStart = !useBlocksByDefault;\n return result;\n }\n else {\n return null;\n }\n }", "function CMode( conf, parserConf )\n {\n // this is a generic multiplexing mode\n // since it supports multiple inner sub-grammar parsers\n // this means all folding/matching/autocompletion/comments multiplexing and so on..\n // should be handled by the mode itself taking account any sub-modes\n // and NOT by Codemirror!!\n var mode;\n mode = {\n Mode: CMode\n \n ,startState: function( ) { \n return {parser: CMode.$parser, state: new State( ), inner: {}, name: null};\n }\n \n ,copyState: function( state ) { \n return {parser: state.parser, state: new State( 0, state.state ), inner: state.inner, name: state.name};\n }\n \n ,token: function( stream, state ) { \n var pstream = Stream( stream.string, stream.start, stream.pos ), \n token = state.parser.get( pstream, state ).type;\n stream.pos = pstream.pos;\n return token;\n }\n \n ,indent: function( state, textAfter, fullLine ) { \n return state.parser.indent( state.state, textAfter, fullLine, conf, parserConf, CodeMirror ); \n }\n \n ,fold: CMode.foldType\n \n // support comments toggle functionality\n ,lineComment: CMode.$parser.LC\n ,blockCommentStart: CMode.$parser.BCS\n ,blockCommentEnd: CMode.$parser.BCE\n ,blockCommentContinue: CMode.$parser.BCC\n ,blockCommentLead: CMode.$parser.BCL\n // support extra functionality defined in grammar\n // eg. code folding, electriChars etc..\n ,electricInput: CMode.$parser.$grammar.$extra.electricInput || false\n ,electricChars: CMode.$parser.$grammar.$extra.electricChars || false\n };\n // store a reference to mode here\n CMode.mode = mode;\n return mode;\n }", "function parseMode (mode) {\n switch (mode) {\n case 'js':\n case 'javascript':\n mode = 'jsx'\n }\n let syntax = CodeMirror.findModeByName(mode)\n if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')\n return syntax\n}", "function initMode() {\n chrome.storage.local.get({\"mode\": \"flexible\"}, function (items) {\n mode = items.mode;\n });\n}", "checkMode(mode) {\n if (!mode) {\n mode = this.mode\n }\n return mode;\n }", "function startNewMode(mode) {\n var node\n\n if (mode.className) {\n node = build(mode.className, [])\n }\n\n // Enter a new mode.\n if (node) {\n currentChildren.push(node)\n stack.push(currentChildren)\n currentChildren = node.children\n }\n\n top = Object.create(mode, {parent: {value: top}})\n }", "set mode(value) {}", "initContext (mode) {\n this._screenDispatcher = new ScreenDispatcher(constant.SCR_INITIAL)\n this._screenDispatcher.register(constant.SCR_INITIAL, new InitialScreen())\n this._screenDispatcher.register(constant.SCR_SELECT_MODE, new SelectModeScreen())\n this._screenDispatcher.register(constant.SCR_PLAYING, new PlayingScreen())\n this._screenDispatcher.register(constant.SCR_GAMEOVER, new GameOverScreen())\n this._needleSelection = new NeedleSelection()\n this._threadSelection = new ThreadSelection()\n this._gameOverSelection = new GameOverSelection()\n this._pauseSelection = new PauseSelection()\n this._pressStartSelection = new PressStartSelection()\n this._initialTransparentRect = new InitialTransparentRect()\n this._levelUpSelection = new LevelUpSelection()\n this._selectModeScreenSelection = new SelectModeScreenSelection()\n this._statusSelection = new StatusSelection(mode)\n\n this._ctx = this._getInitVars(mode)\n this._statusSelection.setMode(mode)\n this._prevUpdatedTime = Date.now()\n this._selectedMode = mode\n }", "function applyMode(mode) {\n var options = {};\n for (var i = 0; i < mode.length; i++) {\n switch (mode[i]) {\n case 'r':\n options.read = true;\n break;\n case 'w':\n options.write = true;\n break;\n case 'a':\n options.append = true;\n break;\n case '+':\n options.update = true;\n break;\n case 'b':\n options.binary = true;\n break;\n case 'x':\n options.exclusive = true;\n break;\n case 'c':\n options.canonical = true;\n break;\n default:\n throw new Error(\"unsupported mode argument: \" + options);\n }\n }\n return options;\n}", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }", "setMode(mode) {\n this._mode = mode;\n }" ]
[ "0.75762206", "0.72704935", "0.72030133", "0.72030133", "0.71943533", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.71651524", "0.7151816", "0.6037289", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6029042", "0.6026796", "0.5996316", "0.5996316", "0.5988789", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5978087", "0.5926328", "0.5874748", "0.5869498", "0.5615203", "0.54024595", "0.54001206", "0.5323287", "0.53038824", "0.5297068", "0.529531", "0.52738845", "0.52375096", "0.5207231", "0.51544774", "0.5141531", "0.51271343", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5082669", "0.5079434" ]
0.72148794
13
Given a mode and a state (for that mode), find the inner mode and state at the position that the state refers to.
function innerMode(mode, state) { var info; while (mode.innerMode) { info = mode.innerMode(state); if (!info || info.mode == mode) { break } state = info.state; mode = info.mode; } return info || {mode: mode, state: state} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info\n while (mode.innerMode) {\n info = mode.innerMode(state)\n if (!info || info.mode == mode) { break }\n state = info.state\n mode = info.mode\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n}", "function innerMode(mode, state) {\n var info;\n\n while (mode.innerMode) {\n info = mode.innerMode(state);\n\n if (!info || info.mode == mode) {\n break;\n }\n\n state = info.state;\n mode = info.mode;\n }\n\n return info || {\n mode: mode,\n state: state\n };\n }", "function innerMode(mode, state) {\r\n var info;\r\n while (mode.innerMode) {\r\n info = mode.innerMode(state);\r\n if (!info || info.mode == mode) { break }\r\n state = info.state;\r\n mode = info.mode;\r\n }\r\n return info || {mode: mode, state: state}\r\n}", "function innerMode(mode, state) {\n\t\t var info;\n\t\t while (mode.innerMode) {\n\t\t info = mode.innerMode(state);\n\t\t if (!info || info.mode == mode) { break }\n\t\t state = info.state;\n\t\t mode = info.mode;\n\t\t }\n\t\t return info || {mode: mode, state: state}\n\t\t }", "function Ve(e,t){for(var a;e.innerMode&&(a=e.innerMode(t))&&a.mode!=e;)t=a.state,e=a.mode;return a||{mode:e,state:t}}", "function FindMode(arr){\n\tvar mode = arr[Math.ceil(arr.length / 2)];\n\n\treturn mode;\n}", "function findNodeByState(state){\r\n for(let i in NodeStateArr){\r\n let arr = NodeStateArr[i];\r\n if( arr[0] == state[0] && arr[1] == state[1] && arr[2] == state[2])\r\n return i;\r\n }\r\n return -1;\r\n}", "function whichState(coord) {\r\n ex = coord.x;\r\n why = coord.y;\r\n for (var i = 0; i < graph.states.length; i++) {\r\n var state = graph.states[i];\r\n var r = state.radius;\r\n //distance between two points, giving a little buffer room\r\n //between states close together\r\n if (r > (Math.sqrt(Math.pow(ex - state.location.x, 2) +\r\n Math.pow(why - state.location.y, 2))) - STATE_BUFFER) {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n}", "function getMode() {\n return _states.mode;\n }", "function _scanWinSizeB(side) {\r\n var x, y, count;\r\n var startX, startY;\r\n // scan the left-bottom half until y == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (y = GRID_SIZE - WIN_SIZE; y >= 0; --y) {\r\n x = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q < GRID_SIZE; ++p, ++q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p; // we can reuse x BTW\r\n startY = q;\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n \r\n // scan the right-bottom half until x == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (x = 1; x < GRID_SIZE-(WIN_SIZE-1); ++x) {\r\n y = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q < GRID_SIZE; ++p, ++q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p;\r\n startY = q; // we can reuse y BTW\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "function lookupMode(id) {\n return (OPT_MAP[id] || {mode: null}).mode;\n }", "findIndex(pos, side, end, startAt = 0) {\n let arr = end ? this.to : this.from;\n for (let lo = startAt, hi = arr.length;;) {\n if (lo == hi)\n return lo;\n let mid = (lo + hi) >> 1;\n let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;\n if (mid == lo)\n return diff >= 0 ? lo : hi;\n if (diff >= 0)\n hi = mid;\n else\n lo = mid + 1;\n }\n }", "function _scanWinSizeS(side) {\r\n var x, y, count;\r\n var startX, startY;\r\n // scan the left-top half until y == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (y = WIN_SIZE-1; y < GRID_SIZE; ++y) {\r\n x = 0;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q >= 0; ++p, --q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p; // we can reuse x BTW\r\n startY = q;\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n \r\n // scan the right-bottom half until x == GRID_SIZE-1\r\n // only need scan to the last possible position\r\n for (x = 1; x < GRID_SIZE-(WIN_SIZE-1); ++x) {\r\n y = GRID_SIZE-1;\r\n count = 0;\r\n for (var p = x, q = y; p < GRID_SIZE && q >= 0; ++p, --q) {\r\n if (positions[p][q].getValue() === side) {\r\n count++;\r\n if (count == 1) { // record the start position(x,y)\r\n startX = p;\r\n startY = q; // we can reuse y BTW\r\n } else if (count == WIN_SIZE) { // found WIN_SIZE link\r\n return positions[startX][startY];\r\n }\r\n } else {\r\n count = 0;\r\n }\r\n }\r\n }\r\n return null;\r\n }", "function findNeighboring (thing, i , j) {\n var coords = {};\n\n if (A.world[i-1]) {\n // the row above exists....\n if (A.world[i-1][j-1] && A.world[i-1][j-1] === thing) { coords.row = i - 1; coords.col = j - 1; };\n if (A.world[i-1][j] === thing) { coords.row = i - 1; coords.col = j; };\n if (A.world[i-1][j+1] && A.world[i-1][j+1] === thing) { coords.row = i - 1; coords.col = j + 1; };\n }\n if (A.world[i][j-1] && A.world[i][j-1] === thing) { coords.row = i; coords.col = j - 1; }; // the 'current' row\n if (A.world[i][j+1] && A.world[i][j+1] === thing) { coords.row = i; coords.col = j + 1; };\n if (A.world[i+1]) {\n // the row below exists...\n if (A.world[i+1][j-1] && A.world[i+1][j-1] === thing) { coords.row = i + 1; coords.col = j - 1; };\n if (A.world[i+1][j] === thing) { coords.row = i + 1; coords.col = j; };\n if (A.world[i+1][j+1] && A.world[i+1][j+1] === thing) { coords.row = i + 1; coords.col = j + 1; };\n }\n return coords;\n}", "get mode() {}", "function isEditMode(mode) {\r\n // Mutliple edit modes should not be on simultaenously\r\n if (mode == \"any\" && (addChildToggleSwitch.checked || \r\n addLinkToggleSwitch.checked || \r\n removeLinkToggleSwitch.checked || \r\n highlightNextPathToggleSwitch.checked ||\r\n removeNodeToggleSwitch.checked || \r\n editNodeToggleSwitch.checked)) {\r\n return true;\r\n } // Below states are ordered by their least destructive nature \r\n else if (mode == \"highlightPath\" && highlightNextPathToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"editNode\" && editNodeToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"addChild\" && addChildToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"addLink\" && addLinkToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"removeLink\" && removeLinkToggleSwitch.checked) {\r\n return true;\r\n } else if (mode == \"removeNode\" && removeNodeToggleSwitch.checked) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "function resolveInnerMapMode(currentMode, valueIsDefined, isExactMatch) {\n var innerMode = currentMode;\n if (!valueIsDefined && isExactMatch && !(currentMode & 4 /* SkipTargetProp */)) {\n // case 1: set the mode to apply the targeted prop value if it\n // ends up being encountered in another map value\n innerMode |= 2 /* ApplyTargetProp */;\n innerMode &= ~4 /* SkipTargetProp */;\n }\n else {\n // case 2: set the mode to skip the targeted prop value if it\n // ends up being encountered in another map value\n innerMode |= 4 /* SkipTargetProp */;\n innerMode &= ~2 /* ApplyTargetProp */;\n }\n return innerMode;\n}", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "function findKingFront(side, state){\n var sideadd = {S:-1,G:1}\n var kingFront = 00\n var whereking = 00\n var k = side + \"K\"\n var j = side + \"J\"\n for (i in state){\n if (state[i] == k || state[i] == j){\n whereking = i\n }\n }\n var x = parseInt(whereking.charAt(1))\n var y = parseInt(whereking.charAt(2))\n y = y + sideadd[side]\n kingfront = \"B\" + String(x) + String(y)\n return kingfront\n}", "function getMode () {\n if (Object.keys(cli.flags).length > 2) {\n return MODE.ERROR;\n } else if (cli.flags.s) {\n return MODE.SAVE;\n } else if (cli.flags.l) {\n return MODE.LIST;\n } else if (cli.flags.d) {\n return MODE.DELETE;\n } else {\n return MODE.FIND;\n }\n}", "function main_mode(word) {\n word = word.toLowerCase();\n if (STATE === \"block\") {\n // we're in block mode\n if (word === \"end\") {\n // set stack to JUST the last block\n STACK = BLOCK;\n STATE = \"\";\n } else {\n BLOCK = BLOCK.concat(word);\n }\n } else if (STATE === \"escape\") {\n // we're in escape mode\n // escape the word directly to stack, overwriting\n STACK = word;\n STATE = \"\";\n } else if (STATE === \"append-escape\") {\n // add the escaped word to the stack\n STACK = Array.of(STACK).concat(word);\n STATE = \"\";\n } else if (STATE === \"say\") {\n // we're in speak mode\n speak(word);\n STATE = \"\";\n } else if (STATE === \"listen\") {\n // we're in speak mode\n STACK = word;\n STATE = \"\";\n } else if (STATE === \"as\") {\n // assignment mode\n VARS[word] = STACK;\n STATE = \"\";\n } else if (STATE === \"expect\") {\n // expect mode, based on stack\n // next word is what to expect\n // we don't want to EVER re run old expect\n EXPECT = [];\n EXPECT[0] = word;\n STATE = \"expect2\";\n say(\"then\");\n } else if (STATE === \"expect2\") {\n // next word is what var to run if so\n EXPECT[1] = word;\n STATE = \"expect3\";\n say(\"else\");\n } else if (STATE === \"expect3\") {\n // next word is what var to run if not\n EXPECT[2] = word;\n STATE = \"\";\n // run it\n (EXPECT[0] === STACK) ? VARS[EXPECT[1]].forEach(main_mode): VARS[EXPECT[2]].forEach(main_mode);\n // TODO do we want to reclear STATE when done?\n // STATE = \"\";\n } else if (STATE === \"append\") {\n // we're in append mode\n // are we appending an escape?\n if (word === \"escape\") {\n STATE = \"append-escape\";\n }\n STACK = Array.of(STACK).concat(word);\n } else if (word === \"escape\") {\n // non-escaped, non appended \"escape\"\n STATE = \"escape\"\n } else if (STATE === \"run\") {\n // run a block/var\n VARS[word].forEach(main_mode);\n // return value is now on stack\n STATE = \"\";\n } else if (word === \"end\") {\n // confirm then exit program\n MODE = finalization_mode;\n } else if (word === \"block\") {\n // enter block mode\n STATE = \"block\";\n } else if (word === \"as\") {\n // assignment mode\n STATE = \"as\";\n } else if (word === \"say\") {\n // speak mode\n STATE = \"say\";\n } else if (word === \"listen\") {\n // listen mode\n STATE = \"listen\";\n } else if (word === \"run\") {\n // run mode\n STATE = \"run\";\n } else if (word === \"append\") {\n // append mode\n STATE = \"append\";\n } else if (word === \"expect\") {\n STATE = \"expect\";\n } else {\n // it's a literal, put it on stack\n STACK = word;\n }\n}", "function currentPos(ele, mode, direction) {\n var pos = 0;\n direction || (direction = \"left\");\n if ([\"left\", \"top\"].indexOf(direction) === -1) return 0;\n if (mode === \"transition\" && ele.style.transform) {\n pos = ele.style.transform.match(/\\((-?\\d+)px\\)/i);\n return (pos && pos.length >= 2) ? parseInt(pos[1]) : 0;\n }\n if (mode === \"step\") {\n return parseInt(ele.style[direction] === \"\" ? 0 : ele.style[direction]);\n }\n return 0;\n }", "function getParamMode(operation, paramIndex) {\n // 3 and 2 are the offsets we need to get the first character (R to L) after \n // the opcode, subtract the paramIndex additionally to get future modes\n const start = operation.length - 3 - paramIndex;\n const end = operation.length - 2 - paramIndex;\n return parseInt(operation.slice(start, end) || '0');\n}", "function mode(vals) {\n vals = numbers(vals)\n if (vals.length === 0) return NaN\n var mode = NaN\n var dist = {}\n\n for (var i = 0; i < vals.length; i++) {\n var value = vals[i]\n var me = dist[value] || 0\n me++\n dist[value] = me\n }\n\n var rank = numbers(Object.keys(dist).sort(function sortMembers(a, b) { return dist[b] - dist[a] }))\n mode = rank[0]\n if (dist[rank[1]] == dist[mode]) {\n // multi-modal\n if (rank.length == vals.length) {\n // all values are modes\n return vals\n }\n var modes = new Set([mode])\n var modeCount = dist[mode]\n for (var i = 1; i < rank.length; i++) {\n if (dist[rank[i]] == modeCount) {\n modes.add(rank[i])\n }\n else {\n break\n }\n }\n return modes\n }\n return mode\n}", "sharedDepth(pos) {\n for (let depth = this.depth; depth > 0; depth--)\n if (this.start(depth) <= pos && this.end(depth) >= pos)\n return depth;\n return 0;\n }", "handleAppModeSwitch(mode) {\n this.setState(prevState => {\n if (prevState.mode === mode) {\n return null;\n } else {\n return { mode: mode };\n }\n });\n }", "function findFutureState($state, options) {\n if (options.name) {\n var nameComponents = options.name.split(/\\./);\n if (options.name.charAt(0) === '.')\n nameComponents[0] = $state.current.name;\n while (nameComponents.length) {\n var stateName = nameComponents.join(\".\");\n if ($state.get(stateName, { relative: $state.current }))\n return null; // State is already defined; nothing to do\n if (futureStates[stateName])\n return futureStates[stateName];\n nameComponents.pop();\n }\n }\n\n if (options.url) {\n var matches = [];\n for(var future in futureStates) {\n var matcher = futureStates[future].urlMatcher;\n if (matcher && matcher.exec(options.url)) {\n matches.push(futureStates[future]);\n }\n }\n // Find most specific by ignoring matching parents from matches\n var copy = matches.slice(0);\n for (var i = matches.length - 1; i >= 0; i--) {\n for (var j = 0; j < copy.length; j++) {\n if (matches[i] === copy[j].parentFutureState) matches.splice(i, 1);\n }\n }\n return matches[0];\n }\n }", "function findFutureState($state, options) {\n if (options.name) {\n var nameComponents = options.name.split(/\\./);\n if (options.name.charAt(0) === '.')\n nameComponents[0] = $state.current.name;\n while (nameComponents.length) {\n var stateName = nameComponents.join(\".\");\n if ($state.get(stateName, { relative: $state.current }))\n return null; // State is already defined; nothing to do\n if (futureStates[stateName])\n return futureStates[stateName];\n nameComponents.pop();\n }\n }\n\n if (options.url) {\n var matches = [];\n for(var future in futureStates) {\n var matcher = futureStates[future].urlMatcher;\n if (matcher && matcher.exec(options.url)) {\n matches.push(futureStates[future]);\n }\n }\n // Find most specific by ignoring matching parents from matches\n var copy = matches.slice(0);\n for (var i = matches.length - 1; i >= 0; i--) {\n for (var j = 0; j < copy.length; j++) {\n if (matches[i] === copy[j].parentFutureState) matches.splice(i, 1);\n }\n }\n return matches[0];\n }\n }", "function findMode(inputData){\n var arr= inputData.data;\n var length=arr.length;\n\n let mode=0;\n let count=1;\n let value=0, prev_val=0;\n let prev_count=0;\n let sorted=arr.sort();\n\n for(let i=0;i<length;i++){\n if(sorted[i]==sorted[i+1]){\n count++;\n value=sorted[i];\n }\n else{\n if(count>prev_count){\n prev_count=count;\n prev_val=value;\n }\n count=1;\n }\n }\n count>prev_count ? mode=value : mode=prev_val;\n\n return mode;\n}", "function enterMode(stream, state, mode, opt) {\n if (typeof mode === \"string\")\n mode = CodeMirror.getMode(cmCfg, mode);\n if (!mode || mode[\"name\"] === \"null\") {\n if ('endTag' in opt)\n mode = createDummyMode(opt.endTag);\n else\n mode = (typeof opt.fallbackMode === 'function') && opt.fallbackMode();\n if (!mode)\n throw new Error(\"no mode\");\n }\n state.hmdInnerExitChecker = ('endTag' in opt) ? createSimpleInnerModeExitChecker(opt.endTag) : opt.exitChecker;\n state.hmdInnerStyle = opt.style;\n state.hmdInnerMode = mode;\n state.hmdOverride = modeOverride;\n state.hmdInnerState = CodeMirror.startState(mode);\n var ans = opt.style || \"\";\n if (!opt.skipFirstToken) {\n ans += \" \" + mode.token(stream, state.hmdInnerState);\n }\n return ans.trim();\n }", "getCaseState(x, y) {\n // vérifie que les coordonnées sont dans la grille\n if (x.between(0, 7) && y.between(0, 7)) {\n return this.grid[y][x];\n }\n // sinon la case n'existe pas\n return false;\n }", "cursorAt(pos, side = 0, mode = 0) {\n let scope = CachedNode.get(this) || this.topNode;\n let cursor = new TreeCursor(scope);\n cursor.moveTo(pos, side);\n CachedNode.set(this, cursor._tree);\n return cursor;\n }", "function updateMode(mode) {\n\n // LOOP THROUGH MODES ARRAY AND SELECT/DESELECT AS NEEDED\n for (var i = 0; i < modes.length; i++) {\n // DOM ELEMENT FOR EACH MODE DISPLAY\n var d = document.getElementById(modes[i] + '-display');\n // DOM ELEMENT FOR EACH MODE BUTTON\n var l = document.getElementById(modes[i]);\n\n // LOOP THROUGH MODES TO FIND WHAT WAS SELECTED\n if (mode === modes[i]) {\n // FOR THE SELECTED MODE\n // TOGGLE CORRESPONDING DISPLAY TO DISPLAY\n d.classList.add('active-display');\n // ADD SELECTED CLASS\n l.classList.add('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'true');\n // SET AS ACTIVE\n activeMode = modes[i];\n } else {\n // FOR THE UNSELECTED MODES\n // HIDE THEIR DISPLAY\n d.classList.remove('active-display');\n // REMOVE SELECTED CLASS\n l.classList.remove('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'false');\n }\n }\n}", "function modeSwitch(mode) {\n\tresetViews();\n resetCameras();\n\tswitch(mode) {\n\t\tcase \"absolute\":\n\t\t\tupdateShipData(true);\n\t\t\tstepSize = 1; // reset step size\n\t\t\tcurrentMode = 1;\n\t\tbreak;\n\t\tcase \"relative\":\n\t\t\tupdateShipData(false);\n\t\t\tstepSize = Math.PI/64; // reset step size\n\t\t\tcurrentMode = 2;\n\t\tbreak;\n\t\tcase \"geosynchronous\":\n\t\t\tupdateShipData(false);\n\t\t\tcurrentPlanet = 3;\n\t\t\tcurrentMode = 3;\n\t\t\tupdateGeoSyncLookAt(earth, false);\n\t\tbreak;\n\t}\n}", "function selectMode(e){\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n\t\t\t\tif(mode != \"explore\"){\n\t\t\t\t\t$(\".explore\").hide();\n\t\t\t\t\t$(\".stats-table .charged, .stats-table .fast\").hide();\n\t\t\t\t\t$(\".stats-table .\"+mode).show();\n\t\t\t\t\t$(\".move-table-container\").show();\n\n\t\t\t\t\tself.displayMoves();\n\n\t\t\t\t} else{\n\t\t\t\t\t$(\".move-table-container\").hide();\n\t\t\t\t\t$(\".explore\").show();\n\t\t\t\t\t$(\".loading\").hide();\n\t\t\t\t}\n\n\t\t\t\tself.pushHistoryState(mode);\n\t\t\t}", "function setMode(e) {\n console.log(`current mode was: ${currentMode}`);\n currentMode = e.target.getAttribute('id');\n console.log(`current mode is now: ${currentMode}`);\n}", "function getMode(array) {\n if(array.length == 0)\n return null;\n var modeMap = {};\n var maxEl = array[0], maxCount = 1;\n for(var i = 0; i < array.length; i++) {\n var el = array[i];\n if(modeMap[el] == null)\n modeMap[el] = 1;\n else\n modeMap[el]++;\n if(modeMap[el] > maxCount) {\n maxEl = el;\n maxCount = modeMap[el];\n }\n }\n if(maxCount == 1) {\n return array[0];\n }\n return maxEl;\n}", "in_mode(state) {\n return this.state instanceof state;\n }", "function initMode(mode, index) {\n mode.addEventListener('click', (event) => onMode(event, index));\n}", "function parseMode (mode) {\n switch (mode) {\n case 'js':\n case 'javascript':\n mode = 'jsx'\n }\n let syntax = CodeMirror.findModeByName(mode)\n if (syntax == null) syntax = CodeMirror.findModeByName('Plain Text')\n return syntax\n}", "function mode(vals) {\n vals = numbers(vals)\n if (vals.length === 0) return NaN\n var mode = NaN\n var dist = {}\n vals.forEach(function (n) {\n var me = dist[n] || 0\n me++\n dist[n] = me\n })\n var rank = numbers(Object.keys(dist).sort(function (a, b) { return dist[b] - dist[a] }))\n mode = rank[0]\n if (dist[rank[1]] == dist[mode]) {\n // Multiple modes found, abort\n return NaN\n }\n return mode\n}", "isMode(mode) {\n return this.state.mode === mode;\n }", "function Context (state, mode, depth, prev) {\n this.state = state; this.mode = mode; this.depth = depth; this.prev = prev;\n}", "targetNodeMode() {\n this.setState(\n {\n entryNodeMode: false,\n targetNodeMode: true,\n wallMode: false,\n },\n function () {\n console.log('targetnodemode', this.state);\n }\n );\n }", "function getcurrstate() {\n if (modestate.curr[0] == 1) {\n prepaddreq();\n }\n else if (modestate.curr[1] == 1) {\n prepdisplayreq();\n }\n else if (modestate.curr[2] == 1) {\n return; //Relation mode not implemented in this version.\n }\n else {\n console.log(\"ERROR: getcurrstate()\");\n }\n}", "getStatePoint(stateX, stateY, radius, outsideX, outsideY) {\n let A = new Point(outsideX,outsideY);\n let B = new Point(stateX,stateY);\n\n let opposite = A.y-B.y;\n let adjacent = A.x-B.x;\n\n let theta = Math.atan(opposite/adjacent);\n\n let P = new Point(Math.cos(theta)*radius, Math.sin(theta)*radius)\n\n if(adjacent < 0) {\n P.x *= -1;\n P.y *= -1;\n }\n P.x += B.x;\n P.y += B.y;\n\n return P;\n }", "function search(state, character) {\n return TF[states.indexOf(state)][character.charCodeAt()];\n}", "getPosition(absState) {\n return absState % (this._w + 1);\n }", "function Context(state, mode, depth, prev) {\n this.state = state; this.mode = mode; this.depth = depth; this.prev = prev\n }", "function Context(state, mode, depth, prev) {\n this.state = state; this.mode = mode; this.depth = depth; this.prev = prev\n }", "function Context(state, mode, depth, prev) {\n this.state = state; this.mode = mode; this.depth = depth; this.prev = prev\n }", "function getEditMode() {\r\n var mode = $('#editTreeForm').find('input:checked').val();\r\n return mode;\r\n}", "function mode1_onclick(e) {\n var x = Math.floor((e.offsetX) / brickSize);\n var y = Math.floor((e.offsetY) / brickSize);\n\n if(!checkBounds(x, y)) return;\n\n if(selected) {\n var sx = selected.x;\n var sy = selected.y;\n if(adjacent(x, y, sx, sy)) {\n if((!bricks[x][y] || !bricks[x][y].set)) {\n swap(x, y, sx, sy);\n }\n selected = null;\n } else {\n selected = (x == sx && y == sy) ? null : {x: x, y: y};\n }\n } else if(bricks[x][y] && !bricks[x][y].set) {\n selected = {x: x, y: y};\n } else {\n selected = null;\n }\n}", "function get_rank2_mode(period, generator, size, numdown = 0) {\n let degrees = [];\n let modeOut = [];\n var interval;\n\n interval = generator * -numdown;\n for (var n = 0; n < size; n++) {\n while (interval < 0) {\n interval += period;\n }\n if (interval >= period) {\n interval %= period;\n }\n degrees.push(interval);\n interval += generator;\n }\n\n degrees.sort(function (a, b) {\n return a - b;\n });\n for (var n = 1; n < degrees.length; n++) {\n modeOut.push(degrees[n] - degrees[n - 1]);\n }\n\n modeOut.push(period - degrees[degrees.length - 1]);\n\n return modeOut;\n}", "get STATE_IDX() { return 0; }", "getPosition(gid, eid, findAlt){\n let container = document.querySelector(`${this.eCfg.selector} > svg`).getBoundingClientRect();\n let e = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}`).getBoundingClientRect();\n if (findAlt){\n let eAlt = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}-alt`)\n if (eAlt) eAlt = eAlt.getBoundingClientRect();\n if (eAlt) e = eAlt;\n }\n return {left:(e.left-container.left)+(e.width/2), top:(e.top-container.top)+(e.height/2)};\n }", "function getNeighbor(whence, dir) {\n if (whence < 0 || whence >= msize || dir < 0 || dir > 3) {\n alert(\"Internal argument error; dir: \" + dir + \"; whence: \" + whence);\n return -1;\n }\n\n //North\n if (dir == 0) {\n if (whence >= width) {\n return whence - width;\n } else {\n return -1;\n }\n }\n\n //South\n if (dir == 3) {\n if (whence + width < msize) {\n return whence + width;\n } else {\n return -1;\n }\n }\n\n //West\n if (dir == 2) {\n if (whence % width != 0) {\n return whence - 1;\n } else {\n return -1;\n }\n }\n\n //East\n if (dir == 1) {\n if ((whence + 1) % width != 0) {\n return whence + 1;\n } else {\n return -1;\n }\n }\n\n return -1;\n }", "function MeanMode(arr) {\n //Find mean\n var sum = 0;\n \n for (i=0; i< arr.length; i++) { //Loop sums up all the elements in the array\n sum = sum + arr[i];\n }\n \n var mean = sum / arr.length; //Loop then divides the sum by the number of elements to get the mean\n \n //Find mode\n \n var modeCount = [];\n \n for (i=0; i < arr.length; i++) { //Loop goes through the array, while another loop goes through the array\n modeCount[i] = -1; //Starts at -1 to factor in an element matching with itself\n for (j=0; j < arr.length; j++) {\n if (arr[i] === arr[j]) {\n modeCount[i]++; //If a match is made then the modeCount is increased by one\n }\n }\n }\n \n var largestCountNumber = 0;\n var indexOfLargest = 0;\n \n for (i=0; i < arr.length; i++) { //Loop goes through the modeCount array to find the index of the largest count\n if (largestCountNumber < modeCount[i]) {\n largestCountNumber = modeCount[i];\n indexOfLargest = i;\n }\n }\n \n if (largestCountNumber === 0) { //If the largest count is 0 then there is no mode, 0 is returned\n return 0\n }\n \n mode = arr[indexOfLargest]; //The mode is found by inputting the index of the largest count into the original array\n \n if (mean === mode) { //If the mean is equal to the mode then 1 is returned\n return 1\n }\n \n else { //Otherwise 0 is returned\n return 0\n }\n}", "function getModeById(mode_id, callback) {\n\tvar sql = \"select mode.name, alterations.* from mode join alterations on alterations.mode_id = mode.id where mode.id = $1;\";\n\t// bind parameters\n\tvar params = [mode_id];\n\t// log it\n\t// console.log(sql);\n\n\tpool.query(sql, params, function(error, db_results) {\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t} else {\n\t\t\t// log it\n\t\t\t// console.log(\"Back from DB with:\");\n\t\t\t// console.log(db_results);\n\t\t\t\n\t\t\tvar results = {\n\t\t\t\tkeyAlterations:db_results.rows\n\t\t\t};\n\t\t\tcallback(null, results);\n\t\t}\n\t});\n}", "function GetPath() : int {\n\t\tnumberOfHops = 0; \n\t\tvar ToMovePos : int; \n\t\tvar i : int = 0;\n\t\tfor(var a : int = 0; a < ClosedNodes.Length; a++){ \n\t\t\tif (ClosedNodes[a] != 0){ \n\t\t\t\ti++; \n\t\t\t\t//Debug.Log(parent_Closed[a]+\" \"+ClosedNodes[a]);\n\t\t\t\t } }\n\t\tvar match_name = targetLeaf;\n\t\tfor(var b : int = (i-1); b >= 0 ; b--){\n\t\t\tif (ClosedNodes[b] == match_name){\n\t\t\t\tnumberOfHops++;\n\t\t\t\t//Debug.Log(parent_Closed[b]);\n\t\t\t\tmatch_name = parent_Closed[b];\n\t\t\t\tif (match_name == frogLeaf ){\n\t\t\t\t\tToMovePos = ClosedNodes[b];\n\t\t\t\t\tb = -20;\n\t\t\t\t\t//Debug.Log(\"ToMovePos \"+ToMovePos);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ToMovePos;\n\t}", "function whatModeIsSelected() {\n\tvar option;\n\t$(\".mode\").each(function() {\t\t\n\t\tif($(this).hasClass(\"selected\")) {\n\t\t\toption = $(this).text();\n\t\t}\t\t\t\t\t\n\t});\n\treturn option;\t\t\n}", "findInBlock(n, b) {\n // Find the block\n let ib = Math.floor(b/B);\n let jb = b%B;\n let m=new Array();\n for (let i=ib*B; i<ib*B+B; i++) {\n for (let j=jb*B; j<jb*B+B; j++) {\n if (this.state[i][j] == X && this.options[i][j].indexOf(n) > -1) {\n m.push({i,j});\n }\n }\n }\n return m;\n }", "nextState(x, y) {\n let neighbors = this.liveNeighbors(x, y)\n let cellStatus = this.getCell(x, y)\n\n if(cellStatus == ALIVE) {\n if(neighbors != 2 && neighbors != 3) {\n return DEAD\n }\n return ALIVE\n }\n else {\n if(neighbors == 3){\n return ALIVE\n }\n return DEAD\n }\n }", "getDiff(start, end, mode) {\n\t\treturn end.diff(start, mode);\n\t}", "handleClick (event) {\n let mode = this.state.mode;\n \n // #1\n if (mode === \"paint\") {\n this.paint(event);\n }\n // #2\n else if (mode === \"erase\") {\n\n }\n // #3\n else if (mode === \"fill\") {\n \n }\n // #4\n else if (mode === \"mirror\") {\n \n }\n }", "function createModeMethods(pcdTool) {\n const modeMethods = {\n 'edit': {\n prevHover: null,\n mode: null,\n startParam: null,\n animate: function () {\n if (pcdTool._cameraControls.enabled) {\n pcdTool.redrawRequest();\n pcdTool._cameraControls.update();\n }\n },\n mouseDown: function (e) {\n // Enable orbit control\n pcdTool._cameraControls.enabled = true;\n\n let pos = pcdTool.getIntersectPos(e);\n if (this.prevHover !== null && this.prevHover.type === 'top') {\n pos = pcdTool.getZPos(e, this.prevHover.bbox.box.pos);\n }\n\n // Move the selected box\n if (pos != null && this.prevHover !== null) {\n // Disable orbit control\n pcdTool._cameraControls.enabled = false;\n\n this.mode = 'move';\n const startParam = {\n size: this.prevHover.bbox.box.size.clone(),\n pos: this.prevHover.bbox.box.pos.clone(),\n yaw: this.prevHover.bbox.box.yaw,\n mouse: pos.clone()\n };\n if (this.prevHover.type === 'edge') {\n pcdTool.setMouseType('grabbing');\n const p = startParam.pos,\n s = startParam.size;\n const sign = new THREE.Vector2(\n ...[\n [1, 1],\n [-1, 1],\n [1, -1],\n [-1, -1]\n ][this.prevHover.idx]\n );\n const diag = new THREE.Vector2(s.x, s.y)\n .multiply(sign)\n .rotateAround(ZERO2, startParam.yaw);\n startParam.fix = new THREE.Vector2(\n p.x - diag.x / 2,\n p.y - diag.y / 2\n );\n startParam.diag = diag;\n startParam.diagYaw = Math.atan2(diag.y, diag.x);\n }\n this.startParam = startParam;\n pcdTool._modeStatus.busy = true;\n pcdTool.props.controls.selectLabel(this.prevHover.bbox.label);\n this.prevHover.bbox.label.createHistory();\n return;\n }\n\n // Select a box or create a new box\n if (pos != null) {\n if (pcdTool.props.controls.state.isCreationKeyPressed) {\n // Disable orbit control\n pcdTool._cameraControls.enabled = false;\n\n pcdTool._creatingBBox.startPos = pos;\n pcdTool._modeStatus.busy = true;\n this.mode = 'create';\n }\n pcdTool.props.controls.selectLabel(null);\n return;\n }\n this.mode = null;\n },\n resetHoverObj: function () {\n pcdTool._editFaceCube.visible = false;\n },\n setHoverObjZ: function (bbox, normal) {\n const cube = pcdTool._editFaceCube;\n const yaw = bbox.box.yaw;\n const size = bbox.box.size;\n const w = EDIT_OBJ_SIZE;\n cube.rotation.set(0, 0, yaw);\n const p = bbox.box.pos;\n cube.position.set(\n p.x,\n p.y,\n p.z + normal.z * (bbox.box.size.z + w) / 2\n );\n cube.scale.set(size.x, size.y, w);\n cube.visible = true;\n pcdTool.redrawRequest();\n },\n setHoverObj: function (bbox, normal) {\n const cube = pcdTool._editFaceCube;\n const yaw = bbox.box.yaw;\n const size = bbox.box.size;\n // set rotation\n cube.rotation.set(\n 0, //normal.y*Math.PI/2,\n 0, //normal.x*Math.PI/2,\n yaw\n );\n const w = EDIT_OBJ_SIZE;\n const cubeOffset = new THREE.Vector3(\n normal.x * w / 2,\n normal.y * w / 2,\n 0\n );\n const cubeSize = new THREE.Vector3(\n normal.x ? w : size.x,\n normal.y ? w : size.y,\n size.z\n );\n // set pos\n const p = bbox.box.pos.clone()\n .add(\n bbox.box.size.clone()\n .multiply(normal)\n .divideScalar(2)\n .add(cubeOffset)\n .applyAxisAngle(AXES[2], yaw)\n );\n cube.position.set(p.x, p.y, p.z);\n // set pos\n /*\n const nn = normal.clone().multiply(normal);\n const width = (new THREE.Vector3(size.z, size.x, size.x))\n .dot(nn),\n height= (new THREE.Vector3(size.y, size.z, size.y))\n .dot(nn);\n plane.scale.set(width, height, 1);\n */\n cube.scale.set(\n cubeSize.x,\n cubeSize.y,\n cubeSize.z\n );\n // set status\n cube.visible = true;\n pcdTool.redrawRequest();\n },\n resetHover: function () {\n this.resetHoverObj();\n if (this.prevHover == null) {\n return;\n }\n const bbox = this.prevHover.bbox;\n bbox.hover(false);\n pcdTool.redrawRequest();\n this.prevHover = null;\n },\n EDGE_NORMALS: [\n new THREE.Vector3(1, 1, 0),\n new THREE.Vector3(-1, 1, 0),\n new THREE.Vector3(1, -1, 0),\n new THREE.Vector3(-1, -1, 0),\n ],\n mouseMoveEdgeIntersectCheck: function (ray) {\n const bboxes = Array.from(pcdTool.pcdBBoxes);\n for (let i = 0; i < bboxes.length; ++i) {\n const bbox = bboxes[i];\n for (let j = 0; j < 4; ++j) {\n const edge = bbox.cube.edges[j];\n const intersectPos = ray.intersectObject(edge);\n if (intersectPos.length > 0) {\n if (this.prevHover &&\n this.prevHover.type === 'edge' &&\n this.prevHover.bbox === bbox &&\n this.prevHover.idx === j) {\n return true;\n }\n this.resetHover();\n pcdTool.setMouseType('grab');\n const normal = this.EDGE_NORMALS[j];\n this.setHoverObj(bbox, normal);\n this.prevHover = {\n type: 'edge',\n bbox: bbox,\n idx: j\n };\n pcdTool.redrawRequest();\n return true;\n }\n }\n }\n return false;\n },\n CORNER_NORMALS: [\n new THREE.Vector3(1, 0, 0),\n new THREE.Vector3(0, 1, 0),\n new THREE.Vector3(-1, 0, 0),\n new THREE.Vector3(0, -1, 0),\n ],\n TOP_NORMALS: [\n new THREE.Vector3(0, 0, 1),\n new THREE.Vector3(0, 0, -1),\n ],\n mouseMoveCornerIntersectCheck: function (ray) {\n const bboxes = Array.from(pcdTool.pcdBBoxes);\n for (let i = 0; i < bboxes.length; ++i) {\n const bbox = bboxes[i];\n for (let j = 0; j < 4; ++j) {\n const corner = bbox.cube.corners[j];\n const intersectPos = ray.intersectObject(corner);\n if (intersectPos.length > 0) {\n if (this.prevHover &&\n this.prevHover.type === 'corner' &&\n this.prevHover.bbox === bbox &&\n this.prevHover.idx === j) {\n return true;\n }\n this.resetHover();\n pcdTool.setMouseType('ew-resize');\n const normal = this.CORNER_NORMALS[j];\n this.setHoverObj(bbox, normal);\n this.prevHover = {\n type: 'corner',\n bbox: bbox,\n idx: j\n };\n pcdTool.redrawRequest();\n return true;\n }\n }\n }\n return false;\n },\n mouseMoveTopIntersectCheck: function (ray) {\n const bboxes = Array.from(pcdTool.pcdBBoxes);\n for (let i = 0; i < bboxes.length; ++i) {\n const bbox = bboxes[i];\n for (let j = 0; j < 2; ++j) {\n const corner = bbox.cube.zFace[j];\n const intersectPos = ray.intersectObject(corner);\n if (intersectPos.length > 0) {\n if (this.prevHover &&\n this.prevHover.type === 'top' &&\n this.prevHover.bbox === bbox &&\n this.prevHover.idx === j) {\n return true;\n }\n this.resetHover();\n pcdTool.setMouseType('ns-resize');\n const normal = this.TOP_NORMALS[j];\n this.setHoverObjZ(bbox, normal);\n this.prevHover = {\n type: 'top',\n bbox: bbox,\n idx: j\n };\n pcdTool.redrawRequest();\n return true;\n }\n }\n }\n return false;\n },\n mouseMoveIntersectCheck: function (ray) {\n const bboxes = Array.from(pcdTool.pcdBBoxes);\n for (let i = 0; i < bboxes.length; ++i) {\n const bbox = bboxes[i];\n const intersectPos = ray.intersectObject(bbox.cube.mesh);\n if (intersectPos.length > 0) {\n if (this.prevHover &&\n this.prevHover.type === 'box' &&\n this.prevHover.bbox === bbox) {\n return true;\n }\n this.resetHover();\n bbox.hover(true);\n pcdTool.setMouseType('all-scroll');\n this.prevHover = {\n type: 'box',\n bbox: bbox\n };\n pcdTool.redrawRequest();\n return true;\n }\n }\n return false;\n },\n // resize and rotate\n mouseMoveRotateResize: function (bbox, prev, dx, dy) {\n const dp = new THREE.Vector2(dx, dy).add(prev.diag);\n const yaw = Math.atan2(dp.y, dp.x) - prev.diagYaw + prev.yaw;\n let size = dp.clone().rotateAround(ZERO2, -yaw);\n size.x = Math.abs(size.x);\n size.y = Math.abs(size.y);\n size = bbox.setSize2(size.x, size.y);\n const dpLen = dp.length();\n const pos = dp.multiplyScalar(size.length())\n .divideScalar(dpLen * 2).add(prev.fix);\n bbox.box.pos.set(pos.x, pos.y, bbox.box.pos.z);\n bbox.box.yaw = yaw;\n },\n // resize one side size\n mouseMoveResizeXP: function (bbox, prev, dx, dy) {\n const prevSize = prev.size;\n const dsize = bbox.setSize2d(prevSize.x + dx, prevSize.y)\n .divideScalar(2);\n bbox.box.pos.add(new THREE.Vector3(dsize.x, dsize.y, 0));\n },\n mouseMoveResizeXN: function (bbox, prev, dx, dy) {\n const prevSize = prev.size;\n const dsize = bbox.setSize2d(prevSize.x - dx, prevSize.y)\n .divideScalar(2);\n bbox.box.pos.sub(new THREE.Vector3(dsize.x, dsize.y, 0));\n },\n mouseMoveResizeYP: function (bbox, prev, dx, dy) {\n const prevSize = prev.size;\n const dsize = bbox.setSize2d(prevSize.x, prevSize.y + dy)\n .divideScalar(2);\n bbox.box.pos.add(new THREE.Vector3(dsize.x, dsize.y, 0));\n },\n mouseMoveResizeYN: function (bbox, prev, dx, dy) {\n const prevSize = prev.size;\n const dsize = bbox.setSize2d(prevSize.x, prevSize.y - dy)\n .divideScalar(2);\n bbox.box.pos.sub(new THREE.Vector3(dsize.x, dsize.y, 0));\n },\n // resize z size\n mouseMoveResizeZP: function (bbox, prev, dz) {\n const prevSize = prev.size;\n const dsize = bbox.setSizeZ(prevSize.z + dz) / 2;\n bbox.box.pos.add(new THREE.Vector3(0, 0, dsize));\n },\n mouseMoveResizeZN: function (bbox, prev, dz) {\n const prevSize = prev.size;\n const dsize = bbox.setSizeZ(prevSize.z - dz) / 2;\n bbox.box.pos.sub(new THREE.Vector3(0, 0, dsize));\n },\n mouseMove: function (e) {\n if (this.mode === 'move') {\n const bbox = this.prevHover.bbox;\n const prev = this.startParam;\n\n const pos = this.prevHover.type !== 'top'\n ? pcdTool.getIntersectPos(e)\n : pcdTool.getZPos(e, prev.pos);\n if (pos == null) {\n return;\n }\n const dx = pos.x - prev.mouse.x;\n const dy = pos.y - prev.mouse.y;\n const dz = pos.z - prev.mouse.z;\n\n if (this.prevHover.type === 'box') {\n bbox.box.pos.set(prev.pos.x + dx, prev.pos.y + dy, prev.pos.z);\n } else if (this.prevHover.type === 'edge') {\n this.mouseMoveRotateResize(bbox, prev, dx, dy);\n\n const idx = this.prevHover.idx;\n const normal = this.EDGE_NORMALS[idx];\n this.setHoverObj(bbox, normal);\n } else if (this.prevHover.type === 'corner') {\n const yaw = bbox.box.yaw;\n let dp = new THREE.Vector2(dx, dy);\n dp = dp.rotateAround(ZERO2, -yaw);\n const idx = this.prevHover.idx;\n [\n this.mouseMoveResizeXP,\n this.mouseMoveResizeYP,\n this.mouseMoveResizeXN,\n this.mouseMoveResizeYN\n ][idx](bbox, prev, dp.x, dp.y);\n\n const normal = this.CORNER_NORMALS[idx];\n this.setHoverObj(bbox, normal);\n } else if (this.prevHover.type === 'top') {\n const idx = this.prevHover.idx;\n [\n this.mouseMoveResizeZP,\n this.mouseMoveResizeZN\n ][idx](bbox, prev, dz);\n\n const normal = this.TOP_NORMALS[idx];\n this.setHoverObjZ(bbox, normal);\n }\n bbox.updateCube(true);\n pcdTool.redrawRequest();\n return;\n }\n\n if (pcdTool._creatingBBox.startPos != null) {\n this.resetHover();\n const pos = pcdTool.getIntersectPos(e);\n if (pos == null) {\n return;\n }\n const bbox = pcdTool._creatingBBox;\n bbox.endPos = pos;\n const dist = bbox.endPos.distanceTo(bbox.startPos);\n if (bbox.box == null && dist > 0.01) {\n bbox.box = new BoxFrameObject();\n bbox.box.addTo(pcdTool._scene);\n bbox.box.setColor('#fff');\n }\n if (bbox.box != null) {\n pcdTool.creatingBoxUpdate();\n pcdTool.redrawRequest();\n }\n return;\n }\n\n const ray = pcdTool.getRay(e);\n if (this.mouseMoveIntersectCheck(ray)) {\n return;\n }\n if (pcdTool._camera.rotation.x < Math.PI / 180 * 45) {\n if (this.mouseMoveCornerIntersectCheck(ray)) {\n return;\n }\n } else {\n if (this.mouseMoveTopIntersectCheck(ray)) {\n return;\n }\n }\n if (this.mouseMoveEdgeIntersectCheck(ray)) {\n return;\n }\n this.resetHover();\n pcdTool.resetMouseType();\n },\n mouseUp: function (e) {\n const mode = this.mode;\n this.mode = null;\n\n // Enable orbit control\n pcdTool._cameraControls.enabled = true;\n\n if (mode === 'move') {\n const box = this.prevHover.bbox.box;\n if (!this.startParam.size.equals(box.size) ||\n !this.startParam.pos.equals(box.pos) ||\n this.startParam.yaw !== box.yaw) {\n this.prevHover.bbox.label.addHistory();\n }\n }\n if (mode === 'create') {\n const bbox = pcdTool._creatingBBox;\n if (bbox.box == null) {\n if (bbox.startPos != null) {\n bbox.startPos = null;\n bbox.endPos = null;\n }\n return;\n }\n const pos = pcdTool.getIntersectPos(e);\n if (pos != null) {\n bbox.endPos = pos;\n }\n pcdTool.creatingBoxUpdate();\n const boxPos = bbox.box.getPos();\n const boxSize = bbox.box.getSize();\n const boxYaw = bbox.box.getYaw();\n const pcdBBox = new PCDBBox(pcdTool, {\n 'x_3d': boxPos.x,\n 'y_3d': boxPos.y,\n 'z_3d': -0.5,\n 'width_3d': boxSize.x,\n 'height_3d': boxSize.y,\n 'length_3d': boxSize.z,\n 'rotation_y': boxYaw,\n });\n // TODO: add branch use selecting label\n const label = pcdTool.props.controls.createLabel(\n pcdTool.props.controls.getTargetKlass(),\n {[pcdTool.candidateId]: pcdBBox}\n );\n bbox.box.removeFrom(pcdTool._scene);\n pcdTool.redrawRequest();\n bbox.startPos = null;\n bbox.endPos = null;\n bbox.box = null;\n }\n },\n changeFrom: function () {\n pcdTool._cameraControls.enabled = false;\n },\n changeTo: function () {\n pcdTool._cameraControls.enabled = true;\n //pcdTool._main.css('cursor', 'crosshair');\n },\n },\n 'view': {\n animate: function () {\n pcdTool.redrawRequest();\n pcdTool._cameraControls.update();\n },\n mouseDown: function (e) {\n pcdTool._modeStatus.busy = true;\n },\n mouseMove: function (e) {\n },\n mouseUp: function (e) {\n },\n changeFrom: function () {\n pcdTool._cameraControls.enabled = false;\n },\n changeTo: function () {\n pcdTool._cameraControls.enabled = true;\n //pcdTool._main.css('cursor', 'all-scroll');\n },\n },\n };\n return modeMethods;\n}", "function stateIndex(X) {\n for (let i = 0; i < newState.length; i++) {\n if (newState[i].includes(X))\n return i;\n }\n}", "cursor(mode = 0) {\n return new TreeCursor(this.topNode, mode);\n }", "function getStateFromUi() {\n \n var state = {\n tab: getSelectedTab(),\n selectedPeriodOffset: getSelectedPeriodOffset(),\n selectedGroup: getSelectedGroup(),\n selectedIndividual: getSelectedIndividual()\n };\n \n if(state.selectedIndividual !== null) {\n state.mode = MODE.INDIVIDUAL;\n } else if(state.selectedIndividual === null && state.selectedGroup !== null) {\n state.mode = MODE.GROUP;\n } else {\n state.mode = MODE.FLEET;\n }\n \n return state;\n }", "function findMode(arr){\n let arrangedNums = frequencyCounter(arr);\n\n\n let count = 0;\n let mode;\n\n for(let key in arrangedNums){\n if(arrangedNums[key] > count){\n mode = key;\n count = arrangedNums[key];\n }\n }\n\n return +mode;\n}", "handleSquareSelection(position) {\n this.setState((prevState) => {\n let { knightPosition } = prevState;\n if (!knightPosition) {\n knightPosition = position;\n }\n return { knightPosition };\n });\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n if (curStart < stream.pos) f(stream.pos, curStyle);\n }" ]
[ "0.7568602", "0.7568602", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.75572", "0.7552965", "0.74676317", "0.74232215", "0.59458613", "0.56859607", "0.53475493", "0.5253744", "0.49546236", "0.4879175", "0.48647127", "0.48453856", "0.47705847", "0.47429553", "0.47152835", "0.469045", "0.46865764", "0.4678733", "0.46786255", "0.46785644", "0.4665554", "0.46318713", "0.46052688", "0.45970374", "0.45963013", "0.45645028", "0.45632464", "0.45632464", "0.45536193", "0.45507878", "0.4544229", "0.45349196", "0.4531789", "0.45268476", "0.45265487", "0.45263582", "0.45168868", "0.4515438", "0.4496161", "0.44845882", "0.44786495", "0.44596988", "0.44434667", "0.44403595", "0.44342065", "0.44307655", "0.44292766", "0.4423754", "0.4418904", "0.4418904", "0.4418904", "0.44130045", "0.44114596", "0.44108284", "0.4403691", "0.43969375", "0.4385184", "0.43849546", "0.43818155", "0.43810907", "0.43805125", "0.43804914", "0.43685603", "0.43583143", "0.4355619", "0.43417457", "0.4336784", "0.43217516", "0.4317735", "0.43147862", "0.43083954", "0.43040296" ]
0.75678235
13
Compute a style array (an array starting with a mode generation for invalidation followed by pairs of end positions and style strings), which is used to highlight the tokens on the line.
function highlightLine(cm, line, context, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). var st = [cm.state.modeGen], lineClasses = {}; // Compute the base array of styles runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, lineClasses, forceToEnd); var state = context.state; // Run overlays, adjust style array. var loop = function ( o ) { context.baseTokens = st; var overlay = cm.state.overlays[o], i = 1, at = 0; context.state = true; runMode(cm, line.text, overlay.mode, context, function (end, style) { var start = i; // Ensure there's a token end at the current position, and that i points at it while (at < end) { var i_end = st[i]; if (i_end > end) { st.splice(i, 1, end, st[i+1], i_end); } i += 2; at = Math.min(end, i_end); } if (!style) { return } if (overlay.opaque) { st.splice(start, i - start, end, "overlay " + style); i = start + 2; } else { for (; start < i; start += 2) { var cur = st[start+1]; st[start+1] = (cur ? cur + " " : "") + "overlay " + style; } } }, lineClasses); context.state = state; context.baseTokens = null; context.baseTokenPos = 1; }; for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStyleArrayForBlock(block) {\n var text = block.text,\n inlineStyleRanges = block.inlineStyleRanges;\n\n var inlineStyles = {\n BOLD: new Array(text.length),\n ITALIC: new Array(text.length),\n UNDERLINE: new Array(text.length),\n STRIKETHROUGH: new Array(text.length),\n CODE: new Array(text.length),\n SUPERSCRIPT: new Array(text.length),\n SUBSCRIPT: new Array(text.length),\n COLOR: new Array(text.length),\n BGCOLOR: new Array(text.length),\n FONTSIZE: new Array(text.length),\n FONTFAMILY: new Array(text.length),\n length: text.length\n };\n if (inlineStyleRanges && inlineStyleRanges.length > 0) {\n inlineStyleRanges.forEach(function (range) {\n var offset = range.offset;\n\n var length = offset + range.length;\n for (var i = offset; i < length; i += 1) {\n if (range.style.indexOf('color-') === 0) {\n inlineStyles.COLOR[i] = range.style.substring(6);\n } else if (range.style.indexOf('bgcolor-') === 0) {\n inlineStyles.BGCOLOR[i] = range.style.substring(8);\n } else if (range.style.indexOf('fontsize-') === 0) {\n inlineStyles.FONTSIZE[i] = range.style.substring(9);\n } else if (range.style.indexOf('fontfamily-') === 0) {\n inlineStyles.FONTFAMILY[i] = range.style.substring(11);\n } else if (inlineStyles[range.style]) {\n inlineStyles[range.style][i] = true;\n }\n }\n });\n }\n return inlineStyles;\n}", "function parseStyle(text) {\n\tconst result = [];\n\tlet start = 0;\n\tlet position = 0;\n\n\t// At any given time, these carry style information since last time a styling\n\t// control code was met.\n\tlet colorCodes, bold, textColor, bgColor, hexColor, hexBgColor, italic, underline, strikethrough, monospace;\n\n\tconst resetStyle = () => {\n\t\tbold = false;\n\t\ttextColor = undefined;\n\t\tbgColor = undefined;\n\t\thexColor = undefined;\n\t\thexBgColor = undefined;\n\t\titalic = false;\n\t\tunderline = false;\n\t\tstrikethrough = false;\n\t\tmonospace = false;\n\t};\n\n\tresetStyle();\n\n\t// When called, this \"closes\" the current fragment by adding an entry to the\n\t// `result` array using the styling information set last time a control code\n\t// was met.\n\tconst emitFragment = () => {\n\t\t// Uses the text fragment starting from the last control code position up to\n\t\t// the current position\n\t\tconst textPart = text.slice(start, position);\n\n\t\t// Filters out all non-style related control codes present in this text\n\t\tconst processedText = textPart.replace(controlCodesRx, \"\");\n\n\t\tif (processedText.length) {\n\t\t\t// Current fragment starts where the previous one ends, or at 0 if none\n\t\t\tconst fragmentStart = result.length ? result[result.length - 1].end : 0;\n\n\t\t\tresult.push({\n\t\t\t\tbold,\n\t\t\t\ttextColor,\n\t\t\t\tbgColor,\n\t\t\t\thexColor,\n\t\t\t\thexBgColor,\n\t\t\t\titalic,\n\t\t\t\tunderline,\n\t\t\t\tstrikethrough,\n\t\t\t\tmonospace,\n\t\t\t\ttext: processedText,\n\t\t\t\tstart: fragmentStart,\n\t\t\t\tend: fragmentStart + processedText.length,\n\t\t\t});\n\t\t}\n\n\t\t// Now that a fragment has been \"closed\", the next one will start after that\n\t\tstart = position + 1;\n\t};\n\n\t// This loop goes through each character of the given text one by one by\n\t// bumping the `position` cursor. Every time a new special \"styling\" character\n\t// is met, an object gets created (with `emitFragment()`)information on text\n\t// encountered since the previous styling character.\n\twhile (position < text.length) {\n\t\tswitch (text[position]) {\n\t\tcase RESET:\n\t\t\temitFragment();\n\t\t\tresetStyle();\n\t\t\tbreak;\n\n\t\t// Meeting a BOLD character means that the ongoing text is either going to\n\t\t// be in bold or that the previous one was in bold and the following one\n\t\t// must be reset.\n\t\t// This same behavior applies to COLOR, REVERSE, ITALIC, and UNDERLINE.\n\t\tcase BOLD:\n\t\t\temitFragment();\n\t\t\tbold = !bold;\n\t\t\tbreak;\n\n\t\tcase COLOR:\n\t\t\temitFragment();\n\n\t\t\t// Go one step further to find the corresponding color\n\t\t\tcolorCodes = text.slice(position + 1).match(colorRx);\n\n\t\t\tif (colorCodes) {\n\t\t\t\ttextColor = Number(colorCodes[1]);\n\n\t\t\t\tif (colorCodes[2]) {\n\t\t\t\t\tbgColor = Number(colorCodes[2]);\n\t\t\t\t}\n\n\t\t\t\t// Color code length is > 1, so bump the current position cursor by as\n\t\t\t\t// much (and reset the start cursor for the current text block as well)\n\t\t\t\tposition += colorCodes[0].length;\n\t\t\t\tstart = position + 1;\n\t\t\t} else {\n\t\t\t\t// If no color codes were found, toggles back to no colors (like BOLD).\n\t\t\t\ttextColor = undefined;\n\t\t\t\tbgColor = undefined;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase HEX_COLOR:\n\t\t\temitFragment();\n\n\t\t\tcolorCodes = text.slice(position + 1).match(hexColorRx);\n\n\t\t\tif (colorCodes) {\n\t\t\t\thexColor = colorCodes[1].toUpperCase();\n\n\t\t\t\tif (colorCodes[2]) {\n\t\t\t\t\thexBgColor = colorCodes[2].toUpperCase();\n\t\t\t\t}\n\n\t\t\t\t// Color code length is > 1, so bump the current position cursor by as\n\t\t\t\t// much (and reset the start cursor for the current text block as well)\n\t\t\t\tposition += colorCodes[0].length;\n\t\t\t\tstart = position + 1;\n\t\t\t} else {\n\t\t\t\t// If no color codes were found, toggles back to no colors (like BOLD).\n\t\t\t\thexColor = undefined;\n\t\t\t\thexBgColor = undefined;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase REVERSE: {\n\t\t\temitFragment();\n\t\t\tconst tmp = bgColor;\n\t\t\tbgColor = textColor;\n\t\t\ttextColor = tmp;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase ITALIC:\n\t\t\temitFragment();\n\t\t\titalic = !italic;\n\t\t\tbreak;\n\n\t\tcase UNDERLINE:\n\t\t\temitFragment();\n\t\t\tunderline = !underline;\n\t\t\tbreak;\n\n\t\tcase STRIKETHROUGH:\n\t\t\temitFragment();\n\t\t\tstrikethrough = !strikethrough;\n\t\t\tbreak;\n\n\t\tcase MONOSPACE:\n\t\t\temitFragment();\n\t\t\tmonospace = !monospace;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Evaluate the next character at the next iteration\n\t\tposition += 1;\n\t}\n\n\t// The entire text has been parsed, so we finalize the current text fragment.\n\temitFragment();\n\n\treturn result;\n}", "getStyle(){\r\n if (this.style === 'DOTTED') return [2,5]\r\n return []\r\n }", "static get styles() { return []; }", "static getStyleAsArray(feature) {\n const styles = feature.getStyleFunction()();\n return Array.isArray(styles) ? styles : [styles];\n }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\t\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\t\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, state, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\r\n st.push(end, style);\r\n }, lineClasses, forceToEnd);\r\n\r\n // Run overlays, adjust style array.\r\n for (var o = 0; o < cm.state.overlays.length; ++o) {\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n st.splice(i, 1, end, st[i+1], i_end);\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) return;\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"cm-overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n }\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\r\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen],\n lineClasses = {}; // Compute the base array of styles\n\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) {\n return st.push(end, style);\n }, lineClasses, forceToEnd);\n var state = context.state; // Run overlays, adjust style array.\n\n var loop = function loop(o) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o],\n i = 1,\n at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i; // Ensure there's a token end at the current position, and that i points at it\n\n while (at < end) {\n var i_end = st[i];\n\n if (i_end > end) {\n st.splice(i, 1, end, st[i + 1], i_end);\n }\n\n i += 2;\n at = Math.min(end, i_end);\n }\n\n if (!style) {\n return;\n }\n\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start + 1];\n st[start + 1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n loop(o);\n }\n\n return {\n styles: st,\n classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null\n };\n }", "function tokenizeWithTheme(theme, colorMap, fileContents, grammar, options) {\r\n let lines = fileContents.split(/\\r\\n|\\r|\\n/);\r\n let ruleStack = main.exports.INITIAL;\r\n let actual = [];\r\n let final = [];\r\n for (let i = 0, len = lines.length; i < len; i++) {\r\n let line = lines[i];\r\n if (line === '') {\r\n actual = [];\r\n final.push([]);\r\n continue;\r\n }\r\n let resultWithScopes;\r\n let tokensWithScopes;\r\n let tokensWithScopesIndex;\r\n if (options.includeExplanation) {\r\n resultWithScopes = grammar.tokenizeLine(line, ruleStack);\r\n tokensWithScopes = resultWithScopes.tokens;\r\n tokensWithScopesIndex = 0;\r\n }\r\n let result = grammar.tokenizeLine2(line, ruleStack);\r\n let tokensLength = result.tokens.length / 2;\r\n for (let j = 0; j < tokensLength; j++) {\r\n let startIndex = result.tokens[2 * j];\r\n let nextStartIndex = j + 1 < tokensLength ? result.tokens[2 * j + 2] : line.length;\r\n if (startIndex === nextStartIndex) {\r\n continue;\r\n }\r\n let metadata = result.tokens[2 * j + 1];\r\n let foreground = StackElementMetadata.getForeground(metadata);\r\n let foregroundColor = colorMap[foreground];\r\n let fontStyle = StackElementMetadata.getFontStyle(metadata);\r\n let explanation = [];\r\n if (options.includeExplanation) {\r\n let offset = 0;\r\n while (startIndex + offset < nextStartIndex) {\r\n let tokenWithScopes = tokensWithScopes[tokensWithScopesIndex];\r\n let tokenWithScopesText = line.substring(tokenWithScopes.startIndex, tokenWithScopes.endIndex);\r\n offset += tokenWithScopesText.length;\r\n explanation.push({\r\n content: tokenWithScopesText,\r\n scopes: explainThemeScopes(theme, tokenWithScopes.scopes)\r\n });\r\n tokensWithScopesIndex++;\r\n }\r\n }\r\n actual.push({\r\n content: line.substring(startIndex, nextStartIndex),\r\n color: foregroundColor,\r\n fontStyle,\r\n explanation: explanation\r\n });\r\n }\r\n final.push(actual);\r\n actual = [];\r\n ruleStack = result.ruleStack;\r\n }\r\n return final;\r\n}", "function highlightLine(cm, line, state, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t\t st.push(end, style);\n\t\t }, lineClasses, forceToEnd);\n\t\t\n\t\t // Run overlays, adjust style array.\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t st.splice(i, 1, end, st[i+1], i_end);\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) return;\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t }\n\t\t\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t\t }", "readStyles(styles) {\n let add = Mark$1.none, remove = Mark$1.none;\n style:\n for (let i = 0; i < styles.length; i += 2) {\n for (let after = void 0; ; ) {\n let rule = this.parser.matchStyle(styles[i], styles[i + 1], this, after);\n if (!rule)\n continue style;\n if (rule.ignore)\n return null;\n if (rule.clearMark) {\n this.top.pendingMarks.forEach((m) => {\n if (rule.clearMark(m))\n remove = m.addToSet(remove);\n });\n } else {\n add = this.parser.schema.marks[rule.mark].create(rule.attrs).addToSet(add);\n }\n if (rule.consuming === false)\n after = rule;\n else\n break;\n }\n }\n return [add, remove];\n }", "function highlightLine(cm, line, context, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n\t\t lineClasses, forceToEnd);\n\t\t var state = context.state;\n\n\t\t // Run overlays, adjust style array.\n\t\t var loop = function ( o ) {\n\t\t context.baseTokens = st;\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t context.state = true;\n\t\t runMode(cm, line.text, overlay.mode, context, function (end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t { st.splice(i, 1, end, st[i+1], i_end); }\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) { return }\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t context.state = state;\n\t\t context.baseTokens = null;\n\t\t context.baseTokenPos = 1;\n\t\t };\n\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n\t\t }", "function processTokens( tokens, style ) {\n var\n drawOps = [],\n pathOpts = getPathOptions( style || {} ),\n absMode = true,\n currToken, nextToken,\n cnvSpace,\n temp,\n j;\n\n for ( j = 0; j < tokens.length; j++ ) {\n\n // get the current and next token, if any\n currToken = tokens[ j ];\n nextToken = ( j < ( tokens.length - 1 ) ) ? tokens[ j + 1 ] : '';\n\n // store cursor start position (of next line segment)\n lastCursor.x = cursor.x;\n lastCursor.y = cursor.y;\n\n switch( currToken ) {\n case 'm':\n absMode = false;\n temp = strToPoint( nextToken );\n\n cursor.x = 0;\n cursor.y = 0;\n\n cursor.x = cursor.x + temp.x;\n cursor.y = cursor.y + temp.y;\n startCursor.x = cursor.x;\n startCursor.y = cursor.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'moveTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'M':\n absMode = true;\n cursor = strToPoint( nextToken );\n startCursor.x = cursor.x;\n startCursor.y = cursor.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'moveTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'v':\n absMode = false;\n // vertical line on canvas, convert absolute to relative offset\n temp = parseFloat( nextToken ); // dY\n cursor.y = cursor.y + temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'V':\n absMode = true;\n // vertical line on canvas to absolute Y position\n temp = parseFloat( nextToken ); // abs Y\n\n cursor.y = temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'h':\n absMode = false;\n // horizontal draw on canvas to relative X position\n temp = parseFloat( nextToken ); // dX\n cursor.x = cursor.x + temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'H':\n absMode = true;\n // horizontal draw on canvas to absolute X position\n temp = parseFloat( nextToken ); // abs X\n cursor.x = temp;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'l':\n absMode = false;\n // lineTo on canvas to relative X,Y position\n temp = strToPoint( nextToken ); // dX,dY\n cursor.x = cursor.x + temp.x;\n cursor.y = cursor.y + temp.y;\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n\n //objPage.lineTo( cnvSpace.x, ( objPage.height() - cnvSpace.y ) );\n //objPage.moveTo( cnvSpace.x, ( objPage.height() - cnvSpace.y ) );\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n j = j + 1; // has one argument\n break;\n\n case 'L':\n absMode = true;\n // lineTo on canvas to absolute X,Y position\n temp = strToPoint( nextToken ); // abs X,Y\n cursor.x = temp.x;\n cursor.y = temp.y;\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n //objPage.lineTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n //objPage.moveTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n absMode = true;\n j = j + 1; // has one argument\n break;\n\n case 'z':\n case 'Z':\n // close the path\n cnvSpace = applyTransforms( startCursor, path.transformSet, true );\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n // draw the path\n if ( drawOps.length > 0 ) { traceOnCanvas( pathOpts, drawOps ); }\n drawOps = [];\n break;\n\n default:\n if ( -1 !== currToken.indexOf( ',' ) ) {\n\n // assume continuation of l or L, implicit next point on line\n temp = strToPoint( currToken );\n\n if ( absMode ) {\n cursor.x = temp.x; // follows L or M\n cursor.y = temp.y;\n } else {\n cursor.x = cursor.x + temp.x; // follows l or m\n cursor.y = cursor.y + temp.y;\n }\n\n cnvSpace = applyTransforms( cursor, path.transformSet, true );\n //ctx.lineTo( cnvSpace.x, cnvSpace.y );\n //objPage.lineTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n //objPage.moveTo(cnvSpace.x, (objPage.height() - cnvSpace.y));\n\n drawOps.push( { 'op': 'lineTo', 'x': cnvSpace.x, 'y': cnvSpace.y } );\n\n } else {\n Y.log( 'Unhandled SVG path token: ' + currToken + ' in ' + JSON.stringify( tokens ), 'warn', NAME );\n }\n\n break;\n\n }\n }\n\n // finalize any outstanding path (may be missing terminator)\n if ( drawOps.length > 0 ) { traceOnCanvas( pathOpts, drawOps ); }\n }", "function highlightLine(cm, line, context, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\r\n lineClasses, forceToEnd);\r\n var state = context.state;\r\n\r\n // Run overlays, adjust style array.\r\n var loop = function ( o ) {\r\n context.baseTokens = st;\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n context.state = true;\r\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n { st.splice(i, 1, end, st[i+1], i_end); }\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) { return }\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n context.state = state;\r\n context.baseTokens = null;\r\n context.baseTokenPos = 1;\r\n };\r\n\r\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\r\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function parseArray(parser, _ref, style) {\n var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter,\n addJot = _ref.addJot,\n cols = _ref.cols,\n arraystretch = _ref.arraystretch,\n colSeparationType = _ref.colSeparationType;\n // Parse body of array with \\\\ temporarily mapped to \\cr\n parser.gullet.beginGroup();\n parser.gullet.macros.set(\"\\\\\\\\\", \"\\\\cr\"); // Get current arraystretch if it's not set by the environment\n\n if (!arraystretch) {\n var stretch = parser.gullet.expandMacroAsText(\"\\\\arraystretch\");\n\n if (stretch == null) {\n // Default \\arraystretch from lttab.dtx\n arraystretch = 1;\n } else {\n arraystretch = parseFloat(stretch);\n\n if (!arraystretch || arraystretch < 0) {\n throw new src_ParseError(\"Invalid \\\\arraystretch: \" + stretch);\n }\n }\n }\n\n var row = [];\n var body = [row];\n var rowGaps = [];\n var hLinesBeforeRow = []; // Test for \\hline at the top of the array.\n\n hLinesBeforeRow.push(getHLines(parser));\n\n while (true) {\n // eslint-disable-line no-constant-condition\n var cell = parser.parseExpression(false, \"\\\\cr\");\n cell = {\n type: \"ordgroup\",\n mode: parser.mode,\n body: cell\n };\n\n if (style) {\n cell = {\n type: \"styling\",\n mode: parser.mode,\n style: style,\n body: [cell]\n };\n }\n\n row.push(cell);\n var next = parser.nextToken.text;\n\n if (next === \"&\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty.\n // NOTE: Currently, `cell` is the last item added into `row`.\n if (row.length === 1 && cell.type === \"styling\" && cell.body[0].body.length === 0) {\n body.pop();\n }\n\n if (hLinesBeforeRow.length < body.length + 1) {\n hLinesBeforeRow.push([]);\n }\n\n break;\n } else if (next === \"\\\\cr\") {\n var cr = assertNodeType(parser.parseFunction(), \"cr\");\n rowGaps.push(cr.size); // check for \\hline(s) following the row separator\n\n hLinesBeforeRow.push(getHLines(parser));\n row = [];\n body.push(row);\n } else {\n throw new src_ParseError(\"Expected & or \\\\\\\\ or \\\\cr or \\\\end\", parser.nextToken);\n }\n }\n\n parser.gullet.endGroup();\n return {\n type: \"array\",\n mode: parser.mode,\n addJot: addJot,\n arraystretch: arraystretch,\n body: body,\n cols: cols,\n rowGaps: rowGaps,\n hskipBeforeAndAfter: hskipBeforeAndAfter,\n hLinesBeforeRow: hLinesBeforeRow,\n colSeparationType: colSeparationType\n };\n} // Decides on a style for cells in an array according to whether the given", "function getStyleBasedFormatState(editor) {\n var range = editor.getSelectionRange();\n var node = range && roosterjs_editor_dom_1.Position.getStart(range).normalize().node;\n var styles = node ? roosterjs_editor_dom_1.getComputedStyles(node) : [];\n return {\n fontName: styles[0],\n fontSize: styles[1],\n textColor: styles[2],\n backgroundColor: styles[3],\n };\n}", "static get styles() {\n return [style];\n }", "function encodeInlineStyleRanges(block){var styleList=block.getCharacterList().map(function(c){return c.getStyle();}).toList();var ranges=styleList.flatten().toSet().map(function(style){return getEncodedInlinesForType(block,styleList,style);});return Array.prototype.concat.apply(EMPTY_ARRAY,ranges.toJS());}", "function getCurrentStyles(startNode, endNode) {\n var nodes = (0, _getNodeTree2['default'])(startNode, endNode);\n var commands = [];\n\n nodes.forEach(function (node) {\n var tagName = node.tagName;\n\n for (var style in STYLES) {\n if (style === STYLES) {\n commands.push(STYLES[style]);\n }\n }\n\n for (var command in COMMANDS) {\n if (command === tagName) {\n commands.push(COMMANDS[command]);\n }\n }\n });\n return commands;\n}", "function parseArray(parser, _ref, style) {\n var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter,\n addJot = _ref.addJot,\n cols = _ref.cols,\n arraystretch = _ref.arraystretch;\n // Parse body of array with \\\\ temporarily mapped to \\cr\n parser.gullet.beginGroup();\n parser.gullet.macros.set(\"\\\\\\\\\", \"\\\\cr\"); // Get current arraystretch if it's not set by the environment\n\n if (!arraystretch) {\n var stretch = parser.gullet.expandMacroAsText(\"\\\\arraystretch\");\n\n if (stretch == null) {\n // Default \\arraystretch from lttab.dtx\n arraystretch = 1;\n } else {\n arraystretch = parseFloat(stretch);\n\n if (!arraystretch || arraystretch < 0) {\n throw new src_ParseError(\"Invalid \\\\arraystretch: \" + stretch);\n }\n }\n }\n\n var row = [];\n var body = [row];\n var rowGaps = [];\n var hLinesBeforeRow = []; // Test for \\hline at the top of the array.\n\n hLinesBeforeRow.push(getHLines(parser));\n\n while (true) {\n // eslint-disable-line no-constant-condition\n var cell = parser.parseExpression(false, \"\\\\cr\");\n cell = {\n type: \"ordgroup\",\n mode: parser.mode,\n body: cell\n };\n\n if (style) {\n cell = {\n type: \"styling\",\n mode: parser.mode,\n style: style,\n body: [cell]\n };\n }\n\n row.push(cell);\n var next = parser.nextToken.text;\n\n if (next === \"&\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty.\n // NOTE: Currently, `cell` is the last item added into `row`.\n if (row.length === 1 && cell.type === \"styling\" && cell.body[0].body.length === 0) {\n body.pop();\n }\n\n if (hLinesBeforeRow.length < body.length + 1) {\n hLinesBeforeRow.push([]);\n }\n\n break;\n } else if (next === \"\\\\cr\") {\n var cr = assertNodeType(parser.parseFunction(), \"cr\");\n rowGaps.push(cr.size); // check for \\hline(s) following the row separator\n\n hLinesBeforeRow.push(getHLines(parser));\n row = [];\n body.push(row);\n } else {\n throw new src_ParseError(\"Expected & or \\\\\\\\ or \\\\cr or \\\\end\", parser.nextToken);\n }\n }\n\n parser.gullet.endGroup();\n return {\n type: \"array\",\n mode: parser.mode,\n addJot: addJot,\n arraystretch: arraystretch,\n body: body,\n cols: cols,\n rowGaps: rowGaps,\n hskipBeforeAndAfter: hskipBeforeAndAfter,\n hLinesBeforeRow: hLinesBeforeRow\n };\n} // Decides on a style for cells in an array according to whether the given", "function parseArray(parser, _ref, style) {\n var hskipBeforeAndAfter = _ref.hskipBeforeAndAfter,\n addJot = _ref.addJot,\n cols = _ref.cols,\n arraystretch = _ref.arraystretch;\n // Parse body of array with \\\\ temporarily mapped to \\cr\n parser.gullet.beginGroup();\n parser.gullet.macros.set(\"\\\\\\\\\", \"\\\\cr\"); // Get current arraystretch if it's not set by the environment\n\n if (!arraystretch) {\n var stretch = parser.gullet.expandMacroAsText(\"\\\\arraystretch\");\n\n if (stretch == null) {\n // Default \\arraystretch from lttab.dtx\n arraystretch = 1;\n } else {\n arraystretch = parseFloat(stretch);\n\n if (!arraystretch || arraystretch < 0) {\n throw new src_ParseError(\"Invalid \\\\arraystretch: \" + stretch);\n }\n }\n }\n\n var row = [];\n var body = [row];\n var rowGaps = [];\n var hLinesBeforeRow = []; // Test for \\hline at the top of the array.\n\n hLinesBeforeRow.push(getHLines(parser));\n\n while (true) {\n // eslint-disable-line no-constant-condition\n var cell = parser.parseExpression(false, \"\\\\cr\");\n cell = {\n type: \"ordgroup\",\n mode: parser.mode,\n body: cell\n };\n\n if (style) {\n cell = {\n type: \"styling\",\n mode: parser.mode,\n style: style,\n body: [cell]\n };\n }\n\n row.push(cell);\n var next = parser.nextToken.text;\n\n if (next === \"&\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty.\n // NOTE: Currently, `cell` is the last item added into `row`.\n if (row.length === 1 && cell.type === \"styling\" && cell.body[0].body.length === 0) {\n body.pop();\n }\n\n if (hLinesBeforeRow.length < body.length + 1) {\n hLinesBeforeRow.push([]);\n }\n\n break;\n } else if (next === \"\\\\cr\") {\n var cr = assertNodeType(parser.parseFunction(), \"cr\");\n rowGaps.push(cr.size); // check for \\hline(s) following the row separator\n\n hLinesBeforeRow.push(getHLines(parser));\n row = [];\n body.push(row);\n } else {\n throw new src_ParseError(\"Expected & or \\\\\\\\ or \\\\cr or \\\\end\", parser.nextToken);\n }\n }\n\n parser.gullet.endGroup();\n return {\n type: \"array\",\n mode: parser.mode,\n addJot: addJot,\n arraystretch: arraystretch,\n body: body,\n cols: cols,\n rowGaps: rowGaps,\n hskipBeforeAndAfter: hskipBeforeAndAfter,\n hLinesBeforeRow: hLinesBeforeRow\n };\n} // Decides on a style for cells in an array according to whether the given", "getStyles(styleType) {\n if (this.viewer) {\n return this.viewer.styles.getStyles(styleType);\n }\n return [];\n }", "function getProcessedStyle(reference, cellUnit, includeRegionStyles) {\n var styles = [];\n var ids = reference.match(/\\S+/g);\n ids.forEach(function (id) {\n // Find the style for each id received.\n var cueStyle = findStyleFromID(ttmlStyling, id);\n if (cueStyle) {\n // Process the style for the cue in CSS form.\n // Send a copy of the style object, so it does not modify the original by cleaning it.\n var stylesFromId = processStyle(JSON.parse(JSON.stringify(cueStyle)), cellUnit, includeRegionStyles);\n styles = styles.concat(stylesFromId);\n }\n });\n return styles;\n }", "function getProcessedStyle(reference, cellUnit, includeRegionStyles) {\n var styles = [];\n var ids = reference.match(/\\S+/g);\n ids.forEach(function (id) {\n // Find the style for each id received.\n var cueStyle = findStyleFromID(ttmlStyling, id);\n if (cueStyle) {\n // Process the style for the cue in CSS form.\n // Send a copy of the style object, so it does not modify the original by cleaning it.\n var stylesFromId = processStyle(JSON.parse(JSON.stringify(cueStyle)), cellUnit, includeRegionStyles);\n styles = styles.concat(stylesFromId);\n }\n });\n return styles;\n }", "getStyles() {\n\t\tif (!this.props.children) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tkey: this.props.children.key,\n\t\t\t\tdata: this.props.children,\n\t\t\t\tstyle: ensureSpring(this.props.atActive)\n\t\t\t}\n\t\t];\n\t}", "function addOrvCoreStyles() {\n let s = [],s2=[];\n const o1 = \".\"+sOrvCoreLibClassName+\" \"\n let sPos\n\n try {\n if (typeof styleBlk !== \"undefined\") {\n return; // aleady set up\n } // end if\n\n styleBlk = document.createElement(\"STYLE\")\n styleBlk.id = orvCoreLibStyleBlockId;\n\n\n // s.push(\"\")\n\n s.push(o1+\"{\")\n s.push(\" box-sizing:border-box;\")\n s.push(\" margin:0px;\")\n s.push(\" padding:0px;\")\n s.push(\"}\")\n\n s.push(o1+\".bx {\")\n s.push(\" position:absolute;\")\n s.push(\" overflow:hidden;\")\n s.push(\"}\")\n\n s.push(o1+\".tint{\")\n s.push(\" background-color:black;\")\n s.push(\" top:0px;\")\n s.push(\" bottom:0px;\")\n s.push(\" left:0px;\")\n s.push(\" right:0px;\")\n s.push(\" opacity:.6;\")\n s.push(\" z-index:\"+(nHighestZIndex+1)+\";\")\n s.push(\"}\")\n\n // s2.push(\"\")\n s2 = []\n s2.push(o1+\".debugIcon{\")\n s2.push(\" text-align:center;\") \n s2.push(\" width:15px;\")\n s2.push(\" height:15px;\")\n s2.push(\" line-height:12px;\")\n s2.push(\" font-family:Tahoma;\")\n s2.push(\" font-size:11px;\")\n s2.push(\" padding:0px;\")\n s2.push(\" margin:0px;\")\n s2.push(\" margin-right:6px;\") \n s2.push(\" color: white;\")\n s2.push(\" border-radius:3px;\")\n s2.push(\" overflow:hidden;\")\n s2.push(\" display:inline-block;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n\n s2 = []\n s2.push(o1+\".debugIconGreen{\")\n s2.push(\" border:solid #799876 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #799876,-1px -1px #799876, 1px -1px #799876,-1px 1px #799876;\") \n s2.push(\" background-color: #A8C9A6;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n s2 = []\n s2.push(o1+\".debugIconBlue{\")\n s2.push(\" border:solid #6B89A8 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #6B89A8,-1px -1px #6B89A8, 1px -1px #6B89A8,-1px 1px #6B89A8;\") \n s2.push(\" background-color: #96B9D9;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n s2 = []\n s2.push(o1+\".debugIconTan{\")\n s2.push(\" border:solid #CAB471 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #CAB471,-1px -1px #CAB471, 1px -1px #CAB471,-1px 1px #CAB471;\") \n s2.push(\" background-color: #F5DE97;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n s2 = []\n s2.push(o1+\".debugIconPurple{\")\n s2.push(\" border:solid #8C7698 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #8C7698,-1px -1px #8C7698, 1px -1px #8C7698,-1px 1px #8C7698;\") \n s2.push(\" background-color: #BDA6C9;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n s2 = []\n s2.push(o1+\".debugIconRed{\")\n s2.push(\" border:solid #BC6F70 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #BC6F70,-1px -1px #BC6F70, 1px -1px #BC6F70,-1px 1px #BC6F70;\") \n s2.push(\" background-color: #E9999A;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n s2 = []\n s2.push(o1+\".debugIconGray{\")\n s2.push(\" border:solid #999999 1.5px;\")\n s2.push(\" text-shadow: 1px 1px #999999,-1px -1px #999999, 1px -1px #999999,-1px 1px #999999;\") \n s2.push(\" background-color: #D9D9D9;\")\n s2.push(\"}\")\n s.push(s2.join(\"\\n\"))\n\n\n // s.push(\" \")\n sPos = \"30px\"\n s.push(o1+\".dialog {\")\n s.push(\" background-color:silver;\")\n s.push(\" border:solid yellow 3px;\")\n s.push(\" width:700px;\")\n s.push(\" left:\"+sPos+\";\")\n s.push(\" top:\"+sPos+\";\")\n s.push(\" bottom:\"+sPos+\";\")\n s.push(\" z-index:\"+(nHighestZIndex+2)+\";\")\n s.push(\"}\")\n\n s.push(o1+\".diaTitleBar {\")\n s.push(\" left:0px;\")\n s.push(\" right:0px;\")\n s.push(\" top:0px;\")\n s.push(\" height:35px;\")\n s.push(\" line-height:35px;\")\n s.push(\" color:white;\")\n s.push(\" font-size:18pt;\")\n s.push(\" background-color:gray;\")\n s.push(\" text-align:center;\") \n s.push(\"}\")\n\n s.push(o1+\".varArrayLen {\")\n s.push(\" color:gray; \") \n s.push(\" font-size:14px;\") \n s.push(\"}\")\n\n s.push(o1+\".varLst {\")\n s.push(\" list-style-type: none; \") \n s.push(\" background-color:white;\")\n s.push(\" border-radius:4px;\") \n s.push(\" padding-left:4px;\") \n s.push(\" padding-bottom:8px;\") \n s.push(\"}\")\n\n s.push(o1+\".varPropCntr {\") \n s.push(\" margin-left:16px;\") \n s.push(\"}\")\n\n\n // 🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵🔴🔵\n s.push(o1+\"LI {\")\n s.push(\" font-family: Menlo, Monaco, 'Courier New', monospace;\")\n s.push(\" font-size:16px;\")\n s.push(\" width:655px;\")\n //s.push(\" background-color:lightblue;\") \n s.push(\"}\")\n\n s.push(o1+\".varCntr2 {\")\n s.push(\" font-family: Monaco, MonoSpace;\")\n s.push(\" width:655px;\")\n s.push(\" height:20px;\")\n s.push(\" position:relative; \") \n s.push(\" top:0px;\")\n s.push(\" left:0px;\")\n s.push(\" padding-left:17px;\")\n // s.push(\" background-color:lightgreen;\") \n s.push(\"}\")\n\n // s.push(\" \")\n s.push(o1+\".dataType_lbl {\")\n s.push(\" position:absolute; \") \n s.push(\" right:0px;\")\n s.push(\" top:2px;\")\n s.push(\" margin-right:4px;\")\n s.push(\" padding-left:4px;\")\n s.push(\" padding-right:4px;\")\n s.push(\" border-radius:4px;\")\n s.push(\" font-size:9pt;\")\n s.push(\" background-color:#800000;\")\n s.push(\" color:white;\")\n s.push(\"}\")\n\n // alert(s.join(\"\\n\"))\n s.push(o1+\".codeBackground {\")\n s.push(\"}\")\n\n s.push(o1+\".numberValue {\")\n s.push(\"}\")\n\n s.push(o1+\".stringValue {\")\n s.push(\"}\")\n\n s.push(o1+\".typeLabel {\")\n s.push(\"}\")\n\n // s.push(\"\")\n s.push(o1+\".booleanValue {\")\n s.push(\"}\")\n\n s.push(o1+\".dateValue {\")\n s.push(\"}\")\n\n\n styleBlk.innerHTML = s.join(\"\\n\")\n document.body.append(styleBlk)\n\n } catch(err) {\n console.dir(err)\n debugger \n } // end of try/catch\n //styleBlk\n \n }", "function decodeInlineStyleRanges(text,ranges){var styles=Array(text.length).fill(EMPTY_SET);if(ranges){ranges.forEach(function(/*object*/range){var cursor=substr(text,0,range.offset).length;var end=cursor+substr(text,range.offset,range.length).length;while(cursor<end){styles[cursor]=styles[cursor].add(range.style);cursor++;}});}return styles;}", "_getInlineColors() {\n const that = this;\n let trackColor = '',\n fillColor = '',\n lineColor = '';\n\n if (that._track) {\n trackColor = that._track.style.fill;\n }\n\n if (that._fill) {\n fillColor = that._fill.style.fill;\n }\n\n if (that._line) {\n lineColor = that._line.style.stroke;\n }\n\n return [trackColor, fillColor, lineColor];\n }", "function scssTokenize(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var css = input.css.valueOf();\n var ignore = options.ignoreErrors;\n\n var code = void 0,\n next = void 0,\n quote = void 0,\n lines = void 0,\n last = void 0,\n content = void 0,\n escape = void 0,\n nextLine = void 0,\n nextOffset = void 0,\n escaped = void 0,\n escapePos = void 0,\n prev = void 0,\n n = void 0,\n currentToken = void 0;\n\n var brackets = void 0; // SCSS PATCH\n\n var length = css.length;\n var offset = -1;\n var line = 1;\n var pos = 0;\n var buffer = [];\n var returned = [];\n\n function unclosed(what) {\n throw input.error('Unclosed ' + what, line, pos - offset);\n }\n\n function endOfFile() {\n return returned.length === 0 && pos >= length;\n }\n\n function nextToken() {\n if (returned.length) return returned.pop();\n if (pos >= length) return;\n\n code = css.charCodeAt(pos);\n if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {\n offset = pos;\n line += 1;\n }\n\n switch (code) {\n case NEWLINE:\n case SPACE:\n case TAB:\n case CR:\n case FEED:\n next = pos;\n do {\n next += 1;\n code = css.charCodeAt(next);\n if (code === NEWLINE) {\n offset = next;\n line += 1;\n }\n } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);\n\n currentToken = ['space', css.slice(pos, next)];\n pos = next - 1;\n break;\n\n case OPEN_SQUARE:\n currentToken = ['[', '[', line, pos - offset];\n break;\n\n case CLOSE_SQUARE:\n currentToken = [']', ']', line, pos - offset];\n break;\n\n case OPEN_CURLY:\n currentToken = ['{', '{', line, pos - offset];\n break;\n\n case CLOSE_CURLY:\n currentToken = ['}', '}', line, pos - offset];\n break;\n\n // SCSS PATCH {\n case COMMA:\n currentToken = ['word', ',', line, pos - offset, line, pos - offset + 1];\n break;\n // } SCSS PATCH\n\n case COLON:\n currentToken = [':', ':', line, pos - offset];\n break;\n\n case SEMICOLON:\n currentToken = [';', ';', line, pos - offset];\n break;\n\n case OPEN_PARENTHESES:\n prev = buffer.length ? buffer.pop()[1] : '';\n n = css.charCodeAt(pos + 1);\n if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {\n // SCSS PATCH {\n brackets = 1;\n escaped = false;\n next = pos + 1;\n while (next <= css.length - 1) {\n n = css.charCodeAt(next);\n if (n === BACKSLASH) {\n escaped = !escaped;\n } else if (n === OPEN_PARENTHESES) {\n brackets += 1;\n } else if (n === CLOSE_PARENTHESES) {\n brackets -= 1;\n if (brackets === 0) break;\n }\n next += 1;\n }\n // } SCSS PATCH\n\n currentToken = ['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset];\n\n pos = next;\n } else {\n next = css.indexOf(')', pos + 1);\n content = css.slice(pos, next + 1);\n\n if (next === -1 || RE_BAD_BRACKET.test(content)) {\n currentToken = ['(', '(', line, pos - offset];\n } else {\n currentToken = ['brackets', content, line, pos - offset, line, next - offset];\n pos = next;\n }\n }\n\n break;\n\n case CLOSE_PARENTHESES:\n currentToken = [')', ')', line, pos - offset];\n break;\n\n case SINGLE_QUOTE:\n case DOUBLE_QUOTE:\n quote = code === SINGLE_QUOTE ? '\\'' : '\"';\n next = pos;\n do {\n escaped = false;\n next = css.indexOf(quote, next + 1);\n if (next === -1) {\n if (ignore) {\n next = pos + 1;\n break;\n } else {\n unclosed('string');\n }\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n\n content = css.slice(pos, next + 1);\n lines = content.split('\\n');\n last = lines.length - 1;\n\n if (last > 0) {\n nextLine = line + last;\n nextOffset = next - lines[last].length;\n } else {\n nextLine = line;\n nextOffset = offset;\n }\n\n currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];\n\n offset = nextOffset;\n line = nextLine;\n pos = next;\n break;\n\n case AT:\n RE_AT_END.lastIndex = pos + 1;\n RE_AT_END.test(css);\n if (RE_AT_END.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_AT_END.lastIndex - 2;\n }\n\n currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];\n\n pos = next;\n break;\n\n case BACKSLASH:\n next = pos;\n escape = true;\n while (css.charCodeAt(next + 1) === BACKSLASH) {\n next += 1;\n escape = !escape;\n }\n code = css.charCodeAt(next + 1);\n if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {\n next += 1;\n }\n\n currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];\n\n pos = next;\n break;\n\n default:\n // SCSS PATCH {\n n = css.charCodeAt(pos + 1);\n\n if (code === HASH && n === OPEN_CURLY) {\n var deep = 1;\n next = pos;\n while (deep > 0) {\n next += 1;\n if (css.length <= next) unclosed('interpolation');\n\n code = css.charCodeAt(next);\n n = css.charCodeAt(next + 1);\n\n if (code === CLOSE_CURLY) {\n deep -= 1;\n } else if (code === HASH && n === OPEN_CURLY) {\n deep += 1;\n }\n }\n\n content = css.slice(pos, next + 1);\n lines = content.split('\\n');\n last = lines.length - 1;\n\n if (last > 0) {\n nextLine = line + last;\n nextOffset = next - lines[last].length;\n } else {\n nextLine = line;\n nextOffset = offset;\n }\n\n currentToken = ['word', content, line, pos - offset, nextLine, next - nextOffset];\n\n offset = nextOffset;\n line = nextLine;\n pos = next;\n } else if (code === SLASH && n === ASTERISK) {\n // } SCSS PATCH\n next = css.indexOf('*/', pos + 2) + 1;\n if (next === 0) {\n if (ignore) {\n next = css.length;\n } else {\n unclosed('comment');\n }\n }\n\n content = css.slice(pos, next + 1);\n lines = content.split('\\n');\n last = lines.length - 1;\n\n if (last > 0) {\n nextLine = line + last;\n nextOffset = next - lines[last].length;\n } else {\n nextLine = line;\n nextOffset = offset;\n }\n\n currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];\n\n offset = nextOffset;\n line = nextLine;\n pos = next;\n\n // SCSS PATCH {\n } else if (code === SLASH && n === SLASH) {\n RE_NEW_LINE.lastIndex = pos + 1;\n RE_NEW_LINE.test(css);\n if (RE_NEW_LINE.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_NEW_LINE.lastIndex - 2;\n }\n\n content = css.slice(pos, next + 1);\n\n currentToken = ['comment', content, line, pos - offset, line, next - offset, 'inline'];\n\n pos = next;\n // } SCSS PATCH\n } else {\n RE_WORD_END.lastIndex = pos + 1;\n RE_WORD_END.test(css);\n if (RE_WORD_END.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_WORD_END.lastIndex - 2;\n }\n\n currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];\n\n buffer.push(currentToken);\n\n pos = next;\n }\n\n break;\n }\n\n pos++;\n return currentToken;\n }\n\n function back(token) {\n returned.push(token);\n }\n\n return {\n back: back,\n nextToken: nextToken,\n endOfFile: endOfFile\n };\n}", "function getStyle()\n {\tvar p = \"hatch\";\n debugger\n return [ new ol.style.Style(\n {\tfill: new ol.style.FillPattern(\n {\tpattern: (p!='Image (PNG)') ? p : undefined,\n image: (p=='Image (PNG)') ? new ol.style.Icon({ src : 'data/pattern.png' }) : undefined,\n ratio: 1,\n icon: p=='Image (PNG)' ? new ol.style.Icon ({src:'data/target.png'}) : undefined,\n color: \"white\",\n offset:0,\n scale: 0.5,\n fill: new ol.style.Fill ({ color:\"rgba(255,255,255,0)\" }),\n size: 3.5,\n spacing: 14,\n angle: -45\n }),\n stroke: new ol.style.Stroke({\n color: '#ffffff',\n width: 2.8\n })\n })];\n }", "function tokenize(str, maxWidth) {\n\t var result = [];\n\t /* first tokenization pass - split texts and color formatting commands */\n\n\t var offset = 0;\n\t str.replace(RE_COLORS, function (match, type, name, index) {\n\t /* string before */\n\t var part = str.substring(offset, index);\n\n\t if (part.length) {\n\t result.push({\n\t type: TYPE_TEXT,\n\t value: part\n\t });\n\t }\n\t /* color command */\n\n\n\t result.push({\n\t type: type == \"c\" ? TYPE_FG : TYPE_BG,\n\t value: name.trim()\n\t });\n\t offset = index + match.length;\n\t return \"\";\n\t });\n\t /* last remaining part */\n\n\t var part = str.substring(offset);\n\n\t if (part.length) {\n\t result.push({\n\t type: TYPE_TEXT,\n\t value: part\n\t });\n\t }\n\n\t return breakLines(result, maxWidth);\n\t }", "getRawStyling(instance, scene) {\n const styling = [];\n\n for (let i = 0, len = this.selectors.length; i < len; i++) {\n const selector = this.selectors[i].getRawStyling(instance, scene);\n styling.push(selector);\n }\n\n return styling;\n }", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function decodeInlineStyleRanges(text, ranges) {\n var styles = Array(text.length).fill(EMPTY_SET);\n if (ranges) {\n ranges.forEach(function ( /*object*/range) {\n var cursor = substr(text, 0, range.offset).length;\n var end = cursor + substr(text, range.offset, range.length).length;\n while (cursor < end) {\n styles[cursor] = styles[cursor].add(range.style);\n cursor++;\n }\n });\n }\n return styles;\n}", "function kStyle() {\n this.arrayStyle = [];\n this.myclass = null;\n this.addStyle = function (name, value) {\n var style = [name, value];\n this.arrayStyle.push(style);\n };\n this.setClassName = function (name) {\n this.myClass = name;\n };\n this.getClassName = function (name) {\n return this.myClass;\n };\n this.removeStyle = function (name) {\n //not implemented\n };\n this.removeAllStyles = function () {\n //not implemented\n };\n this.getArray = function () {\n return this.arrayStyle;\n };\n}", "function getInlineStyleSections(block, styles, start, end) {\n var styleSections = [];\n var text = block.text;\n\n if (text.length > 0) {\n var inlineStyles = getStyleArrayForBlock(block);\n var section = void 0;\n for (var i = start; i < end; i += 1) {\n if (i !== start && sameStyleAsPrevious(inlineStyles, styles, i)) {\n section.text.push(text[i]);\n section.end = i + 1;\n } else {\n section = {\n styles: getStylesAtOffset(inlineStyles, i),\n text: [text[i]],\n start: i,\n end: i + 1\n };\n styleSections.push(section);\n }\n }\n }\n return styleSections;\n}", "function parseArray(parser, result, style) {\n var row = [];\n var body = [row];\n var rowGaps = [];\n while (true) {\n // eslint-disable-line no-constant-condition\n var cell = parser.parseExpression(false, undefined);\n cell = new __WEBPACK_IMPORTED_MODULE_4__ParseNode__[\"a\" /* default */](\"ordgroup\", cell, parser.mode);\n if (style) {\n cell = new __WEBPACK_IMPORTED_MODULE_4__ParseNode__[\"a\" /* default */](\"styling\", {\n style: style,\n value: [cell]\n }, parser.mode);\n }\n row.push(cell);\n var next = parser.nextToken.text;\n if (next === \"&\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty.\n var lastRow = body[body.length - 1];\n if (body.length > 1 && lastRow.length === 1 && lastRow[0].value.value[0].value.length === 0) {\n body.pop();\n }\n break;\n } else if (next === \"\\\\\\\\\" || next === \"\\\\cr\") {\n var cr = parser.parseFunction();\n if (!cr) {\n throw new __WEBPACK_IMPORTED_MODULE_3__ParseError__[\"a\" /* default */](\"Failed to parse function after \" + next);\n }\n rowGaps.push(cr.value.size);\n row = [];\n body.push(row);\n } else {\n throw new __WEBPACK_IMPORTED_MODULE_3__ParseError__[\"a\" /* default */](\"Expected & or \\\\\\\\ or \\\\end\", parser.nextToken);\n }\n }\n result.body = body;\n result.rowGaps = rowGaps;\n return new __WEBPACK_IMPORTED_MODULE_4__ParseNode__[\"a\" /* default */](result.type, result, parser.mode);\n}", "extractStyles() {\n\t\tconst options = this.options\n\t\tlet full_code = this.full_code\n\t\tlet first = true\n\t\tlet res = ''\n\n\t\tlet styles = pregMatchAll(styleRegex, full_code)\n\t\tif (!styles.length) return ''\n\t\t\n\t\tfor (let style of styles) {\n\t\t\tres += style[1] + '\\n'\n\n\t\t\t// Style tag spacer\n\t\t\tlet spacer = options.openDelimiter + options.delimiter\n\t\t\t\t+ '// ' + style[0].replace(/\\r?\\n/g, '\\n// ')\n\t\t\t\t+ options.delimiter + options.closeDelimiter\n\t\t\t\n\t\t\t// Add <%= styles %> for the first tag\n\t\t\tif (first) {\n\t\t\t\tfirst = false\n\t\t\t\tspacer = options.openDelimiter + options.delimiter\n\t\t\t\t\t+ '- styles '\n\t\t\t\t\t+ options.delimiter + options.closeDelimiter\n\t\t\t\t\t+ spacer\n\t\t\t}\n\t\t\t\n\t\t\tfull_code = full_code.replace(style[0], spacer)\n\t\t}\n\n\t\t//TODO: Sass?\n\n\t\tthis.styles = res\n\t\tthis.full_code = full_code\n\t}", "function decodeInlineStyleRanges(text, ranges) {\n\t var styles = Array(text.length).fill(EMPTY_SET);\n\t if (ranges) {\n\t ranges.forEach(function ( /*object*/range) {\n\t var cursor = substr(text, 0, range.offset).length;\n\t var end = cursor + substr(text, range.offset, range.length).length;\n\t while (cursor < end) {\n\t styles[cursor] = styles[cursor].add(range.style);\n\t cursor++;\n\t }\n\t });\n\t }\n\t return styles;\n\t}", "_normalizeIntralineHighlights(content, highlights) {\n let contentIndex = 0;\n let idx = 0;\n const normalized = [];\n for (const hl of highlights) {\n let line = content[contentIndex] + '\\n';\n let j = 0;\n while (j < hl[0]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n continue;\n }\n idx++;\n j++;\n }\n let lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n\n j = 0;\n while (line && j < hl[1]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n normalized.push(lineHighlight);\n lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n continue;\n }\n idx++;\n j++;\n }\n lineHighlight.endIndex = idx;\n normalized.push(lineHighlight);\n }\n return normalized;\n }", "reparsePretties(range) {\r\n range = this.document.validateRange(range);\r\n const startCharacter = 0;\r\n const newUglyRanges = new DisjointRangeSet_1.DisjointRangeSet();\r\n const newStyledRanges = new DisjointRangeSet_1.DisjointRangeSet();\r\n const newScopedRanges = [];\r\n const newUnscopedRanges = [];\r\n const newConditionalRanges = new RangeSet_1.RangeSet();\r\n // initialize an empty range set for every id\r\n this.prettyDecorations.unscoped.forEach(() => newUnscopedRanges.push(new DisjointRangeSet_1.DisjointRangeSet()));\r\n this.prettyDecorations.scoped.forEach(() => newScopedRanges.push(new DisjointRangeSet_1.DisjointRangeSet()));\r\n let invalidatedTokenState = false;\r\n // Collect new pretties\r\n const lineCount = this.document.getLineCount();\r\n let lineIdx;\r\n for (lineIdx = range.start.line; lineIdx <= range.end.line || (invalidatedTokenState && lineIdx < lineCount); ++lineIdx) {\r\n const line = this.document.getLine(lineIdx);\r\n const { tokens: tokens, invalidated: invalidated } = this.refreshTokensOnLine(line, lineIdx);\r\n invalidatedTokenState = invalidated;\r\n for (let ugly of this.iterateLineUglies(line, tokens)) {\r\n const uglyRange = new vscode.Range(lineIdx, ugly.start, lineIdx, ugly.end);\r\n newConditionalRanges.add(new vscode.Range(lineIdx, ugly.matchStart, lineIdx, ugly.matchEnd));\r\n if (ugly.type === \"scoped\") {\r\n if (this.prettyDecorations.scoped[ugly.id].pretty)\r\n newUglyRanges.insert(uglyRange);\r\n else\r\n newStyledRanges.insert(uglyRange);\r\n newScopedRanges[ugly.id].insert(uglyRange);\r\n }\r\n else if (ugly.type === \"unscoped\") {\r\n if (this.prettyDecorations.unscoped[ugly.id].pretty)\r\n newUglyRanges.insert(uglyRange);\r\n else\r\n newStyledRanges.insert(uglyRange);\r\n newUnscopedRanges[ugly.id].insert(uglyRange);\r\n }\r\n }\r\n }\r\n if (lineIdx - 1 > range.end.line) {\r\n // console.info('Aditional tokens reparsed: ' + (lineIdx-range.end.line) + ' lines');\r\n range = range.with({ end: range.end.with({ line: lineIdx, character: 0 }) });\r\n }\r\n // compute the total reparsed range\r\n // use this to clear any preexisting substitutions\r\n const newUglyTotalRange = newUglyRanges.getTotalRange();\r\n const newStyledTotalRange = newStyledRanges.getTotalRange();\r\n let hiddenOverlap = range.with({ start: range.start.with({ character: startCharacter }) });\r\n let styledOverlap = range.with({ start: range.start.with({ character: startCharacter }) });\r\n if (!newUglyTotalRange.isEmpty)\r\n hiddenOverlap = hiddenOverlap.union(newUglyRanges.getTotalRange());\r\n if (!newStyledTotalRange.isEmpty)\r\n styledOverlap = styledOverlap.union(newStyledRanges.getTotalRange());\r\n const overlap = hiddenOverlap.union(styledOverlap);\r\n this.conditionalRanges.removeOverlapping(overlap, { includeTouchingStart: false, includeTouchingEnd: false });\r\n this.uglyDecorationRanges.removeOverlapping(hiddenOverlap);\r\n // this.styledDecorationRanges.removeOverlapping(styledOverlap);\r\n this.prettyDecorations.unscoped.forEach(r => r.ranges.removeOverlapping(overlap));\r\n this.prettyDecorations.scoped.forEach(r => r.ranges.removeOverlapping(overlap));\r\n // add the new pretties & ugly ducklings\r\n newConditionalRanges.getRanges().forEach(r => this.conditionalRanges.add(r));\r\n this.uglyDecorationRanges.insertRanges(newUglyRanges);\r\n this.prettyDecorations.unscoped.forEach((pretty, idx) => pretty.ranges.insertRanges(newUnscopedRanges[idx]));\r\n this.prettyDecorations.scoped.forEach((pretty, idx) => {\r\n pretty.ranges.insertRanges(newScopedRanges[idx]);\r\n });\r\n if (!newStyledRanges.isEmpty() || !newUglyRanges.isEmpty())\r\n this.changedUglies = true;\r\n return hiddenOverlap.union(styledOverlap);\r\n }", "function createHighlights(root, cssClass = '') {\n let highlights = [];\n\n for (let i = 0; i < 3; i++) {\n const span = document.createElement('span');\n span.textContent = 'Test text';\n const range = new Range();\n range.setStartBefore(span.childNodes[0]);\n range.setEndAfter(span.childNodes[0]);\n root.appendChild(span);\n highlights.push(...highlightRange(range, cssClass));\n }\n\n return highlights;\n }", "getStyleElements() {\n return this.styleElements.slice();\n }", "static get styles () {\n return css`${unsafeCSS(style)}`\n }", "function r(e,t,n,i,o,a,r,s){for(var l=m[\"default\"](n,i,function(e,n){var i=t(n);return null==i?null:x[\"default\"](o[e],i,a[e])?null:{key:n.key,data:n.data,style:i}}),u=[],p=[],d=[],h=[],f=0;f<l.length;f++){for(var g=l[f],y=null,v=0;v<n.length;v++)if(n[v].key===g.key){y=v;break}if(null==y){var b=e(g);u[f]=b,d[f]=b;var w=c[\"default\"](g.style);p[f]=w,h[f]=w}else u[f]=o[y],d[f]=r[y],p[f]=a[y],h[f]=s[y]}return[l,u,p,d,h]}", "function separateStyles(stylesArray) {\n var aphroditeStyles = [];\n\n // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n var hasInlineStyles = false;\n var inlineStyles = {};\n\n // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i];\n\n // If this style is falsey, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n if (style) {\n if ((0, _has2['default'])(style, '_name') && (0, _has2['default'])(style, '_definition')) {\n // This looks like a reference to an Aphrodite style object, so that's\n // where it goes.\n aphroditeStyles.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n aphroditeStyles: aphroditeStyles,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}", "function Ze(e,t,a,n){\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var r=[e.state.modeGen],f={};\n // Compute the base array of styles\n nt(e,t.text,e.doc.mode,a,function(e,t){return r.push(e,t)},f,n);for(var o=a.state,i=0;i<e.state.overlays.length;++i)!function(n){a.baseTokens=r;var i=e.state.overlays[n],s=1,c=0;a.state=!0,nt(e,t.text,i.mode,a,function(e,t){\n // Ensure there's a token end at the current position, and that i points at it\n for(var a=s;c<e;){var n=r[s];n>e&&r.splice(s,1,e,r[s+1],n),s+=2,c=Math.min(e,n)}if(t)if(i.opaque)r.splice(a,s-a,e,\"overlay \"+t),s=a+2;else for(;a<s;a+=2){var f=r[a+1];r[a+1]=(f?f+\" \":\"\")+\"overlay \"+t}},f),a.state=o,a.baseTokens=null,a.baseTokenPos=1}(i);return{styles:r,classes:f.bgClass||f.textClass?f:null}}", "function parseTheme(source) {\r\n if (!source) {\r\n return [];\r\n }\r\n if (!source.settings || !Array.isArray(source.settings)) {\r\n return [];\r\n }\r\n var settings = source.settings;\r\n var result = [], resultLen = 0;\r\n for (var i = 0, len = settings.length; i < len; i++) {\r\n var entry = settings[i];\r\n if (!entry.settings) {\r\n continue;\r\n }\r\n var scopes = void 0;\r\n if (typeof entry.scope === 'string') {\r\n var _scope = entry.scope;\r\n // remove leading commas\r\n _scope = _scope.replace(/^[,]+/, '');\r\n // remove trailing commans\r\n _scope = _scope.replace(/[,]+$/, '');\r\n scopes = _scope.split(',');\r\n }\r\n else if (Array.isArray(entry.scope)) {\r\n scopes = entry.scope;\r\n }\r\n else {\r\n scopes = [''];\r\n }\r\n var fontStyle = -1 /* NotSet */;\r\n if (typeof entry.settings.fontStyle === 'string') {\r\n fontStyle = 0 /* None */;\r\n var segments = entry.settings.fontStyle.split(' ');\r\n for (var j = 0, lenJ = segments.length; j < lenJ; j++) {\r\n var segment = segments[j];\r\n switch (segment) {\r\n case 'italic':\r\n fontStyle = fontStyle | 1 /* Italic */;\r\n break;\r\n case 'bold':\r\n fontStyle = fontStyle | 2 /* Bold */;\r\n break;\r\n case 'underline':\r\n fontStyle = fontStyle | 4 /* Underline */;\r\n break;\r\n }\r\n }\r\n }\r\n var foreground = null;\r\n if (typeof entry.settings.foreground === 'string' && isValidHexColor(entry.settings.foreground)) {\r\n foreground = entry.settings.foreground;\r\n }\r\n var background = null;\r\n if (typeof entry.settings.background === 'string' && isValidHexColor(entry.settings.background)) {\r\n background = entry.settings.background;\r\n }\r\n for (var j = 0, lenJ = scopes.length; j < lenJ; j++) {\r\n var _scope = scopes[j].trim();\r\n var segments = _scope.split(' ');\r\n var scope = segments[segments.length - 1];\r\n var parentScopes = null;\r\n if (segments.length > 1) {\r\n parentScopes = segments.slice(0, segments.length - 1);\r\n parentScopes.reverse();\r\n }\r\n result[resultLen++] = new ParsedThemeRule(scope, parentScopes, i, fontStyle, foreground, background);\r\n }\r\n }\r\n return result;\r\n}", "function parseArray(parser, result, style) {\n var row = [];\n var body = [row];\n var rowGaps = [];\n while (true) {\n // eslint-disable-line no-constant-condition\n var cell = parser.parseExpression(false, null);\n cell = new _ParseNode2.default(\"ordgroup\", cell, parser.mode);\n if (style) {\n cell = new _ParseNode2.default(\"styling\", {\n style: style,\n value: [cell]\n }, parser.mode);\n }\n row.push(cell);\n var next = parser.nextToken.text;\n if (next === \"&\") {\n parser.consume();\n } else if (next === \"\\\\end\") {\n // Arrays terminate newlines with `\\crcr` which consumes a `\\cr` if\n // the last line is empty.\n var lastRow = body[body.length - 1];\n if (body.length > 1 && lastRow.length === 1 && lastRow[0].value.value[0].value.length === 0) {\n body.pop();\n }\n break;\n } else if (next === \"\\\\\\\\\" || next === \"\\\\cr\") {\n var cr = parser.parseFunction();\n rowGaps.push(cr.value.size);\n row = [];\n body.push(row);\n } else {\n throw new _ParseError2.default(\"Expected & or \\\\\\\\ or \\\\end\", parser.nextToken);\n }\n }\n result.body = body;\n result.rowGaps = rowGaps;\n return new _ParseNode2.default(result.type, result, parser.mode);\n}", "function TStylingRange() {}", "function TStylingRange() {}", "function getStylesAtOffset(inlineStyles, offset) {\n var styles = {};\n if (inlineStyles.COLOR[offset]) {\n styles.COLOR = inlineStyles.COLOR[offset];\n }\n if (inlineStyles.BGCOLOR[offset]) {\n styles.BGCOLOR = inlineStyles.BGCOLOR[offset];\n }\n if (inlineStyles.FONTSIZE[offset]) {\n styles.FONTSIZE = inlineStyles.FONTSIZE[offset];\n }\n if (inlineStyles.FONTFAMILY[offset]) {\n styles.FONTFAMILY = inlineStyles.FONTFAMILY[offset];\n }\n if (inlineStyles.UNDERLINE[offset]) {\n styles.UNDERLINE = true;\n }\n if (inlineStyles.ITALIC[offset]) {\n styles.ITALIC = true;\n }\n if (inlineStyles.BOLD[offset]) {\n styles.BOLD = true;\n }\n if (inlineStyles.STRIKETHROUGH[offset]) {\n styles.STRIKETHROUGH = true;\n }\n if (inlineStyles.CODE[offset]) {\n styles.CODE = true;\n }\n if (inlineStyles.SUBSCRIPT[offset]) {\n styles.SUBSCRIPT = true;\n }\n if (inlineStyles.SUPERSCRIPT[offset]) {\n styles.SUPERSCRIPT = true;\n }\n return styles;\n}", "function copyArrays(textStyle) {\n // These color fields were arrays, but will set to WASM pointers before we pass this\n // object over the WASM interface.\n textStyle['_colorPtr'] = copyColorToWasm(textStyle['color']);\n textStyle['_foregroundColorPtr'] = nullptr; // nullptr is 0, from helper.js\n textStyle['_backgroundColorPtr'] = nullptr;\n textStyle['_decorationColorPtr'] = nullptr;\n if (textStyle['foregroundColor']) {\n textStyle['_foregroundColorPtr'] = copyColorToWasm(textStyle['foregroundColor'], scratchForegroundColorPtr);\n }\n if (textStyle['backgroundColor']) {\n textStyle['_backgroundColorPtr'] = copyColorToWasm(textStyle['backgroundColor'], scratchBackgroundColorPtr);\n }\n if (textStyle['decorationColor']) {\n textStyle['_decorationColorPtr'] = copyColorToWasm(textStyle['decorationColor'], scratchDecorationColorPtr);\n }\n\n if (Array.isArray(textStyle['fontFamilies']) && textStyle['fontFamilies'].length) {\n textStyle['_fontFamiliesPtr'] = naiveCopyStrArray(textStyle['fontFamilies']);\n textStyle['_fontFamiliesLen'] = textStyle['fontFamilies'].length;\n } else {\n textStyle['_fontFamiliesPtr'] = nullptr;\n textStyle['_fontFamiliesLen'] = 0;\n Debug('no font families provided, text may draw wrong or not at all');\n }\n\n if (textStyle['locale']) {\n var str = textStyle['locale'];\n textStyle['_localePtr'] = cacheOrCopyString(str);\n textStyle['_localeLen'] = lengthBytesUTF8(str) + 1; // add 1 for the null terminator.\n } else {\n textStyle['_localePtr'] = nullptr;\n textStyle['_localeLen'] = 0;\n }\n\n if (Array.isArray(textStyle['shadows']) && textStyle['shadows'].length) {\n var shadows = textStyle['shadows'];\n var shadowColors = shadows.map(function (s) { return s['color'] || CanvasKit.BLACK; });\n var shadowBlurRadii = shadows.map(function (s) { return s['blurRadius'] || 0.0; });\n textStyle['_shadowLen'] = shadows.length;\n // 2 floats per point, 4 bytes per float\n var ptr = CanvasKit._malloc(shadows.length * 2 * 4);\n var adjustedPtr = ptr / 4; // 4 bytes per float\n for (var i = 0; i < shadows.length; i++) {\n var offset = shadows[i]['offset'] || [0, 0];\n CanvasKit.HEAPF32[adjustedPtr] = offset[0];\n CanvasKit.HEAPF32[adjustedPtr + 1] = offset[1];\n adjustedPtr += 2;\n }\n textStyle['_shadowColorsPtr'] = copyFlexibleColorArray(shadowColors).colorPtr;\n textStyle['_shadowOffsetsPtr'] = ptr;\n textStyle['_shadowBlurRadiiPtr'] = copy1dArray(shadowBlurRadii, 'HEAPF32');\n } else {\n textStyle['_shadowLen'] = 0;\n textStyle['_shadowColorsPtr'] = nullptr;\n textStyle['_shadowOffsetsPtr'] = nullptr;\n textStyle['_shadowBlurRadiiPtr'] = nullptr;\n }\n\n if (Array.isArray(textStyle['fontFeatures']) && textStyle['fontFeatures'].length) {\n var fontFeatures = textStyle['fontFeatures'];\n var fontFeatureNames = fontFeatures.map(function (s) { return s['name']; });\n var fontFeatureValues = fontFeatures.map(function (s) { return s['value']; });\n textStyle['_fontFeatureLen'] = fontFeatures.length;\n textStyle['_fontFeatureNamesPtr'] = naiveCopyStrArray(fontFeatureNames);\n textStyle['_fontFeatureValuesPtr'] = copy1dArray(fontFeatureValues, 'HEAPU32');\n } else {\n textStyle['_fontFeatureLen'] = 0;\n textStyle['_fontFeatureNamesPtr'] = nullptr;\n textStyle['_fontFeatureValuesPtr'] = nullptr;\n }\n\n if (Array.isArray(textStyle['fontVariations']) && textStyle['fontVariations'].length) {\n var fontVariations = textStyle['fontVariations'];\n var fontVariationAxes = fontVariations.map(function (s) { return s['axis']; });\n var fontVariationValues = fontVariations.map(function (s) { return s['value']; });\n textStyle['_fontVariationLen'] = fontVariations.length;\n textStyle['_fontVariationAxesPtr'] = naiveCopyStrArray(fontVariationAxes);\n textStyle['_fontVariationValuesPtr'] = copy1dArray(fontVariationValues, 'HEAPF32');\n } else {\n textStyle['_fontVariationLen'] = 0;\n textStyle['_fontVariationAxesPtr'] = nullptr;\n textStyle['_fontVariationValuesPtr'] = nullptr;\n }\n }", "applyStyleValues() {\n if (this._style) this._style.parseInlineStyle(this._inlineStyle);\n }", "function codestyling() {\n\t\t$('pre code').each(function(i, e) {\n\t\t\thljs.highlightBlock(e);\n\n\t\t\tif(!$(this).hasClass('language-text')) {\n\t\t\t\tvar code = $(this);\n\t\t\t\tvar lines = code.html().split(/\\n/).length;\n\t\t\t\tvar numbers = [];\n\t\t\t\tfor (i = 1; i < lines; i++) {\n\t\t\t\t\tnumbers += '<span class=\"line\">' + i + '</span>';\n\t\t\t\t}\n\t\t\t\tcode.parent().append('<div class=\"lines\">' + numbers + '</div>');\n\t\t\t}\n\t\t});\n\t}" ]
[ "0.65269905", "0.6442376", "0.61422366", "0.59607124", "0.58378893", "0.5775188", "0.5773922", "0.5773922", "0.56918806", "0.56918806", "0.56918806", "0.56918806", "0.56918806", "0.56918806", "0.56918806", "0.56613845", "0.56613845", "0.5654884", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.5608059", "0.55870765", "0.55698615", "0.55622184", "0.5535341", "0.55266863", "0.55043346", "0.55034757", "0.5477039", "0.5477039", "0.5435976", "0.5414502", "0.5397996", "0.5381231", "0.536963", "0.5341787", "0.5341787", "0.5339349", "0.5336117", "0.5336117", "0.53328407", "0.5309011", "0.5277764", "0.5277204", "0.5259064", "0.5252563", "0.5248552", "0.5245208", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.52433103", "0.5221809", "0.5204883", "0.5163348", "0.5133676", "0.5132139", "0.5124313", "0.5108495", "0.5105012", "0.5096477", "0.5076567", "0.50725114", "0.506772", "0.50656337", "0.50576216", "0.5052236", "0.5029008", "0.5029008", "0.5014974", "0.4992058", "0.49677357", "0.49662638" ]
0.56094074
29
Lightweight form of highlight proceed over this line and update state, but don't save a style array. Used for lines that aren't currently visible.
function processLine(cm, text, context, startAt) { var mode = cm.doc.mode; var stream = new StringStream(text, cm.options.tabSize, context); stream.start = stream.pos = startAt || 0; if (text == "") { callBlankLine(mode, context.state); } while (!stream.eol()) { readToken(mode, stream, context.state); stream.start = stream.pos; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "highlightLine(line_num)\n{\n this.highlightSet = line_num;\n}", "function highlightLine(cm, line, state, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t\t st.push(end, style);\n\t\t }, lineClasses, forceToEnd);\n\t\t\n\t\t // Run overlays, adjust style array.\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t st.splice(i, 1, end, st[i+1], i_end);\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) return;\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t }\n\t\t\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t\t }", "function highlightLine(code_mirror_box, lineIndex, css) {\n\n // first remove any previous highlighting for css\n undoHighlightLine(code_mirror_box, css)\n\n var lineHandle = code_mirror_box.getLineHandle(lineIndex)\n var identifier = \"_\" + css\n if (code_mirror_box[identifier] != lineHandle) {\n cm.addLineClass(lineHandle, \"background\", css)\n code_mirror_box[identifier] = lineHandle\n }\n\n}", "function highlightActiveLine() {\n return activeLineHighlighter;\n}", "function highlightLine(highlight) {\n d3.selectAll('.elm')\n .transition()\n .style('opacity', 0.1)\n .style('stroke-width', 1)\n\n var n = highlight.length;\n for (var i = 0; i < n; i++) {\n d3.selectAll('.sel-'+highlight[i]).transition()\n .style('opacity', 1).style('stroke-width', 3);\n }\n }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\t\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\t\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\r\n st.push(end, style);\r\n }, lineClasses, forceToEnd);\r\n\r\n // Run overlays, adjust style array.\r\n for (var o = 0; o < cm.state.overlays.length; ++o) {\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n st.splice(i, 1, end, st[i+1], i_end);\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) return;\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"cm-overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n }\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\r\n }", "function highlightActiveLine() {\n return activeLineHighlighter;\n}", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "highlight(on) { }", "function highlightLine(cm, line, context, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n\t\t lineClasses, forceToEnd);\n\t\t var state = context.state;\n\n\t\t // Run overlays, adjust style array.\n\t\t var loop = function ( o ) {\n\t\t context.baseTokens = st;\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t context.state = true;\n\t\t runMode(cm, line.text, overlay.mode, context, function (end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t { st.splice(i, 1, end, st[i+1], i_end); }\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) { return }\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t context.state = state;\n\t\t context.baseTokens = null;\n\t\t context.baseTokenPos = 1;\n\t\t };\n\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n\t\t }", "function highlight() {\r\n\tthis.style.backgroundColor = '#ff0';\r\n}", "highlight() {\n if (arguments.length === 2) {\n this._highlightedPositionsToBe.push({ line: arguments[1], col: arguments[0], type: '.' });\n } else if (arguments.length === 1) {\n let { line, col } = linearPosToLineCol(this._lines.join('\\n'), arguments[0]);\n this._highlightedPositionsToBe.push({ line, col, type: '.' });\n } else throw new Error(`highlight: invalid arguments`);\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\r\n lineClasses, forceToEnd);\r\n var state = context.state;\r\n\r\n // Run overlays, adjust style array.\r\n var loop = function ( o ) {\r\n context.baseTokens = st;\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n context.state = true;\r\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n { st.splice(i, 1, end, st[i+1], i_end); }\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) { return }\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n context.state = state;\r\n context.baseTokens = null;\r\n context.baseTokenPos = 1;\r\n };\r\n\r\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\r\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen],\n lineClasses = {}; // Compute the base array of styles\n\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) {\n return st.push(end, style);\n }, lineClasses, forceToEnd);\n var state = context.state; // Run overlays, adjust style array.\n\n var loop = function loop(o) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o],\n i = 1,\n at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i; // Ensure there's a token end at the current position, and that i points at it\n\n while (at < end) {\n var i_end = st[i];\n\n if (i_end > end) {\n st.splice(i, 1, end, st[i + 1], i_end);\n }\n\n i += 2;\n at = Math.min(end, i_end);\n }\n\n if (!style) {\n return;\n }\n\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start + 1];\n st[start + 1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n loop(o);\n }\n\n return {\n styles: st,\n classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null\n };\n }", "highlight_correct() {\n\t\t\tthis.selection_board.get_shape(this.shape).set_highlight('green');\n\t\t\tthis.selection_board.draw();\n\t\t}", "function undoHighlightLine(code_mirror_box, css) {\n var identifier = \"_\" + css\n if (identifier in code_mirror_box) {\n var lineHandle = code_mirror_box[identifier]\n code_mirror_box.removeLineClass(lineHandle, \"background\", css);\n }\n}", "updateHighlight() {\n var on = this.hover || this.selected;\n this.highlighted = on;\n if (on) {\n this.material.emissive = this.defaultEmissiveness;\n } else {\n this.material.emissive = this.defaultEmissiveness\n .clone()\n .multiplyScalar(this.brightness);\n this.material.needsUpdate = true;\n }\n }", "get highlight() { return this._highlight; }", "function highlight() {\n d3.select(this).classed('selected', true)\n }", "function highlight(text, style) {\n var page_html = document.getElementById('page').innerHTML;\n var page = document.getElementById('page');\n var draft_html = document.getElementById('draft').innerHTML;\n var draft = document.getElementById('draft');\n text = text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); //https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\n\n var re = new RegExp(text, 'g');\n var m;\n\n if (text.length > 0) {\n page.innerHTML = page_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n draft.innerHTML = draft_html.replace(re, `<span style='background-color:${style};'>$&</span>`);\n\n } else {\n page.innerHTML = page_html;\n draft.innerHTML = draft_html;\n }\n }", "setHighlightedLabelStyle(style) {\n this._.highlightedLabelStyle = clone(style);\n if (this._.selectedLabel) {\n this.highlightLabel(this._.selectedLabel);\n this.refreshIconsPositions();\n this.animateForAWhile();\n }\n }", "function resetHighlight(e) {\n\te.target.setStyle({\n\t\tweight: 1.5,\n\t\tcolor: '#fff'\n\t});\n\tinfo.update();\n}", "function highlightLink() {\r\n // Extract dimensions / coord from highlighted element\r\n const linkCoords = this.getBoundingClientRect();\r\n // Set the highlight elements dimensions and coords based on THIS' data\r\n highlight.style.width = `${linkCoords.width}px`;\r\n highlight.style.height = `${linkCoords.height}px`;\r\n highlight.style.transform = `translate(${linkCoords.left}px, ${linkCoords.top + window.scrollY}px)`;\r\n}", "function highlightActiveLineGutter() {\n return activeLineGutterHighlighter;\n}", "function highlight(props){\n //change stroke\n var selected = d3.selectAll(\".\" + props.adm1_code)\n .style(\"stroke\", \"#62030F\")\n .style(\"stroke-width\", \"3\");\n\n setLabel(props);\n } //last line of highlight function", "_processUnderline(style, attr) {\n // treat extended attrs as immutable, thus always clone from old one\n // this is needed since the buffer only holds references to it\n attr.extended = attr.extended.clone();\n // default to 1 == single underline\n if (!~style || style > 5) {\n style = 1;\n }\n attr.extended.underlineStyle = style;\n attr.fg |= 268435456 /* UNDERLINE */;\n // 0 deactivates underline\n if (style === 0) {\n attr.fg &= ~268435456 /* UNDERLINE */;\n }\n // update HAS_EXTENDED in BG\n attr.updateExtended();\n }", "set highlightColor(value) {\n if (value === this.highlightColorIn) {\n return;\n }\n this.highlightColorIn = value;\n this.notifyPropertyChanged('highlightColor');\n }", "function highlightSpecialLines() {\n // identify all lines\n find_lines();\n\n d3.select('.increase')\n .on('click', function() {\n // if the lines were already filtered out\n if (state.green) {\n resetSelection();\n state.green = false;\n } else {\n highlightNav(special_lines.green);\n highlightLine(special_lines.green);\n highlightLabel(special_lines.green);\n state.green = true;\n }\n // update graph filter status and reset button\n checkFiltered();\n updateReset();\n })\n\n d3.select('.decrease')\n .on('click', function() {\n if (state.red) {\n resetSelection();\n state.red = false;\n } else {\n state.red = true;\n highlightNav(special_lines.red);\n highlightLine(special_lines.red);\n highlightLabel(special_lines.red);\n }\n // determine if graph is filtered\n checkFiltered();\n updateReset();\n })\n }", "function highlight(state) {\r\n if (element === undefined) element = document.getElementById('shape');\r\n element.style.setProperty('--border-color', (state === \"True\" ? 'steelblue' : '#000'));\r\n\r\n highlighted = (state === \"True\");\r\n}", "function highlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n range.surroundContents(highlightNode);\n selection.removeAllRanges();\n }\n }\n}", "function addRowHighlight(event)\n{\n event.currentTarget.style.backgroundColor = ROW_HOVER_COLOR;\n}", "onLineMouseOver(part) {\n this.setState({...this.state,selectedPart: part})\n }", "highlightPrev() {\n const $highlightOld = this.$autocompleteSuggests.find('tr.highlight');\n let $highlightNew = this.$autocompleteSuggests.find('tr').last();\n\n if ($highlightOld.length) {\n $highlightOld.removeClass('highlight');\n const $highlightOldPrev = $highlightOld.prev();\n\n if ($highlightOldPrev.length) {\n $highlightNew = $highlightOldPrev;\n }\n }\n\n $highlightNew.addClass('highlight');\n this.highlighted = $highlightNew.data('command');\n this._updateState(AUTOCOMPLETE_STATE.COMMANDS.HIGHLIGHT);\n }", "function highlight_lines(lines, css, where = 'text') {\n cm.eachLine(l => {\n if (lines.includes(cm.getLineNumber(l))) {\n cm.addLineClass(l, where, css)\n } else {\n cm.removeLineClass(l, where, css)\n }\n })\n}", "removeHighlight() {\n if (this._highlight) {\n this._highlight.setStyle({\n fillOpacity: 0,\n });\n }\n }", "get highlighted() { return this._highlighted; }", "function changetextstrikethrough() {\n var currentIndex = findCurrentIndex(tempKey);\n if (mainDiagram.model.nodeDataArray[currentIndex].isStrikethrough) {\n mainDiagram.model.nodeDataArray[currentIndex].isStrikethrough = false\n document.getElementById(\"strikethrough\").style.backgroundColor = \"white\"\n }\n else {\n mainDiagram.model.nodeDataArray[currentIndex].isStrikethrough = true;\n document.getElementById(\"strikethrough\").style.backgroundColor = \"#ff8c00\"\n }\n mainDiagram.rebuildParts();\n}", "function mouseover() {\r\n\t// if the piece is movable, give a class name \"highlight\"\r\n\tif(movable(this)) {\r\n\t\tthis.className = \"highlight\";\r\n\t\t// if not, remove the class name \"highlight\"\r\n\t\t} else {\r\n\t\tthis.removeClassName(\"highlight\");\r\n\t}\r\n}", "function highlight(tr) {\n while (tr && tr.length > 0) {\n tr = highlight0(tr);\n if (trjs.events.lineGetCell(tr, trjs.data.TSCOL) || trjs.events.lineGetCell(tr, trjs.data.TECOL))\n break;\n }\n }", "function highlight(props){\n\n //Ids were stored in different forms on the map\n // and the barchart\n var selectThis;\n if(props.Id2){\n selectThis = \".id\" + props.Id2;\n }else{\n selectThis = \".\" + props[0];\n }\n //change stroke\n var selected = d3.selectAll(selectThis)\n .style({\n \"stroke\": \"black\",\n \"stroke-width\": \"2\"\n });\n\n setLabel(props);\n }", "function resetHighlight(e) {\n var layer = e.target;\n layer.setStyle({\n weight: 3,\n opacity: 1,\n fillColor: '#faebd7'\n });\n }", "function processLine(cm, line, state) {\n var mode = cm.doc.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, line, state) {\n var mode = cm.doc.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function highlightLine(parent, selector, elementIndex) {\n const element = parent.querySelectorAll(selector)[elementIndex];\n element.classList.add('highlight');\n element.scrollIntoView({block: 'center'});\n}", "function undoHighlightCurrentCode() {\n // Change the css property by applying no highlighted background color\n $(\"#code_\" + registers[\"rip\"]).css(\"background-color\", \"\");\n}", "function SetHighlight ()\n\t{\n\t\tif( showHighlight == true )\n\t\t{\n\t\t\t// Enable images if they are off\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightBase.gameObject.SetActive( true );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == false )\n\t\t\t\thighlightJoystick.gameObject.SetActive( true );\n\n\t\t\t// Here we need to check if each variable is assigned so we don't get a null reference log error when applying color\n\t\t\tif( highlightBase != null )\n\t\t\t\thighlightBase.color = highlightColor;\n\t\t\tif( highlightJoystick != null )\n\t\t\t\thighlightJoystick.color = highlightColor;\n\n\t\t\t// If we are using fade, then we want to modify our highlight's color\n\t\t\tif( useFade == true )\n\t\t\t\tHandleFade( \"Untouched\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Here we want to check if we have any highlights, and if so, SetActive( false )\n\t\t\tif( highlightBase != null && highlightBase.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightBase.gameObject.SetActive( false );\n\t\t\tif( highlightJoystick != null && highlightJoystick.gameObject.activeInHierarchy == true )\n\t\t\t\thighlightJoystick.gameObject.SetActive( false );\n\t\t}\n\t}", "addHighlight({ hlGroup: _hlGroup, line, colStart: _start, colEnd: _end, srcId: _srcId, }) {\n const hlGroup = typeof _hlGroup !== 'undefined' ? _hlGroup : '';\n const colEnd = typeof _end !== 'undefined' ? _end : -1;\n const colStart = typeof _start !== 'undefined' ? _start : -0;\n const srcId = typeof _srcId !== 'undefined' ? _srcId : -1;\n const method = hlGroup === '' ? 'request' : 'notify';\n let res = this[method](`${this.prefix}add_highlight`, [\n srcId,\n hlGroup,\n line,\n colStart,\n colEnd,\n ]);\n return method === 'request' ? res : Promise.resolve(null);\n }", "function highlightCurrentCode() {\n // Change the css property by applying a highlighted background color of orange\n $(\"#code_\" + registers[\"rip\"]).css('background-color', '#df9857');\n}", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) { lineView.node = built.pre; }\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(cm, lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function applyLineStyle(state, tr, node, startPos) {\n if (node) {\n if (node.attrs && node.attrs.styleName && RESERVED_STYLE_NONE !== node.attrs.styleName) {\n const styleProp = getCustomStyleByName(node.attrs.styleName);\n if (\n null !== styleProp &&\n styleProp.styles &&\n styleProp.styles.boldPartial\n ) {\n if (!tr) {\n tr = state.tr;\n }\n tr = addMarksToLine(\n tr,\n state,\n node,\n startPos,\n styleProp.styles.boldSentence\n );\n }\n }\n } else {\n const { selection } = state;\n const from = selection.$from.before(1);\n const to = selection.$to.after(1);\n // [FS] IRAD-1168 2021-06-21\n // FIX: multi-select paragraphs and apply a style with the bold the first sentence,\n // only the last selected paragraph have bold first sentence.\n tr.doc.nodesBetween(from, to, (node, pos) => {\n if (node.content && node.content.content && node.content.content.length) {\n // Check styleName is available for node\n if (\n node.attrs &&\n node.attrs.styleName &&\n RESERVED_STYLE_NONE !== node.attrs.styleName\n ) {\n const styleProp = getCustomStyleByName(node.attrs.styleName);\n if (\n null !== styleProp &&\n styleProp.styles &&\n styleProp.styles.boldPartial\n ) {\n if (!tr) {\n tr = state.tr;\n }\n tr = addMarksToLine(\n tr,\n state,\n node,\n pos,\n styleProp.styles.boldSentence\n );\n }\n }\n }\n });\n }\n return tr;\n}", "function highlightLine(parent, selector, elementIndex) {\n // console.log('parent, selector, element', parent, selector, elementIndex);\n const element = parent.querySelectorAll(selector)[elementIndex];\n element.classList.add('highlight');\n element.scrollIntoView({inline: 'center'});\n}", "function highlight(field) {\r\n if(field.getAttribute('readonly')) {\r\n return;\r\n }\r\n if(field.select != null)\r\n field.select();\r\n field.onblur=unhighlight;\r\n// field.oldBackgroundColor = computedStyle(field,'backgroundColor','background-color');\r\n field.style.backgroundColor='#e6e6e6';\r\n}", "function highlight(props){\r\n //change stroke\r\n var selected = d3.selectAll(\".\" + props.CODE)\r\n .style(\"stroke\", \"blue\")\r\n .style(\"stroke-width\", \"2\");\r\n setLabel(props);\r\n}", "function changetextunderline() {\n var currentIndex = findCurrentIndex(tempKey);\n if (mainDiagram.model.nodeDataArray[currentIndex].isUnderline) {\n mainDiagram.model.nodeDataArray[currentIndex].isUnderline = false\n document.getElementById(\"underline\").style.backgroundColor = \"white\"\n }\n else {\n mainDiagram.model.nodeDataArray[currentIndex].isUnderline = true;\n document.getElementById(\"underline\").style.backgroundColor = \"#ff8c00\"\n }\n mainDiagram.rebuildParts();\n}", "function paintFirstSpanInLine(){\n var oldTop;\n // target = our text\n var $selected = $('#selectme');\n //$selectedArray = $selected.text().split(' ');\n // separate each word into its own span\n $selected.html(\"<span>\" + $selected.text().split(' ').join(\"</span> <span>\") + \"</span>\");\n oldTop = -1;\n $selected.find('span').each(function(){\n var $this = $(this),\n top = $this.position().top;\n if (top > oldTop){\n $this.css(\"color\", \"rgb(0, 255, 180)\");\n oldTop = top;\n }\n });\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }" ]
[ "0.68473744", "0.68018955", "0.67464715", "0.66991407", "0.66876996", "0.6672703", "0.66450125", "0.66450125", "0.66450125", "0.66450125", "0.66450125", "0.66450125", "0.66450125", "0.6641981", "0.6641981", "0.66312367", "0.6630908", "0.6606648", "0.6606648", "0.6594182", "0.6517111", "0.6407068", "0.6385785", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.6303495", "0.626529", "0.6262471", "0.6262471", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.6245575", "0.62363", "0.6180063", "0.60869074", "0.60631675", "0.6041989", "0.6020139", "0.59973955", "0.5960011", "0.58873326", "0.58643526", "0.5862769", "0.58550346", "0.58446634", "0.58407617", "0.58287877", "0.5804413", "0.5796409", "0.579064", "0.5787237", "0.5783844", "0.5773933", "0.57555467", "0.5751352", "0.57494205", "0.57487345", "0.57259417", "0.5724129", "0.572254", "0.5722493", "0.5722493", "0.5720522", "0.57130355", "0.5704594", "0.56867486", "0.56787896", "0.56645715", "0.56643593", "0.56617534", "0.56559896", "0.5653829", "0.56401634", "0.56368196", "0.5632953", "0.56267095", "0.56267095", "0.56267095", "0.56267095", "0.56267095", "0.56267095" ]
0.0
-1
Utility for getTokenAt and getLineTokens
function takeToken(cm, pos, precise, asArray) { var doc = cm.doc, mode = doc.mode, style; pos = clipPos(doc, pos); var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; if (asArray) { tokens = []; } while ((asArray || stream.pos < pos.ch) && !stream.eol()) { stream.start = stream.pos; style = readToken(mode, stream, context.state); if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } } return asArray ? tokens : new Token(stream, style, context.state) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeToken(cm, pos, precise, asArray) {\n\t\t var doc = cm.doc, mode = doc.mode, style;\n\t\t pos = clipPos(doc, pos);\n\t\t var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n\t\t var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n\t\t if (asArray) { tokens = []; }\n\t\t while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n\t\t stream.start = stream.pos;\n\t\t style = readToken(mode, stream, context.state);\n\t\t if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n\t\t }\n\t\t return asArray ? tokens : new Token(stream, style, context.state)\n\t\t }", "function takeToken(cm, pos, precise, asArray) {\n\t\t function getObj(copy) {\n\t\t return {start: stream.start, end: stream.pos,\n\t\t string: stream.current(),\n\t\t type: style || null,\n\t\t state: copy ? copyState(doc.mode, state) : state};\n\t\t }\n\t\t\n\t\t var doc = cm.doc, mode = doc.mode, style;\n\t\t pos = clipPos(doc, pos);\n\t\t var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n\t\t var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n\t\t if (asArray) tokens = [];\n\t\t while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n\t\t stream.start = stream.pos;\n\t\t style = readToken(mode, stream, state);\n\t\t if (asArray) tokens.push(getObj(true));\n\t\t }\n\t\t return asArray ? tokens : getObj();\n\t\t }", "function takeToken(cm, pos, precise, asArray) {\r\n var doc = cm.doc, mode = doc.mode, style;\r\n pos = clipPos(doc, pos);\r\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\r\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\r\n if (asArray) { tokens = []; }\r\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\r\n stream.start = stream.pos;\r\n style = readToken(mode, stream, context.state);\r\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\r\n }\r\n return asArray ? tokens : new Token(stream, style, context.state)\r\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n}", "function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }", "function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }", "function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }", "function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }", "function takeToken(cm, pos, precise, asArray) {\n function getObj(copy) {\n return {start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state};\n }\n\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n if (asArray) tokens = [];\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, state);\n if (asArray) tokens.push(getObj(true));\n }\n return asArray ? tokens : getObj();\n }", "function takeToken(cm, pos, precise, asArray) {\n\t function getObj(copy) {\n\t return {start: stream.start, end: stream.pos,\n\t string: stream.current(),\n\t type: style || null,\n\t state: copy ? copyState(doc.mode, state) : state};\n\t }\n\t\n\t var doc = cm.doc, mode = doc.mode, style;\n\t pos = clipPos(doc, pos);\n\t var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n\t var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n\t if (asArray) tokens = [];\n\t while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n\t stream.start = stream.pos;\n\t style = readToken(mode, stream, state);\n\t if (asArray) tokens.push(getObj(true));\n\t }\n\t return asArray ? tokens : getObj();\n\t }", "function takeToken(cm, pos, precise, asArray) {\n\t function getObj(copy) {\n\t return {start: stream.start, end: stream.pos,\n\t string: stream.current(),\n\t type: style || null,\n\t state: copy ? copyState(doc.mode, state) : state};\n\t }\n\n\t var doc = cm.doc, mode = doc.mode, style;\n\t pos = clipPos(doc, pos);\n\t var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n\t var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n\t if (asArray) tokens = [];\n\t while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n\t stream.start = stream.pos;\n\t style = readToken(mode, stream, state);\n\t if (asArray) tokens.push(getObj(true));\n\t }\n\t return asArray ? tokens : getObj();\n\t }", "function takeToken(cm, pos, precise, asArray) {\n\t function getObj(copy) {\n\t return {start: stream.start, end: stream.pos,\n\t string: stream.current(),\n\t type: style || null,\n\t state: copy ? copyState(doc.mode, state) : state};\n\t }\n\n\t var doc = cm.doc, mode = doc.mode, style;\n\t pos = clipPos(doc, pos);\n\t var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise);\n\t var stream = new StringStream(line.text, cm.options.tabSize), tokens;\n\t if (asArray) tokens = [];\n\t while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n\t stream.start = stream.pos;\n\t style = readToken(mode, stream, state);\n\t if (asArray) tokens.push(getObj(true));\n\t }\n\t return asArray ? tokens : getObj();\n\t }", "function takeToken(cm, pos, precise, asArray) {\n var getObj = function (copy) { return ({\n start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state\n }); }\n\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, state)\n if (asArray) { tokens.push(getObj(true)) }\n }\n return asArray ? tokens : getObj()\n}", "function takeToken(cm, pos, precise, asArray) {\n var getObj = function (copy) { return ({\n start: stream.start, end: stream.pos,\n string: stream.current(),\n type: style || null,\n state: copy ? copyState(doc.mode, state) : state\n }); }\n\n var doc = cm.doc, mode = doc.mode, style\n pos = clipPos(doc, pos)\n var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)\n var stream = new StringStream(line.text, cm.options.tabSize), tokens\n if (asArray) { tokens = [] }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos\n style = readToken(mode, stream, state)\n if (asArray) { tokens.push(getObj(true)) }\n }\n return asArray ? tokens : getObj()\n}", "function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc,\n mode = doc.mode,\n style;\n pos = _clipPos(doc, pos);\n var line = getLine(doc, pos.line),\n context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context),\n tokens;\n\n if (asArray) {\n tokens = [];\n }\n\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n\n if (asArray) {\n tokens.push(new Token(stream, style, copyState(doc.mode, context.state)));\n }\n }\n\n return asArray ? tokens : new Token(stream, style, context.state);\n }", "getTokenFromCode(code) {\n switch (code) {\n // newlines are significant!\n case 13:\n if (this.input.charCodeAt(this.state.pos + 1) === 10) {\n ++this.state.pos;\n }\n case 10: case 8232: case 8233:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n return this.finishToken(tt.newline);\n\n // The interpretation of a dot depends on whether it is followed\n // by a digit or another two dots.\n case 46: // '.'\n // TODO: use \"readNumberStartingWithDot\" (that just calls readNumber, but it's for readability :))\n return this.readToken_dot();\n\n // Punctuation tokens.\n case 40: ++this.state.pos; return this.finishToken(tt.parenL); // '('\n case 41: ++this.state.pos; return this.finishToken(tt.parenR); // ')'\n case 44: ++this.state.pos; return this.finishToken(tt.comma); // ','\n case 91: ++this.state.pos; return this.finishToken(tt.bracketL); // '['\n case 93: ++this.state.pos; return this.finishToken(tt.bracketR); // ']'\n case 123: ++this.state.pos; return this.finishToken(tt.braceL); // '{'\n case 125: ++this.state.pos; return this.finishToken(tt.braceR); // '}'\n\n case 59: return this.readToken_semi(); // ';'\n case 33: return this.readToken_excl(); // '!'\n\n case 58:\n if (this.input.charCodeAt(this.state.pos + 1) === 58) {\n this.state.pos += 2;\n return this.finishToken(tt.doubleColon, '::');\n } else {\n ++this.state.pos;\n return this.finishToken(tt.colon);\n }\n\n case 63: ++this.state.pos; return this.finishToken(tt.question);\n // TODO: figure out alternate syntax for 'this' shorthand. Probably `@.`, but no standalone\n case 64: ++this.state.pos; return this.finishToken(tt.at);\n\n case 96: // '`'\n ++this.state.pos;\n return this.finishToken(tt.backQuote);\n\n case 48: // '0'\n let next = this.input.charCodeAt(this.state.pos + 1);\n if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number\n if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number\n if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number\n // Anything else beginning with a digit is an integer, octal\n // number, or float.\n case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9\n return this.readNumber();\n\n // Quotes produce strings.\n case 34: case 39: // '\"', \"'\"\n return this.readString(code);\n\n // Operators are parsed inline in tiny state machines. '=' (61) is\n // often referred to. `finishOp` simply skips the amount of\n // characters it is given as second argument, and returns a token\n // of the type given by its first argument.\n\n case 47: // '/'\n return this.readToken_slash();\n\n case 37: return this.finishEqOrType(tt.modulo); // '%'\n case 124: return this.finishEqOrType(tt.bitwiseOR); // '|'\n case 38: return this.finishEqOrType(tt.bitwiseAND); // '&'\n case 94: return this.finishEqOrType(tt.bitwiseXOR); // '^'\n\n case 42: return this.readToken_star(); //'*'\n\n case 43: case 45: // '+-'\n return this.readToken_plus_min(code);\n\n case 60: case 62: // '<>'\n return this.readToken_lt_gt(code);\n\n case 61: // '='\n return this.readToken_eq();\n\n case 126: // '~'\n ++this.state.pos;\n return this.finishToken(tt.bitwiseNOT);\n }\n this.raise(this.state.pos, `Unexpected character '${codePointToString(code)}' (${code})`);\n }", "function getTokenFromBuffer(offset) {\n\t\t\tvar toRead = offset - tokenBuffer.length + 1;\n\t\t\twhile (toRead-- > 0) readTokenToBuffer();\n\t\t\treturn tokenBuffer[offset];\n\t\t}", "function getTokens(board, line) {\n return [board[line[0]], board[line[1]], board[line[2]]];\n}", "readToken() {\n for (let i = 0; i < TOKENS.length; i++) {\n const token = TOKENS[i];\n if (token === this.line.substr(this.pos, token.length).toUpperCase()) {\n return FIRST_TOKEN + i;\n }\n }\n return undefined;\n }", "function getTokenAtPosition(sourceFile, position, includeJsDocComment) {\n if (includeJsDocComment === void 0) { includeJsDocComment = false; }\n return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ true, /*includeItemAtEndPosition*/ undefined, includeJsDocComment);\n }", "function getToken(c) {\n return c >= FIRST_TOKEN && c < FIRST_TOKEN + TOKENS.length ? TOKENS[c - FIRST_TOKEN] : undefined;\n}", "function NextTokenInfo()\n {\n if (tokenIndex >= tokens.length) {\n console.log(\"sheets.js: NextTokenInfo: Ran out of tokens!\");\n return ['.', -1, -1];\n }\n var tokenInfo = tokens[tokenIndex++];\n return tokenInfo;\n }", "function currentTokenRange() {\n var pos = m_lexed.indices[m_position]\n var nextPos = m_lexed.indices[m_position + 1]\n return [pos, nextPos - pos - 1]\n }", "token(input, start, value) { return new Token(input,start,input.pos,this.type,value) }", "lineToken({chunk = this.chunk, offset = 0} = {}) {\r\n\t\t\t\tvar backslash, diff, endsContinuationLineIndentation, indent, match, minLiteralLength, newIndentLiteral, noNewlines, prev, ref, size;\r\n\t\t\t\tif (!(match = MULTI_DENT.exec(chunk))) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\tindent = match[0];\r\n\t\t\t\tprev = this.prev();\r\n\t\t\t\tbackslash = (prev != null ? prev[0] : void 0) === '\\\\';\r\n\t\t\t\tif (!((backslash || ((ref = this.seenFor) != null ? ref.endsLength : void 0) < this.ends.length) && this.seenFor)) {\r\n\t\t\t\t\tthis.seenFor = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!((backslash && this.seenImport) || this.importSpecifierList)) {\r\n\t\t\t\t\tthis.seenImport = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!((backslash && this.seenExport) || this.exportSpecifierList)) {\r\n\t\t\t\t\tthis.seenExport = false;\r\n\t\t\t\t}\r\n\t\t\t\tsize = indent.length - 1 - indent.lastIndexOf('\\n');\r\n\t\t\t\tnoNewlines = this.unfinished();\r\n\t\t\t\tnewIndentLiteral = size > 0 ? indent.slice(-size) : '';\r\n\t\t\t\tif (!/^(.?)\\1*$/.exec(newIndentLiteral)) {\r\n\t\t\t\t\tthis.error('mixed indentation', {\r\n\t\t\t\t\t\toffset: indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tminLiteralLength = Math.min(newIndentLiteral.length, this.indentLiteral.length);\r\n\t\t\t\tif (newIndentLiteral.slice(0, minLiteralLength) !== this.indentLiteral.slice(0, minLiteralLength)) {\r\n\t\t\t\t\tthis.error('indentation mismatch', {\r\n\t\t\t\t\t\toffset: indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tif (size - this.continuationLineAdditionalIndent === this.indent) {\r\n\t\t\t\t\tif (noNewlines) {\r\n\t\t\t\t\t\tthis.suppressNewlines();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.newlineToken(offset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tif (size > this.indent) {\r\n\t\t\t\t\tif (noNewlines) {\r\n\t\t\t\t\t\tif (!backslash) {\r\n\t\t\t\t\t\t\tthis.continuationLineAdditionalIndent = size - this.indent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.continuationLineAdditionalIndent) {\r\n\t\t\t\t\t\t\tprev.continuationLineIndent = this.indent + this.continuationLineAdditionalIndent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.suppressNewlines();\r\n\t\t\t\t\t\treturn indent.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!this.tokens.length) {\r\n\t\t\t\t\t\tthis.baseIndent = this.indent = size;\r\n\t\t\t\t\t\tthis.indentLiteral = newIndentLiteral;\r\n\t\t\t\t\t\treturn indent.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdiff = size - this.indent + this.outdebt;\r\n\t\t\t\t\tthis.token('INDENT', diff, {\r\n\t\t\t\t\t\toffset: offset + indent.length - size,\r\n\t\t\t\t\t\tlength: size\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.indents.push(diff);\r\n\t\t\t\t\tthis.ends.push({\r\n\t\t\t\t\t\ttag: 'OUTDENT'\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.outdebt = this.continuationLineAdditionalIndent = 0;\r\n\t\t\t\t\tthis.indent = size;\r\n\t\t\t\t\tthis.indentLiteral = newIndentLiteral;\r\n\t\t\t\t} else if (size < this.baseIndent) {\r\n\t\t\t\t\tthis.error('missing indentation', {\r\n\t\t\t\t\t\toffset: offset + indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tendsContinuationLineIndentation = this.continuationLineAdditionalIndent > 0;\r\n\t\t\t\t\tthis.continuationLineAdditionalIndent = 0;\r\n\t\t\t\t\tthis.outdentToken({\r\n\t\t\t\t\t\tmoveOut: this.indent - size,\r\n\t\t\t\t\t\tnoNewlines,\r\n\t\t\t\t\t\toutdentLength: indent.length,\r\n\t\t\t\t\t\toffset,\r\n\t\t\t\t\t\tindentSize: size,\r\n\t\t\t\t\t\tendsContinuationLineIndentation\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn indent.length;\r\n\t\t\t}", "tokenizer(token , isEndOfInput , previousTokens , terminal , config){\n }", "_getYamlToken (cm, cur) {\n let token\n const { lineTokens, lineString } = this._getTokenLine(cm, cur)\n forEach(lineTokens, lineToken => {\n const result = lineToken.string.match(/^(\\s*)-\\s(.*)?$/)\n if (result) {\n const indent = result[1]\n token = lineToken\n token.type = 'firstArrayItem'\n token.string = this._getTokenStringFromLine(lineString, cur.ch)\n token.indent = token.start = indent.length\n token.end = token.start + token.string.length + this.arrayBulletIndent\n token.propertyName = trim(token.string)\n\n const objectToken = this._returnObjectTokenFromTokenLine(lineTokens)\n if (objectToken) {\n // firstArrayItem line can also start new object\n token.propertyName = objectToken.propertyName\n }\n }\n })\n if (!token) {\n token = this._returnObjectTokenFromTokenLine(lineTokens)\n }\n if (!token) {\n token = cm.getTokenAt(cur, true)\n token.string = this._getTokenStringFromLine(lineString, cur.ch)\n token.start = token.end - token.string.length\n }\n return token\n }", "function Tokens(code) {\n\n this.tokens = tokenize(code);\n\n // Remmeber all of the tokens eaten so we can provide useful error message context.\n this.eaten = [];\n\n this.eat = function (expected) {\n //console.log(expected);\n\n if (expected && !this.nextIs(expected)) {\n console.log(\"expected\", expected);\n throw new Error(\"Line \" + this.currentLine() + \": expected '\" + expected + \"', but found '\" + this.tokens.slice(0, 5).join(\" \") + \"'\");\n }\n\n var eaten = this.tokens.shift();\n\n this.eaten.push(eaten);\n\n return eaten;\n };\n\n this.uneat = function () {\n\n this.tokens.unshift(this.eaten.pop());\n };\n\n this.eatN = function (n) {\n\n for (var i = 0; i < n; i++) this.eat();\n };\n\n this.count = function (text) {\n\n var index = 0;\n while (index < this.tokens.length && this.tokens[index] === text) index++;\n return index;\n };\n\n this.hasNext = function () {\n return this.tokens.length > 0;\n };\n this.nextIs = function (string) {\n return this.hasNext() && this.peek() === string;\n };\n this.peek = function () {\n return this.hasNext() ? this.tokens[0].toLowerCase() : null;\n };\n\n this.currentLine = function () {\n\n var line = 1;\n for (var i = 0; i < this.eaten.length; ++i) {\n if (this.eaten[i] === \"\\n\") line++;\n }\n return line;\n };\n}", "function getToken() {\n tokenType = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r') { // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c == '#') {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) == ' ' || dot.charAt(i) == '\\t') {\n i--;\n }\n if (dot.charAt(i) == '\\n' || dot.charAt(i) == '') {\n // the # is at the start of a line, this is indeed a line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n }\n if (c == '/' && nextPreview() == '/') {\n // skip line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n if (c == '/' && nextPreview() == '*') {\n // skip block comment\n while (c != '') {\n if (c == '*' && nextPreview() == '/') {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n }\n else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c == ' ' || c == '\\t' || c == '\\n' || c == '\\r') { // space, tab, enter\n next();\n }\n }\n while (isComment);\n\n // check for end of dot file\n if (c == '') {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c == '-') {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token == 'false') {\n token = false; // convert to boolean\n }\n else if (token == 'true') {\n token = true; // convert to boolean\n }\n else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c == '\"') {\n next();\n while (c != '' && (c != '\"' || (c == '\"' && nextPreview() == '\"'))) {\n token += c;\n if (c == '\"') { // skip the escape character\n next();\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n }", "function startLine(token) {\n return token.startLine || token.line;\n }", "function getToken() {\n tokenType = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c === '#') {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) === ' ' || dot.charAt(i) === '\\t') {\n i--;\n }\n if (dot.charAt(i) === '\\n' || dot.charAt(i) === '') {\n // the # is at the start of a line, this is indeed a line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n }\n if (c === '/' && nextPreview() === '/') {\n // skip line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n if (c === '/' && nextPreview() === '*') {\n // skip block comment\n while (c != '') {\n if (c === '*' && nextPreview() === '/') {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n } else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n } while (isComment);\n\n // check for end of dot file\n if (c === '') {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c === '-') {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token === 'false') {\n token = false; // convert to boolean\n } else if (token === 'true') {\n token = true; // convert to boolean\n } else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c === '\"') {\n next();\n while (c != '' && (c != '\"' || c === '\"' && nextPreview() === '\"')) {\n if (c === '\"') {\n // skip the escape character\n token += c;\n next();\n } else if (c === '\\\\' && nextPreview() === 'n') {\n // Honor a newline escape sequence\n token += '\\n';\n next();\n } else {\n token += c;\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n}", "function getToken(line) {\n line = line.replace(CommentsRegex, '') //remove the comments parts\n line = line.replace(/^\\s+|\\s+$/, '') // strip the spaces\n let match\n if (match = MemoryRegex.exec(line)) {\n return {\n type: 'memory',\n command: match[0],\n operator: match[1],\n segment: match[2],\n index: match[3]\n }\n } else if (match = ALRegex.exec(line)) {\n return {\n type: 'al',\n command: match[0],\n operator: match[1]\n }\n } else if (match = FunctionRegex.exec(line)) {\n return {\n type: 'function',\n command: match[0],\n action: match[1],\n functionName: match[2],\n count: match[3]\n }\n } else if (match = FlowRegex.exec(line)) {\n return {\n type: 'flow',\n command: match[0],\n operator: match[1],\n label: match[2]\n }\n } else if (/^\\s*$/.exec(line)) { // an empty line\n return null\n } else {\n throw SyntaxError('Unrecognizable Commmand.')\n }\n}", "function getToken() {\n tokenType = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c === '#') {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) === ' ' || dot.charAt(i) === '\\t') {\n i--;\n }\n if (dot.charAt(i) === '\\n' || dot.charAt(i) === '') {\n // the # is at the start of a line, this is indeed a line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n }\n if (c === '/' && nextPreview() === '/') {\n // skip line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n if (c === '/' && nextPreview() === '*') {\n // skip block comment\n while (c != '') {\n if (c === '*' && nextPreview() === '/') {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n } else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n } while (isComment);\n\n // check for end of dot file\n if (c === '') {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c === '-') {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token === 'false') {\n token = false; // convert to boolean\n } else if (token === 'true') {\n token = true; // convert to boolean\n } else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c === '\"') {\n next();\n while (c != '' && (c != '\"' || c === '\"' && nextPreview() === '\"')) {\n token += c;\n if (c === '\"') {\n // skip the escape character\n next();\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n }", "function getToken() {\n tokenType = TOKENTYPE.NULL;\n token = '';\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c === '#') {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) === ' ' || dot.charAt(i) === '\\t') {\n i--;\n }\n if (dot.charAt(i) === '\\n' || dot.charAt(i) === '') {\n // the # is at the start of a line, this is indeed a line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n }\n if (c === '/' && nextPreview() === '/') {\n // skip line comment\n while (c != '' && c != '\\n') {\n next();\n }\n isComment = true;\n }\n if (c === '/' && nextPreview() === '*') {\n // skip block comment\n while (c != '') {\n if (c === '*' && nextPreview() === '/') {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n } else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c === ' ' || c === '\\t' || c === '\\n' || c === '\\r') {\n // space, tab, enter\n next();\n }\n } while (isComment);\n\n // check for end of dot file\n if (c === '') {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c === '-') {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token === 'false') {\n token = false; // convert to boolean\n } else if (token === 'true') {\n token = true; // convert to boolean\n } else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c === '\"') {\n next();\n while (c != '' && (c != '\"' || c === '\"' && nextPreview() === '\"')) {\n token += c;\n if (c === '\"') {\n // skip the escape character\n next();\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != '') {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n }", "function takeLine$2144(from$2170, to$2171) {\n var next$2172;\n if (to$2171.token.type === parser$2126.Token.Delimiter) {\n var sm_startLineNumber$2173 = typeof to$2171.token.sm_startLineNumber !== 'undefined' ? to$2171.token.sm_startLineNumber : to$2171.token.startLineNumber;\n var sm_endLineNumber$2174 = typeof to$2171.token.sm_endLineNumber !== 'undefined' ? to$2171.token.sm_endLineNumber : to$2171.token.endLineNumber;\n var sm_startLineStart$2175 = typeof to$2171.token.sm_startLineStart !== 'undefined' ? to$2171.token.sm_startLineStart : to$2171.token.startLineStart;\n var sm_endLineStart$2176 = typeof to$2171.token.sm_endLineStart !== 'undefined' ? to$2171.token.sm_endLineStart : to$2171.token.endLineStart;\n var sm_startRange$2177 = typeof to$2171.token.sm_startRange !== 'undefined' ? to$2171.token.sm_startRange : to$2171.token.startRange;\n var sm_endRange$2178 = typeof to$2171.token.sm_endRange !== 'undefined' ? to$2171.token.sm_endRange : to$2171.token.endRange;\n if (from$2170.token.type === parser$2126.Token.Delimiter) {\n next$2172 = syntaxFromToken$2130({\n type: parser$2126.Token.Delimiter,\n value: to$2171.token.value,\n inner: takeLineContext$2143(from$2170, to$2171.token.inner),\n startRange: from$2170.token.startRange,\n endRange: from$2170.token.endRange,\n startLineNumber: from$2170.token.startLineNumber,\n startLineStart: from$2170.token.startLineStart,\n endLineNumber: from$2170.token.endLineNumber,\n endLineStart: from$2170.token.endLineStart,\n sm_startLineNumber: sm_startLineNumber$2173,\n sm_endLineNumber: sm_endLineNumber$2174,\n sm_startLineStart: sm_startLineStart$2175,\n sm_endLineStart: sm_endLineStart$2176,\n sm_startRange: sm_startRange$2177,\n sm_endRange: sm_endRange$2178\n }, to$2171);\n } else {\n next$2172 = syntaxFromToken$2130({\n type: parser$2126.Token.Delimiter,\n value: to$2171.token.value,\n inner: takeLineContext$2143(from$2170, to$2171.token.inner),\n startRange: from$2170.token.range,\n endRange: from$2170.token.range,\n startLineNumber: from$2170.token.lineNumber,\n startLineStart: from$2170.token.lineStart,\n endLineNumber: from$2170.token.lineNumber,\n endLineStart: from$2170.token.lineStart,\n sm_startLineNumber: sm_startLineNumber$2173,\n sm_endLineNumber: sm_endLineNumber$2174,\n sm_startLineStart: sm_startLineStart$2175,\n sm_endLineStart: sm_endLineStart$2176,\n sm_startRange: sm_startRange$2177,\n sm_endRange: sm_endRange$2178\n }, to$2171);\n }\n } else {\n var sm_lineNumber$2179 = typeof to$2171.token.sm_lineNumber !== 'undefined' ? to$2171.token.sm_lineNumber : to$2171.token.lineNumber;\n var sm_lineStart$2180 = typeof to$2171.token.sm_lineStart !== 'undefined' ? to$2171.token.sm_lineStart : to$2171.token.lineStart;\n var sm_range$2181 = typeof to$2171.token.sm_range !== 'undefined' ? to$2171.token.sm_range : to$2171.token.range;\n if (from$2170.token.type === parser$2126.Token.Delimiter) {\n next$2172 = syntaxFromToken$2130({\n value: to$2171.token.value,\n type: to$2171.token.type,\n lineNumber: from$2170.token.startLineNumber,\n lineStart: from$2170.token.startLineStart,\n range: from$2170.token.startRange,\n sm_lineNumber: sm_lineNumber$2179,\n sm_lineStart: sm_lineStart$2180,\n sm_range: sm_range$2181\n }, to$2171);\n } else {\n next$2172 = syntaxFromToken$2130({\n value: to$2171.token.value,\n type: to$2171.token.type,\n lineNumber: from$2170.token.lineNumber,\n lineStart: from$2170.token.lineStart,\n range: from$2170.token.range,\n sm_lineNumber: sm_lineNumber$2179,\n sm_lineStart: sm_lineStart$2180,\n sm_range: sm_range$2181\n }, to$2171);\n }\n }\n if (to$2171.token.leadingComments) {\n next$2172.token.leadingComments = to$2171.token.leadingComments;\n }\n if (to$2171.token.trailingComments) {\n next$2172.token.trailingComments = to$2171.token.trailingComments;\n }\n return next$2172;\n }", "tokenBefore(types) {\n let token = language.syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types.indexOf(token.name) < 0)\n token = token.parent;\n return token ? { from: token.from, to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type } : null;\n }", "getToken() { return this.token.getToken(); }", "positionAt(offset) {\n const before = this.textDocument.slice(0, offset);\n const newLines = before.match(/\\n/g);\n const line = newLines ? newLines.length : 0;\n const preCharacters = before.match(/(\\n|^).*$/g);\n return new tokenizer_1.Position(line, preCharacters ? preCharacters[0].length : 0);\n }", "function getTouchingToken(sourceFile, position, includeItemAtEndPosition, includeJsDocComment) {\n if (includeJsDocComment === void 0) { includeJsDocComment = false; }\n return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ false, includeItemAtEndPosition, includeJsDocComment);\n }", "findTokenIndexAtOffset(offset) {\r\n return LineTokens.findIndexInTokensArray(this._tokens, offset);\r\n }", "function readTokenToBuffer() {\n\t\t\t// init local variables\n\t\t\tvar startPos, matchPos, matchStr, match, length;\n\n\t\t\tfor (;;) if (tokenRegExp.lastIndex !== inputLength) {\n\t\t\t\tstartPos = tokenRegExp.lastIndex;\n\t\t\t\tif (match = tokenRegExp.exec(inputString)) {\n\t\t\t\t\tmatchStr = match[0], matchPos = match.index;\n\n\t\t\t\t\t// check if we have T_ERR token\n\t\t\t\t\tif (length = matchPos - startPos) {\n\t\t\t\t\t\ttokenBuffer.push({\n\t\t\t\t\t\t\ttype: T_ERR,\n\t\t\t\t\t\t\tpos: startPos,\n\t\t\t\t\t\t\tvalue: inputString.substr(startPos, length)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tlength = match.length;\n\n\t\t\t\t\t// find matched group index\n\t\t\t\t\twhile (match[length--] === undefined);\n\n\t\t\t\t\t// obtain token info\n\t\t\t\t\tmatch = tokenIds[length];\n\t\t\t\t\t// match next token in case if this one is ignored\n\t\t\t\t\tif (match === IGNORE_START) continue;\n\t\t\t\t\t// return matched token\n\t\t\t\t\treturn tokenBuffer.push({\n\t\t\t\t\t\ttype: match,\n\t\t\t\t\t\tpos: matchPos,\n\t\t\t\t\t\tvalue: matchStr\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// return T_ERR token in case if we couldn't match anything\n\t\t\t\telse return (\n\t\t\t\t\ttokenRegExp.lastIndex = inputLength,\n\t\t\t\t\ttokenBuffer.push({\n\t\t\t\t\t\ttype: T_ERR,\n\t\t\t\t\t\tpos: startPos,\n\t\t\t\t\t\tvalue: inputString.slice(startPos)\n\t\t\t\t\t})\n\t\t\t\t);\n\n\t\t\t}\n\t\t\t// return T_EOF if we reached end of file\n\t\t\telse return tokenBuffer.push({\n\t\t\t\ttype: T_EOF,\n\t\t\t\tpos: inputLength\n\t\t\t});\n\t\t}", "nextToken() {\n let c1 = this.la(0);\n if(c1 < 128) {\n let t = this.map[c1];\n if(t >= 0) {\n return this.acceptToken(t, 1);\n } else {\n t = -t;\n if(t < this.Literal.$Literal) {\n return this.lexKnownToken(t);\n } else {\n return this.lexUnknownToken(t);\n }\n }\n } else if(Number.isNaN(c1)) {\n return this.acceptToken(this.Token.$EOF, 0);\n } else {\n return this.lexNonAsciiToken(c1);\n }\n }", "function factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}", "current() { return (0<=this.pos && this.pos<this.tokens.length)?this.tokens[this.pos]:null; }", "tokenize(buf, off, len, line, column) {\n this._reset(line, column);\n\n let parseState = START;\n for (let i = 0; i < len; i += 1) {\n const c = buf[off + i];\n switch (parseState) {\n case START:\n if (c === '<') {\n parseState = TAG;\n }\n break;\n case TAG:\n if (c === '/') {\n this.endTag = true;\n parseState = NAME;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = INSIDE;\n } else {\n this.tagName += c;\n parseState = NAME;\n }\n break;\n case NAME:\n if (isWhitespace(c)) {\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n parseState = END;\n } else if (c === '/') {\n parseState = ENDSLASH;\n } else {\n this.tagName += c;\n }\n break;\n case INSIDE:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (isWhitespace(c)) {\n parseState = BETWEEN_ATTNAME;\n } else {\n this.attName += c;\n }\n break;\n case BETWEEN_ATTNAME:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '/') {\n this._attributeEnded();\n parseState = ENDSLASH;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '=') {\n parseState = EQUAL;\n } else if (!isWhitespace(c)) {\n this._attributeEnded();\n this.attName += c;\n parseState = ATTNAME;\n }\n break;\n case EQUAL:\n if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this._attributeValueStarted();\n this.quoteChar = c;\n parseState = STRING;\n } else if (!isWhitespace(c)) {\n this._attributeValueStarted();\n this.attValue += c;\n parseState = ATTVALUE;\n }\n break;\n case ATTVALUE:\n if (isWhitespace(c)) {\n this._attributeEnded();\n parseState = INSIDE;\n } else if (c === '\"' || c === '\\'') {\n this._attributeEnded();\n this.quoteChar = c;\n parseState = STRING;\n } else if (c === '>') {\n this._attributeEnded();\n parseState = END;\n } else {\n this.attValue += c;\n }\n break;\n case STRING:\n if (c === this.quoteChar) {\n this._attributeEnded();\n parseState = INSIDE;\n } else {\n this.attValue += (c);\n }\n break;\n case ENDSLASH:\n if (c === '>') {\n this.endSlash = true;\n parseState = END;\n } else if (c === '\"' || c === '\\'') {\n this.quoteChar = c;\n parseState = STRING;\n } else if (c !== '/' && !isWhitespace(c)) {\n this.attName += c;\n parseState = ATTNAME;\n } else {\n parseState = INSIDE;\n }\n break;\n case END:\n break;\n default:\n throw new Error('Unexpected parse state');\n }\n if (c === '\\n') {\n this.line += 1;\n this.column = 0;\n } else {\n this.column += 1;\n }\n }\n return this;\n }", "token(input, start, end, value) { return new Token(input, start, end, this.type, value) }", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /* Update line, column, and offset based on\n * `value`. */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /* Get offset. Called before the first character is\n * eaten to retrieve the range's offsets. */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /* Done. Called when the last character is\n * eaten to retrieve the range’s offsets. */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /* Get the current position. */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /* Store position information for a node. */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /* Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules. */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /* Mark position and patch `node.position`. */\n function position() {\n var before = now();\n\n return update;\n\n /* Add the position to a node. */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /* Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible. */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /* Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`. */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /* Add the given arguments, add `position` to\n * the returned node, and return the node. */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /* Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n * See `apply` above for what parameters are\n * expected. */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /* Test the position, after eating, and reverse\n * to a not-eaten state. */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "function getLineInfo(input, offset) {\n\t for (var line = 1, cur = 0;;) {\n\t _whitespace.lineBreakG.lastIndex = cur;\n\t var match = _whitespace.lineBreakG.exec(input);\n\t if (match && match.index < offset) {\n\t ++line;\n\t cur = match.index + match[0].length;\n\t } else {\n\t return new Position(line, offset - cur);\n\t }\n\t }\n\t}", "readNextToken() {\n this.state.prevLexType = this.state.lex.type;\n\n if (this.state.nextIndentation !== this.state.indentation) {\n if (this.state.nextIndentation > this.state.indentation) {\n return this.finishToken(tt.indent);\n } else {\n if (this.state.prevLexType === tt.newline) {\n return this.finishToken(tt.dedent);\n } else {\n return this.finishToken(tt.newline);\n }\n }\n }\n\n let curContext = this.curContext();\n if (curContext == null || !curContext.preserveSpace) {\n if (this.state.eol && this.state.pos !== this.state.eolPos) {\n this.skipIndentation();\n }\n // newlines are significant, so this only skips comments and non-indentation whitespace\n this.skipNonTokens();\n }\n this.state.containsOctal = false;\n this.state.octalPosition = null;\n\n this.startTokenLex();\n\n if (this.state.pos >= this.input.length) {\n if (this.state.indentation > 0) {\n this.state.nextIndentation = 0;\n return this.finishToken(tt.newline);\n }\n if (this.state.lex.type !== tt.eof || this.state.tokens.length === 0) {\n return this.finishToken(tt.eof);\n } else {\n return;\n }\n }\n\n if (curContext.override) return curContext.override(this);\n else return this.readToken(this.fullCharCodeAtPos());\n }", "findToken() {\n let t;\n if(this.peekTokens.length) {\n return this.peekedToken();\n }\n do {\n t = this.nextToken();\n } while(!t);\n return t;\n }", "function tokenizeLine(line, lineIndex) {\n // Trim leading whitespace.\n // We can't trim trailing or interior whitespace or comments at this point\n // because those might belong to string literals.\n const trimmed = line.trimLeft();\n\n // Include the line number when we parse string literals\n // so that error messages are more helpful.\n const parseStringCtx = withContext(parseString,\n `on line ${lineIndex + 1}`);\n\n // Now we execute a small state machine.\n // At any point, we can be\n // * ready to start a new token;\n // * in the middle of a token; or\n // * in the middle of a string.\n const [IDLE, TOKEN, STRING] = [0, 1, 2];\n let state = IDLE;\n\n // These are the list of tokens/strings we've collected so far\n // (which will be the return value of this function)\n // and the value of the token/string currently being built.\n let tokens = [];\n let current = \"\";\n\n for (let i = 0; i < line.length; i++) {\n const here = trimmed.charAt(i);\n const isWhitespace = !!here.match(/\\s/);\n const isComma = here === ',';\n const isQuote = here === '\"';\n\n if (state === IDLE) {\n if (isWhitespace || isComma) {\n continue;\n } else {\n state = isQuote ? STRING : TOKEN;\n }\n }\n\n // Break at comments, unless we're inside a string.\n if (here === ';' && state !== STRING) {\n break;\n }\n\n if (state === TOKEN) {\n // Break tokens at commas and whitespace.\n if (isWhitespace || isComma) {\n tokens.push(current);\n state = IDLE;\n current = \"\";\n } else {\n current += here;\n }\n } else if (state === STRING) {\n current += here; // includes the quotation marks\n if (here === '\\\\') {\n // All our escape sequences are just one character,\n // so we can just read that in. Easy.\n current += trimmed.charAt(++i);\n } else if (isQuote && current.length > 1) {\n tokens.push(parseStringCtx(current));\n state = IDLE;\n current = \"\";\n }\n }\n }\n\n // Finally, add any tokens that extended to the end of the line.\n if (current.length > 0) {\n if (state === TOKEN) {\n tokens.push(current);\n } else if (state === STRING) {\n tokens.push(parseStringCtx(current));\n }\n }\n\n return tokens;\n}", "nextToken() {\n return this.tokens[this.tokenIndex] || \"\";\n }", "function hmdModeLineInfo(lineNo) {\n if (lineNo === void 0) lineNo = cm.getCursor().line\n var tokens = cm.getLineTokens(lineNo)\n tokens = tokens.map(function (t) {\n return [t.string, t.type, t.state]\n })\n return tokens\n}", "function getTokenString(state) {\n return state.data.substring(state.currentTokenStart, state.currentTokenEnd);\n }", "function isTokenOnSameLine(left, right) {\n return left.loc.end.line === right.loc.start.line;\n}", "function factory(type) {\n return tokenize;\n\n /* Tokenizer for a bound `type`. */\n function tokenize(value, location) {\n var self = this;\n var offset = self.offset;\n var tokens = [];\n var methods = self[type + 'Methods'];\n var tokenizers = self[type + 'Tokenizers'];\n var line = location.line;\n var column = location.column;\n var index;\n var length;\n var method;\n var name;\n var matched;\n var valueLength;\n\n /* Trim white space only lines. */\n if (!value) {\n return tokens;\n }\n\n /* Expose on `eat`. */\n eat.now = now;\n eat.file = self.file;\n\n /* Sync initial offset. */\n updatePosition('');\n\n /* Iterate over `value`, and iterate over all\n * tokenizers. When one eats something, re-iterate\n * with the remaining value. If no tokenizer eats,\n * something failed (should not happen) and an\n * exception is thrown. */\n while (value) {\n index = -1;\n length = methods.length;\n matched = false;\n\n while (++index < length) {\n name = methods[index];\n method = tokenizers[name];\n\n if (\n method &&\n (!method.onlyAtStart || self.atStart) &&\n (!method.notInList || !self.inList) &&\n (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length;\n\n method.apply(self, [eat, value]);\n\n matched = valueLength !== value.length;\n\n if (matched) {\n break;\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now());\n }\n }\n\n self.eof = now();\n\n return tokens;\n\n /**\n * Update line, column, and offset based on\n * `value`.\n *\n * @example\n * updatePosition('foo');\n *\n * @param {string} subvalue - Subvalue to eat.\n */\n function updatePosition(subvalue) {\n var lastIndex = -1;\n var index = subvalue.indexOf('\\n');\n\n while (index !== -1) {\n line++;\n lastIndex = index;\n index = subvalue.indexOf('\\n', index + 1);\n }\n\n if (lastIndex === -1) {\n column += subvalue.length;\n } else {\n column = subvalue.length - lastIndex;\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line];\n } else if (column <= offset[line]) {\n column = offset[line] + 1;\n }\n }\n }\n\n /**\n * Get offset. Called before the first character is\n * eaten to retrieve the range's offsets.\n *\n * @return {Function} - `done`, to be called when\n * the last character is eaten.\n */\n function getOffset() {\n var indentation = [];\n var pos = line + 1;\n\n /**\n * Done. Called when the last character is\n * eaten to retrieve the range’s offsets.\n *\n * @return {Array.<number>} - Offset.\n */\n return function () {\n var last = line + 1;\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1);\n\n pos++;\n }\n\n return indentation;\n };\n }\n\n /**\n * Get the current position.\n *\n * @example\n * position = now(); // {line: 1, column: 1, offset: 0}\n *\n * @return {Object} - Current Position.\n */\n function now() {\n var pos = {line: line, column: column};\n\n pos.offset = self.toOffset(pos);\n\n return pos;\n }\n\n /**\n * Store position information for a node.\n *\n * @example\n * start = now();\n * updatePosition('foo');\n * location = new Position(start);\n * // {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n *\n * @param {Object} start - Starting position.\n */\n function Position(start) {\n this.start = start;\n this.end = now();\n }\n\n /**\n * Throw when a value is incorrectly eaten.\n * This shouldn’t happen but will throw on new,\n * incorrect rules.\n *\n * @example\n * // When the current value is set to `foo bar`.\n * validateEat('foo');\n * eat('foo');\n *\n * validateEat('bar');\n * // throws, because the space is not eaten.\n *\n * @param {string} subvalue - Value to be eaten.\n * @throws {Error} - When `subvalue` cannot be eaten.\n */\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.substring(0, subvalue.length) !== subvalue) {\n /* Capture stack-trace. */\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this ' +\n 'warning on http://git.io/vg5Ft'\n ),\n now()\n );\n }\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @example\n * var update = position();\n * updatePosition('foo');\n * update({});\n * // {\n * // position: {\n * // start: {line: 1, column: 1, offset: 0},\n * // end: {line: 1, column: 3, offset: 2}\n * // }\n * // }\n *\n * @returns {Function} - Updater.\n */\n function position() {\n var before = now();\n\n return update;\n\n /**\n * Add the position to a node.\n *\n * @example\n * update({type: 'text', value: 'foo'});\n *\n * @param {Node} node - Node to attach position\n * on.\n * @param {Array} [indent] - Indentation for\n * `node`.\n * @return {Node} - `node`.\n */\n function update(node, indent) {\n var prev = node.position;\n var start = prev ? prev.start : before;\n var combined = [];\n var n = prev && prev.end.line;\n var l = before.line;\n\n node.position = new Position(start);\n\n /* If there was already a `position`, this\n * node was merged. Fixing `start` wasn’t\n * hard, but the indent is different.\n * Especially because some information, the\n * indent between `n` and `l` wasn’t\n * tracked. Luckily, that space is\n * (should be?) empty, so we can safely\n * check for it now. */\n if (prev && indent && prev.indent) {\n combined = prev.indent;\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1);\n }\n\n combined.push(before.column);\n }\n\n indent = combined.concat(indent);\n }\n\n node.position.indent = indent || [];\n\n return node;\n }\n }\n\n /**\n * Add `node` to `parent`s children or to `tokens`.\n * Performs merges where possible.\n *\n * @example\n * add({});\n *\n * add({}, {children: []});\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Parent to insert into.\n * @return {Object} - Added or merged into node.\n */\n function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\n mergeable(prev) &&\n mergeable(node)\n ) {\n node = MERGEABLE_NODES[node.type].call(self, prev, node);\n }\n\n if (node !== prev) {\n children.push(node);\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart();\n }\n\n return node;\n }\n\n /**\n * Remove `subvalue` from `value`.\n * `subvalue` must be at the start of `value`.\n *\n * @example\n * eat('foo')({type: 'text', value: 'foo'});\n *\n * @param {string} subvalue - Removed from `value`,\n * and passed to `updatePosition`.\n * @return {Function} - Wrapper around `add`, which\n * also adds `position` to node.\n */\n function eat(subvalue) {\n var indent = getOffset();\n var pos = position();\n var current = now();\n\n validateEat(subvalue);\n\n apply.reset = reset;\n reset.test = test;\n apply.test = test;\n\n value = value.substring(subvalue.length);\n\n updatePosition(subvalue);\n\n indent = indent();\n\n return apply;\n\n /**\n * Add the given arguments, add `position` to\n * the returned node, and return the node.\n *\n * @param {Object} node - Node to add.\n * @param {Object} [parent] - Node to insert into.\n * @return {Node} - Added node.\n */\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent);\n }\n\n /**\n * Functions just like apply, but resets the\n * content: the line and column are reversed,\n * and the eaten value is re-added.\n *\n * This is useful for nodes with a single\n * type of content, such as lists and tables.\n *\n * See `apply` above for what parameters are\n * expected.\n *\n * @return {Node} - Added node.\n */\n function reset() {\n var node = apply.apply(null, arguments);\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return node;\n }\n\n /**\n * Test the position, after eating, and reverse\n * to a not-eaten state.\n *\n * @return {Position} - Position after eating `subvalue`.\n */\n function test() {\n var result = pos({});\n\n line = current.line;\n column = current.column;\n value = subvalue + value;\n\n return result.position;\n }\n }\n }\n}", "function getToken(word, tokenLength, position)\r\n{\r\n\treturn word.substring(position, position + tokenLength);\r\n}", "function GenTokenParser(){}", "nextToken() {\n\t\t\tif (this.isEOF(this.nextTokenIndex)) {\n\t\t\t\tthis.currentToken = this.eofToken;\n\t\t\t\treturn this.eofToken;\n\t\t\t}\n\n\t\t\tif (this.tokenizing) {\n\t\t\t\tthrow new Error(\"Can't call nextToken while tokenizing\");\n\t\t\t}\n\n\t\t\tconst prevToken = this.currentToken;\n\t\t\tconst [state, nextToken] = this.lookahead();\n\n\t\t\tif (nextToken.end === prevToken.end) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"tokenize() returned a token with the same position as the last - Previous token: \" +\n\t\t\t\t\tJSON.stringify(prevToken) +\n\t\t\t\t\t\"; Next token: \" +\n\t\t\t\t\tJSON.stringify(nextToken) +\n\t\t\t\t\t\"; Input: \" +\n\t\t\t\t\tthis.input.slice(0, 100),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst {line, column} = this.getPositionFromIndex(nextToken.start);\n\t\t\tthis.currLine = line;\n\t\t\tthis.currColumn = column;\n\n\t\t\tthis.nextTokenIndex = nextToken.end;\n\t\t\tthis.prevToken = prevToken;\n\t\t\tthis.currentToken = nextToken;\n\t\t\tthis.state = state;\n\t\t\treturn nextToken;\n\t\t}", "function getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }", "function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }" ]
[ "0.67839366", "0.66377556", "0.66228", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65925443", "0.65721285", "0.65721285", "0.65721285", "0.65721285", "0.65721285", "0.65526426", "0.65285516", "0.65285516", "0.6480898", "0.6480898", "0.64721924", "0.6453198", "0.6137326", "0.60596985", "0.5998625", "0.5990652", "0.5964562", "0.5931306", "0.58064973", "0.5779311", "0.5771402", "0.5755144", "0.5753961", "0.57416886", "0.56733286", "0.56699324", "0.56696314", "0.56675535", "0.56620413", "0.56620413", "0.56434005", "0.5632606", "0.5619636", "0.5615967", "0.5600378", "0.55977106", "0.55874777", "0.55751455", "0.55724376", "0.5570571", "0.55422056", "0.55392754", "0.553246", "0.553246", "0.553246", "0.553246", "0.553246", "0.55257803", "0.55257803", "0.5524211", "0.5518601", "0.55126196", "0.5506488", "0.54879576", "0.5485745", "0.54842424", "0.54828006", "0.5471408", "0.5469682", "0.5432252", "0.54211086", "0.54180044", "0.54180044", "0.54180044", "0.54180044", "0.54180044", "0.54180044", "0.54180044", "0.54180044", "0.54180044" ]
0.6679065
12
Run the given mode's parser over a line, calling f for each token.
function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { var flattenSpans = mode.flattenSpans; if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } var curStart = 0, curStyle = null; var stream = new StringStream(text, cm.options.tabSize, context), style; var inner = cm.options.addModeClass && [null]; if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } while (!stream.eol()) { if (stream.pos > cm.options.maxHighlightLength) { flattenSpans = false; if (forceToEnd) { processLine(cm, text, context, stream.pos); } stream.pos = text.length; style = null; } else { style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); } if (inner) { var mName = inner[0].name; if (mName) { style = "m-" + (style ? mName + " " + style : mName); } } if (!flattenSpans || curStyle != style) { while (curStart < stream.start) { curStart = Math.min(stream.start, curStart + 5000); f(curStart, curStyle); } curStyle = style; } stream.start = stream.pos; } while (curStart < stream.pos) { // Webkit seems to refuse to render text nodes longer than 57444 // characters, and returns inaccurate measurements in nodes // starting around 5000 chars. var pos = Math.min(stream.pos, curStart + 5000); f(pos, curStyle); curStart = pos; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.pos + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n if (curStart < stream.pos) f(stream.pos, curStyle);\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (cm.options.addModeClass) {\n var mName = CodeMirror.innerMode(mode, state).mode.name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state), lineClasses);\n }\n if (cm.options.addModeClass) {\n var mName = CodeMirror.innerMode(mode, state).mode.name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state), lineClasses);\n }\n if (cm.options.addModeClass) {\n var mName = CodeMirror.innerMode(mode, state).mode.name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\r\n var flattenSpans = mode.flattenSpans;\r\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\r\n var curStart = 0, curStyle = null;\r\n var stream = new StringStream(text, cm.options.tabSize), style;\r\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\r\n while (!stream.eol()) {\r\n if (stream.pos > cm.options.maxHighlightLength) {\r\n flattenSpans = false;\r\n if (forceToEnd) processLine(cm, text, state, stream.pos);\r\n stream.pos = text.length;\r\n style = null;\r\n } else {\r\n style = extractLineClasses(readToken(mode, stream, state), lineClasses);\r\n }\r\n if (cm.options.addModeClass) {\r\n var mName = CodeMirror.innerMode(mode, state).mode.name;\r\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\r\n }\r\n if (!flattenSpans || curStyle != style) {\r\n if (curStart < stream.start) f(stream.start, curStyle);\r\n curStart = stream.start; curStyle = style;\r\n }\r\n stream.start = stream.pos;\r\n }\r\n while (curStart < stream.pos) {\r\n // Webkit seems to refuse to render text nodes longer than 57444 characters\r\n var pos = Math.min(stream.pos, curStart + 50000);\r\n f(pos, curStyle);\r\n curStart = pos;\r\n }\r\n }", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n}", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, state, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }\n var curStart = 0, curStyle = null\n var stream = new StringStream(text, cm.options.tabSize), style\n var inner = cm.options.addModeClass && [null]\n if (text == \"\") { extractLineClasses(callBlankLine(mode, state), lineClasses) }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false\n if (forceToEnd) { processLine(cm, text, state, stream.pos) }\n stream.pos = text.length\n style = null\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)\n }\n if (inner) {\n var mName = inner[0].name\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName) }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000)\n f(curStart, curStyle)\n }\n curStyle = style\n }\n stream.start = stream.pos\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000)\n f(pos, curStyle)\n curStart = pos\n }\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\r\n var flattenSpans = mode.flattenSpans;\r\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\r\n var curStart = 0, curStyle = null;\r\n var stream = new StringStream(text, cm.options.tabSize, context), style;\r\n var inner = cm.options.addModeClass && [null];\r\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\r\n while (!stream.eol()) {\r\n if (stream.pos > cm.options.maxHighlightLength) {\r\n flattenSpans = false;\r\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\r\n stream.pos = text.length;\r\n style = null;\r\n } else {\r\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\r\n }\r\n if (inner) {\r\n var mName = inner[0].name;\r\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\r\n }\r\n if (!flattenSpans || curStyle != style) {\r\n while (curStart < stream.start) {\r\n curStart = Math.min(stream.start, curStart + 5000);\r\n f(curStart, curStyle);\r\n }\r\n curStyle = style;\r\n }\r\n stream.start = stream.pos;\r\n }\r\n while (curStart < stream.pos) {\r\n // Webkit seems to refuse to render text nodes longer than 57444\r\n // characters, and returns inaccurate measurements in nodes\r\n // starting around 5000 chars.\r\n var pos = Math.min(stream.pos, curStart + 5000);\r\n f(pos, curStyle);\r\n curStart = pos;\r\n }\r\n}", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 50000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 50000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 50000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 50000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n\t\t var flattenSpans = mode.flattenSpans;\n\t\t if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n\t\t var curStart = 0, curStyle = null;\n\t\t var stream = new StringStream(text, cm.options.tabSize, context), style;\n\t\t var inner = cm.options.addModeClass && [null];\n\t\t if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n\t\t while (!stream.eol()) {\n\t\t if (stream.pos > cm.options.maxHighlightLength) {\n\t\t flattenSpans = false;\n\t\t if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n\t\t stream.pos = text.length;\n\t\t style = null;\n\t\t } else {\n\t\t style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n\t\t }\n\t\t if (inner) {\n\t\t var mName = inner[0].name;\n\t\t if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n\t\t }\n\t\t if (!flattenSpans || curStyle != style) {\n\t\t while (curStart < stream.start) {\n\t\t curStart = Math.min(stream.start, curStart + 5000);\n\t\t f(curStart, curStyle);\n\t\t }\n\t\t curStyle = style;\n\t\t }\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t while (curStart < stream.pos) {\n\t\t // Webkit seems to refuse to render text nodes longer than 57444\n\t\t // characters, and returns inaccurate measurements in nodes\n\t\t // starting around 5000 chars.\n\t\t var pos = Math.min(stream.pos, curStart + 5000);\n\t\t f(pos, curStyle);\n\t\t curStart = pos;\n\t\t }\n\t\t }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n\t\t var flattenSpans = mode.flattenSpans;\n\t\t if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n\t\t var curStart = 0, curStyle = null;\n\t\t var stream = new StringStream(text, cm.options.tabSize), style;\n\t\t var inner = cm.options.addModeClass && [null];\n\t\t if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n\t\t while (!stream.eol()) {\n\t\t if (stream.pos > cm.options.maxHighlightLength) {\n\t\t flattenSpans = false;\n\t\t if (forceToEnd) processLine(cm, text, state, stream.pos);\n\t\t stream.pos = text.length;\n\t\t style = null;\n\t\t } else {\n\t\t style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n\t\t }\n\t\t if (inner) {\n\t\t var mName = inner[0].name;\n\t\t if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n\t\t }\n\t\t if (!flattenSpans || curStyle != style) {\n\t\t while (curStart < stream.start) {\n\t\t curStart = Math.min(stream.start, curStart + 50000);\n\t\t f(curStart, curStyle);\n\t\t }\n\t\t curStyle = style;\n\t\t }\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t while (curStart < stream.pos) {\n\t\t // Webkit seems to refuse to render text nodes longer than 57444 characters\n\t\t var pos = Math.min(stream.pos, curStart + 50000);\n\t\t f(pos, curStyle);\n\t\t curStart = pos;\n\t\t }\n\t\t }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n\t var flattenSpans = mode.flattenSpans;\n\t if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n\t var curStart = 0, curStyle = null;\n\t var stream = new StringStream(text, cm.options.tabSize), style;\n\t var inner = cm.options.addModeClass && [null];\n\t if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n\t while (!stream.eol()) {\n\t if (stream.pos > cm.options.maxHighlightLength) {\n\t flattenSpans = false;\n\t if (forceToEnd) processLine(cm, text, state, stream.pos);\n\t stream.pos = text.length;\n\t style = null;\n\t } else {\n\t style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n\t }\n\t if (inner) {\n\t var mName = inner[0].name;\n\t if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n\t }\n\t if (!flattenSpans || curStyle != style) {\n\t while (curStart < stream.start) {\n\t curStart = Math.min(stream.start, curStart + 50000);\n\t f(curStart, curStyle);\n\t }\n\t curStyle = style;\n\t }\n\t stream.start = stream.pos;\n\t }\n\t while (curStart < stream.pos) {\n\t // Webkit seems to refuse to render text nodes longer than 57444 characters\n\t var pos = Math.min(stream.pos, curStart + 50000);\n\t f(pos, curStyle);\n\t curStart = pos;\n\t }\n\t }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n\t var flattenSpans = mode.flattenSpans;\n\t if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n\t var curStart = 0, curStyle = null;\n\t var stream = new StringStream(text, cm.options.tabSize), style;\n\t var inner = cm.options.addModeClass && [null];\n\t if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n\t while (!stream.eol()) {\n\t if (stream.pos > cm.options.maxHighlightLength) {\n\t flattenSpans = false;\n\t if (forceToEnd) processLine(cm, text, state, stream.pos);\n\t stream.pos = text.length;\n\t style = null;\n\t } else {\n\t style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n\t }\n\t if (inner) {\n\t var mName = inner[0].name;\n\t if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n\t }\n\t if (!flattenSpans || curStyle != style) {\n\t while (curStart < stream.start) {\n\t curStart = Math.min(stream.start, curStart + 50000);\n\t f(curStart, curStyle);\n\t }\n\t curStyle = style;\n\t }\n\t stream.start = stream.pos;\n\t }\n\t while (curStart < stream.pos) {\n\t // Webkit seems to refuse to render text nodes longer than 57444 characters\n\t var pos = Math.min(stream.pos, curStart + 50000);\n\t f(pos, curStyle);\n\t curStart = pos;\n\t }\n\t }", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n\t var flattenSpans = mode.flattenSpans;\n\t if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n\t var curStart = 0, curStyle = null;\n\t var stream = new StringStream(text, cm.options.tabSize), style;\n\t var inner = cm.options.addModeClass && [null];\n\t if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n\t while (!stream.eol()) {\n\t if (stream.pos > cm.options.maxHighlightLength) {\n\t flattenSpans = false;\n\t if (forceToEnd) processLine(cm, text, state, stream.pos);\n\t stream.pos = text.length;\n\t style = null;\n\t } else {\n\t style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n\t }\n\t if (inner) {\n\t var mName = inner[0].name;\n\t if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n\t }\n\t if (!flattenSpans || curStyle != style) {\n\t while (curStart < stream.start) {\n\t curStart = Math.min(stream.start, curStart + 5000);\n\t f(curStart, curStyle);\n\t }\n\t curStyle = style;\n\t }\n\t stream.start = stream.pos;\n\t }\n\t while (curStart < stream.pos) {\n\t // Webkit seems to refuse to render text nodes longer than 57444\n\t // characters, and returns inaccurate measurements in nodes\n\t // starting around 5000 chars.\n\t var pos = Math.min(stream.pos, curStart + 5000);\n\t f(pos, curStyle);\n\t curStart = pos;\n\t }\n\t }", "function processLine(cm, line, state) {\n var mode = cm.view.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= 5000) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, line, state) {\n var mode = cm.view.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= 5000) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, line, state) {\n var mode = cm.view.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= 5000) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n\n if (text == \"\") {\n callBlankLine(mode, context.state);\n }\n\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, line, state) {\n var mode = cm.doc.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, line, state) {\n var mode = cm.doc.mode;\n var stream = new StringStream(line.text, cm.options.tabSize);\n if (line.text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, state) }\n while (!stream.eol()) {\n readToken(mode, stream, state)\n stream.start = stream.pos\n }\n}", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode\n var stream = new StringStream(text, cm.options.tabSize)\n stream.start = stream.pos = startAt || 0\n if (text == \"\") { callBlankLine(mode, state) }\n while (!stream.eol()) {\n readToken(mode, stream, state)\n stream.start = stream.pos\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n}", "function processLine(cm, text, context, startAt) {\n\t\t var mode = cm.doc.mode;\n\t\t var stream = new StringStream(text, cm.options.tabSize, context);\n\t\t stream.start = stream.pos = startAt || 0;\n\t\t if (text == \"\") { callBlankLine(mode, context.state); }\n\t\t while (!stream.eol()) {\n\t\t readToken(mode, stream, context.state);\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t }", "function processLine(cm, text, context, startAt) {\r\n var mode = cm.doc.mode;\r\n var stream = new StringStream(text, cm.options.tabSize, context);\r\n stream.start = stream.pos = startAt || 0;\r\n if (text == \"\") { callBlankLine(mode, context.state); }\r\n while (!stream.eol()) {\r\n readToken(mode, stream, context.state);\r\n stream.start = stream.pos;\r\n }\r\n}", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol()) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function processLine(cm, text, state, startAt) {\n\t var mode = cm.doc.mode;\n\t var stream = new StringStream(text, cm.options.tabSize);\n\t stream.start = stream.pos = startAt || 0;\n\t if (text == \"\") callBlankLine(mode, state);\n\t while (!stream.eol()) {\n\t readToken(mode, stream, state);\n\t stream.start = stream.pos;\n\t }\n\t }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n mode.token(stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }", "function processLine(cm, text, state, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") callBlankLine(mode, state);\n while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {\n readToken(mode, stream, state);\n stream.start = stream.pos;\n }\n }" ]
[ "0.68395495", "0.68284214", "0.68284214", "0.67762023", "0.6611103", "0.6484349", "0.6440528", "0.6335101", "0.6335101", "0.6291342", "0.6291017", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.6217092", "0.62071395", "0.62071395", "0.6194971", "0.61920553", "0.61920553", "0.61920553", "0.61920553", "0.6144224", "0.6096485", "0.60881245", "0.60881245", "0.60771704", "0.5465573", "0.5465573", "0.5465573", "0.5422408", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.5418699", "0.53852224", "0.53852224", "0.537931", "0.537931", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.53636867", "0.5328905", "0.5318346", "0.5303547", "0.52878106", "0.52878106", "0.52878106", "0.52627224", "0.52627224", "0.52343124", "0.52343124", "0.52343124", "0.52343124", "0.52343124", "0.52343124" ]
0.6227828
23
Finds the line to start with when starting a parse. Tries to find a line with a stateAfter, so that it can start with a valid state. If that fails, it returns the line with the smallest indentation, which tends to need the least context to parse correctly.
function findStartLine(cm, n, precise) { var minindent, minline, doc = cm.doc; var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); for (var search = n; search > lim; --search) { if (search <= doc.first) { return doc.first } var line = getLine(doc, search - 1), after = line.stateAfter; if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) { return search } var indented = countColumn(line.text, null, cm.options.tabSize); if (minline == null || minindent > indented) { minline = search - 1; minindent = indented; } } return minline }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = lines[search-1];\n if (line.stateAfter) return search;\n var indented = line.indentation();\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = lines[search-1];\n if (line.stateAfter) return search;\n var indented = line.indentation();\n if (minline == null || minindent > indented) {\n minline = search;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = lines[search-1];\n if (line.stateAfter) return search;\n var indented = line.indentation();\n if (minline == null || minindent > indented) {\n minline = search;\n minindent = indented;\n }\n }\n return minline;\n }", "function find_start_line() {\n // TODO:\n return 0\n}", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(search-1);\n if (line.stateAfter) return search;\n var indented = line.indentation(options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(search-1);\n if (line.stateAfter) return search;\n var indented = line.indentation(options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(search-1);\n if (line.stateAfter) return search;\n var indented = line.indentation(options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(n) {\n var minindent, minline;\n for (var search = n, lim = n - 40; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(search-1);\n if (line.stateAfter) return search;\n var indented = line.indentation(options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n\t\t var minindent, minline, doc = cm.doc;\n\t\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t\t for (var search = n; search > lim; --search) {\n\t\t if (search <= doc.first) { return doc.first }\n\t\t var line = getLine(doc, search - 1), after = line.stateAfter;\n\t\t if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n\t\t { return search }\n\t\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t\t if (minline == null || minindent > indented) {\n\t\t minline = search - 1;\n\t\t minindent = indented;\n\t\t }\n\t\t }\n\t\t return minline\n\t\t }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n) {\n var minindent, minline, doc = cm.view.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search == 0) return 0;\n var line = getLine(doc, search-1);\n if (line.stateAfter) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent,\n minline,\n doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) {\n return doc.first;\n }\n\n var line = getLine(doc, search - 1),\n after = line.stateAfter;\n\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) {\n return search;\n }\n\n var indented = countColumn(line.text, null, cm.options.tabSize);\n\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\r\n var minindent, minline, doc = cm.doc;\r\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\r\n for (var search = n; search > lim; --search) {\r\n if (search <= doc.first) { return doc.first }\r\n var line = getLine(doc, search - 1), after = line.stateAfter;\r\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\r\n { return search }\r\n var indented = countColumn(line.text, null, cm.options.tabSize);\r\n if (minline == null || minindent > indented) {\r\n minline = search - 1;\r\n minindent = indented;\r\n }\r\n }\r\n return minline\r\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n for (var search = n, lim = n - 100; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) return doc.first;\n var line = getLine(doc, search - 1);\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline;\n }", "function findStartLine(cm, n, precise) {\n\t\t var minindent, minline, doc = cm.doc;\n\t\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t\t for (var search = n; search > lim; --search) {\n\t\t if (search <= doc.first) return doc.first;\n\t\t var line = getLine(doc, search - 1);\n\t\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t\t if (minline == null || minindent > indented) {\n\t\t minline = search - 1;\n\t\t minindent = indented;\n\t\t }\n\t\t }\n\t\t return minline;\n\t\t }", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1)\n if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize)\n if (minline == null || minindent > indented) {\n minline = search - 1\n minindent = indented\n }\n }\n return minline\n}", "function findStartLine(cm, n, precise) {\r\n var minindent, minline, doc = cm.doc;\r\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\r\n for (var search = n; search > lim; --search) {\r\n if (search <= doc.first) return doc.first;\r\n var line = getLine(doc, search - 1);\r\n if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\r\n var indented = countColumn(line.text, null, cm.options.tabSize);\r\n if (minline == null || minindent > indented) {\r\n minline = search - 1;\r\n minindent = indented;\r\n }\r\n }\r\n return minline;\r\n }", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function findStartLine(cm, n, precise) {\n\t var minindent, minline, doc = cm.doc;\n\t var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n\t for (var search = n; search > lim; --search) {\n\t if (search <= doc.first) return doc.first;\n\t var line = getLine(doc, search - 1);\n\t if (line.stateAfter && (!precise || search <= doc.frontier)) return search;\n\t var indented = countColumn(line.text, null, cm.options.tabSize);\n\t if (minline == null || minindent > indented) {\n\t minline = search - 1;\n\t minindent = indented;\n\t }\n\t }\n\t return minline;\n\t }", "function startLine(token) {\n return token.startLine || token.line;\n }", "get lineBegin() {\n\t\treturn this.state.lineBegin;\n\t}", "matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.text.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };\n }", "function getBeginningOfLineOffset(node) {\n return node.position.start.offset - node.position.start.column + 1;\n}", "function lineStart(area) {\n area.pos = area.pos || pos(area);\n return pos - linePos(area);\n }", "getPrecedingValidLine(model, lineNumber, indentRulesSupport) {\r\n let languageID = model.getLanguageIdAtPosition(lineNumber, 0);\r\n if (lineNumber > 1) {\r\n let lastLineNumber;\r\n let resultLineNumber = -1;\r\n for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) {\r\n if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) {\r\n return resultLineNumber;\r\n }\r\n let text = model.getLineContent(lastLineNumber);\r\n if (indentRulesSupport.shouldIgnore(text) || /^\\s+$/.test(text) || text === '') {\r\n resultLineNumber = lastLineNumber;\r\n continue;\r\n }\r\n return lastLineNumber;\r\n }\r\n }\r\n return -1;\r\n }", "before(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position before the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];\n }", "function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}", "function updateParserState(line, state) {\n if (!state.inMultilineDirective) {\n const maybeStatement = reStatementWord.exec(line);\n if (maybeStatement) {\n const currentVerb = maybeStatement[1];\n const inMultilineDirective = !!maybeStatement[2]; // whether we found \"(\"\n if (inMultilineDirective) {\n return { inMultilineDirective, currentVerb, lineRemainder: null };\n }\n else {\n return { inMultilineDirective, currentVerb,\n lineRemainder: line.substr(currentVerb.length + 1).trim() };\n }\n }\n else {\n const lineNoComment = reLineWithComments.exec(line)[1].trim();\n if (lineNoComment) {\n throw new Error('Unrecognized statement: ' + line);\n }\n return { inMultilineDirective: false, currentVerb: null, lineRemainder: null };\n }\n }\n else if (line === ')') {\n return { inMultilineDirective: false, currentVerb: null, lineRemainder: null };\n }\n else {\n return { inMultilineDirective: true, currentVerb: state.currentVerb, lineRemainder: line };\n }\n}", "function lineBefore(area) { return beforeLines(area).last(); }", "baseIndentFor(node) {\n let line = this.state.doc.lineAt(node.from);\n // Skip line starts that are covered by a sibling (or cousin, etc)\n for (;;) {\n let atBreak = node.resolve(line.from);\n while (atBreak.parent && atBreak.parent.from == atBreak.from)\n atBreak = atBreak.parent;\n if (isParent(atBreak, node))\n break;\n line = this.state.doc.lineAt(atBreak.from);\n }\n return this.lineIndent(line.from);\n }", "getLineStartLeft(widget) {\n let left = widget.paragraph.x;\n let paragraphFormat = widget.paragraph.paragraphFormat;\n if (this.isParagraphFirstLine(widget) && !paragraphFormat.bidi) {\n left += HelperMethods.convertPointToPixel(paragraphFormat.firstLineIndent);\n }\n if (widget.children.length > 0) {\n left += widget.children[0].margin.left;\n }\n return left;\n }", "_getStartRefLineNumber(referenceNumber) {\n var refRef = PassageMarkdown.START_REF_PREFIX + referenceNumber;\n var ref = this.refs[refRef];\n\n if (!ref) {\n return null;\n }\n\n var $ref = $$1(ReactDOM$c.findDOMNode(ref)); // We really care about the first text after the ref, not the\n // ref element itself:\n\n var $refText = $ref.next();\n\n if ($refText.length === 0) {\n // But if there are no elements after the ref, just\n // use the ref itself.\n $refText = $ref;\n }\n\n var vPos = $refText.offset().top;\n return this.state.startLineNumbersAfter + 1 + this._convertPosToLineNumber(vPos);\n }", "function getNextSyntacticCharOffset(char, state) {\n var pendingSource = state.g.source.substring(state.g.position);\n var pendingSourceLines = pendingSource.split('\\n');\n\n var charOffset = 0;\n var line;\n var withinBlockComment = false;\n var withinString = false;\n lineLoop: while ((line = pendingSourceLines.shift()) !== undefined) {\n var lineEndPos = charOffset + line.length;\n charLoop: for (; charOffset < lineEndPos; charOffset++) {\n var currChar = pendingSource[charOffset];\n if (currChar === '\"' || currChar === '\\'') {\n withinString = !withinString;\n continue charLoop;\n } else if (withinString) {\n continue charLoop;\n } else if (charOffset + 1 < lineEndPos) {\n var nextTwoChars = currChar + line[charOffset + 1];\n if (nextTwoChars === '//') {\n charOffset = lineEndPos + 1;\n continue lineLoop;\n } else if (nextTwoChars === '/*') {\n withinBlockComment = true;\n charOffset += 1;\n continue charLoop;\n } else if (nextTwoChars === '*/') {\n withinBlockComment = false;\n charOffset += 1;\n continue charLoop;\n }\n }\n\n if (!withinBlockComment && currChar === char) {\n return charOffset + state.g.position;\n }\n }\n\n // Account for '\\n'\n charOffset++;\n withinString = false;\n }\n\n throw new Error('`' + char + '` not found!');\n}", "function getNextSyntacticCharOffset(char, state) {\n var pendingSource = state.g.source.substring(state.g.position);\n var pendingSourceLines = pendingSource.split('\\n');\n\n var charOffset = 0;\n var line;\n var withinBlockComment = false;\n var withinString = false;\n lineLoop: while ((line = pendingSourceLines.shift()) !== undefined) {\n var lineEndPos = charOffset + line.length;\n charLoop: for (; charOffset < lineEndPos; charOffset++) {\n var currChar = pendingSource[charOffset];\n if (currChar === '\"' || currChar === '\\'') {\n withinString = !withinString;\n continue charLoop;\n } else if (withinString) {\n continue charLoop;\n } else if (charOffset + 1 < lineEndPos) {\n var nextTwoChars = currChar + line[charOffset + 1];\n if (nextTwoChars === '//') {\n charOffset = lineEndPos + 1;\n continue lineLoop;\n } else if (nextTwoChars === '/*') {\n withinBlockComment = true;\n charOffset += 1;\n continue charLoop;\n } else if (nextTwoChars === '*/') {\n withinBlockComment = false;\n charOffset += 1;\n continue charLoop;\n }\n }\n\n if (!withinBlockComment && currChar === char) {\n return charOffset + state.g.position;\n }\n }\n\n // Account for '\\n'\n charOffset++;\n withinString = false;\n }\n\n throw new Error('`' + char + '` not found!');\n}", "getCurrentLineIndentation() {\n return this.currentLine.length - Utils.ltrim(this.currentLine, ' ').length;\n }", "function lineWordStart(area) {\n area.pos = area.pos || pos(area);\n return linePos(area) - wordPos(area);\n }", "function startOfLine(node) {\n while (node && !isBR(node)) node = node.previousSibling;\n return node;\n }", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "function findNodeBefore(node, pos, test, base, state) {\n test = makeTest(test);\n if (!base) { base = exports.base; }\n var max;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n base[type](node, st, c);\n })(node, state);\n return max\n}", "function editorLineNumberForError(error) {\n if (!error) return null;\n var parsed = parsestack(error);\n if (!parsed) return null;\n if (!scope || !scope.CoffeeScript || !scope.CoffeeScript.code) return null;\n // Find the innermost call that corresponds to compiled CoffeeScript.\n var frame = null;\n for (var j = 0; j < parsed.length; ++j) {\n if (parsed[j].file in scope.CoffeeScript.code) {\n frame = parsed[j];\n }\n }\n if (!frame) return null;\n var map = scope.CoffeeScript.code[frame.file].map;\n if (!map) return null;\n var smc = new sourcemap.SourceMapConsumer(map);\n var mapped = smc.originalPositionFor(frame);\n if (!mapped) return null;\n if (!mapped.line || mapped.line < 4) return null;\n // Subtract a few lines of boilerplate from the top of the script.\n return mapped.line - 3;\n}", "lineToken({chunk = this.chunk, offset = 0} = {}) {\r\n\t\t\t\tvar backslash, diff, endsContinuationLineIndentation, indent, match, minLiteralLength, newIndentLiteral, noNewlines, prev, ref, size;\r\n\t\t\t\tif (!(match = MULTI_DENT.exec(chunk))) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\tindent = match[0];\r\n\t\t\t\tprev = this.prev();\r\n\t\t\t\tbackslash = (prev != null ? prev[0] : void 0) === '\\\\';\r\n\t\t\t\tif (!((backslash || ((ref = this.seenFor) != null ? ref.endsLength : void 0) < this.ends.length) && this.seenFor)) {\r\n\t\t\t\t\tthis.seenFor = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!((backslash && this.seenImport) || this.importSpecifierList)) {\r\n\t\t\t\t\tthis.seenImport = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (!((backslash && this.seenExport) || this.exportSpecifierList)) {\r\n\t\t\t\t\tthis.seenExport = false;\r\n\t\t\t\t}\r\n\t\t\t\tsize = indent.length - 1 - indent.lastIndexOf('\\n');\r\n\t\t\t\tnoNewlines = this.unfinished();\r\n\t\t\t\tnewIndentLiteral = size > 0 ? indent.slice(-size) : '';\r\n\t\t\t\tif (!/^(.?)\\1*$/.exec(newIndentLiteral)) {\r\n\t\t\t\t\tthis.error('mixed indentation', {\r\n\t\t\t\t\t\toffset: indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tminLiteralLength = Math.min(newIndentLiteral.length, this.indentLiteral.length);\r\n\t\t\t\tif (newIndentLiteral.slice(0, minLiteralLength) !== this.indentLiteral.slice(0, minLiteralLength)) {\r\n\t\t\t\t\tthis.error('indentation mismatch', {\r\n\t\t\t\t\t\toffset: indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tif (size - this.continuationLineAdditionalIndent === this.indent) {\r\n\t\t\t\t\tif (noNewlines) {\r\n\t\t\t\t\t\tthis.suppressNewlines();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.newlineToken(offset);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn indent.length;\r\n\t\t\t\t}\r\n\t\t\t\tif (size > this.indent) {\r\n\t\t\t\t\tif (noNewlines) {\r\n\t\t\t\t\t\tif (!backslash) {\r\n\t\t\t\t\t\t\tthis.continuationLineAdditionalIndent = size - this.indent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (this.continuationLineAdditionalIndent) {\r\n\t\t\t\t\t\t\tprev.continuationLineIndent = this.indent + this.continuationLineAdditionalIndent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.suppressNewlines();\r\n\t\t\t\t\t\treturn indent.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!this.tokens.length) {\r\n\t\t\t\t\t\tthis.baseIndent = this.indent = size;\r\n\t\t\t\t\t\tthis.indentLiteral = newIndentLiteral;\r\n\t\t\t\t\t\treturn indent.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdiff = size - this.indent + this.outdebt;\r\n\t\t\t\t\tthis.token('INDENT', diff, {\r\n\t\t\t\t\t\toffset: offset + indent.length - size,\r\n\t\t\t\t\t\tlength: size\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.indents.push(diff);\r\n\t\t\t\t\tthis.ends.push({\r\n\t\t\t\t\t\ttag: 'OUTDENT'\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.outdebt = this.continuationLineAdditionalIndent = 0;\r\n\t\t\t\t\tthis.indent = size;\r\n\t\t\t\t\tthis.indentLiteral = newIndentLiteral;\r\n\t\t\t\t} else if (size < this.baseIndent) {\r\n\t\t\t\t\tthis.error('missing indentation', {\r\n\t\t\t\t\t\toffset: offset + indent.length\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tendsContinuationLineIndentation = this.continuationLineAdditionalIndent > 0;\r\n\t\t\t\t\tthis.continuationLineAdditionalIndent = 0;\r\n\t\t\t\t\tthis.outdentToken({\r\n\t\t\t\t\t\tmoveOut: this.indent - size,\r\n\t\t\t\t\t\tnoNewlines,\r\n\t\t\t\t\t\toutdentLength: indent.length,\r\n\t\t\t\t\t\toffset,\r\n\t\t\t\t\t\tindentSize: size,\r\n\t\t\t\t\t\tendsContinuationLineIndentation\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn indent.length;\r\n\t\t\t}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = void 0;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "walkBackwardsToBeginningOfCall(document, position) {\n let parenBalance = 0;\n let maxLookupLines = 30;\n const commas = [];\n for (let lineNr = position.line; lineNr >= 0 && maxLookupLines >= 0; lineNr--, maxLookupLines--) {\n const line = document.lineAt(lineNr);\n // Stop processing if we're inside a comment\n if (util_1.isPositionInComment(document, position)) {\n return null;\n }\n // if its current line, get the text until the position given, otherwise get the full line.\n const [currentLine, characterPosition] = lineNr === position.line\n ? [line.text.substring(0, position.character), position.character]\n : [line.text, line.text.length - 1];\n for (let char = characterPosition; char >= 0; char--) {\n switch (currentLine[char]) {\n case '(':\n parenBalance--;\n if (parenBalance < 0) {\n return {\n openParen: new vscode_1.Position(lineNr, char),\n commas\n };\n }\n break;\n case ')':\n parenBalance++;\n break;\n case ',':\n const commaPos = new vscode_1.Position(lineNr, char);\n if (parenBalance === 0 && !util_1.isPositionInString(document, commaPos)) {\n commas.push(commaPos);\n }\n break;\n }\n }\n }\n return null;\n }", "function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match = undefined;\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n return { line: line, column: column };\n}", "function syntaxIndentation(cx, ast, pos) {\n return indentFrom(ast.resolveInner(pos).enterUnfinishedNodesBefore(pos), pos, cx);\n}", "line() { return this.program.currentLine(); }", "function findStartIndex(markdown) {\n const match = markdown.match(/\\n## Table of Contents\\n/);\n if (match === null || match.index === undefined) return null;\n return match.index + match[0].length - 1;\n}", "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return start;\n }", "function skipMarker(state, line) {\n var pos, marker,\n start = state.bMarks[line] + state.tShift[line],\n max = state.eMarks[line];\n\n if (start >= max) { return -1; }\n\n // Check bullet\n marker = state.src.charCodeAt(start++);\n if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1; }\n\n pos = state.skipSpaces(start);\n\n // require space after \":\"\n if (start === pos) { return -1; }\n\n // no empty definitions, e.g. \" : \"\n if (pos >= max) { return -1; }\n\n return start;\n }" ]
[ "0.69632703", "0.69560045", "0.69560045", "0.69001615", "0.6821355", "0.6821355", "0.6821355", "0.68161285", "0.67185724", "0.66503805", "0.66503805", "0.66503805", "0.66265565", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.66058767", "0.6562405", "0.64298207", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.639", "0.6378871", "0.6361556", "0.6361556", "0.63349044", "0.6311351", "0.6311351", "0.6311351", "0.5890896", "0.5780313", "0.54967785", "0.54948217", "0.53652847", "0.5320459", "0.5280451", "0.52367854", "0.5218109", "0.5198332", "0.5175344", "0.5165142", "0.5150116", "0.5084535", "0.5084535", "0.5082889", "0.5073524", "0.50621086", "0.5030244", "0.50186914", "0.50151557", "0.5014283", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.5003825", "0.50024885", "0.49795833", "0.4973989", "0.4972683", "0.49467522", "0.49433425", "0.49433425" ]
0.67155445
20
Change the content (text, markers) of a line. Automatically invalidates cached information and tries to reestimate the line's height.
function updateLine(line, text, markedSpans, estimateHeight) { line.text = text; if (line.stateAfter) { line.stateAfter = null; } if (line.styles) { line.styles = null; } if (line.order != null) { line.order = null; } detachMarkedSpans(line); attachMarkedSpans(line, markedSpans); var estHeight = estimateHeight ? estimateHeight(line) : 1; if (estHeight != line.height) { updateLineHeight(line, estHeight); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n\n if (line.stateAfter) {\n line.stateAfter = null;\n }\n\n if (line.styles) {\n line.styles = null;\n }\n\n if (line.order != null) {\n line.order = null;\n }\n\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\n if (estHeight != line.height) {\n updateLineHeight(line, estHeight);\n }\n } // Detach a line from the document tree and its markers.", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) { line.stateAfter = null; }\n\t\t if (line.styles) { line.styles = null; }\n\t\t if (line.order != null) { line.order = null; }\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n\t\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) line.stateAfter = null;\n if (line.styles) line.styles = null;\n if (line.order != null) line.order = null;\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) updateLineHeight(line, estHeight);\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t\t line.text = text;\n\t\t if (line.stateAfter) line.stateAfter = null;\n\t\t if (line.styles) line.styles = null;\n\t\t if (line.order != null) line.order = null;\n\t\t detachMarkedSpans(line);\n\t\t attachMarkedSpans(line, markedSpans);\n\t\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t line.text = text;\n\t if (line.stateAfter) line.stateAfter = null;\n\t if (line.styles) line.styles = null;\n\t if (line.order != null) line.order = null;\n\t detachMarkedSpans(line);\n\t attachMarkedSpans(line, markedSpans);\n\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t line.text = text;\n\t if (line.stateAfter) line.stateAfter = null;\n\t if (line.styles) line.styles = null;\n\t if (line.order != null) line.order = null;\n\t detachMarkedSpans(line);\n\t attachMarkedSpans(line, markedSpans);\n\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n\t line.text = text;\n\t if (line.stateAfter) line.stateAfter = null;\n\t if (line.styles) line.styles = null;\n\t if (line.order != null) line.order = null;\n\t detachMarkedSpans(line);\n\t attachMarkedSpans(line, markedSpans);\n\t var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\t if (estHeight != line.height) updateLineHeight(line, estHeight);\n\t }", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text\n if (line.stateAfter) { line.stateAfter = null }\n if (line.styles) { line.styles = null }\n if (line.order != null) { line.order = null }\n detachMarkedSpans(line)\n attachMarkedSpans(line, markedSpans)\n var estHeight = estimateHeight ? estimateHeight(line) : 1\n if (estHeight != line.height) { updateLineHeight(line, estHeight) }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\r\n line.text = text;\r\n if (line.stateAfter) line.stateAfter = null;\r\n if (line.styles) line.styles = null;\r\n if (line.order != null) line.order = null;\r\n detachMarkedSpans(line);\r\n attachMarkedSpans(line, markedSpans);\r\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\r\n if (estHeight != line.height) updateLineHeight(line, estHeight);\r\n }", "function updateLine(line, text, markedSpans, estimateHeight) {\r\n line.text = text;\r\n if (line.stateAfter) { line.stateAfter = null; }\r\n if (line.styles) { line.styles = null; }\r\n if (line.order != null) { line.order = null; }\r\n detachMarkedSpans(line);\r\n attachMarkedSpans(line, markedSpans);\r\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\r\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\r\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n\n if (lineView.text == lineView.node) {\n lineView.node = built.pre;\n }\n\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) lineView.node = built.pre;\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(cm, lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(cm, lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) { lineView.node = built.pre; }\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(cm, lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n\n return buildLineContent(cm, lineView);\n } // Redraw the line's text. Interacts with the background and text", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function Line(text, markedSpans, estimateHeight) {\n this.text = text\n attachMarkedSpans(this, markedSpans)\n this.height = estimateHeight ? estimateHeight(this) : 1\n}", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }" ]
[ "0.74917233", "0.73945045", "0.73891616", "0.73891616", "0.73891616", "0.73891616", "0.73891616", "0.73891616", "0.73891616", "0.73873484", "0.7345047", "0.7345047", "0.7345047", "0.7339334", "0.7339334", "0.7328154", "0.73016775", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.7292444", "0.69603586", "0.69357586", "0.69357586", "0.69357586", "0.69357586", "0.69357586", "0.69357586", "0.69357586", "0.69357586", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6932326", "0.6923419", "0.6900463", "0.6900463", "0.6900463", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.68953586", "0.6890783", "0.68853724", "0.68844867", "0.6881817", "0.6875288", "0.6567086", "0.6502599", "0.6474136", "0.64618266", "0.64481175", "0.64477843", "0.64477843", "0.64477843", "0.64477843", "0.64477843" ]
0.7390007
13
Detach a line from the document tree and its markers.
function cleanUpLine(line) { line.parent = null; detachMarkedSpans(line); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line) }\n line.markedSpans = null\n}", "function detachMarkedSpans(line) {\n\t\t var spans = line.markedSpans;\n\t\t if (!spans) return;\n\t\t for (var i = 0; i < spans.length; ++i)\n\t\t spans[i].marker.detachLine(line);\n\t\t line.markedSpans = null;\n\t\t }", "function cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}", "function cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}", "function detachMarkedSpans(line) {\n\t\t var spans = line.markedSpans;\n\t\t if (!spans) { return }\n\t\t for (var i = 0; i < spans.length; ++i)\n\t\t { spans[i].marker.detachLine(line); }\n\t\t line.markedSpans = null;\n\t\t }", "function detachMarkedSpans(line) {\r\n var spans = line.markedSpans;\r\n if (!spans) { return }\r\n for (var i = 0; i < spans.length; ++i)\r\n { spans[i].marker.detachLine(line); }\r\n line.markedSpans = null;\r\n}", "function detachMarkedSpans(line) {\r\n var spans = line.markedSpans;\r\n if (!spans) return;\r\n for (var i = 0; i < spans.length; ++i)\r\n spans[i].marker.detachLine(line);\r\n line.markedSpans = null;\r\n }", "function cleanUpLine(line) {\r\n line.parent = null;\r\n detachMarkedSpans(line);\r\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n}", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) return;\n for (var i = 0; i < spans.length; ++i)\n spans[i].marker.detachLine(line);\n line.markedSpans = null;\n }", "function detachMarkedSpans(line) {\n\t var spans = line.markedSpans;\n\t if (!spans) return;\n\t for (var i = 0; i < spans.length; ++i)\n\t spans[i].marker.detachLine(line);\n\t line.markedSpans = null;\n\t }", "function detachMarkedSpans(line) {\n\t var spans = line.markedSpans;\n\t if (!spans) return;\n\t for (var i = 0; i < spans.length; ++i)\n\t spans[i].marker.detachLine(line);\n\t line.markedSpans = null;\n\t }", "function detachMarkedSpans(line) {\n\t var spans = line.markedSpans;\n\t if (!spans) return;\n\t for (var i = 0; i < spans.length; ++i)\n\t spans[i].marker.detachLine(line);\n\t line.markedSpans = null;\n\t }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\r\n line.parent = null;\r\n detachMarkedSpans(line);\r\n }", "function cleanUpLine(line) {\n\t\t line.parent = null;\n\t\t detachMarkedSpans(line);\n\t\t }", "function cleanUpLine(line) {\n\t\t line.parent = null;\n\t\t detachMarkedSpans(line);\n\t\t }", "function cleanUpLine(line) {\n\t line.parent = null;\n\t detachMarkedSpans(line);\n\t }", "function cleanUpLine(line) {\n\t line.parent = null;\n\t detachMarkedSpans(line);\n\t }", "function cleanUpLine(line) {\n\t line.parent = null;\n\t detachMarkedSpans(line);\n\t }", "removeLineSegmant(){\n this.linePath.splice(this.linePath.length-1, 1);\n this.circlesInLinePath.splice(this.circlesInLinePath.length-1, 1);\n this.lineGraphics.clear();\n var lineToDelete = this.animLinePath.splice(this.animLinePath.length-1, 1);\n\n lineToDelete[0].destroy();\n }", "function ae(e){var t=e.markedSpans;if(t){for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}}", "removeToLineStart() {\n if (this.selection.isEmpty())\n this.selection.selectLineStart();\n if (this.selection.isEmpty())\n this.selection.selectLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }", "remove(line) {\n this.grid.remove(line)\n }", "function deleteLine(){\n\t\tul.removeChild(li);\n\t\tli.removeChild(btn);\n\t}", "_eraseInBufferLine(y, start, end, clearWrap = false) {\n const line = this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase + y);\n line.replaceCells(start, end, this._bufferService.buffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n if (clearWrap) {\n line.isWrapped = false;\n }\n }", "function removeMapLine(line) {\n mymap.removeLayer(line);\n}", "function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n\n if (line.stateAfter) {\n line.stateAfter = null;\n }\n\n if (line.styles) {\n line.styles = null;\n }\n\n if (line.order != null) {\n line.order = null;\n }\n\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n\n if (estHeight != line.height) {\n updateLineHeight(line, estHeight);\n }\n } // Detach a line from the document tree and its markers.", "function onDeleteLine() {\n changeCurrMeme('delete-row');\n initCanvasAndEditor();\n}", "function deleteLine() {\r\n ctx.clearRect(0, 0, can.width, can.height);\r\n}", "deleteLine(row) {\n if (!this.transaction || !this.editBuilder) {\n return;\n }\n const lastRow = this.getLastRow();\n if (row > lastRow) {\n return;\n }\n const line = this.editor.document.lineAt(row);\n const _range = line.range;\n this.editBuilder.delete(_range);\n }", "function deleteLastLine() {\n $('.line:last').remove();\n }", "removeToLineEnd() {\n if (this.selection.isEmpty())\n this.selection.selectLineEnd();\n\n var range = this.getSelectionRange();\n if (range.start.column == range.end.column && range.start.row == range.end.row) {\n range.end.column = 0;\n range.end.row++;\n }\n\n this.session.remove(range);\n this.clearSelection();\n }" ]
[ "0.7419141", "0.7419141", "0.7408427", "0.7399212", "0.7399212", "0.73966587", "0.7390764", "0.7388641", "0.7385563", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.738401", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.7371651", "0.73693633", "0.73693633", "0.73693633", "0.73693633", "0.73693633", "0.73693633", "0.73693633", "0.73526675", "0.73526675", "0.73526675", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7346404", "0.7267581", "0.71840346", "0.71840346", "0.71441704", "0.71441704", "0.71441704", "0.666879", "0.6614497", "0.6513022", "0.6315747", "0.6306676", "0.62402284", "0.62338567", "0.619329", "0.6092409", "0.60908824", "0.6075638", "0.6050109", "0.60125345" ]
0.7264013
82
Render the DOM representation of the text of a line. Also builds up a 'line map', which points at the DOM nodes that represent specific stretches of text, and is used by the measuring code. The returned object contains the DOM node, this map, and information about linewide styles that were set by the mode.
function buildLineContent(cm, lineView) { // The padding-right forces the element to have a 'border', which // is needed on Webkit to be able to get line-level bounding // rectangles for it (in measureChar). var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, col: 0, pos: 0, cm: cm, trailingSpace: false, splitSpaces: cm.getOption("lineWrapping")}; lineView.measure = {}; // Iterate over the logical lines that make up this visual line. for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); builder.pos = 0; builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering // algorithm, to deal with browser quirks. if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) { builder.addToken = buildTokenBadBidi(builder.addToken, order); } builder.map = []; var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); if (line.styleClasses) { if (line.styleClasses.bgClass) { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } if (line.styleClasses.textClass) { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } } // Ensure at least a single node is present, for measuring. if (builder.map.length == 0) { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } // Store the map and a cache object for the current logical line if (i == 0) { lineView.measure.map = builder.map; lineView.measure.cache = {}; } else { (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); } } // See issue #2901 if (webkit) { var last = builder.content.lastChild; if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) { builder.content.className = "cm-tab-wrap-hack"; } } signal(cm, "renderLine", cm, lineView.line, builder.pre); if (builder.pre.className) { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } return builder }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\r\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\r\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\r\n builder.map = [];\r\n insertLineContent(line, builder, getLineStyles(cm, line));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\r\n if (line.styleClasses.textClass)\r\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\r\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\r\n return builder;\r\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\r\n builder.map = [];\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild;\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\"; }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\r\n\r\n return builder\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: eltP(\"pre\", [content], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {}; // Iterate over the logical lines that make up this visual line.\n\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n } // Ensure at least a single node is present, for measuring.\n\n\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n } // Store the map and a cache object for the current logical line\n\n\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n } // See issue #2901\n\n\n if (webkit) {\n var last = builder.content.lastChild;\n\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function RendererTextLine() {\n\n /*\n * The width of the line in pixels.\n * @property width\n * @type number\n * @protected\n */\n this.width = 0;\n\n /*\n * The height of the line in pixels.\n * @property width\n * @type number\n * @protected\n */\n this.height = 0;\n\n /*\n * The descent of the line in pixels.\n * @property descent\n * @type number\n * @protected\n */\n this.descent = 0;\n\n /*\n * The content of the line as token objects.\n * @property content\n * @type Object[]\n * @protected\n */\n this.content = [];\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) { lineView.bgClass = built.bgClass; }\n\t\t if (built.textClass) { lineView.textClass = built.textClass; }\n\n\t\t updateLineClasses(cm, lineView);\n\t\t updateLineGutter(cm, lineView, lineN, dims);\n\t\t insertLineWidgets(cm, lineView, dims);\n\t\t return lineView.node\n\t\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t\t if (built.textClass) lineView.textClass = built.textClass;\n\t\t\n\t\t updateLineClasses(lineView);\n\t\t updateLineGutter(cm, lineView, lineN, dims);\n\t\t insertLineWidgets(cm, lineView, dims);\n\t\t return lineView.node;\n\t\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function _renderLine(input, sb) {\r\n var fontIsMonospace = input.fontIsMonospace;\r\n var canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\r\n var containsForeignElements = input.containsForeignElements;\r\n var lineContent = input.lineContent;\r\n var len = input.len;\r\n var isOverflowing = input.isOverflowing;\r\n var parts = input.parts;\r\n var fauxIndentLength = input.fauxIndentLength;\r\n var tabSize = input.tabSize;\r\n var startVisibleColumn = input.startVisibleColumn;\r\n var containsRTL = input.containsRTL;\r\n var spaceWidth = input.spaceWidth;\r\n var middotWidth = input.middotWidth;\r\n var renderWhitespace = input.renderWhitespace;\r\n var renderControlCharacters = input.renderControlCharacters;\r\n // use U+2E31 - WORD SEPARATOR MIDDLE DOT or U+00B7 - MIDDLE DOT\r\n var spaceRenderWhitespaceCharacter = (middotWidth > spaceWidth ? 0x2E31 : 0xB7);\r\n var characterMapping = new CharacterMapping(len + 1, parts.length);\r\n var charIndex = 0;\r\n var visibleColumn = startVisibleColumn;\r\n var charOffsetInPart = 0;\r\n var prevPartContentCnt = 0;\r\n var partAbsoluteOffset = 0;\r\n sb.appendASCIIString('<span>');\r\n for (var partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\r\n partAbsoluteOffset += prevPartContentCnt;\r\n var part = parts[partIndex];\r\n var partEndIndex = part.endIndex;\r\n var partType = part.type;\r\n var partRendersWhitespace = (renderWhitespace !== 0 /* None */ && (partType.indexOf('vs-whitespace') >= 0));\r\n charOffsetInPart = 0;\r\n sb.appendASCIIString('<span class=\"');\r\n sb.appendASCIIString(partType);\r\n sb.appendASCII(34 /* DoubleQuote */);\r\n if (partRendersWhitespace) {\r\n var partContentCnt = 0;\r\n {\r\n var _charIndex = charIndex;\r\n var _visibleColumn = visibleColumn;\r\n for (; _charIndex < partEndIndex; _charIndex++) {\r\n var charCode = lineContent.charCodeAt(_charIndex);\r\n var charWidth = (charCode === 9 /* Tab */ ? (tabSize - (_visibleColumn % tabSize)) : 1) | 0;\r\n partContentCnt += charWidth;\r\n if (_charIndex >= fauxIndentLength) {\r\n _visibleColumn += charWidth;\r\n }\r\n }\r\n }\r\n if (!fontIsMonospace) {\r\n var partIsOnlyWhitespace = (partType === 'vs-whitespace');\r\n if (partIsOnlyWhitespace || !containsForeignElements) {\r\n sb.appendASCIIString(' style=\"display:inline-block;width:');\r\n sb.appendASCIIString(String(spaceWidth * partContentCnt));\r\n sb.appendASCIIString('px\"');\r\n }\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var charWidth = void 0;\r\n if (charCode === 9 /* Tab */) {\r\n charWidth = (tabSize - (visibleColumn % tabSize)) | 0;\r\n if (!canUseHalfwidthRightwardsArrow || charWidth > 1) {\r\n sb.write1(0x2192); // RIGHTWARDS ARROW\r\n }\r\n else {\r\n sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\r\n }\r\n for (var space = 2; space <= charWidth; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n }\r\n else { // must be CharCode.Space\r\n charWidth = 1;\r\n sb.write1(spaceRenderWhitespaceCharacter); // &middot; or word separator middle dot\r\n }\r\n charOffsetInPart += charWidth;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n else {\r\n var partContentCnt = 0;\r\n if (containsRTL) {\r\n sb.appendASCIIString(' dir=\"ltr\"');\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var producedCharacters = 1;\r\n var charWidth = 1;\r\n switch (charCode) {\r\n case 9 /* Tab */:\r\n producedCharacters = (tabSize - (visibleColumn % tabSize));\r\n charWidth = producedCharacters;\r\n for (var space = 1; space <= producedCharacters; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n break;\r\n case 32 /* Space */:\r\n sb.write1(0xA0); // &nbsp;\r\n break;\r\n case 60 /* LessThan */:\r\n sb.appendASCIIString('&lt;');\r\n break;\r\n case 62 /* GreaterThan */:\r\n sb.appendASCIIString('&gt;');\r\n break;\r\n case 38 /* Ampersand */:\r\n sb.appendASCIIString('&amp;');\r\n break;\r\n case 0 /* Null */:\r\n sb.appendASCIIString('&#00;');\r\n break;\r\n case 65279 /* UTF8_BOM */:\r\n case 8232 /* LINE_SEPARATOR_2028 */:\r\n sb.write1(0xFFFD);\r\n break;\r\n default:\r\n if (strings.isFullWidthCharacter(charCode)) {\r\n charWidth++;\r\n }\r\n if (renderControlCharacters && charCode < 32) {\r\n sb.write1(9216 + charCode);\r\n }\r\n else {\r\n sb.write1(charCode);\r\n }\r\n }\r\n charOffsetInPart += producedCharacters;\r\n partContentCnt += producedCharacters;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n sb.appendASCIIString('</span>');\r\n }\r\n // When getting client rects for the last character, we will position the\r\n // text range at the end of the span, insteaf of at the beginning of next span\r\n characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\r\n if (isOverflowing) {\r\n sb.appendASCIIString('<span>&hellip;</span>');\r\n }\r\n sb.appendASCIIString('</span>');\r\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\r\n}", "function buildLineElement(cm, lineView, lineN, dims) {\r\n var built = getLineContent(cm, lineView);\r\n lineView.text = lineView.node = built.pre;\r\n if (built.bgClass) lineView.bgClass = built.bgClass;\r\n if (built.textClass) lineView.textClass = built.textClass;\r\n\r\n updateLineClasses(lineView);\r\n updateLineGutter(cm, lineView, lineN, dims);\r\n insertLineWidgets(lineView, dims);\r\n return lineView.node;\r\n }", "function buildLineElement(cm, lineView, lineN, dims) {\r\n var built = getLineContent(cm, lineView);\r\n lineView.text = lineView.node = built.pre;\r\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\r\n if (built.textClass) { lineView.textClass = built.textClass; }\r\n\r\n updateLineClasses(cm, lineView);\r\n updateLineGutter(cm, lineView, lineN, dims);\r\n insertLineWidgets(cm, lineView, dims);\r\n return lineView.node\r\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\t\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n\n return buildLineContent(cm, lineView);\n } // Redraw the line's text. Interacts with the background and text", "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "function Line(text, styles) {\n this.styles = styles || [text, null];\n this.text = text;\n this.height = 1;\n this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null;\n this.stateAfter = this.parent = this.hidden = null;\n }", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built;\r\n }\r\n return buildLineContent(cm, lineView);\r\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }" ]
[ "0.72961694", "0.7259279", "0.7259279", "0.71934396", "0.71934396", "0.71934396", "0.70302963", "0.70234215", "0.7002869", "0.6999494", "0.6986597", "0.69860077", "0.6976536", "0.69632566", "0.69540685", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6932572", "0.6921946", "0.6921946", "0.69109726", "0.6837876", "0.66838187", "0.63400245", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.6314181", "0.62810916", "0.6272154", "0.6271257", "0.62702614", "0.62702614", "0.62702614", "0.62702614", "0.62702614", "0.62702614", "0.62689364", "0.6267873", "0.62618876", "0.62609655", "0.62609655", "0.625471", "0.625471", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.6251788", "0.62416667", "0.6218082", "0.6141084", "0.6141084", "0.6141084", "0.590188", "0.5893293", "0.5893293", "0.5893293", "0.5893293" ]
0.6947981
27
Build up the DOM representation for a single token, and add it to the line map. Takes care to render special characters separately.
function buildToken(builder, text, style, startStyle, endStyle, title, css) { if (!text) { return } var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; var special = builder.cm.state.specialChars, mustWrap = false; var content; if (!special.test(text)) { builder.col += text.length; content = document.createTextNode(displayText); builder.map.push(builder.pos, builder.pos + text.length, content); if (ie && ie_version < 9) { mustWrap = true; } builder.pos += text.length; } else { content = document.createDocumentFragment(); var pos = 0; while (true) { special.lastIndex = pos; var m = special.exec(text); var skipped = m ? m.index - pos : text.length - pos; if (skipped) { var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } else { content.appendChild(txt); } builder.map.push(builder.pos, builder.pos + skipped, txt); builder.col += skipped; builder.pos += skipped; } if (!m) { break } pos += skipped + 1; var txt$1 = (void 0); if (m[0] == "\t") { var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); txt$1.setAttribute("role", "presentation"); txt$1.setAttribute("cm-text", "\t"); builder.col += tabWidth; } else if (m[0] == "\r" || m[0] == "\n") { txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); txt$1.setAttribute("cm-text", m[0]); builder.col += 1; } else { txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); txt$1.setAttribute("cm-text", m[0]); if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } else { content.appendChild(txt$1); } builder.col += 1; } builder.map.push(builder.pos, builder.pos + 1, txt$1); builder.pos++; } } builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; if (style || startStyle || endStyle || mustWrap || css) { var fullStyle = style || ""; if (startStyle) { fullStyle += startStyle; } if (endStyle) { fullStyle += endStyle; } var token = elt("span", [content], fullStyle, css); if (title) { token.title = title; } return builder.content.appendChild(token) } builder.content.appendChild(content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawHTMLToken() {\n const tokenContainer = document.createElement('div');\n const gameBoardUnderlay = document.getElementById('game-board-underlay');\n gameBoardUnderlay.appendChild(tokenContainer);\n tokenContainer.setAttribute(\"id\", this.id);\n tokenContainer.setAttribute(\"class\", \"token\");\n tokenContainer.style.backgroundColor = this.owner.colour;\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n\t\t if (!text) { return }\n\t\t var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n\t\t var special = builder.cm.state.specialChars, mustWrap = false;\n\t\t var content;\n\t\t if (!special.test(text)) {\n\t\t builder.col += text.length;\n\t\t content = document.createTextNode(displayText);\n\t\t builder.map.push(builder.pos, builder.pos + text.length, content);\n\t\t if (ie && ie_version < 9) { mustWrap = true; }\n\t\t builder.pos += text.length;\n\t\t } else {\n\t\t content = document.createDocumentFragment();\n\t\t var pos = 0;\n\t\t while (true) {\n\t\t special.lastIndex = pos;\n\t\t var m = special.exec(text);\n\t\t var skipped = m ? m.index - pos : text.length - pos;\n\t\t if (skipped) {\n\t\t var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\t\t if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n\t\t else { content.appendChild(txt); }\n\t\t builder.map.push(builder.pos, builder.pos + skipped, txt);\n\t\t builder.col += skipped;\n\t\t builder.pos += skipped;\n\t\t }\n\t\t if (!m) { break }\n\t\t pos += skipped + 1;\n\t\t var txt$1 = (void 0);\n\t\t if (m[0] == \"\\t\") {\n\t\t var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n\t\t txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n\t\t txt$1.setAttribute(\"role\", \"presentation\");\n\t\t txt$1.setAttribute(\"cm-text\", \"\\t\");\n\t\t builder.col += tabWidth;\n\t\t } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n\t\t txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n\t\t txt$1.setAttribute(\"cm-text\", m[0]);\n\t\t builder.col += 1;\n\t\t } else {\n\t\t txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n\t\t txt$1.setAttribute(\"cm-text\", m[0]);\n\t\t if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n\t\t else { content.appendChild(txt$1); }\n\t\t builder.col += 1;\n\t\t }\n\t\t builder.map.push(builder.pos, builder.pos + 1, txt$1);\n\t\t builder.pos++;\n\t\t }\n\t\t }\n\t\t builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n\t\t if (style || startStyle || endStyle || mustWrap || css || attributes) {\n\t\t var fullStyle = style || \"\";\n\t\t if (startStyle) { fullStyle += startStyle; }\n\t\t if (endStyle) { fullStyle += endStyle; }\n\t\t var token = elt(\"span\", [content], fullStyle, css);\n\t\t if (attributes) {\n\t\t for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n\t\t { token.setAttribute(attr, attributes[attr]); } }\n\t\t }\n\t\t return builder.content.appendChild(token)\n\t\t }\n\t\t builder.content.appendChild(content);\n\t\t }", "function buildToken(builder, text, style, startStyle, endStyle, title) {\r\n if (!text) return;\r\n var special = builder.cm.options.specialChars, mustWrap = false;\r\n if (!special.test(text)) {\r\n builder.col += text.length;\r\n var content = document.createTextNode(text);\r\n builder.map.push(builder.pos, builder.pos + text.length, content);\r\n if (ie && ie_version < 9) mustWrap = true;\r\n builder.pos += text.length;\r\n } else {\r\n var content = document.createDocumentFragment(), pos = 0;\r\n while (true) {\r\n special.lastIndex = pos;\r\n var m = special.exec(text);\r\n var skipped = m ? m.index - pos : text.length - pos;\r\n if (skipped) {\r\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\r\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\r\n else content.appendChild(txt);\r\n builder.map.push(builder.pos, builder.pos + skipped, txt);\r\n builder.col += skipped;\r\n builder.pos += skipped;\r\n }\r\n if (!m) break;\r\n pos += skipped + 1;\r\n if (m[0] == \"\\t\") {\r\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\r\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\r\n builder.col += tabWidth;\r\n } else {\r\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\r\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\r\n else content.appendChild(txt);\r\n builder.col += 1;\r\n }\r\n builder.map.push(builder.pos, builder.pos + 1, txt);\r\n builder.pos++;\r\n }\r\n }\r\n if (style || startStyle || endStyle || mustWrap) {\r\n var fullStyle = style || \"\";\r\n if (startStyle) fullStyle += startStyle;\r\n if (endStyle) fullStyle += endStyle;\r\n var token = elt(\"span\", [content], fullStyle);\r\n if (title) token.title = title;\r\n return builder.content.appendChild(token);\r\n }\r\n builder.content.appendChild(content);\r\n }", "function buildToken(builder, text, style, startStyle, endStyle, title) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n\t\t if (!text) return;\n\t\t var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n\t\t var special = builder.cm.state.specialChars, mustWrap = false;\n\t\t if (!special.test(text)) {\n\t\t builder.col += text.length;\n\t\t var content = document.createTextNode(displayText);\n\t\t builder.map.push(builder.pos, builder.pos + text.length, content);\n\t\t if (ie && ie_version < 9) mustWrap = true;\n\t\t builder.pos += text.length;\n\t\t } else {\n\t\t var content = document.createDocumentFragment(), pos = 0;\n\t\t while (true) {\n\t\t special.lastIndex = pos;\n\t\t var m = special.exec(text);\n\t\t var skipped = m ? m.index - pos : text.length - pos;\n\t\t if (skipped) {\n\t\t var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\t\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t\t else content.appendChild(txt);\n\t\t builder.map.push(builder.pos, builder.pos + skipped, txt);\n\t\t builder.col += skipped;\n\t\t builder.pos += skipped;\n\t\t }\n\t\t if (!m) break;\n\t\t pos += skipped + 1;\n\t\t if (m[0] == \"\\t\") {\n\t\t var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n\t\t var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n\t\t txt.setAttribute(\"role\", \"presentation\");\n\t\t txt.setAttribute(\"cm-text\", \"\\t\");\n\t\t builder.col += tabWidth;\n\t\t } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n\t\t var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n\t\t txt.setAttribute(\"cm-text\", m[0]);\n\t\t builder.col += 1;\n\t\t } else {\n\t\t var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n\t\t txt.setAttribute(\"cm-text\", m[0]);\n\t\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t\t else content.appendChild(txt);\n\t\t builder.col += 1;\n\t\t }\n\t\t builder.map.push(builder.pos, builder.pos + 1, txt);\n\t\t builder.pos++;\n\t\t }\n\t\t }\n\t\t builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n\t\t if (style || startStyle || endStyle || mustWrap || css) {\n\t\t var fullStyle = style || \"\";\n\t\t if (startStyle) fullStyle += startStyle;\n\t\t if (endStyle) fullStyle += endStyle;\n\t\t var token = elt(\"span\", [content], fullStyle, css);\n\t\t if (title) token.title = title;\n\t\t return builder.content.appendChild(token);\n\t\t }\n\t\t builder.content.appendChild(content);\n\t\t }", "function tokenToNode(token, tokenText) {\n switch (token.tokenType) {\n case \"ident\":\n return createStyledNode(tokenText, identClass);\n case \"symbol\":\n updateIdentClass(tokenText);\n return doc.createTextNode(tokenText);\n case \"whitespace\":\n return doc.createTextNode(tokenText);\n case \"comment\":\n return createStyledNode(tokenText, COMMENT_COLOR);\n default:\n return createStyledNode(tokenText, PROPERTY_VALUE_COLOR);\n }\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) return;\n var special = builder.cm.options.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(text);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(text.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt.setAttribute(\"role\", \"presentation\");\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n\t if (!text) return;\n\t var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text;\n\t var special = builder.cm.state.specialChars, mustWrap = false;\n\t if (!special.test(text)) {\n\t builder.col += text.length;\n\t var content = document.createTextNode(displayText);\n\t builder.map.push(builder.pos, builder.pos + text.length, content);\n\t if (ie && ie_version < 9) mustWrap = true;\n\t builder.pos += text.length;\n\t } else {\n\t var content = document.createDocumentFragment(), pos = 0;\n\t while (true) {\n\t special.lastIndex = pos;\n\t var m = special.exec(text);\n\t var skipped = m ? m.index - pos : text.length - pos;\n\t if (skipped) {\n\t var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.map.push(builder.pos, builder.pos + skipped, txt);\n\t builder.col += skipped;\n\t builder.pos += skipped;\n\t }\n\t if (!m) break;\n\t pos += skipped + 1;\n\t if (m[0] == \"\\t\") {\n\t var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n\t var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n\t txt.setAttribute(\"role\", \"presentation\");\n\t txt.setAttribute(\"cm-text\", \"\\t\");\n\t builder.col += tabWidth;\n\t } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n\t var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t builder.col += 1;\n\t } else {\n\t var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.col += 1;\n\t }\n\t builder.map.push(builder.pos, builder.pos + 1, txt);\n\t builder.pos++;\n\t }\n\t }\n\t if (style || startStyle || endStyle || mustWrap || css) {\n\t var fullStyle = style || \"\";\n\t if (startStyle) fullStyle += startStyle;\n\t if (endStyle) fullStyle += endStyle;\n\t var token = elt(\"span\", [content], fullStyle, css);\n\t if (title) token.title = title;\n\t return builder.content.appendChild(token);\n\t }\n\t builder.content.appendChild(content);\n\t }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n\t if (!text) return;\n\t var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text;\n\t var special = builder.cm.state.specialChars, mustWrap = false;\n\t if (!special.test(text)) {\n\t builder.col += text.length;\n\t var content = document.createTextNode(displayText);\n\t builder.map.push(builder.pos, builder.pos + text.length, content);\n\t if (ie && ie_version < 9) mustWrap = true;\n\t builder.pos += text.length;\n\t } else {\n\t var content = document.createDocumentFragment(), pos = 0;\n\t while (true) {\n\t special.lastIndex = pos;\n\t var m = special.exec(text);\n\t var skipped = m ? m.index - pos : text.length - pos;\n\t if (skipped) {\n\t var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.map.push(builder.pos, builder.pos + skipped, txt);\n\t builder.col += skipped;\n\t builder.pos += skipped;\n\t }\n\t if (!m) break;\n\t pos += skipped + 1;\n\t if (m[0] == \"\\t\") {\n\t var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n\t var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n\t txt.setAttribute(\"role\", \"presentation\");\n\t txt.setAttribute(\"cm-text\", \"\\t\");\n\t builder.col += tabWidth;\n\t } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n\t var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t builder.col += 1;\n\t } else {\n\t var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.col += 1;\n\t }\n\t builder.map.push(builder.pos, builder.pos + 1, txt);\n\t builder.pos++;\n\t }\n\t }\n\t if (style || startStyle || endStyle || mustWrap || css) {\n\t var fullStyle = style || \"\";\n\t if (startStyle) fullStyle += startStyle;\n\t if (endStyle) fullStyle += endStyle;\n\t var token = elt(\"span\", [content], fullStyle, css);\n\t if (title) token.title = title;\n\t return builder.content.appendChild(token);\n\t }\n\t builder.content.appendChild(content);\n\t }", "function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) {\n return;\n }\n\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars,\n mustWrap = false;\n var content;\n\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n\n if (ie && ie_version < 9) {\n mustWrap = true;\n }\n\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\n if (ie && ie_version < 9) {\n content.appendChild(elt(\"span\", [txt]));\n } else {\n content.appendChild(txt);\n }\n\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n\n if (!m) {\n break;\n }\n\n pos += skipped + 1;\n var txt$1 = void 0;\n\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize,\n tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240D\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n\n if (ie && ie_version < 9) {\n content.appendChild(elt(\"span\", [txt$1]));\n } else {\n content.appendChild(txt$1);\n }\n\n builder.col += 1;\n }\n\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n\n if (startStyle) {\n fullStyle += startStyle;\n }\n\n if (endStyle) {\n fullStyle += endStyle;\n }\n\n var token = elt(\"span\", [content], fullStyle, css);\n\n if (attributes) {\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\") {\n token.setAttribute(attr, attributes[attr]);\n }\n }\n }\n\n return builder.content.appendChild(token);\n }\n\n builder.content.appendChild(content);\n } // Change some spaces to NBSP to prevent the browser from collapsing", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n\t if (!text) return;\n\t var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n\t var special = builder.cm.state.specialChars, mustWrap = false;\n\t if (!special.test(text)) {\n\t builder.col += text.length;\n\t var content = document.createTextNode(displayText);\n\t builder.map.push(builder.pos, builder.pos + text.length, content);\n\t if (ie && ie_version < 9) mustWrap = true;\n\t builder.pos += text.length;\n\t } else {\n\t var content = document.createDocumentFragment(), pos = 0;\n\t while (true) {\n\t special.lastIndex = pos;\n\t var m = special.exec(text);\n\t var skipped = m ? m.index - pos : text.length - pos;\n\t if (skipped) {\n\t var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.map.push(builder.pos, builder.pos + skipped, txt);\n\t builder.col += skipped;\n\t builder.pos += skipped;\n\t }\n\t if (!m) break;\n\t pos += skipped + 1;\n\t if (m[0] == \"\\t\") {\n\t var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n\t var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n\t txt.setAttribute(\"role\", \"presentation\");\n\t txt.setAttribute(\"cm-text\", \"\\t\");\n\t builder.col += tabWidth;\n\t } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n\t var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t builder.col += 1;\n\t } else {\n\t var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n\t txt.setAttribute(\"cm-text\", m[0]);\n\t if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n\t else content.appendChild(txt);\n\t builder.col += 1;\n\t }\n\t builder.map.push(builder.pos, builder.pos + 1, txt);\n\t builder.pos++;\n\t }\n\t }\n\t builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n\t if (style || startStyle || endStyle || mustWrap || css) {\n\t var fullStyle = style || \"\";\n\t if (startStyle) fullStyle += startStyle;\n\t if (endStyle) fullStyle += endStyle;\n\t var token = elt(\"span\", [content], fullStyle, css);\n\t if (title) token.title = title;\n\t return builder.content.appendChild(token);\n\t }\n\t builder.content.appendChild(content);\n\t }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = (void 0)\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false\n var content\n if (!special.test(text)) {\n builder.col += text.length\n content = document.createTextNode(displayText)\n builder.map.push(builder.pos, builder.pos + text.length, content)\n if (ie && ie_version < 9) { mustWrap = true }\n builder.pos += text.length\n } else {\n content = document.createDocumentFragment()\n var pos = 0\n while (true) {\n special.lastIndex = pos\n var m = special.exec(text)\n var skipped = m ? m.index - pos : text.length - pos\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped))\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])) }\n else { content.appendChild(txt) }\n builder.map.push(builder.pos, builder.pos + skipped, txt)\n builder.col += skipped\n builder.pos += skipped\n }\n if (!m) { break }\n pos += skipped + 1\n var txt$1 = (void 0)\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"))\n txt$1.setAttribute(\"role\", \"presentation\")\n txt$1.setAttribute(\"cm-text\", \"\\t\")\n builder.col += tabWidth\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"))\n txt$1.setAttribute(\"cm-text\", m[0])\n builder.col += 1\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0])\n txt$1.setAttribute(\"cm-text\", m[0])\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])) }\n else { content.appendChild(txt$1) }\n builder.col += 1\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1)\n builder.pos++\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\"\n if (startStyle) { fullStyle += startStyle }\n if (endStyle) { fullStyle += endStyle }\n var token = elt(\"span\", [content], fullStyle, css)\n if (title) { token.title = title }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content)\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) return;\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text\n var special = builder.cm.state.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt.setAttribute(\"role\", \"presentation\");\n txt.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n var txt = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n txt.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function addToken() {\n token.end = {\n line: line,\n col: column\n };\n\n DEBUG && debug('addToken:', JSON.stringify(token, null, 2));\n\n tokens.push(token);\n\n buffer = '';\n token = {};\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\r\n if (!text) { return }\r\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\r\n var special = builder.cm.state.specialChars, mustWrap = false;\r\n var content;\r\n if (!special.test(text)) {\r\n builder.col += text.length;\r\n content = document.createTextNode(displayText);\r\n builder.map.push(builder.pos, builder.pos + text.length, content);\r\n if (ie && ie_version < 9) { mustWrap = true; }\r\n builder.pos += text.length;\r\n } else {\r\n content = document.createDocumentFragment();\r\n var pos = 0;\r\n while (true) {\r\n special.lastIndex = pos;\r\n var m = special.exec(text);\r\n var skipped = m ? m.index - pos : text.length - pos;\r\n if (skipped) {\r\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\r\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\r\n else { content.appendChild(txt); }\r\n builder.map.push(builder.pos, builder.pos + skipped, txt);\r\n builder.col += skipped;\r\n builder.pos += skipped;\r\n }\r\n if (!m) { break }\r\n pos += skipped + 1;\r\n var txt$1 = (void 0);\r\n if (m[0] == \"\\t\") {\r\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\r\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\r\n txt$1.setAttribute(\"role\", \"presentation\");\r\n txt$1.setAttribute(\"cm-text\", \"\\t\");\r\n builder.col += tabWidth;\r\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\r\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\r\n txt$1.setAttribute(\"cm-text\", m[0]);\r\n builder.col += 1;\r\n } else {\r\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\r\n txt$1.setAttribute(\"cm-text\", m[0]);\r\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\r\n else { content.appendChild(txt$1); }\r\n builder.col += 1;\r\n }\r\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\r\n builder.pos++;\r\n }\r\n }\r\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\r\n if (style || startStyle || endStyle || mustWrap || css) {\r\n var fullStyle = style || \"\";\r\n if (startStyle) { fullStyle += startStyle; }\r\n if (endStyle) { fullStyle += endStyle; }\r\n var token = elt(\"span\", [content], fullStyle, css);\r\n if (title) { token.title = title; }\r\n return builder.content.appendChild(token)\r\n }\r\n builder.content.appendChild(content);\r\n}", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\r\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\r\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\r\n builder.map = [];\r\n insertLineContent(line, builder, getLineStyles(cm, line));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\r\n if (line.styleClasses.textClass)\r\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\r\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\r\n return builder;\r\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) return;\n var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n if (!special.test(text)) {\n builder.col += text.length;\n var content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) mustWrap = true;\n builder.pos += text.length;\n } else {\n var content = document.createDocumentFragment(), pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) break;\n pos += skipped + 1;\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n var txt = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt.setAttribute(\"role\", \"presentation\");\n txt.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else {\n var txt = builder.cm.options.specialCharPlaceholder(m[0]);\n txt.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) content.appendChild(elt(\"span\", [txt]));\n else content.appendChild(txt);\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt);\n builder.pos++;\n }\n }\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) fullStyle += startStyle;\n if (endStyle) fullStyle += endStyle;\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) token.title = title;\n return builder.content.appendChild(token);\n }\n builder.content.appendChild(content);\n }", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildToken(builder, text, style, startStyle, endStyle, title, css) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (title) { token.title = title; }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function addToken(token, write) {\n if (token.type.label == \"string\") {\n write(\"'\" + sanitize(token.value) + \"'\",\n token.loc.start.line,\n token.loc.start.column);\n } else if (token.type.label == \"regexp\") {\n write(String(token.value.value),\n token.loc.start.line,\n token.loc.start.column);\n } else {\n let value;\n if (token.value != null) {\n value = token.value;\n if (token.type.label === \"privateId\") {\n value = `#${value}`;\n }\n } else {\n value = token.type.label;\n }\n write(String(value),\n token.loc.start.line,\n token.loc.start.column);\n }\n }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "function tokenPart(token){\n var part = makePartSpan(token.value, self.doc); \n part.className = token.style;\n return part;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\r\n builder.map = [];\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild;\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\"; }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\r\n\r\n return builder\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: eltP(\"pre\", [content], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {}; // Iterate over the logical lines that make up this visual line.\n\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n } // Ensure at least a single node is present, for measuring.\n\n\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n } // Store the map and a cache object for the current logical line\n\n\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n } // See issue #2901\n\n\n if (webkit) {\n var last = builder.content.lastChild;\n\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function injectLineNumbers(tokens, idx, options, env, slf) {\n var line;\n if (tokens[idx].map && tokens[idx].level === 0) {\n line = tokens[idx].map[0];\n tokens[idx].attrJoin('class', 'line');\n tokens[idx].attrSet('data-line', String(line));\n }\n return slf.renderToken(tokens, idx, options, env, slf);\n }", "function _renderLine(input, sb) {\r\n var fontIsMonospace = input.fontIsMonospace;\r\n var canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;\r\n var containsForeignElements = input.containsForeignElements;\r\n var lineContent = input.lineContent;\r\n var len = input.len;\r\n var isOverflowing = input.isOverflowing;\r\n var parts = input.parts;\r\n var fauxIndentLength = input.fauxIndentLength;\r\n var tabSize = input.tabSize;\r\n var startVisibleColumn = input.startVisibleColumn;\r\n var containsRTL = input.containsRTL;\r\n var spaceWidth = input.spaceWidth;\r\n var middotWidth = input.middotWidth;\r\n var renderWhitespace = input.renderWhitespace;\r\n var renderControlCharacters = input.renderControlCharacters;\r\n // use U+2E31 - WORD SEPARATOR MIDDLE DOT or U+00B7 - MIDDLE DOT\r\n var spaceRenderWhitespaceCharacter = (middotWidth > spaceWidth ? 0x2E31 : 0xB7);\r\n var characterMapping = new CharacterMapping(len + 1, parts.length);\r\n var charIndex = 0;\r\n var visibleColumn = startVisibleColumn;\r\n var charOffsetInPart = 0;\r\n var prevPartContentCnt = 0;\r\n var partAbsoluteOffset = 0;\r\n sb.appendASCIIString('<span>');\r\n for (var partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {\r\n partAbsoluteOffset += prevPartContentCnt;\r\n var part = parts[partIndex];\r\n var partEndIndex = part.endIndex;\r\n var partType = part.type;\r\n var partRendersWhitespace = (renderWhitespace !== 0 /* None */ && (partType.indexOf('vs-whitespace') >= 0));\r\n charOffsetInPart = 0;\r\n sb.appendASCIIString('<span class=\"');\r\n sb.appendASCIIString(partType);\r\n sb.appendASCII(34 /* DoubleQuote */);\r\n if (partRendersWhitespace) {\r\n var partContentCnt = 0;\r\n {\r\n var _charIndex = charIndex;\r\n var _visibleColumn = visibleColumn;\r\n for (; _charIndex < partEndIndex; _charIndex++) {\r\n var charCode = lineContent.charCodeAt(_charIndex);\r\n var charWidth = (charCode === 9 /* Tab */ ? (tabSize - (_visibleColumn % tabSize)) : 1) | 0;\r\n partContentCnt += charWidth;\r\n if (_charIndex >= fauxIndentLength) {\r\n _visibleColumn += charWidth;\r\n }\r\n }\r\n }\r\n if (!fontIsMonospace) {\r\n var partIsOnlyWhitespace = (partType === 'vs-whitespace');\r\n if (partIsOnlyWhitespace || !containsForeignElements) {\r\n sb.appendASCIIString(' style=\"display:inline-block;width:');\r\n sb.appendASCIIString(String(spaceWidth * partContentCnt));\r\n sb.appendASCIIString('px\"');\r\n }\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var charWidth = void 0;\r\n if (charCode === 9 /* Tab */) {\r\n charWidth = (tabSize - (visibleColumn % tabSize)) | 0;\r\n if (!canUseHalfwidthRightwardsArrow || charWidth > 1) {\r\n sb.write1(0x2192); // RIGHTWARDS ARROW\r\n }\r\n else {\r\n sb.write1(0xFFEB); // HALFWIDTH RIGHTWARDS ARROW\r\n }\r\n for (var space = 2; space <= charWidth; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n }\r\n else { // must be CharCode.Space\r\n charWidth = 1;\r\n sb.write1(spaceRenderWhitespaceCharacter); // &middot; or word separator middle dot\r\n }\r\n charOffsetInPart += charWidth;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n else {\r\n var partContentCnt = 0;\r\n if (containsRTL) {\r\n sb.appendASCIIString(' dir=\"ltr\"');\r\n }\r\n sb.appendASCII(62 /* GreaterThan */);\r\n for (; charIndex < partEndIndex; charIndex++) {\r\n characterMapping.setPartData(charIndex, partIndex, charOffsetInPart, partAbsoluteOffset);\r\n var charCode = lineContent.charCodeAt(charIndex);\r\n var producedCharacters = 1;\r\n var charWidth = 1;\r\n switch (charCode) {\r\n case 9 /* Tab */:\r\n producedCharacters = (tabSize - (visibleColumn % tabSize));\r\n charWidth = producedCharacters;\r\n for (var space = 1; space <= producedCharacters; space++) {\r\n sb.write1(0xA0); // &nbsp;\r\n }\r\n break;\r\n case 32 /* Space */:\r\n sb.write1(0xA0); // &nbsp;\r\n break;\r\n case 60 /* LessThan */:\r\n sb.appendASCIIString('&lt;');\r\n break;\r\n case 62 /* GreaterThan */:\r\n sb.appendASCIIString('&gt;');\r\n break;\r\n case 38 /* Ampersand */:\r\n sb.appendASCIIString('&amp;');\r\n break;\r\n case 0 /* Null */:\r\n sb.appendASCIIString('&#00;');\r\n break;\r\n case 65279 /* UTF8_BOM */:\r\n case 8232 /* LINE_SEPARATOR_2028 */:\r\n sb.write1(0xFFFD);\r\n break;\r\n default:\r\n if (strings.isFullWidthCharacter(charCode)) {\r\n charWidth++;\r\n }\r\n if (renderControlCharacters && charCode < 32) {\r\n sb.write1(9216 + charCode);\r\n }\r\n else {\r\n sb.write1(charCode);\r\n }\r\n }\r\n charOffsetInPart += producedCharacters;\r\n partContentCnt += producedCharacters;\r\n if (charIndex >= fauxIndentLength) {\r\n visibleColumn += charWidth;\r\n }\r\n }\r\n prevPartContentCnt = partContentCnt;\r\n }\r\n sb.appendASCIIString('</span>');\r\n }\r\n // When getting client rects for the last character, we will position the\r\n // text range at the end of the span, insteaf of at the beginning of next span\r\n characterMapping.setPartData(len, parts.length - 1, charOffsetInPart, partAbsoluteOffset);\r\n if (isOverflowing) {\r\n sb.appendASCIIString('<span>&hellip;</span>');\r\n }\r\n sb.appendASCIIString('</span>');\r\n return new RenderLineOutput(characterMapping, containsRTL, containsForeignElements);\r\n}", "function appendTokenList(item){ //because lexeme is dynamically updated in a list\n var temp = item;\n lineTokens.push(temp);\n}", "function tokensToNodes(tokens, opts, doc) {\n\t\t\tvar result = [];\n\n\t\t\tfor (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\t\t\tvar _ref;\n\n\t\t\t\tif (_isArray) {\n\t\t\t\t\tif (_i >= _iterator.length) break;\n\t\t\t\t\t_ref = _iterator[_i++];\n\t\t\t\t} else {\n\t\t\t\t\t_i = _iterator.next();\n\t\t\t\t\tif (_i.done) break;\n\t\t\t\t\t_ref = _i.value;\n\t\t\t\t}\n\n\t\t\t\tvar token = _ref;\n\n\t\t\t\tif (token.type === 'nl' && opts.nl2br) {\n\t\t\t\t\tresult.push(doc.createElement('br'));\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (!token.isLink || !opts.check(token)) {\n\t\t\t\t\tresult.push(doc.createTextNode(token.toString()));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar _opts$resolve = opts.resolve(token),\n\t\t\t\t formatted = _opts$resolve.formatted,\n\t\t\t\t formattedHref = _opts$resolve.formattedHref,\n\t\t\t\t tagName = _opts$resolve.tagName,\n\t\t\t\t className = _opts$resolve.className,\n\t\t\t\t target = _opts$resolve.target,\n\t\t\t\t events = _opts$resolve.events,\n\t\t\t\t attributes = _opts$resolve.attributes;\n\n\t\t\t\t// Build the link\n\n\n\t\t\t\tvar link = doc.createElement(tagName);\n\t\t\t\tlink.setAttribute('href', formattedHref);\n\n\t\t\t\tif (className) {\n\t\t\t\t\tlink.setAttribute('class', className);\n\t\t\t\t}\n\n\t\t\t\tif (target) {\n\t\t\t\t\tlink.setAttribute('target', target);\n\t\t\t\t}\n\n\t\t\t\t// Build up additional attributes\n\t\t\t\tif (attributes) {\n\t\t\t\t\tfor (var attr in attributes) {\n\t\t\t\t\t\tlink.setAttribute(attr, attributes[attr]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (events) {\n\t\t\t\t\tfor (var event in events) {\n\t\t\t\t\t\tif (link.addEventListener) {\n\t\t\t\t\t\t\tlink.addEventListener(event, events[event]);\n\t\t\t\t\t\t} else if (link.attachEvent) {\n\t\t\t\t\t\t\tlink.attachEvent('on' + event, events[event]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlink.appendChild(doc.createTextNode(formatted));\n\t\t\t\tresult.push(link);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}", "function tokensToNodes(tokens, opts, doc) {\n\t\t\tvar result = [];\n\n\t\t\tfor (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\t\t\tvar _ref;\n\n\t\t\t\tif (_isArray) {\n\t\t\t\t\tif (_i >= _iterator.length) break;\n\t\t\t\t\t_ref = _iterator[_i++];\n\t\t\t\t} else {\n\t\t\t\t\t_i = _iterator.next();\n\t\t\t\t\tif (_i.done) break;\n\t\t\t\t\t_ref = _i.value;\n\t\t\t\t}\n\n\t\t\t\tvar token = _ref;\n\n\t\t\t\tif (token.type === 'nl' && opts.nl2br) {\n\t\t\t\t\tresult.push(doc.createElement('br'));\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (!token.isLink || !opts.check(token)) {\n\t\t\t\t\tresult.push(doc.createTextNode(token.toString()));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tvar _opts$resolve = opts.resolve(token),\n\t\t\t\t formatted = _opts$resolve.formatted,\n\t\t\t\t formattedHref = _opts$resolve.formattedHref,\n\t\t\t\t tagName = _opts$resolve.tagName,\n\t\t\t\t className = _opts$resolve.className,\n\t\t\t\t target = _opts$resolve.target,\n\t\t\t\t events = _opts$resolve.events,\n\t\t\t\t attributes = _opts$resolve.attributes;\n\n\t\t\t\t// Build the link\n\n\n\t\t\t\tvar link = doc.createElement(tagName);\n\t\t\t\tlink.setAttribute('href', formattedHref);\n\n\t\t\t\tif (className) {\n\t\t\t\t\tlink.setAttribute('class', className);\n\t\t\t\t}\n\n\t\t\t\tif (target) {\n\t\t\t\t\tlink.setAttribute('target', target);\n\t\t\t\t}\n\n\t\t\t\t// Build up additional attributes\n\t\t\t\tif (attributes) {\n\t\t\t\t\tfor (var attr in attributes) {\n\t\t\t\t\t\tlink.setAttribute(attr, attributes[attr]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (events) {\n\t\t\t\t\tfor (var event in events) {\n\t\t\t\t\t\tif (link.addEventListener) {\n\t\t\t\t\t\t\tlink.addEventListener(event, events[event]);\n\t\t\t\t\t\t} else if (link.attachEvent) {\n\t\t\t\t\t\t\tlink.attachEvent('on' + event, events[event]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlink.appendChild(doc.createTextNode(formatted));\n\t\t\t\tresult.push(link);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}" ]
[ "0.6337438", "0.6153451", "0.6116774", "0.611497", "0.611497", "0.611497", "0.61053276", "0.60906744", "0.60436153", "0.6043088", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.60180473", "0.6009089", "0.6009089", "0.5997945", "0.59927744", "0.59623456", "0.59623456", "0.5941064", "0.5900672", "0.58747405", "0.5859519", "0.58462507", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.58348167", "0.583411", "0.583411", "0.5811858", "0.5792111", "0.5787187", "0.57831633", "0.57831633", "0.57831633", "0.57720095", "0.5756298", "0.5752775", "0.57416284", "0.56928265", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56776464", "0.56736743", "0.5657439", "0.5648943", "0.5630439", "0.5618498", "0.56067884", "0.56067884", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.5589436", "0.54797304", "0.54797304", "0.53364414", "0.5336058", "0.53008944", "0.53008944" ]
0.58894855
34
Change some spaces to NBSP to prevent the browser from collapsing trailing spaces at the end of a line when rendering text (issue 1362).
function splitSpaces(text, trailingBefore) { if (text.length > 1 && !/ /.test(text)) { return text } var spaceBefore = trailingBefore, result = ""; for (var i = 0; i < text.length; i++) { var ch = text.charAt(i); if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) { ch = "\u00a0"; } result += ch; spaceBefore = ch == " "; } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function String_SpaceToNonBreakingSpace()\n{\n\t//replace them\n\treturn this.replace(/\\b {2}/g, \" &nbsp;\").replace(/ {2}\\b/g, \"&nbsp; \").replace(/ {2}/g, \"&nbsp;&nbsp;\");\n}", "function normalizeSpaces(text)\n{\n // IE has already done this conversion, so doing it again will remove multiple nbsp\n if (browserVersion.isIE)\n {\n return text;\n }\n\n // Replace multiple spaces with a single space\n // TODO - this shouldn't occur inside PRE elements\n text = text.replace(/\\ +/g, \" \");\n\n // Replace &nbsp; with a space\n var nbspPattern = new RegExp(String.fromCharCode(160), \"g\");\n if (browserVersion.isSafari) {\n return replaceAll(text, String.fromCharCode(160), \" \");\n } else {\n return text.replace(nbspPattern, \" \");\n }\n}", "function nbspCleanup() {\r\n\tif (o3_wrap) {\r\n\t\to3_text = o3_text.replace(/\\&nbsp;/g, ' ');\r\n\t\to3_cap = o3_cap.replace(/\\&nbsp;/g, ' ');\r\n\t}\r\n}", "function nonBreakingSpaces(str) {\n return str.replace(/ /g, \"&nbsp;\");\n}", "function fixSpaces(string) {\n if (string.charAt(0) == \" \") string = nbsp + string.slice(1);\n return string.replace(/\\t/g, function(){return makeWhiteSpace(indentUnit);})\n .replace(/[ \\u00a0]{2,}/g, function(s) {return makeWhiteSpace(s.length);});\n}", "function replaceSpace(text) {\n\treturn text.replace(/\\r/g, \"\").replace(/\\n/g, \" \");\n}", "function replaceSpace(str) {\n return str.replace(/^(\\s|\\u00A0)+/, '').replace(/(\\s|\\u00A0)+$/, '')\n}", "function splitSpaces(text, trailingBefore) {\n\t\t if (text.length > 1 && !/ /.test(text)) { return text }\n\t\t var spaceBefore = trailingBefore, result = \"\";\n\t\t for (var i = 0; i < text.length; i++) {\n\t\t var ch = text.charAt(i);\n\t\t if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n\t\t { ch = \"\\u00a0\"; }\n\t\t result += ch;\n\t\t spaceBefore = ch == \" \";\n\t\t }\n\t\t return result\n\t\t }", "function elimineSpaces(str) {\n\tvar s = str.replace(/\\s+/g, '');\n\ts = s.replace(/\\t+/g, '');\n\treturn s;\n}", "function nbsp(count)\r\n{\r\n\tvar result = \"\";\r\n\twhile( count-- > 0 )\r\n\t\tresult += \"\\u00a0\";\r\n\treturn result;\r\n}", "function cleanDocumentText(text) {\n var cleanedText = text.replace(/\\u200B\\u200c/g, '');\n var nonBreakingSpaces = String.fromCharCode(160);\n var regex = new RegExp(nonBreakingSpaces, 'g');\n cleanedText = cleanedText.replace(regex, ' ');\n return cleanedText;\n }", "function replaceSpaces(value) {\n var pattern = new RegExp(\" \", \"g\");\n return value.replace(pattern, '&nbsp;');\n}", "function imtrim(s) \n{\n s = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\n s = s.replace(/[ ]{2,}/gi,\" \");\n s = s.replace(/\\n /,\"\\n\");\n return s;\n}", "function noSpace(x) {\n return x.replace(/[ ]/g, '');\n}", "function makeWhiteSpace(n) {\n var buffer = [], nb = true;\n for (; n > 0; n--) {\n buffer.push((nb || n == 1) ? nbsp : \" \");\n nb = !nb;\n }\n return buffer.join(\"\");\n}", "function fillWhitespace(thing) {\n var txt = $(thing).text();\n var txt2 = \"\";\n var i = 0;\n for(i = 0; i < txt.length; i++) {\n if(txt[i] == \" \") {\n txt2 += \"&nbsp;\";\n }\n else\n txt2 += txt[i];\n }\n return txt2;\n}", "function qctrim(s) {\r\n\ts = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\r\n\ts = s.replace(/[ ]{2,}/gi,\" \");\r\n\ts = s.replace(/\\n /,\"\\n\");\r\n\treturn s;\r\n}", "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n}", "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n}", "function elimine2Spaces(str) {\n\tvar s = str.replace(/\\t+/g, ' ');\n\ts = s.replace(/\\s\\s+/g, ' ');\n\treturn s;\n}", "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "function replaceWhiteSpaces(text) {\n var i, result = '',\n len = text.length;\n\n for (i = 0; i < len; i += 1) {\n if (text[i] === ' ') {\n result += '&nbsp;';\n } else {\n result += text[i];\n }\n }\n\n return result;\n}", "function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) {\n return text;\n }\n\n var spaceBefore = trailingBefore,\n result = \"\";\n\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) {\n ch = \"\\xA0\";\n }\n\n result += ch;\n spaceBefore = ch == \" \";\n }\n\n return result;\n } // Work around nonsense dimensions being reported for stretches of", "function showSpaces(string) {\n return string && string.replace(/^\\s|\\s$/g, '␣');\n}", "function normalizeWhitespace( text ) {\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n\t}", "function autoEdWhitespace(str) { //MAIN FUNCTION describes list of fixes\n \n str = str.replace(/\\t/g, \" \");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/(\\n\\n)\\n+/g, \"$1\");\n str = str.replace(/== ? ?\\n\\n==/g, \"== \\n ==\");\n str = str.replace(/\\n\\n(\\* ?\\[?http)/g, \"\\n$1\");\n \n str = str.replace(/^ ? ? \\n/gm, \"\\n\");\n str = str.replace(/\\n\\n\\*/g, \"\\n*\");\n str = str.replace(/[ \\t][ \\t]+/g, \" \");\n str = str.replace(/([=\\n]\\n)\\n+/g, \"$1\");\n str = str.replace(/ \\n/g, \"\\n\");\n \n //* bullet points\n str = str.replace(/^([\\*#]+:*) /gm, \"$1\");\n str = str.replace(/^([\\*#]+:*)/gm, \"$1 \");\n \n //==Headings==\n str = str.replace(/^(={1,4}) ?(.*?) ?(={1,4})$/gm, \"$1 $2 $3\");\n return str;\n}", "function encodeWhiteSpaces(str) {\n return str.split('').map(function (c) {\n if (c === ' ') {\n return '&nbsp;&nbsp;'\n } else {\n return c;\n }\n }).join('');\n}", "function convertToSpaces(phrase) {\n phrase = phrase.replaceAll(/%20/g, \" \");\n return phrase.replace(moreInfo, \"\");\n}", "function replaceSpace(x){\n var array = x.split('');\n for(i=0;i<=array.length;i++){\n if (array[i] == ' ') {\n array.splice(i,1,'%20');\n }\n }\n return array.join('');\n}", "function outdentOneSpace() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utLineUtility,\n sp: utilitymanager_1.um.TIXSelPolicy.All,\n }, function (up) { return up.intext !== '' && up.intext[0] === ' ' ?\n up.intext.substr(1) : up.intext; });\n }", "function noSpace(x){\n return x.replace(/\\s/g,\"\");\n}", "function filterExtraSpacing(apib) {\n const result = apib.trim().replace(/\\n\\s*\\n\\s*\\n/g, '\\n\\n');\n\n return `${result}\\n`;\n}", "function stripSpaces(textControl){\n\tx = textControl.value;\n\twhile (x.substring(0,1) == ' ') x = x.substring(1);\n\twhile (x.substring(x.length-1,x.length) == ' ') x = x.substring(0,x.length-1);\n\ttextControl.value = x;\n}", "_prepareTextForClipboard(text) {\n const space = String.fromCharCode(32);\n const nonBreakingSpace = String.fromCharCode(160);\n const allNonBreakingSpaces = new RegExp(nonBreakingSpace, 'g');\n\n return text.split('\\n').map((line) => {\n return line.replace(/\\s+$/g, '').replace(allNonBreakingSpaces, space);\n }).join('\\n');\n }", "function checkForNbsp(text){\n if(text == \"\\u00a0\"){\n text = '';\n }\n return text;\n }", "function formatSpaces (str) {\n return str.trim().replace(/ +/g, \" \");\n}", "function normalizeEndings(text) {\n text = text.replace(/\\r\\n/g, '\\n')\n text = text + '\\n'\n\n text = text.replace(/[\\n]{2,}/g, '\\n')\n text = text.replace(/\\n/g, eol)\n\n return text\n}", "function myspacefmt(text) {\n\n\ts = text\n\n\t// Turn special characters back into HTML entities so they don't get stripped\n\t// List is from the tables at http://www.htmlhelp.com/reference/html40/entities/\n\ts = s.replace(/\\uA0/g, '&nbsp;');\n\ts = s.replace(/\\uA1/g, '&iexcl;');\n\ts = s.replace(/\\uA2/g, '&cent;');\n\ts = s.replace(/\\uA3/g, '&pound;');\n\ts = s.replace(/\\uA4/g, '&curren;');\n\ts = s.replace(/\\uA5/g, '&yen;');\n\ts = s.replace(/\\uA6/g, '&brvbar;');\n\ts = s.replace(/\\uA7/g, '&sect;');\n\ts = s.replace(/\\uA8/g, '&uml;');\n\ts = s.replace(/\\uA9/g, '&copy;');\n\ts = s.replace(/\\uAA/g, '&ordf;');\n\ts = s.replace(/\\uAB/g, '&laquo;');\n\ts = s.replace(/\\uAC/g, '&not;');\n\ts = s.replace(/\\uAD/g, '&shy;');\n\ts = s.replace(/\\uAE/g, '&reg;');\n\ts = s.replace(/\\uAF/g, '&macr;');\n\ts = s.replace(/\\uB0/g, '&deg;');\n\ts = s.replace(/\\uB1/g, '&plusmn;');\n\ts = s.replace(/\\uB2/g, '&sup2;');\n\ts = s.replace(/\\uB3/g, '&sup3;');\n\ts = s.replace(/\\uB4/g, '&acute;');\n\ts = s.replace(/\\uB5/g, '&micro;');\n\ts = s.replace(/\\uB6/g, '&para;');\n\ts = s.replace(/\\uB7/g, '&middot;');\n\ts = s.replace(/\\uB8/g, '&cedil;');\n\ts = s.replace(/\\uB9/g, '&sup1;');\n\ts = s.replace(/\\uBA/g, '&ordm;');\n\ts = s.replace(/\\uBB/g, '&raquo;');\n\ts = s.replace(/\\uBC/g, '&frac14;');\n\ts = s.replace(/\\uBD/g, '&frac12;');\n\ts = s.replace(/\\uBE/g, '&frac34;');\n\ts = s.replace(/\\uBF/g, '&iquest;');\n\ts = s.replace(/\\uC0/g, '&Agrave;');\n\ts = s.replace(/\\uC1/g, '&Aacute;');\n\ts = s.replace(/\\uC2/g, '&Acirc;');\n\ts = s.replace(/\\uC3/g, '&Atilde;');\n\ts = s.replace(/\\uC4/g, '&Auml;');\n\ts = s.replace(/\\uC5/g, '&Aring;');\n\ts = s.replace(/\\uC6/g, '&AElig;');\n\ts = s.replace(/\\uC7/g, '&Ccedil;');\n\ts = s.replace(/\\uC8/g, '&Egrave;');\n\ts = s.replace(/\\uC9/g, '&Eacute;');\n\ts = s.replace(/\\uCA/g, '&Ecirc;');\n\ts = s.replace(/\\uCB/g, '&Euml;');\n\ts = s.replace(/\\uCC/g, '&Igrave;');\n\ts = s.replace(/\\uCD/g, '&Iacute;');\n\ts = s.replace(/\\uCE/g, '&Icirc;');\n\ts = s.replace(/\\uCF/g, '&Iuml;');\n\ts = s.replace(/\\uD0/g, '&ETH;');\n\ts = s.replace(/\\uD1/g, '&Ntilde;');\n\ts = s.replace(/\\uD2/g, '&Ograve;');\n\ts = s.replace(/\\uD3/g, '&Oacute;');\n\ts = s.replace(/\\uD4/g, '&Ocirc;');\n\ts = s.replace(/\\uD5/g, '&Otilde;');\n\ts = s.replace(/\\uD6/g, '&Ouml;');\n\ts = s.replace(/\\uD7/g, '&times;');\n\ts = s.replace(/\\uD8/g, '&Oslash;');\n\ts = s.replace(/\\uD9/g, '&Ugrave;');\n\ts = s.replace(/\\uDA/g, '&Uacute;');\n\ts = s.replace(/\\uDB/g, '&Ucirc;');\n\ts = s.replace(/\\uDC/g, '&Uuml;');\n\ts = s.replace(/\\uDD/g, '&Yacute;');\n\ts = s.replace(/\\uDE/g, '&THORN;');\n\ts = s.replace(/\\uDF/g, '&szlig;');\n\ts = s.replace(/\\uE0/g, '&agrave;');\n\ts = s.replace(/\\uE1/g, '&aacute;');\n\ts = s.replace(/\\uE2/g, '&acirc;');\n\ts = s.replace(/\\uE3/g, '&atilde;');\n\ts = s.replace(/\\uE4/g, '&auml;');\n\ts = s.replace(/\\uE5/g, '&aring;');\n\ts = s.replace(/\\uE6/g, '&aelig;');\n\ts = s.replace(/\\uE7/g, '&ccedil;');\n\ts = s.replace(/\\uE8/g, '&egrave;');\n\ts = s.replace(/\\uE9/g, '&eacute;');\n\ts = s.replace(/\\uEA/g, '&ecirc;');\n\ts = s.replace(/\\uEB/g, '&euml;');\n\ts = s.replace(/\\uEC/g, '&igrave;');\n\ts = s.replace(/\\uED/g, '&iacute;');\n\ts = s.replace(/\\uEE/g, '&icirc;');\n\ts = s.replace(/\\uEF/g, '&iuml;');\n\ts = s.replace(/\\uF0/g, '&eth;');\n\ts = s.replace(/\\uF1/g, '&ntilde;');\n\ts = s.replace(/\\uF2/g, '&ograve;');\n\ts = s.replace(/\\uF3/g, '&oacute;');\n\ts = s.replace(/\\uF4/g, '&ocirc;');\n\ts = s.replace(/\\uF5/g, '&otilde;');\n\ts = s.replace(/\\uF6/g, '&ouml;');\n\ts = s.replace(/\\uF7/g, '&divide;');\n\ts = s.replace(/\\uF8/g, '&oslash;');\n\ts = s.replace(/\\uF9/g, '&ugrave;');\n\ts = s.replace(/\\uFA/g, '&uacute;');\n\ts = s.replace(/\\uFB/g, '&ucirc;');\n\ts = s.replace(/\\uFC/g, '&uuml;');\n\ts = s.replace(/\\uFD/g, '&yacute;');\n\ts = s.replace(/\\uFE/g, '&thorn;');\n\ts = s.replace(/\\uFF/g, '&yuml;');\n\ts = s.replace(/\\u192/g, '&fnof;');\n\ts = s.replace(/\\u391/g, '&Alpha;');\n\ts = s.replace(/\\u392/g, '&Beta;');\n\ts = s.replace(/\\u393/g, '&Gamma;');\n\ts = s.replace(/\\u394/g, '&Delta;');\n\ts = s.replace(/\\u395/g, '&Epsilon;');\n\ts = s.replace(/\\u396/g, '&Zeta;');\n\ts = s.replace(/\\u397/g, '&Eta;');\n\ts = s.replace(/\\u398/g, '&Theta;');\n\ts = s.replace(/\\u399/g, '&Iota;');\n\ts = s.replace(/\\u39A/g, '&Kappa;');\n\ts = s.replace(/\\u39B/g, '&Lambda;');\n\ts = s.replace(/\\u39C/g, '&Mu;');\n\ts = s.replace(/\\u39D/g, '&Nu;');\n\ts = s.replace(/\\u39E/g, '&Xi;');\n\ts = s.replace(/\\u39F/g, '&Omicron;');\n\ts = s.replace(/\\u3A0/g, '&Pi;');\n\ts = s.replace(/\\u3A1/g, '&Rho;');\n\ts = s.replace(/\\u3A3/g, '&Sigma;');\n\ts = s.replace(/\\u3A4/g, '&Tau;');\n\ts = s.replace(/\\u3A5/g, '&Upsilon;');\n\ts = s.replace(/\\u3A6/g, '&Phi;');\n\ts = s.replace(/\\u3A7/g, '&Chi;');\n\ts = s.replace(/\\u3A8/g, '&Psi;');\n\ts = s.replace(/\\u3A9/g, '&Omega;');\n\ts = s.replace(/\\u3B1/g, '&alpha;');\n\ts = s.replace(/\\u3B2/g, '&beta;');\n\ts = s.replace(/\\u3B3/g, '&gamma;');\n\ts = s.replace(/\\u3B4/g, '&delta;');\n\ts = s.replace(/\\u3B5/g, '&epsilon;');\n\ts = s.replace(/\\u3B6/g, '&zeta;');\n\ts = s.replace(/\\u3B7/g, '&eta;');\n\ts = s.replace(/\\u3B8/g, '&theta;');\n\ts = s.replace(/\\u3B9/g, '&iota;');\n\ts = s.replace(/\\u3BA/g, '&kappa;');\n\ts = s.replace(/\\u3BB/g, '&lambda;');\n\ts = s.replace(/\\u3BC/g, '&mu;');\n\ts = s.replace(/\\u3BD/g, '&nu;');\n\ts = s.replace(/\\u3BE/g, '&xi;');\n\ts = s.replace(/\\u3BF/g, '&omicron;');\n\ts = s.replace(/\\u3C0/g, '&pi;');\n\ts = s.replace(/\\u3C1/g, '&rho;');\n\ts = s.replace(/\\u3C2/g, '&sigmaf;');\n\ts = s.replace(/\\u3C3/g, '&sigma;');\n\ts = s.replace(/\\u3C4/g, '&tau;');\n\ts = s.replace(/\\u3C5/g, '&upsilon;');\n\ts = s.replace(/\\u3C6/g, '&phi;');\n\ts = s.replace(/\\u3C7/g, '&chi;');\n\ts = s.replace(/\\u3C8/g, '&psi;');\n\ts = s.replace(/\\u3C9/g, '&omega;');\n\ts = s.replace(/\\u3D1/g, '&thetasym;');\n\ts = s.replace(/\\u3D2/g, '&upsih;');\n\ts = s.replace(/\\u3D6/g, '&piv;');\n\ts = s.replace(/\\u2022/g, '&bull;');\n\ts = s.replace(/\\u2026/g, '&hellip;');\n\ts = s.replace(/\\u2032/g, '&prime;');\n\ts = s.replace(/\\u2033/g, '&Prime;');\n\ts = s.replace(/\\u203E/g, '&oline;');\n\ts = s.replace(/\\u2044/g, '&frasl;');\n\ts = s.replace(/\\u2118/g, '&weierp;');\n\ts = s.replace(/\\u2111/g, '&image;');\n\ts = s.replace(/\\u211C/g, '&real;');\n\ts = s.replace(/\\u2122/g, '&trade;');\n\ts = s.replace(/\\u2135/g, '&alefsym;');\n\ts = s.replace(/\\u2190/g, '&larr;');\n\ts = s.replace(/\\u2191/g, '&uarr;');\n\ts = s.replace(/\\u2192/g, '&rarr;');\n\ts = s.replace(/\\u2193/g, '&darr;');\n\ts = s.replace(/\\u2194/g, '&harr;');\n\ts = s.replace(/\\u21B5/g, '&crarr;');\n\ts = s.replace(/\\u21D0/g, '&lArr;');\n\ts = s.replace(/\\u21D1/g, '&uArr;');\n\ts = s.replace(/\\u21D2/g, '&rArr;');\n\ts = s.replace(/\\u21D3/g, '&dArr;');\n\ts = s.replace(/\\u21D4/g, '&hArr;');\n\ts = s.replace(/\\u2200/g, '&forall;');\n\ts = s.replace(/\\u2202/g, '&part;');\n\ts = s.replace(/\\u2203/g, '&exist;');\n\ts = s.replace(/\\u2205/g, '&empty;');\n\ts = s.replace(/\\u2207/g, '&nabla;');\n\ts = s.replace(/\\u2208/g, '&isin;');\n\ts = s.replace(/\\u2209/g, '&notin;');\n\ts = s.replace(/\\u220B/g, '&ni;');\n\ts = s.replace(/\\u220F/g, '&prod;');\n\ts = s.replace(/\\u2211/g, '&sum;');\n\ts = s.replace(/\\u2212/g, '&minus;');\n\ts = s.replace(/\\u2217/g, '&lowast;');\n\ts = s.replace(/\\u221A/g, '&radic;');\n\ts = s.replace(/\\u221D/g, '&prop;');\n\ts = s.replace(/\\u221E/g, '&infin;');\n\ts = s.replace(/\\u2220/g, '&ang;');\n\ts = s.replace(/\\u2227/g, '&and;');\n\ts = s.replace(/\\u2228/g, '&or;');\n\ts = s.replace(/\\u2229/g, '&cap;');\n\ts = s.replace(/\\u222A/g, '&cup;');\n\ts = s.replace(/\\u222B/g, '&int;');\n\ts = s.replace(/\\u2234/g, '&there4;');\n\ts = s.replace(/\\u223C/g, '&sim;');\n\ts = s.replace(/\\u2245/g, '&cong;');\n\ts = s.replace(/\\u2248/g, '&asymp;');\n\ts = s.replace(/\\u2260/g, '&ne;');\n\ts = s.replace(/\\u2261/g, '&equiv;');\n\ts = s.replace(/\\u2264/g, '&le;');\n\ts = s.replace(/\\u2265/g, '&ge;');\n\ts = s.replace(/\\u2282/g, '&sub;');\n\ts = s.replace(/\\u2283/g, '&sup;');\n\ts = s.replace(/\\u2284/g, '&nsub;');\n\ts = s.replace(/\\u2286/g, '&sube;');\n\ts = s.replace(/\\u2287/g, '&supe;');\n\ts = s.replace(/\\u2295/g, '&oplus;');\n\ts = s.replace(/\\u2297/g, '&otimes;');\n\ts = s.replace(/\\u22A5/g, '&perp;');\n\ts = s.replace(/\\u22C5/g, '&sdot;');\n\ts = s.replace(/\\u2308/g, '&lceil;');\n\ts = s.replace(/\\u2309/g, '&rceil;');\n\ts = s.replace(/\\u230A/g, '&lfloor;');\n\ts = s.replace(/\\u230B/g, '&rfloor;');\n\ts = s.replace(/\\u2329/g, '&lang;');\n\ts = s.replace(/\\u232A/g, '&rang;');\n\ts = s.replace(/\\u25CA/g, '&loz;');\n\ts = s.replace(/\\u2660/g, '&spades;');\n\ts = s.replace(/\\u2663/g, '&clubs;');\n\ts = s.replace(/\\u2665/g, '&hearts;');\n\ts = s.replace(/\\u2666/g, '&diams;');\n\ts = s.replace(/\\u152/g, '&OElig;');\n\ts = s.replace(/\\u153/g, '&oelig;');\n\ts = s.replace(/\\u160/g, '&Scaron;');\n\ts = s.replace(/\\u161/g, '&scaron;');\n\ts = s.replace(/\\u178/g, '&Yuml;');\n\ts = s.replace(/\\u2C6/g, '&circ;');\n\ts = s.replace(/\\u2DC/g, '&tilde;');\n\ts = s.replace(/\\u2002/g, '&ensp;');\n\ts = s.replace(/\\u2003/g, '&emsp;');\n\ts = s.replace(/\\u2009/g, '&thinsp;');\n\t// Blanking these four because they screw things up:\n\ts = s.replace(/\\u200C/g, ' ');\n\ts = s.replace(/\\u200D/g, ' ');\n\ts = s.replace(/\\u200E/g, ' ');\n\ts = s.replace(/\\u200F/g, ' ');\n\ts = s.replace(/\\u2020/g, '&dagger;');\n\ts = s.replace(/\\u2021/g, '&Dagger;');\n\ts = s.replace(/\\u2030/g, '&permil;');\n\ts = s.replace(/\\u2039/g, '&lsaquo;');\n\ts = s.replace(/\\u203A/g, '&rsaquo;');\n\ts = s.replace(/\\u20AC/g, '&euro;');\n\t\n\n\treplacements = [\n\n//\t[//g, ''], \n\n\t// Cyrillic quotes\n//\t[/(\\s+|^)\"([^\"]+?)\"(\\s+|$|\\.|\\,)/g, '$1\\u00ab$2\\u00bb$3'],\n\n\t// Latin quotes: \"test\" become smart quotes\n\t[/(\\s+|^)\"([^\\\"]+?)\"(\\s+|$|\\.|\\,)/g, '$1&ldquo;$2&rdquo;$3'],\n\t[/(\\s+|^)'([^\\']+?)'(\\s+|$|\\.|\\,)/g, '$1&lsquo;$2&rsquo;$3'],\n\n\t// Trademark: (TM)\n\t[/\\((tm|TM|\\u0422\\u041C|\\u0442\\u043C)\\)/g, '&trade;'],\n\n\t// Copyright: (C)\n\t[/\\([cC\\u0421\\u0441]\\)/g, '&copy;'],\n\n\t// Registered: (R)\n\t[/\\([rR\\u0420\\u0440]\\)/g, '&reg;'],\n\t\n\t// Hearts, of course! <3\n\t[/(\\s)(<3)(\\s)/g, '$1\\&hearts;$3'],\n\t\n\t// Section symbol, by request: {SS}\n\t[/\\{SS\\}/g, '&sect;'], \n\n\t// Arrows ==> <-- <==> and so on\n\t[/([^<])-{2}>/g, '$1&rarr;'],\n\t[/<-{2}([^>])/g, '&larr;$1'],\n\t[/<-{1,2}>/g, '&harr;'],\n\t[/([^<])={2}>/g, '$1&rArr;'],\n\t[/<={2}([^>])/g, '&lArr;$1'],\n\t[/<={1,2}>/g, '&hArr;'],\n\n\t// Horizontal rules: ---- becomes <hr>\n\t[/\\n----+\\n/g, '<hr>'], \n\t\n\t// Degree sign: degC becomes &deg;C (K does not have a degree sign!)\n\t[/degC(\\s)/g, '&deg;C$1'], \n\t[/degF(\\s)/g, '&deg;F$1'], \t\n\t\n\t// TeX subs and supers: x squared: x^{2} carbon dioxide: CO_{2}\n\t[/\\^\\{(.*?)\\}/g, '<sup>$1</sup>'], \n\t[/_\\{(.*?)\\}/g, '<sub>$1</sub>'], \n\t\t\n\t// Scientific notation: 3.5E2 becomes 3.5&times;10<sup>2</sup>\n\t[/(\\d)E(\\d+)/g, '$1&times;10<sup>$2</sup>'], \n\t\n\t// Plus or minus sign +-5 becomes &plusmn;5\n\t[/\\+-(\\d)/g, '&plusmn;$1'], \n\n\t// Censorship is evil.\n//\t[/A(IM\\s*)\\:/gi, '&Acirc;$1:'],\n\n\t// These screw up your posts if you've got 'em (Myspace sucks). It converts to something similar looking. :-\\ Best I can do...\n//\t[/\\#/gi, '&Dagger;&Dagger;'],\n\t[/\\\\/gi, '&lfloor;'],\n\n\t// Em dash -- two minuses surrounded by spaces\n\t[/(\\s+|^)--(\\s+)/g, '$1\\u2014$2'],\n\n\t// **bold**\t\n\t[/\\*{2}(.+?)\\*{2}/g, '<b>$1</b>'],\n\n\t// '''Wikipedia strong emphasis''' (rendered as bold usually)\n\t[/\\'{3}(.+?)\\'{3}/g, '<strong>$1</strong>'],\n\n\t// //italic//\n\t[/([^\\:]|^)\\/{2}(.+?)\\/{2}/g, '$1<i>$2</i>'],\n\n\t// ''Wikipedia emphasis'' (rendered as italics usually)\n\t[/\\'{2}(.+?)\\'{2}/g, '<em>$1</em>'],\n\n\t// --strikethrough--\n\t[/-{2}(.+?)-{2}/g, '<s>$1</s>'],\n\n\t// __underlined__\n\t[/_{2}(.+?)_{2}/g, '<u>$1</u>'],\n\t\n\t// A few colors? [blue]text[/color] becomes <font color=\"0000BB\">text</font> (will also accept [bl]text[/bl] or whatever)\n\t[/\\[(bk|k|black)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"black\">$2</font>'],\n\t[/\\[(n|navy)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"navy\">$2</font>'],\t\n\t[/\\[(gn|green)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"green\">$2</font>'],\n\t[/\\[(tl|teal)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"teal\">$2</font>'], // [t] would conflict with quote tags\n\t[/\\[(s|silver)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"silver\">$2</font>'],\t\n\t[/\\[(bl|be|bu|blue)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"blue\">$2</font>'],\t\n\t[/\\[(l|lime)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"lime\">$2</font>'],\t\n\t[/\\[(a|aq|aqua|c|cy|cyan)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t'<font color=\"aqua\">$2</font>'],\t\n\t[/\\[(m|maroon)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"maroon\">$2</font>'],\n\t[/\\[(p|purple|v|violet)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t'<font color=\"purple\">$2</font>'],\t\n\t[/\\[(o|olive)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t'<font color=\"olive\">$2</font>'],\n\t[/\\[(gy|gray|grey)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"gray\">$2</font>'],\n\t[/\\[(r|red)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t\t\t'<font color=\"red\">$2</font>'],\t\n\t[/\\[(f|fuschia|magenta)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t'<font color=\"fuschia\">$2</font>'],\t\n\t[/\\[(y|yw|yellow)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"yellow\">$2</font>'],\t\n\t[/\\[(w|wh|white)\\]([\\s\\S]*?)\\[\\/(\\1|c|color)?\\]/gim,\t\t\t'<font color=\"white\">$2</font>'],\t\n\t\n\t// En dash for number ranges: 1995-2005\n\t[/(\\d+)-(\\d+)/g, '$1\\u2013$2'],\n\n\t// Ellipsis\n//\t[/\\.\\.\\./g, '\\u2026'],\n\n\t// [quote] tags [/quote] (or [q] or [Q] or [t] or whatever)\n\t// First replace the SomeoneWrote: bit with legend tags\n\t[/\\[(quote|q|t)\\](\\s*\\n?)([^\\n]*)Wrote:(\\s*\\n)([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '[$1]<legend>$3 wrote:</legend>$5[/$6]'],\n\t// Then replace the rest with fieldset tags \n\t[/\\[(quote|q|t)\\]([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '<fieldset style=\"border: 1px solid; border-color: aaaaaa; padding: 1em; margin: 1em 2em;\">$2</fieldset>'],\n\t// (This way it can handle nested quotes and optional \"Wrote:\" sections.)\n\n\t// Old version of quotes based directly on Myspace's quote markup:\t\n//\t[/\\[(quote|q|t)\\]([\\s\\S]*?)\\[\\/(quote|q|t)\\]/gim, '<table align=\"center\" bgcolor=\"cccccc\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"90%\"><tbody><tr><td><table bgcolor=\"ffffff\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"100%\"><tbody><tr><td><p>$2</p></td></tr></tbody></table></td></tr></tbody></table>'],\n\n\t// Image shortcut IMG=http://www.url.com/image.png surrounded by whitespace.\n\t[/(\\s)IMG=(\\S*?)([\\s\\]])/gi, '$1<img src=\"$2\">$3'],\n\t\n\t// Named URLs in wikipedia format [http://address linked text]\n\t[/\\[http:([^ \\t\\v\\f\\n\\r\\]]*?)\\s+(\\S.*?)\\]/gi, '<a href=\"http:$1\">$2</a>'],\n\t\n\t// Myspace URLs [my:Firefox] or [myspace:Firefox] becomes http://www.myspace.com/Firefox\n\t[/\\[(my|myspace):(\\S.*?)\\]/gi, '<a href=\"http://www.myspace.com/$2\">Myspace: $2</a>'],\n\t\n\t// Myspace group URLs [gr:toolbar] or [group:toolbar] becomes http://groups.myspace.com/toolbar\n\t[/\\[(gr|group):(\\S.*?)\\]/gi, '<a href=\"http://groups.myspace.com/$2\">Myspace group: $2</a>'],\n\n\t// Auto-link naked URLs\n\t[/(\\s)http(s)*:(\\S*?)(\\s)/gi, '$1<a href=\"http$2:$3\">http$2:$3</a>$4'],\n\t\n\t// Links to wikipedia articles [[linked text]] (useful in fights)\n\t[/\\[\\[([\\s\\S]+?)\\]\\]/gi, '<a href=\"http://en.wikipedia.org/wiki/$1\">$1</a>']\n\n\t];\n\n\t// Runs through itself over and over until nothing changes, to handle nested quote tags and the like. \n\t// Uses \"for\" instead of \"while\" to prevent infinite loops from poorly written regexps. ;-)\n\tfor( j=0; j<=100; j++) {\n\t\tolds = s;\n\t\tfor( i=0; i < replacements.length; i++) {\n\t\t\ts = s.replace(replacements[i][0], replacements[i][1]);\n\t\t}\n\t\tif(olds == s) {break};\n\t}\n\t\n\treturn s\n}", "function replaceSpace(input) \n{\n if (input.indexOf(\" \")) \n {\n input.replace(\" \", \"%20\"); \n }\n return input;\n}", "removeSpace() {\n\t}", "function wrapSpace(s){\n if (s === \" \"){\n return \"' '\";\n }\n else {\n return s;\n }\n}", "function widont( string ) {\n return string.replace( Private.regexp, \"&#160;$1\" );\n }", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\tvar rng, container, offset;\n\n\t\t\trng = selection.getRng(true);\n\t\t\tcontainer = rng.startContainer;\n\t\t\toffset = rng.startOffset;\n\n\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function deleteSpaces(nStr)\r\n{\r\n\t\r\n\tfor(var i=0;i<10;i++)\r\n\t\tnStr=nStr.replace(' ','');\r\n\treturn nStr;\r\n}", "function addSpaceText() {\n\tappendText(\" \");\n}", "space() {\n\t\t\tthis.append(' ');\n\t\t}", "function unspace(string) {\n return string.replace(/\\r\\n|\\n| /g, '')\n}", "function addWhiteSpaces(nbSpaces) {\n let result = '';\n for (let i = 0; i < nbSpaces; i++) {\n result += ' ';\n }\n return result;\n}", "function noSpace(x) {\n let newStr = x.split(\" \").join(\"\");\n return newStr;\n}", "function nbsp(x) {\n var times = x || 1;\n var returns = \"\";\n for (var x = 0; x < times; x++)\n returns += String.fromCharCode(0xA0);\n return returns;\n}", "function trimWithSingleSpace(string) {\n return string.replace(/^[ \\t\\xA0]{2,}/, ' ').\n replace(/[ \\t\\xA0]{2,}$/, ' ').replace(/^\\s+$/, '');\n}", "function trimWithSingleSpace(string) {\n return string.replace(/^[ \\t\\xA0]{2,}/, ' ').\n replace(/[ \\t\\xA0]{2,}$/, ' ').replace(/^\\s+$/, '');\n}", "function cleanWhiteSpace(text) {\n let revisedText = text.replace(/^\\s+|\\s+$/g, \"\").replace(/\\s\\s+/g, \" \");\n return revisedText;\n}", "function trimNbspAfterDeleteAndPaddValue() {\n\t\t\t\t\tvar rng, container, offset;\n\n\t\t\t\t\trng = selection.getRng(true);\n\t\t\t\t\tcontainer = rng.startContainer;\n\t\t\t\t\toffset = rng.startOffset;\n\n\t\t\t\t\tif (container.nodeType == 3 && rng.collapsed) {\n\t\t\t\t\t\tif (container.data[offset] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue += ' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (container.data[offset - 1] === '\\u00a0') {\n\t\t\t\t\t\t\tcontainer.deleteData(offset - 1, 1);\n\n\t\t\t\t\t\t\tif (!/[\\u00a0| ]$/.test(value)) {\n\t\t\t\t\t\t\t\tvalue = ' ' + value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "function removeDoubleWhiteSpace(phrase) {\n return phrase.replace(/[\\s]+/g, ' ');\n}", "function addSpaces(value) {\n if(typeof(value) == typeof(undefined)) {\n return value;\n }\n\n var parsedValue = value.toString()\n .replace(/[^\\d]/g, '')\n .replace(/(.{4})/g, '$1 ').trim()\n .replace(/\\/$/, '');\n return parsedValue.slice(0,19);\n }", "gobbleSpaces() {\n let ch = this.code;\n while (ch === _Jsep.SPACE_CODE || ch === _Jsep.TAB_CODE || ch === _Jsep.LF_CODE || ch === _Jsep.CR_CODE) {\n ch = this.expr.charCodeAt(++this.index);\n }\n this.runHook(\"gobble-spaces\");\n }", "function noSpace(test){\r\n return test.replace(/\\s+/g,\"\");\r\n \r\n }", "function qwerty_addSpaceText() {\n\tqwerty_appendText(\" \");\n}", "function nobr(s) {\n return s.toString().replace(/<br>/gi, \" \")\n }", "function removeSpaces(str) {\n if (str === null) {\n return;\n }\n str = str.trim();\n for (let i = 0; i < str.length; i++)\n if (str[i] === \" \") {\n var leftStr = str.slice(0, i);\n var rightStr = str.slice(i + 1,);\n str = leftStr + \"%20\" + rightStr;\n }\n return str;\n}", "function stripWhitespace(str) {\n return str.trim().replace(/\\s*\\n\\s*/g, ' ');\n}", "function squeeze(string) {\n return string.replace(/\\s+/g, ' ');\n }", "function noSpace(x){\n return x.split(\"\").filter(el => {return el!==\" \"}).join(\"\")\n }", "function replaceSpaces(str){\n var result = str.replace(/ /g, '');\n\n document.getElementById('content').innerHTML =result;\n }", "function SupprEspaceString(str){\n\tvar result6 = str.trim();\n\treturn result6;\n }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function normalize(s) {\n\t return s ? s.replace(/\\r?\\n/g, '\\r\\n') : ''\n\t }", "function removeAllSpaces(textStr){\n var retVal = \"\";\n var strLen = textStr.length;\n var i;\n for (i=0;i<strLen;i++){\n if ( textStr.charAt(i) != \"\\n\" && textStr.charAt(i) != \"\\r\" &&\n textStr.charAt(i) != \"\\t\")\n retVal += textStr.charAt(i);\n }\n return retVal;\n\n}", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function qwerty_addSpaceText() {\r\n\tqwerty_appendText(\" \");\r\n}", "function adjustSpaces(fld) {\r\n\tvar val = \"\"\r\n\tl_length_of_data = fld.length;\r\n\tcountspace = 0\r\n\tfor(ctr=0;ctr<l_length_of_data;ctr++){\r\n\t\tif(fld.charAt(ctr) != \" \") {\r\n\t\t\tval = val + fld.charAt(ctr)\r\n\t\t\tcountspace = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif(countspace == 0){\r\n\t\t\t\tval = val + fld.charAt(ctr);\r\n\t\t\t\tcountspace = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn val\r\n}", "function hardTrim(text) {\n\n\tif (!exists(text)) {\n\t\treturn \"\"\n\t}\n\ttext = text.replace(/^\\&nbsp\\;|<br?\\>*/gi, \"\").replace(/\\&nbsp\\;|<br?\\>$/gi, \"\").trim();\n\n\treturn text\n}", "function _coalesceOutput(str){\n\t\treturn typeof(str) == \"undefined\" ? \"&nbsp\" : str;\n\t}", "function squeeze(string) {\n\t\treturn string.replace(/\\s+/g, ' ');\n\t}", "function replaceNgsp(value) {\n // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE\n return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' ');\n }", "function reduceDoubleSpaces( string ) {\n\tstring = string.replace( \" \", \" \" );\n\tif ( string.search( \" \" ) > 0 ) {\n\t\treturn reduceDoubleSpaces( string );\n\t}\n\treturn string;\n}" ]
[ "0.77390885", "0.75844264", "0.72715914", "0.7261503", "0.7015394", "0.6916965", "0.67166466", "0.66469103", "0.6593544", "0.65841943", "0.6578181", "0.6573375", "0.6522154", "0.6420517", "0.641463", "0.64093447", "0.6409034", "0.64078605", "0.64078605", "0.63825333", "0.6367446", "0.6367446", "0.6362875", "0.6354405", "0.63465756", "0.63405305", "0.62789565", "0.62479526", "0.6198975", "0.61987746", "0.6181507", "0.6169261", "0.61511236", "0.6142134", "0.6137727", "0.61230373", "0.6121439", "0.6104611", "0.6104375", "0.61017275", "0.6098449", "0.6086137", "0.60844296", "0.60796255", "0.60796255", "0.6074147", "0.6062663", "0.60603243", "0.6055619", "0.6031508", "0.60242856", "0.60107505", "0.6006656", "0.6006656", "0.59926116", "0.59569615", "0.59521174", "0.594204", "0.59397453", "0.5924331", "0.5917067", "0.5910599", "0.58807343", "0.5879516", "0.5858271", "0.58560836", "0.5849218", "0.5819892", "0.58168054", "0.58168054", "0.58168054", "0.58168054", "0.58168054", "0.58168054", "0.58147997", "0.58111066", "0.58111066", "0.58111066", "0.5800792", "0.57972986", "0.5794388", "0.57941425", "0.5792148", "0.5791176" ]
0.6566625
25
Work around nonsense dimensions being reported for stretches of righttoleft text.
function buildTokenBadBidi(inner, order) { return function (builder, text, style, startStyle, endStyle, title, css) { style = style ? style + " cm-force-border" : "cm-force-border"; var start = builder.pos, end = start + text.length; for (;;) { // Find the part that overlaps with the start of this text var part = (void 0); for (var i = 0; i < order.length; i++) { part = order[i]; if (part.to > start && part.from <= start) { break } } if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) } inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); startStyle = null; text = text.slice(part.to - start); start = part.to; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textResize(elt, d) {\n\n var textWidth = elt.getComputedTextLength();\n var arrayBro = elt.parentNode.childNodes;\n var len = arrayBro.length;\n var i = len / 2;\n\n if (arrayBro[i].firstChild === null || elt.firstChild === null)\n return null;\n\n while (arrayBro[i].firstChild.nodeValue !== elt.firstChild.nodeValue) {\n i++;\n }\n\n var irect = i - len / 2;\n var rectWidth = parseInt(elt.parentNode.childNodes[irect].getAttribute('width'));\n\n console.log(d.name);\n console.log(textWidth);\n console.log(rectWidth);\n\n return textWidth < rectWidth ? null : rectWidth * 2;\n}", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "getBoundsRightX() {\n if (SharedElementHelpers.IsTextOrShapeElements(this)) {\n return this.content.width;\n }\n return this.content.width / 2;\n }", "function rf(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(\n // Might be a text scaling operation, clear size caches.\n t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}", "function R(){var e=s.getBoundingClientRect(),n=\"offset\"+[\"Width\",\"Height\"][t.ort];return 0===t.ort?e.width||s[n]:e.height||s[n]}", "measure(availableSize) {\n let desired = undefined;\n let desiredBounds = undefined;\n if (this.hasChildren()) {\n //Measuring the children\n for (let child of this.children) {\n if (child instanceof TextElement) {\n if (child.canMeasure) {\n availableSize.width = availableSize.width || this.maxWidth || this.minWidth;\n child.measure(availableSize);\n }\n else {\n break;\n }\n }\n else if (!(child instanceof TextElement)) {\n child.measure(availableSize);\n }\n let childSize = child.desiredSize.clone();\n if (child.rotateAngle !== 0) {\n childSize = rotateSize(childSize, child.rotateAngle);\n }\n let right = childSize.width + child.margin.right;\n let bottom = childSize.height + child.margin.bottom;\n let childBounds = new Rect(child.margin.left, child.margin.top, right, bottom);\n if (child.float) {\n let position = child.getAbsolutePosition(childSize);\n if (position !== undefined) {\n continue;\n }\n }\n if ((!(child instanceof TextElement)) || (child instanceof TextElement && child.canConsiderBounds)) {\n if (desiredBounds === undefined) {\n desiredBounds = childBounds;\n }\n else {\n desiredBounds.uniteRect(childBounds);\n }\n }\n }\n if (desiredBounds) {\n let leftMargin = 0;\n let topMargin = 0;\n leftMargin = Math.max(desiredBounds.left, 0);\n topMargin = Math.max(desiredBounds.top, 0);\n desired = new Size(desiredBounds.width + leftMargin, desiredBounds.height + topMargin);\n }\n }\n desired = super.validateDesiredSize(desired, availableSize);\n super.stretchChildren(desired);\n this.desiredSize = desired;\n return desired;\n }", "static estimateTruncateOffset(fullText, containerWidth, actualWidth) {\n const textChars = fullText.length;\n const avgLetterSize = actualWidth / textChars;\n const canFit = containerWidth / avgLetterSize; // number of letters that can fit to container\n const deltaEachSide = (textChars - canFit) / 2; // index that used to truncate for left and right sides\n const endLeft = Math.floor(textChars / 2 - deltaEachSide);\n const startRight = Math.ceil(textChars / 2 + deltaEachSide);\n return {\n endLeft,\n startRight\n };\n }", "function j(){var e=s.getBoundingClientRect(),r=\"offset\"+[\"Width\",\"Height\"][t.ort]\nreturn 0===t.ort?e.width||s[r]:e.height||s[r]}", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "_getExtraRightWidth(_id) {\n return this._getExtraSize(_id, 'right');\n }", "_getExtraRightWidth(_id) {\n return this._getExtraSize(_id, 'right');\n }", "getExtraWidth(_id) {\n return (\n this._getExtraSize(_id, 'left') +\n this._getExtraSize(_id, 'right')\n );\n }", "getExtraWidth(_id) {\n return (\n this._getExtraSize(_id, 'left') +\n this._getExtraSize(_id, 'right')\n );\n }", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "getWidth() {\n return this.content >> 22 /* WIDTH_SHIFT */;\n }", "getInnerWidth() {\n mustInherit();\n }", "function fitTextToRect(theText, theWidth, theHeight) {\n // First pass\n\n textSize(18) //got to start somewhere\n tSize = textSize()\n try{\n theText = theText.toString()\n if (theText.length > 0) {\n \n var theArea = int(theWidth * theHeight) //this is the area of the Rect\n var multiplier = 0.01 //this is by how much we want to grow the textSize until its too big\n var withinReason = theArea * 0.3 //this is how much we reduce the are because of line breaks etc\n //how are 0.01 and 0.3 linked?\n\n var thisArea = 0 // start with nothing and grow it until it's too big\n while (thisArea <= withinReason) {\n textSize(tSize)\n let bbox = font.textBounds(theText, 0, 0, tSize);\n thisArea = int(bbox.w * bbox.h)\n tSize = textSize() + multiplier\n }\n print(\"whoo hoo!\", thisArea, withinReason, int(tSize), theLine)\n } else {\n return \"Error\"\n }\n }catch(e){\n print(e)\n return tSize\n \n }\n return tSize\n\n}", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "get maxWidth() {}", "innerWidthDependsOnChilds(){if(this.__controlStretchedWidth)return!0;if(this.__columnOptions)for(const columnOption of this.__columnOptions)if(\"Content\"===columnOption.widthMode)return!0;return super.innerWidthDependsOnChilds()}", "function dxt1etc1Size(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n }", "get width() {\n return this.right - this.left;\n }", "_getNonTransformedDimensions() {\n // Object dimensions\n return new fabric.Point(this.width, this.height).scalarAdd(\n this.padding + boundingBoxPadding\n )\n }", "get Width() { return this.x2 - this.x1; }", "get Width() { return this.x2 - this.x1; }", "function h(a){for(var b=y(\"isRTL\"),c=0;c<a.length;c++){var d=a[c],e=(b?d.isEnd:d.isStart)?R:P,f=(b?d.isStart:d.isEnd)?S:Q,g=e(d.leftCol),h=f(d.rightCol);d.left=g,d.outerWidth=h-g}}", "function q(){var e=p.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||p[t]:e.height||p[t]}", "function calculateTextWidth(text, rems) {\n if (typeof rems === \"undefined\") {\n rems = 1;\n }\n\n var $textDiv = $(\"<p>\").css({\n \"font-size\": convertRemToPixels(rems) + \"px\",\n \"position\": \"fixed\",\n \"right\": \"9999px\"\n });\n\n $(\"body\").append($textDiv);\n\n $textDiv.text(text);\n var width = $textDiv.width();\n\n $textDiv.remove();\n\n return width;\n}", "_updateDimensions() {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n // Calculate the scaled character width. Width is floored as it must be\n // drawn to an integer grid in order for the CharAtlas \"stamps\" to not be\n // blurry. When text is drawn to the grid not using the CharAtlas, it is\n // clipped to ensure there is no overlap with the next cell.\n this.dimensions.scaledCharWidth = Math.floor(this._charSizeService.width * window.devicePixelRatio);\n // Calculate the scaled character height. Height is ceiled in case\n // devicePixelRatio is a floating point number in order to ensure there is\n // enough space to draw the character to the cell.\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n // Calculate the scaled cell height, if lineHeight is not 1 then the value\n // will be floored because since lineHeight can never be lower then 1, there\n // is a guarentee that the scaled line height will always be larger than\n // scaled char height.\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.options.lineHeight);\n // Calculate the y coordinate within a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharTop = this._optionsService.options.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);\n // Calculate the scaled cell width, taking the letterSpacing into account.\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.options.letterSpacing);\n // Calculate the x coordinate with a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharLeft = Math.floor(this._optionsService.options.letterSpacing / 2);\n // Recalculate the canvas dimensions; scaled* define the actual number of\n // pixel in the canvas\n this.dimensions.scaledCanvasHeight = this._bufferService.rows * this.dimensions.scaledCellHeight;\n this.dimensions.scaledCanvasWidth = this._bufferService.cols * this.dimensions.scaledCellWidth;\n // The the size of the canvas on the page. It's very important that this\n // rounds to nearest integer and not ceils as browsers often set\n // window.devicePixelRatio as something like 1.100000023841858, when it's\n // actually 1.1. Ceiling causes blurriness as the backing canvas image is 1\n // pixel too large for the canvas element size.\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n // Get the _actual_ dimensions of an individual cell. This needs to be\n // derived from the canvasWidth/Height calculated above which takes into\n // account window.devicePixelRatio. ICharSizeService.width/height by itself\n // is insufficient when the page is not at 100% zoom level as it's measured\n // in CSS pixels, but the actual char size on the canvas can differ.\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n }", "get defaultCharacterWidth() { return this.viewState.heightOracle.charWidth; }", "function PdfStringLayouter(){/**\n * Checks whether the x co-ordinate is need to set as client size or not.\n * @hidden\n * @private\n */this.isOverloadWithPosition=false;//\n}", "wrapText(textElement, cWidth) {\n // Allow 'function' and 'this', for D3...\n /* eslint-disable func-names, no-invalid-this */\n textElement.each(function () {\n const thisText = Dthree.select(this);\n // Extract properties from D3 bound data, since they\n // don't seem to survive the call...\n thisText.attr({\n 'content': (ddd) => ddd.content,\n 'class': (ddd) => ddd.class,\n 'wrapwidth': (ddd) => ddd.wrapwidth,\n 'leading': (ddd) => ddd.leading,\n 'x': (ddd) => {\n let xVal = ddd.x;\n // Right-aligned?\n if (xVal < 0) {\n xVal += cWidth;\n }\n return xVal;\n },\n });\n const wrapWidth = thisText.attr('wrapwidth');\n // String content as reversed array, by word\n const content = thisText.attr('content');\n const words = content.split(/\\s+/).reverse();\n // X pos for tspans\n const xPos = `${ thisText.attr('x') }px`;\n // Bostock's original had a linecounter, but I don't seem to need that...\n let line = [];\n const leading = `${ thisText.attr('leading') }px`;\n let tspan = thisText.text(null).append('tspan').attr('x', xPos).attr('dy', 0);\n while (words.length > 0) {\n const word = words.pop();\n line.push(word);\n tspan.text(line.join(' '));\n if (tspan.node().getComputedTextLength() > wrapWidth) {\n // debugger;\n line.pop();\n tspan.text(line.join(' '));\n line = [ word ];\n tspan = thisText.append('tspan').attr('x', xPos).attr('dy', leading).text(word);\n }\n }\n });\n }", "get colliderWidth () {\n\t\tlet leftMostX = this.isSignMagnitude ? this.signLabel.x : ZERO;\n\t\tlet rightMostX = this.textLabel.x + this.textLabel.width;\n\t\treturn rightMostX - leftMostX;\n\t}", "function TSplit_doFitWidthFix(d,align){\n\tvar du = d;\n\tvar dd = d;\n\n\tswitch(this.Orientation) {\n\tcase 'h':\n\t\tbreak;\n\tcase 'v':\n\t\tswitch (align) {\n\t\t\tcase 'left':\n this.UpNode.changeWidth(+du);\n this.DownNode.changeWidth(-dd);\n\t\t\t\tbreak;\n\t\t\tcase 'right':\n this.UpNode.changeWidth(-du);\n this.DownNode.changeWidth(+dd);\n\t\t\t\tbreak;\n\t\t\tcase 'nil':\n this.DownNode.changeWidth(+dd);\n\t\t\t\tbreak;\n\t\t}\n\tcase 'n':\n\t\tbreak;\n\t}\n\tthis.doDOM_Refresh();\n}", "getTextWidth(text, font, size) {\n let e = d3.select(this.element)\n .append('svg').attr('id', 'textMeasureContainer')\n .append('text').attr('font-family', font).attr('font-size', size).text(text);\n let len = e.node().getComputedTextLength();\n d3.select(this.element).select('#textMeasureContainer').remove();\n\n return len;\n }", "getRenderedRight(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.right}", "function correctDimensions() {\n var width = visuals.getRecorderWidth(true);\n\n if (width < 1) {\n throw _videomailError2.default.create('Recorder width cannot be less than 1!', options);\n } else {\n containerElement.style.width = width + 'px';\n }\n }", "_getExtraLeftWidth(_id) {\n return this._getExtraSize(_id, 'left');\n }", "_getExtraLeftWidth(_id) {\n return this._getExtraSize(_id, 'left');\n }", "function jt(e,t,a){var n=e.options.lineWrapping,r=n&&zt(e);if(!t.measure.heights||n&&t.measure.width!=r){var f=t.measure.heights=[];if(n){t.measure.width=r;for(var o=t.text.firstChild.getClientRects(),i=0;i<o.length-1;i++){var s=o[i],c=o[i+1];Math.abs(s.bottom-c.bottom)>2&&f.push((s.bottom+c.top)/2-a.top)}}f.push(a.bottom-a.top)}}", "function visualLength(text)\n\t{\n\t\tvar ruler = document.getElementById(\"ruler\");\n\t\truler.innerHTML = text;\n\t\treturn ruler.offsetWidth;\n\t}", "getDimensions(width, height) {\n if (!width || !height) {\n return \"\";\n }\n if (!this.containsOnlyNumbers(width, height)) {\n return \"\";\n }\n return `${width}x${height}`;\n }", "getMaxWidthUnit(){return this.__maxWidthUnit}", "function fontSizeForDimensions(str, font, width, height, lower, upper) {\n // Lower and upper bounds for font\n lower = (lower === undefined) ? 0 : lower;\n upper = (upper === undefined) ? height : upper;\n\n // The font size we're guessing with\n var middle = Math.floor((upper + lower) / 2);\n\n if (middle === lower) {\n return middle;\n }\n\n // Get text dimensions\n var tsize = textsize(str, middle, font);\n\n return (\n // Are we above or below ?\n (tsize.width <= width && tsize.height <= height) ?\n // Go up\n fontSizeForDimensions(str, font, width, height, middle, upper) :\n // Go down\n fontSizeForDimensions(str, font, width, height, lower, middle)\n );\n}", "function calculateBounds(properties, laf, flags, iconLeft, dialogLeft) {\r\n\tvar rect = new Rectangle(0, 0, 0, 0);\r\n\t\r\n\tvar portrait = laf.getBoolean(\"is.portrait\", true);\r\n\tvar d = laf.getDimension(\"screen.size\");\r\n\tvar content = laf.getRectangle(\"content.pane.bounds\");\r\n\t\r\n\tvar padding = laf.getInteger(\"note.padding\", 2);\r\n\trect.width = Math.min(d.x, d.y) - padding*2;\r\n\tif (portrait) {\r\n\t\trect.x = content.x + (content.width - rect.width) / 2; \r\n\t}\r\n\telse {\r\n\t\trect.x = d.x - rect.width;\r\n\t}\r\n\t\t\r\n\tvar font = laf.getFont(\"message.font\");\r\n\r\n\tvar info = getTextInfo(properties, laf, font, flags, iconLeft, dialogLeft);\r\n\tvar extent = info[0];\r\n\tvar text = info[1];\r\n\tvar maxWidth = info[2];\r\n\tvar lineGap = info[3];\r\n\t\r\n\tvar height = extent.y + 7*2 + lineGap\r\n\t\r\n\tif (portrait)\r\n\t\trect.y = content.y + content.height - height - padding;\r\n\telse\r\n\t\trect.y = (d.y - height) / 2;\r\n\r\n\trect.height = height;\r\n\t\r\n\t// adjust for insets\r\n\tvar inset = laf.getDimension(\"note.inset\");\r\n\trect.x += inset.x;\r\n\trect.width -= (2 * inset.x);\r\n\trect.height -= (2 * inset.y);\r\n\t\r\n\t// add pixels for shadow\r\n\trect.width += 3;\r\n\trect.height += 3;\r\n\t\r\n\treturn rect;\r\n}", "function presentWrap(stringDimentions) {\n let dimensions = stringDimentions.split('x');\n // [ '43', '3', '21' ]\n\n let length = dimensions[0];\n let width = dimensions[1];\n let height = dimensions[2];\n\n let extra = Math.min((length * width), (width * height), (height * length));\n\n let total = (2 * length * width) + (2 * width * height) + (2 * height * length) + extra;\n console.log(total);\n return total;\n}", "getOuterWidth() {\n mustInherit();\n }", "function Themes_GetRectBorderThickness(interfaceLook)\n{\n\t//for now we hardcode this\n\treturn 1;\n}", "function updateWidthHeight() {\n\tvar width = (document.getElementById(\"clientText\").clientWidth - PADDING_PX) * PX_TO_INCH\n\tvar height = (document.getElementById(\"clientText\").clientHeight - PADDING_PX) * PX_TO_INCH;\n\n\tdocument.getElementById(\"width\").innerHTML = Math.round(width)\n\tdocument.getElementById(\"height\").innerHTML = Math.round(height);\n}", "function computeCustomizedWidth(){\n\tvar note_div = document.querySelector('#note_div');\n\tvar largeWidth = note_div.offsetWidth;\n\tvar margin = NOTE_MARGIN;\n\t//border = 2px\n\tvar border = window.getComputedStyle(note_div).borderWidth[0];\n\treturn (largeWidth - (2*border))/numOfKey -(2*margin) -1;\n}", "function findWidth() {\n if (noteStack == \"stack_bar_top\") {\n return \"100%\";\n }\n if (noteStack == \"stack_bar_bottom\") {\n return \"70%\";\n } else {\n return \"290px\";\n }\n }", "get halfDrawWidth() {\n return this.drawWidth / 2;\n }", "function _reCalculateDimensions(){\n keywordLookupTable = {\n '{{SCREEN_WIDTH}}' : screen.outerWidth(),\n '{{SCREEN_HEIGHT}}' : screen.outerHeight()\n };\n logger.logEvent({'msg': 'recalculated dimensions', 'new_table': keywordLookupTable});\n }", "function stbValign() {\n\t\t\t$(\".split-text-block.fullWidth .valign\").each(function(){\n\t\t\t\tvar height = $(this).outerHeight();\n\t\t\t\tvar margin = height / 2;\n\t\t\t\tvar rightHeight = $(this).parent('.right').siblings('.left').children('img').height();\n\t\t\t\tif (height > rightHeight) {\n\t\t\t\t\t// $(this).css({\"position\": \"relative\", \"margin-top\": \"inherit\", \"top\": \"inherit\", \"left\":\"inherit\", \"right\":\"inherit\", \"padding-bottom\":\"6rem\"});\n\t\t\t\t\t$(this).parent('.right').siblings('.left').height(height);\n\t\t\t\t} else {\n\t\t\t\t\t$(this).parent('.right').height(rightHeight).css('position','relative');\n\t\t\t\t\t$(this).css({\"position\": \"absolute\", \"margin-top\": \"-\"+margin+\"px\", \"top\": \"50%\", \"left\":\"0\", \"right\":\"0\", \"padding-bottom\":\"0\"});\n\t\t\t\t}\n\t\t\t\tif ($(window).width() < '868') {\n\t\t\t\t\t$(this).attr('style', '');\n\t\t\t\t\t$(this).parent('.right').siblings('.left').attr('style', '');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function getTextPositionInLabel(text) {\r\n\t\ttext = text + \"\";\r\n\t\treturn 15 - (text.length * 2.2); \r\n\t}", "function onResize(cm) {\n\t\t var d = cm.display;\n\t\t if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n\t\t return;\n\t\t // Might be a text scaling operation, clear size caches.\n\t\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t\t d.scrollbarsClipped = false;\n\t\t cm.setSize();\n\t\t }", "function findDimensions(gd, sliderOpts) {\n var sliderLabels = Drawing.tester.selectAll('g.' + constants.labelGroupClass).data(sliderOpts._visibleSteps);\n sliderLabels.enter().append('g').classed(constants.labelGroupClass, true);\n\n // loop over fake buttons to find width / height\n var maxLabelWidth = 0;\n var labelHeight = 0;\n sliderLabels.each(function (stepOpts) {\n var labelGroup = d3.select(this);\n var text = drawLabel(labelGroup, {\n step: stepOpts\n }, sliderOpts);\n var textNode = text.node();\n if (textNode) {\n var bBox = Drawing.bBox(textNode);\n labelHeight = Math.max(labelHeight, bBox.height);\n maxLabelWidth = Math.max(maxLabelWidth, bBox.width);\n }\n });\n sliderLabels.remove();\n var dims = sliderOpts._dims = {};\n dims.inputAreaWidth = Math.max(constants.railWidth, constants.gripHeight);\n\n // calculate some overall dimensions - some of these are needed for\n // calculating the currentValue dimensions\n var graphSize = gd._fullLayout._size;\n dims.lx = graphSize.l + graphSize.w * sliderOpts.x;\n dims.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n if (sliderOpts.lenmode === 'fraction') {\n // fraction:\n dims.outerLength = Math.round(graphSize.w * sliderOpts.len);\n } else {\n // pixels:\n dims.outerLength = sliderOpts.len;\n }\n\n // The length of the rail, *excluding* padding on either end:\n dims.inputAreaStart = 0;\n dims.inputAreaLength = Math.round(dims.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n var textableInputLength = dims.inputAreaLength - 2 * constants.stepInset;\n var availableSpacePerLabel = textableInputLength / (sliderOpts._stepCount - 1);\n var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n dims.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n dims.labelHeight = labelHeight;\n\n // loop over all possible values for currentValue to find the\n // area we need for it\n dims.currentValueMaxWidth = 0;\n dims.currentValueHeight = 0;\n dims.currentValueTotalHeight = 0;\n dims.currentValueMaxLines = 1;\n if (sliderOpts.currentvalue.visible) {\n // Get the dimensions of the current value label:\n var dummyGroup = Drawing.tester.append('g');\n sliderLabels.each(function (stepOpts) {\n var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n var curValSize = curValPrefix.node() && Drawing.bBox(curValPrefix.node()) || {\n width: 0,\n height: 0\n };\n var lines = svgTextUtils.lineCount(curValPrefix);\n dims.currentValueMaxWidth = Math.max(dims.currentValueMaxWidth, Math.ceil(curValSize.width));\n dims.currentValueHeight = Math.max(dims.currentValueHeight, Math.ceil(curValSize.height));\n dims.currentValueMaxLines = Math.max(dims.currentValueMaxLines, lines);\n });\n dims.currentValueTotalHeight = dims.currentValueHeight + sliderOpts.currentvalue.offset;\n dummyGroup.remove();\n }\n dims.height = dims.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + dims.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n var xanchor = 'left';\n if (Lib.isRightAnchor(sliderOpts)) {\n dims.lx -= dims.outerLength;\n xanchor = 'right';\n }\n if (Lib.isCenterAnchor(sliderOpts)) {\n dims.lx -= dims.outerLength / 2;\n xanchor = 'center';\n }\n var yanchor = 'top';\n if (Lib.isBottomAnchor(sliderOpts)) {\n dims.ly -= dims.height;\n yanchor = 'bottom';\n }\n if (Lib.isMiddleAnchor(sliderOpts)) {\n dims.ly -= dims.height / 2;\n yanchor = 'middle';\n }\n dims.outerLength = Math.ceil(dims.outerLength);\n dims.height = Math.ceil(dims.height);\n dims.lx = Math.round(dims.lx);\n dims.ly = Math.round(dims.ly);\n var marginOpts = {\n y: sliderOpts.y,\n b: dims.height * FROM_BR[yanchor],\n t: dims.height * FROM_TL[yanchor]\n };\n if (sliderOpts.lenmode === 'fraction') {\n marginOpts.l = 0;\n marginOpts.xl = sliderOpts.x - sliderOpts.len * FROM_TL[xanchor];\n marginOpts.r = 0;\n marginOpts.xr = sliderOpts.x + sliderOpts.len * FROM_BR[xanchor];\n } else {\n marginOpts.x = sliderOpts.x;\n marginOpts.l = dims.outerLength * FROM_TL[xanchor];\n marginOpts.r = dims.outerLength * FROM_BR[xanchor];\n }\n Plots.autoMargin(gd, autoMarginId(sliderOpts), marginOpts);\n}", "function subtitleSidePosition(subWidth, titleWidth, subScale, titleScale, marginBetween) {\nvar subHalfWidth = (subWidth*subScale)/2;\nvar titleHalfWidth = (titleWidth*titleScale)/2;\n// Calculate how far from the center this title needs to be\nvar centerOffset = subHalfWidth + titleHalfWidth + marginBetween;\nvar offset = ($(window).width()/2) - centerOffset;\n\nreturn offset;\n}", "function checkTextWidth(text){\n const dummyElement = document.createElement(\"div\");\n dummyElement.style = \"font-family: 'Segoe UI'; font-size: 13px; font-weight: 400; opacity: 0;\";\n dummyElement.innerText = text;\n const dummyParent = document.getElementById(\"status_info\");\n dummyParent.appendChild(dummyElement);\n const textWidth = dummyElement.getBoundingClientRect().width;\n dummyParent.removeChild(dummyElement);\n return textWidth;\n }", "function fitText(ctx, str, font, style, width){\n\tvar l=36\n\tvar r=100\n\twhile (r-l>1){\n\t\tvar m=Math.floor((l+r)/2)\n\t\tctx.font = style + \" \" + m.toString()+\"px \"+font\n\t\tif (ctx.measureText(str).width <= width){\n\t\t\tl=m\n\t\t} else {\n\t\t\tr=m\n\t\t}\n\t}\n\treturn l\n}", "function getWidth(){\n\tif( $(\"#visualizationDiv\").width() > MAXWIDTH )\treturn MAXWIDTH - LEGENDWIDHT-20;\n\tif ($(\"#visualizationDiv\").width() < MOBILEBREAKPOINT ) return $(\"#visualizationDiv\").width();\n\treturn $(\"#visualizationDiv\").width() -LEGENDWIDHT-20;\n}", "get fullWidth() {\n\t\t\treturn this.width + self.margin.right + self.margin.left;\n\t\t}", "function resizeTwoFloatObejctsLeftKnown(left , right , papa){\n var widthPapa = $(papa).width();\n var widthLeft = $(left).width();\n $(right).width(widthPapa - widthLeft - 10);\n}", "getRenderedWidth(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.width}", "resizeCheck() {\n\t\tlet width = this.textWidth();\n\t\tlet height = this.textHeight();\n\n\t\tif (width != this._size.width || height != this._size.height) {\n\n\t\t\tthis._size = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\n\t\t\tthis.onResize && this.onResize(this._size);\n\t\t\tthis.emit(EVENTS.CONTENTS.RESIZE, this._size);\n\t\t}\n\t}", "_measureLabel() {\r\n let drawContext = canvas._canvas.getContext(\"2d\");\r\n \r\n drawContext.save();\r\n this._setupText(drawContext);\r\n let measurements = drawContext.measureText(this._text);\r\n drawContext.restore();\r\n \r\n let numLines = 1 + (this._text.match(new RegExp(\"\\n\", \"g\")) || []).length;\r\n \r\n this._textWidth = measurements.width;\r\n this._textHeight = this._fontHeight * numLines;\r\n }", "function TSplit_doFitWidthEnh(d,align){\n\tswitch(this.Orientation) {\n\tcase 'h':\n this.UpNode.changeWidth(d);\n this.DownNode.changeWidth(d);\n\t\t\tthis.Width+=d;\t\t\t\t\t\n\t\tbreak;\n\tcase 'v':\n\t\t\tswitch (align) {\n\t\t\t\tcase 'left':\n this.UpNode.changeWidth(d);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n this.DownNode.changeWidth(d);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nil':\n this.DownNode.changeWidth(d);\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\n\t\t\tthis.Width += d;\n\t\tbreak;\n\tcase 'n':\n\t\tbreak;\n\t}\n\tthis.doDOM_Refresh();\n}", "function Ea(e){var t=ya(e.display),a=e.options.lineWrapping,n=a&&Math.max(5,e.display.scroller.clientWidth/va(e.display)-3);return function(r){if(he(e.doc,r))return 0;var f=0;if(r.widgets)for(var o=0;o<r.widgets.length;o++)r.widgets[o].height&&(f+=r.widgets[o].height);return a?f+(Math.ceil(r.text.length/n)||1)*t:f+t}}", "function I(){var e=p.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?e.width||p[t]:e.height||p[t]}", "getRenderedLeft(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.left}", "get width() { return this.#format.width; }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "function onResize(cm) {\n\t var d = cm.display;\n\t if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n\t return;\n\t // Might be a text scaling operation, clear size caches.\n\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t d.scrollbarsClipped = false;\n\t cm.setSize();\n\t }", "function onResize(cm) {\n\t var d = cm.display;\n\t if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n\t return;\n\t // Might be a text scaling operation, clear size caches.\n\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t d.scrollbarsClipped = false;\n\t cm.setSize();\n\t }", "function onResize(cm) {\n\t var d = cm.display;\n\t if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)\n\t return;\n\t // Might be a text scaling operation, clear size caches.\n\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t d.scrollbarsClipped = false;\n\t cm.setSize();\n\t }", "getHandleWidth () {\n return this.props.dividerWidth + this.props.handleBleed * 2\n }", "dimension() {\n if (!this.item.width) {\n return '';\n }\n return `${this.item.width}px * ${this.item.height}px`;\n }", "function v(){var t=W.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||W[e]:t.height||W[e]}", "get size() {\n var padding = this.padding;\n var width = 0;\n var height = DEFAULT_EXPR_HEIGHT;\n var sizes = this.getHoleSizes();\n var scale_x = this.scale.x;\n\n if (this._stackVertically) {\n width = EMPTY_EXPR_WIDTH;\n height = 0;\n }\n\n if (sizes.length === 0) return { w:this._size.w, h:this._size.h };\n\n sizes.forEach((s) => {\n if (this._stackVertically) {\n height += s.h;\n width = Math.max(width, s.w);\n }\n else {\n height = Math.max(height, s.h);\n width += s.w + padding.inner;\n }\n });\n\n if (this._stackVertically) {\n width += padding.right + padding.left;\n }\n else {\n width += padding.right; // the end\n }\n\n return { w:width, h: height };\n }", "function calculateTextWidth (node) {\n /* istanbul ignore else */\n {\n const range = document.createRange();\n range.selectNode(node.firstChild);\n return range.getBoundingClientRect().width\n }\n}", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n }\n else if (this.x > width) {\n this.x -= width;\n }\n constrain(this.y, 0, height);\n }", "function ve(e){if(0==e.height)return 0;for(var t,a=e.text.length,n=e;t=se(n);){var r=t.find(0,!0);n=r.from.line,a+=r.from.ch-r.to.ch}for(n=e;t=ce(n);){var f=t.find(0,!0);a-=n.text.length-f.from.ch,n=f.to.line,a+=n.text.length-f.to.ch}return a}", "applyNodeDimensions() {\n if (this.nodeElements && this.nodeElements.length) {\n this.nodeElements.map(elem => {\n const nativeElement = elem.nativeElement;\n const node = this.graph.nodes.find(n => n.id === nativeElement.id);\n if (!node) {\n return;\n }\n // calculate the height\n let dims;\n try {\n dims = nativeElement.getBBox();\n if (!dims.width || !dims.height) {\n return;\n }\n }\n catch (ex) {\n // Skip drawing if element is not displayed - Firefox would throw an error here\n return;\n }\n if (this.nodeHeight) {\n node.dimension.height =\n node.dimension.height && node.meta.forceDimensions ? node.dimension.height : this.nodeHeight;\n }\n else {\n node.dimension.height =\n node.dimension.height && node.meta.forceDimensions ? node.dimension.height : dims.height;\n }\n if (this.nodeMaxHeight) {\n node.dimension.height = Math.max(node.dimension.height, this.nodeMaxHeight);\n }\n if (this.nodeMinHeight) {\n node.dimension.height = Math.min(node.dimension.height, this.nodeMinHeight);\n }\n if (this.nodeWidth) {\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : this.nodeWidth;\n }\n else {\n // calculate the width\n if (nativeElement.getElementsByTagName('text').length) {\n let maxTextDims;\n try {\n for (const textElem of nativeElement.getElementsByTagName('text')) {\n const currentBBox = textElem.getBBox();\n if (!maxTextDims) {\n maxTextDims = currentBBox;\n }\n else {\n if (currentBBox.width > maxTextDims.width) {\n maxTextDims.width = currentBBox.width;\n }\n if (currentBBox.height > maxTextDims.height) {\n maxTextDims.height = currentBBox.height;\n }\n }\n }\n }\n catch (ex) {\n // Skip drawing if element is not displayed - Firefox would throw an error here\n return;\n }\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : maxTextDims.width + 20;\n }\n else {\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : dims.width;\n }\n }\n if (this.nodeMaxWidth) {\n node.dimension.width = Math.max(node.dimension.width, this.nodeMaxWidth);\n }\n if (this.nodeMinWidth) {\n node.dimension.width = Math.min(node.dimension.width, this.nodeMinWidth);\n }\n });\n }\n }", "function getWidth() {\n\tvar width = document.getElementById(\"clientText\").clientWidth - PADDING_PX;\n\twidth = width * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn width.toFixed(2);\n}", "function estimateWidth(item) {\n fontHeight = height(item);\n return estimate(textValue(item));\n}", "function estimateWidth(item) {\n fontHeight = height(item);\n return estimate(textValue(item));\n}", "function measureText(description) {\n const splitted = description.split(\"~~\");\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n return Math.max(\n ctx.measureText(splitted[0]).width,\n ctx.measureText(splitted[1]).width\n );\n}", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "function N() {\n var t = p.getBoundingClientRect(),\n e = \"offset\" + [\"Width\", \"Height\"][i.ort];\n return 0 === i.ort ? t.width || p[e] : t.height || p[e]\n }", "function findDimensions(gd, sliderOpts) {\n\t var sliderLabels = gd._tester.selectAll('g.' + constants.labelGroupClass)\n\t .data(sliderOpts.steps);\n\t\n\t sliderLabels.enter().append('g')\n\t .classed(constants.labelGroupClass, true);\n\t\n\t // loop over fake buttons to find width / height\n\t var maxLabelWidth = 0;\n\t var labelHeight = 0;\n\t sliderLabels.each(function(stepOpts) {\n\t var labelGroup = d3.select(this);\n\t\n\t var text = drawLabel(labelGroup, {step: stepOpts}, sliderOpts);\n\t\n\t var tWidth = (text.node() && Drawing.bBox(text.node()).width) || 0;\n\t\n\t // This just overwrites with the last. Which is fine as long as\n\t // the bounding box (probably incorrectly) measures the text *on\n\t // a single line*:\n\t labelHeight = (text.node() && Drawing.bBox(text.node()).height) || 0;\n\t\n\t maxLabelWidth = Math.max(maxLabelWidth, tWidth);\n\t });\n\t\n\t sliderLabels.remove();\n\t\n\t sliderOpts.inputAreaWidth = Math.max(\n\t constants.railWidth,\n\t constants.gripHeight\n\t );\n\t\n\t sliderOpts.currentValueMaxWidth = 0;\n\t sliderOpts.currentValueHeight = 0;\n\t sliderOpts.currentValueTotalHeight = 0;\n\t\n\t if(sliderOpts.currentvalue.visible) {\n\t // Get the dimensions of the current value label:\n\t var dummyGroup = gd._tester.append('g');\n\t\n\t sliderLabels.each(function(stepOpts) {\n\t var curValPrefix = drawCurrentValue(dummyGroup, sliderOpts, stepOpts.label);\n\t var curValSize = (curValPrefix.node() && Drawing.bBox(curValPrefix.node())) || {width: 0, height: 0};\n\t sliderOpts.currentValueMaxWidth = Math.max(sliderOpts.currentValueMaxWidth, Math.ceil(curValSize.width));\n\t sliderOpts.currentValueHeight = Math.max(sliderOpts.currentValueHeight, Math.ceil(curValSize.height));\n\t });\n\t\n\t sliderOpts.currentValueTotalHeight = sliderOpts.currentValueHeight + sliderOpts.currentvalue.offset;\n\t\n\t dummyGroup.remove();\n\t }\n\t\n\t var graphSize = gd._fullLayout._size;\n\t sliderOpts.lx = graphSize.l + graphSize.w * sliderOpts.x;\n\t sliderOpts.ly = graphSize.t + graphSize.h * (1 - sliderOpts.y);\n\t\n\t if(sliderOpts.lenmode === 'fraction') {\n\t // fraction:\n\t sliderOpts.outerLength = Math.round(graphSize.w * sliderOpts.len);\n\t } else {\n\t // pixels:\n\t sliderOpts.outerLength = sliderOpts.len;\n\t }\n\t\n\t // Set the length-wise padding so that the grip ends up *on* the end of\n\t // the bar when at either extreme\n\t sliderOpts.lenPad = Math.round(constants.gripWidth * 0.5);\n\t\n\t // The length of the rail, *excluding* padding on either end:\n\t sliderOpts.inputAreaStart = 0;\n\t sliderOpts.inputAreaLength = Math.round(sliderOpts.outerLength - sliderOpts.pad.l - sliderOpts.pad.r);\n\t\n\t var textableInputLength = sliderOpts.inputAreaLength - 2 * constants.stepInset;\n\t var availableSpacePerLabel = textableInputLength / (sliderOpts.steps.length - 1);\n\t var computedSpacePerLabel = maxLabelWidth + constants.labelPadding;\n\t sliderOpts.labelStride = Math.max(1, Math.ceil(computedSpacePerLabel / availableSpacePerLabel));\n\t sliderOpts.labelHeight = labelHeight;\n\t\n\t sliderOpts.height = sliderOpts.currentValueTotalHeight + constants.tickOffset + sliderOpts.ticklen + constants.labelOffset + sliderOpts.labelHeight + sliderOpts.pad.t + sliderOpts.pad.b;\n\t\n\t var xanchor = 'left';\n\t if(anchorUtils.isRightAnchor(sliderOpts)) {\n\t sliderOpts.lx -= sliderOpts.outerLength;\n\t xanchor = 'right';\n\t }\n\t if(anchorUtils.isCenterAnchor(sliderOpts)) {\n\t sliderOpts.lx -= sliderOpts.outerLength / 2;\n\t xanchor = 'center';\n\t }\n\t\n\t var yanchor = 'top';\n\t if(anchorUtils.isBottomAnchor(sliderOpts)) {\n\t sliderOpts.ly -= sliderOpts.height;\n\t yanchor = 'bottom';\n\t }\n\t if(anchorUtils.isMiddleAnchor(sliderOpts)) {\n\t sliderOpts.ly -= sliderOpts.height / 2;\n\t yanchor = 'middle';\n\t }\n\t\n\t sliderOpts.outerLength = Math.ceil(sliderOpts.outerLength);\n\t sliderOpts.height = Math.ceil(sliderOpts.height);\n\t sliderOpts.lx = Math.round(sliderOpts.lx);\n\t sliderOpts.ly = Math.round(sliderOpts.ly);\n\t\n\t Plots.autoMargin(gd, constants.autoMarginIdRoot + sliderOpts._index, {\n\t x: sliderOpts.x,\n\t y: sliderOpts.y,\n\t l: sliderOpts.outerLength * ({right: 1, center: 0.5}[xanchor] || 0),\n\t r: sliderOpts.outerLength * ({left: 1, center: 0.5}[xanchor] || 0),\n\t b: sliderOpts.height * ({top: 1, middle: 0.5}[yanchor] || 0),\n\t t: sliderOpts.height * ({bottom: 1, middle: 0.5}[yanchor] || 0)\n\t });\n\t}", "function H(){var t=f.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?t.width||f[e]:t.height||f[e]}", "function textFits(text, nrOfColumns) {\n\n if (renderTextDimensions(text, bottomFont.fontName, bottomFont.fontSize).length <\n (allDimensions.framedImageWidth / nrOfColumns\n - 0.02 * allDimensions.framedImageWidth)) { //leave some space between columns\n return true;\n }\n else {\n return false;\n }\n}", "redimension(fontSize, width, height) {\n this.fontSize = fontSize;\n\n // calculate the pixel dimensions of a single character\n var ctx = this.dimensionCanvas.getContext('2d');\n ctx.font = fontSize + \"px monospace\";\n this.div.style.fontSize = fontSize + \"px\";\n this.charWidth = ctx.measureText(' ').width;\n this.charHeight = fontSize * 1.2;\n\n // calculate the adjustment factors for bold font; bold monospace fonts\n // can be wider than normal weight; boldWidthAdjust is the value for the\n // CSS letter-spacing property to correct this; boldSizeScale provides\n // the scale factor for the font size to correct when letter spacing \n // isn't available (eg canvas rendering)\n ctx.font = \"bold \" + fontSize + \"px monospace\";\n this.boldWidthAdjust = this.charWidth - ctx.measureText(' ').width;\n this.boldSizeScale = this.charWidth / ctx.measureText(' ').width;\n\n // calculate the overall terminal dimensions in pixels and characters\n this.pixWidth = width - 10;\n this.pixHeight = height - 10;\n this.termCols = Math.floor(this.pixWidth / this.charWidth);\n this.termRows = Math.floor(this.pixHeight / this.charHeight);\n\n // Force a minimum size of 10 rows x 20 cols; this will cause visual\n // overflow if the terminal is made smaller\n if (this.termRows < 10) {\n this.termRows = 10\n }\n if (this.termCols < 20) {\n this.termCols = 20;\n }\n\n // The upper and lower limits of the scrollable region\n this.scrollMin = 0;\n this.scrollMax = this.termRows - 1;\n\n // delete all old elements in the terminal DOM node\n while (this.div.firstChild) {\n this.div.removeChild(this.div.firstChild);\n }\n this.rowNodes = [];\n\n // dimension and create the cursor DOM node\n this.cursorNode = document.createElement(\"div\");\n this.cursorNode.classList = \"term-cursor\";\n this.div.appendChild(this.cursorNode);\n this.cursorNode.style.width = this.charWidth + \"px\";\n this.cursorNode.style.height = this.charHeight + \"px\";\n\n // fill in the terminal DOM node for the current draw method\n if (this.drawMethod == 'DOM') {\n\n // build a DOM node for each row in the terminal\n for (var row = 0; row < this.termRows; row++) {\n var rowNode = document.createElement(\"div\");\n rowNode.style.top = row * this.charHeight + \"px\";\n rowNode.style.width = this.pixWidth + \"px\";\n rowNode.classList = \"term-row\";\n this.div.appendChild(rowNode);\n this.rowNodes.push(rowNode);\n }\n }\n else if (this.drawMethod == 'canvas') {\n this.canvas.width = this.pixWidth;\n this.canvas.height = this.pixHeight;\n this.div.appendChild(this.canvas);\n }\n\n // rebuild the character array and report the size change\n this.blankCharArray();\n this.sendResize(this.termRows, this.termCols);\n }", "function checkSize() {\n var truncate = function truncate() {\n if (line < 1) lineData = [that._ellipsis(\"\", line)];else lineData[line - 1] = that._ellipsis(lineData[line - 1], line);\n }; // Constraint the font size\n\n\n fS = max([fS, fMin]);\n fS = min([fS, fMax]);\n\n if (resize) {\n lH = fS * lHRatio;\n wrapper.fontSize(fS).lineHeight(lH);\n style[\"font-size\"] = fS;\n style[\"line-height\"] = lH;\n }\n\n wrapResults = wrapper(t);\n lineData = wrapResults.lines.filter(function (l) {\n return l !== \"\";\n });\n line = lineData.length;\n\n if (wrapResults.truncated) {\n if (resize) {\n fS--;\n\n if (fS < fMin) {\n fS = fMin;\n truncate();\n return;\n } else checkSize();\n } else truncate();\n }\n }", "getDotPatternSize() {\n //const { width } = this.getWindowDimensions();\n return 28; // 28 for all for now\n }", "function onResize(cm) {\n\t\t var d = cm.display;\n\t\t // Might be a text scaling operation, clear size caches.\n\t\t d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\t\t d.scrollbarsClipped = false;\n\t\t cm.setSize();\n\t\t }", "function ImageDimensions() { }", "function getimagewidth(nfullimagewidth,nrating){\r\nvar nwidth = nfullimagewidth;\r\n return \"\\\"\" + nwidth + \"\\\" \"\r\n}" ]
[ "0.6419615", "0.62969416", "0.6237837", "0.60760343", "0.6073828", "0.5946762", "0.592194", "0.58706087", "0.585344", "0.57196945", "0.57196945", "0.5669483", "0.5669483", "0.56625825", "0.56436014", "0.56314695", "0.5612791", "0.55979156", "0.55979156", "0.55979156", "0.559383", "0.55796045", "0.55705154", "0.5567242", "0.55586636", "0.55430424", "0.55430424", "0.5527729", "0.55276865", "0.5524977", "0.55237615", "0.5514983", "0.5513239", "0.5505763", "0.55006903", "0.54877657", "0.5471048", "0.5456006", "0.54451567", "0.54445183", "0.54445183", "0.54237753", "0.5414351", "0.54021174", "0.5401391", "0.5397268", "0.53895456", "0.53873193", "0.5376529", "0.53726786", "0.5364806", "0.534578", "0.532809", "0.5327809", "0.53178614", "0.5310491", "0.5309663", "0.5302052", "0.52988523", "0.5296672", "0.5294386", "0.5290936", "0.52731943", "0.5270788", "0.52656764", "0.5250696", "0.5247208", "0.5246257", "0.5243847", "0.5239273", "0.52354085", "0.5233239", "0.5231169", "0.523096", "0.52306724", "0.52306724", "0.52306724", "0.5225136", "0.52218986", "0.5221037", "0.5216839", "0.52158123", "0.5214685", "0.5212564", "0.52113533", "0.5208194", "0.52051586", "0.52051586", "0.5204321", "0.5200287", "0.5200287", "0.51890814", "0.5183842", "0.51826453", "0.51816493", "0.5171523", "0.5170666", "0.51698565", "0.5164042", "0.51629525", "0.5160306" ]
0.0
-1
Outputs a number of spans to make up a line, taking highlighting and marked text into account.
function insertLineContent(line, builder, styles) { var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i$1 = 1; i$1 < styles.length; i$1+=2) { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } return } var len = allText.length, pos = 0, i = 1, text = "", style, css; var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; for (;;) { if (nextChange == pos) { // Update current marker set spanStyle = spanEndStyle = spanStartStyle = title = css = ""; collapsed = null; nextChange = Infinity; var foundBookmarks = [], endStyles = (void 0); for (var j = 0; j < spans.length; ++j) { var sp = spans[j], m = sp.marker; if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { foundBookmarks.push(m); } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { if (sp.to != null && sp.to != pos && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } if (m.className) { spanStyle += " " + m.className; } if (m.css) { css = (css ? css + ";" : "") + m.css; } if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } if (m.title && !title) { title = m.title; } if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) { collapsed = sp; } } else if (sp.from > pos && nextChange > sp.from) { nextChange = sp.from; } } if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } if (collapsed && (collapsed.from || 0) == pos) { buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null); if (collapsed.to == null) { return } if (collapsed.to == pos) { collapsed = false; } } } if (pos >= len) { break } var upto = Math.min(len, nextChange); while (true) { if (text) { var end = pos + text.length; if (!collapsed) { var tokenText = end > upto ? text.slice(0, upto - pos) : text; builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); } if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} pos = end; spanStartStyle = ""; } text = allText.slice(at, at = styles[i++]); style = interpretTokenStyle(styles[i++], builder.cm.options); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\t\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\t\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\t\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t\t if (!spans) {\n\t\t for (var i = 1; i < styles.length; i+=2)\n\t\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t\t return;\n\t\t }\n\t\t\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t\t collapsed = null; nextChange = Infinity;\n\t\t var foundBookmarks = [], endStyles\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker;\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m);\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to;\n\t\t spanEndStyle = \"\";\n\t\t }\n\t\t if (m.className) spanStyle += \" \" + m.className;\n\t\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t\t if (m.title && !title) title = m.title;\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t collapsed = sp;\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from;\n\t\t }\n\t\t }\n\t\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\t\t\n\t\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null);\n\t\t if (collapsed.to == null) return;\n\t\t if (collapsed.to == pos) collapsed = false;\n\t\t }\n\t\t }\n\t\t if (pos >= len) break;\n\t\t\n\t\t var upto = Math.min(len, nextChange);\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length;\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t\t pos = end;\n\t\t spanStartStyle = \"\";\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++]);\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t\t }\n\t\t }\n\t\t }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "highlightSpan(span) {\n let hashes = hashesForSpan(span);\n if (hashes.length > 0) {\n let labels = createElement('div', {\n position: 'absolute',\n left: 0,\n top: 0,\n zIndex: 10\n });\n\n let allNodes = [];\n hashes.forEach((h, i) => {\n let color = this.colors[i % this.colors.length];\n let nodes = nodesForHash(h);\n\n // For figuring out where to attach the labels\n allNodes = allNodes.concat(nodes);\n\n // Draw underlines for each node\n nodes.forEach((n) => {\n // Calculate line height and number of lines\n let lineHeight = calculateLineHeight(n);\n let lines = Math.ceil(n.offsetHeight/lineHeight);\n let leftOffset = calculateLeftOffset(n);\n\n // Create the underline element\n n.style.position = 'relative';\n let underline = createElement('div', {\n borderTop: `2px solid ${color}`,\n height: `${lineHeight}px`,\n position: 'absolute',\n left: '0',\n right: '0',\n bottom: `-${lineHeight+(i*2)}px`,\n pointerEvents: 'none'\n });\n n.appendChild(underline);\n\n // So we can clean this up later\n this.highlights.push(underline);\n\n // Handle additional lines, if any\n [...Array(lines-1).keys()].forEach((l) => {\n // If last line,\n // figure out where the highlight ends on this line\n // by inserting a marker element.\n // Otherwise we can assume it extends the full line.\n let right = 0;\n if (l == lines - 2) {\n let marker = createElement('span');\n n.appendChild(marker);\n right = `${n.offsetWidth-marker.offsetLeft}px`;\n marker.remove();\n }\n\n let underline = createElement('div', {\n borderTop: `2px solid ${color}`,\n height: `${lineHeight}px`,\n position: 'absolute',\n left: `-${n.offsetLeft-leftOffset}px`,\n right: right,\n bottom: `-${lineHeight+(i*2)+((l+1)*(lineHeight-1))}px`,\n pointerEvents: 'none'\n });\n n.appendChild(underline);\n\n // So we can clean this up later\n this.highlights.push(underline);\n });\n });\n\n // Create the tag label for this hash\n let label = createElement('div', {\n background: color,\n color: '#fff',\n padding: '2px'\n });\n label.innerHTML = this.state.db.get(h).tags.join('<br />');\n labels.appendChild(label);\n });\n\n // Attach to left-most node\n allNodes.sort((a, b) => a.offsetLeft - b.offsetLeft);\n allNodes[0].appendChild(labels);\n labels.style.left = `-${allNodes[0].offsetLeft + labels.offsetWidth}px`;\n\n // So we can clean this up later\n this.highlights.push(labels);\n }\n }", "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n\t if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t }\n\t if (pos >= len) break;\n\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function insertLineContent(line, builder, styles) {\n\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t if (!spans) {\n\t for (var i = 1; i < styles.length; i+=2)\n\t builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n\t return;\n\t }\n\n\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n\t for (;;) {\n\t if (nextChange == pos) { // Update current marker set\n\t spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n\t collapsed = null; nextChange = Infinity;\n\t var foundBookmarks = [], endStyles\n\t for (var j = 0; j < spans.length; ++j) {\n\t var sp = spans[j], m = sp.marker;\n\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t foundBookmarks.push(m);\n\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t nextChange = sp.to;\n\t spanEndStyle = \"\";\n\t }\n\t if (m.className) spanStyle += \" \" + m.className;\n\t if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n\t if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n\t if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n\t if (m.title && !title) title = m.title;\n\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t collapsed = sp;\n\t } else if (sp.from > pos && nextChange > sp.from) {\n\t nextChange = sp.from;\n\t }\n\t }\n\t if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n\t if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n\t if (collapsed && (collapsed.from || 0) == pos) {\n\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t collapsed.marker, collapsed.from == null);\n\t if (collapsed.to == null) return;\n\t if (collapsed.to == pos) collapsed = false;\n\t }\n\t if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n\t buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n\t }\n\t if (pos >= len) break;\n\n\t var upto = Math.min(len, nextChange);\n\t while (true) {\n\t if (text) {\n\t var end = pos + text.length;\n\t if (!collapsed) {\n\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n\t }\n\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n\t pos = end;\n\t spanStartStyle = \"\";\n\t }\n\t text = allText.slice(at, at = styles[i++]);\n\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t }\n\t }\n\t }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = (css ? css + \";\" : \"\") + m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) for (var j = 0; j < endStyles.length; j += 2)\n if (endStyles[j + 1] == nextChange) spanEndStyle += \" \" + endStyles[j]\n\n if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n if (collapsed.to == pos) collapsed = false;\n }\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function render(){\n var i = spans.length,\n span;\n while (i-- > 0) {\n span = spans[i];\n renderSpan(span.start, span.end);\n }\n}", "function insertLineContent(line, builder, styles) {\r\n var spans = line.markedSpans, allText = line.text, at = 0;\r\n if (!spans) {\r\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\r\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\r\n return\r\n }\r\n\r\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\r\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\r\n for (;;) {\r\n if (nextChange == pos) { // Update current marker set\r\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\r\n collapsed = null; nextChange = Infinity;\r\n var foundBookmarks = [], endStyles = (void 0);\r\n for (var j = 0; j < spans.length; ++j) {\r\n var sp = spans[j], m = sp.marker;\r\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\r\n foundBookmarks.push(m);\r\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\r\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\r\n nextChange = sp.to;\r\n spanEndStyle = \"\";\r\n }\r\n if (m.className) { spanStyle += \" \" + m.className; }\r\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\r\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\r\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\r\n if (m.title && !title) { title = m.title; }\r\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\r\n { collapsed = sp; }\r\n } else if (sp.from > pos && nextChange > sp.from) {\r\n nextChange = sp.from;\r\n }\r\n }\r\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\r\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\r\n\r\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\r\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\r\n if (collapsed && (collapsed.from || 0) == pos) {\r\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\r\n collapsed.marker, collapsed.from == null);\r\n if (collapsed.to == null) { return }\r\n if (collapsed.to == pos) { collapsed = false; }\r\n }\r\n }\r\n if (pos >= len) { break }\r\n\r\n var upto = Math.min(len, nextChange);\r\n while (true) {\r\n if (text) {\r\n var end = pos + text.length;\r\n if (!collapsed) {\r\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\r\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\r\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\r\n }\r\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\r\n pos = end;\r\n spanStartStyle = \"\";\r\n }\r\n text = allText.slice(at, at = styles[i++]);\r\n style = interpretTokenStyle(styles[i++], builder.cm.options);\r\n }\r\n }\r\n}", "function cr(e,t,a,n){var r=t[\"spans_\"+e.id],f=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,n),function(a){a.markedSpans&&((r||(r=t[\"spans_\"+e.id]={}))[f]=a.markedSpans),++f})}", "function insertLineContent(line, builder, styles) {\r\n var spans = line.markedSpans, allText = line.text, at = 0;\r\n if (!spans) {\r\n for (var i = 1; i < styles.length; i+=2)\r\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\r\n return;\r\n }\r\n\r\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\r\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\r\n for (;;) {\r\n if (nextChange == pos) { // Update current marker set\r\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\r\n collapsed = null; nextChange = Infinity;\r\n var foundBookmarks = [];\r\n for (var j = 0; j < spans.length; ++j) {\r\n var sp = spans[j], m = sp.marker;\r\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\r\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\r\n if (m.className) spanStyle += \" \" + m.className;\r\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\r\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\r\n if (m.title && !title) title = m.title;\r\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\r\n collapsed = sp;\r\n } else if (sp.from > pos && nextChange > sp.from) {\r\n nextChange = sp.from;\r\n }\r\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\r\n }\r\n if (collapsed && (collapsed.from || 0) == pos) {\r\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\r\n collapsed.marker, collapsed.from == null);\r\n if (collapsed.to == null) return;\r\n }\r\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\r\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\r\n }\r\n if (pos >= len) break;\r\n\r\n var upto = Math.min(len, nextChange);\r\n while (true) {\r\n if (text) {\r\n var end = pos + text.length;\r\n if (!collapsed) {\r\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\r\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\r\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\r\n }\r\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\r\n pos = end;\r\n spanStartStyle = \"\";\r\n }\r\n text = allText.slice(at, at = styles[i++]);\r\n style = interpretTokenStyle(styles[i++], builder.cm.options);\r\n }\r\n }\r\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, styles[i], styleToClass(styles[i+1]));\n return;\n }\n\n var allText = line.text, len = allText.length;\n var pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.collapsed && (!collapsed || collapsed.marker.width < m.width))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith)\n foundBookmark = m.replacedWith;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.from != null && collapsed.marker.replacedWith);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style + spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\");\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = styles[i++]; style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n\t\t var spans = line.markedSpans, allText = line.text, at = 0;\n\t\t if (!spans) {\n\t\t for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n\t\t { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n\t\t return\n\t\t }\n\n\t\t var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n\t\t var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n\t\t for (;;) {\n\t\t if (nextChange == pos) { // Update current marker set\n\t\t spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n\t\t attributes = null;\n\t\t collapsed = null; nextChange = Infinity;\n\t\t var foundBookmarks = [], endStyles = (void 0);\n\t\t for (var j = 0; j < spans.length; ++j) {\n\t\t var sp = spans[j], m = sp.marker;\n\t\t if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n\t\t foundBookmarks.push(m);\n\t\t } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n\t\t if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n\t\t nextChange = sp.to;\n\t\t spanEndStyle = \"\";\n\t\t }\n\t\t if (m.className) { spanStyle += \" \" + m.className; }\n\t\t if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n\t\t if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n\t\t if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n\t\t // support for the old title property\n\t\t // https://github.com/codemirror/CodeMirror/pull/5673\n\t\t if (m.title) { (attributes || (attributes = {})).title = m.title; }\n\t\t if (m.attributes) {\n\t\t for (var attr in m.attributes)\n\t\t { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n\t\t }\n\t\t if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n\t\t { collapsed = sp; }\n\t\t } else if (sp.from > pos && nextChange > sp.from) {\n\t\t nextChange = sp.from;\n\t\t }\n\t\t }\n\t\t if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n\t\t { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n\t\t if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n\t\t { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n\t\t if (collapsed && (collapsed.from || 0) == pos) {\n\t\t buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n\t\t collapsed.marker, collapsed.from == null);\n\t\t if (collapsed.to == null) { return }\n\t\t if (collapsed.to == pos) { collapsed = false; }\n\t\t }\n\t\t }\n\t\t if (pos >= len) { break }\n\n\t\t var upto = Math.min(len, nextChange);\n\t\t while (true) {\n\t\t if (text) {\n\t\t var end = pos + text.length;\n\t\t if (!collapsed) {\n\t\t var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n\t\t builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n\t\t spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n\t\t }\n\t\t if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n\t\t pos = end;\n\t\t spanStartStyle = \"\";\n\t\t }\n\t\t text = allText.slice(at, at = styles[i++]);\n\t\t style = interpretTokenStyle(styles[i++], builder.cm.options);\n\t\t }\n\t\t }\n\t\t }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\"\n collapsed = null; nextChange = Infinity\n var foundBookmarks = [], endStyles = (void 0)\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m)\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to\n spanEndStyle = \"\"\n }\n if (m.className) { spanStyle += \" \" + m.className }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }\n if (m.title && !title) { title = m.title }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1] } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null)\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange)\n while (true) {\n if (text) {\n var end = pos + text.length\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css)\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end\n spanStartStyle = \"\"\n }\n text = allText.slice(at, at = styles[i++])\n style = interpretTokenStyle(styles[i++], builder.cm.options)\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmark = null;\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmark = m;\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = styleToClass(styles[i++]);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.replacedWith) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return collapsed.marker.find();\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n if (m.title && !title) { title = m.title; }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n}", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i = 1; i < styles.length; i+=2)\n builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));\n return;\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = title = css = \"\";\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [];\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (sp.from <= pos && (sp.to == null || sp.to > pos)) {\n if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = \"\"; }\n if (m.className) spanStyle += \" \" + m.className;\n if (m.css) css = m.css;\n if (m.startStyle && sp.from == pos) spanStartStyle += \" \" + m.startStyle;\n if (m.endStyle && sp.to == nextChange) spanEndStyle += \" \" + m.endStyle;\n if (m.title && !title) title = m.title;\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n collapsed = sp;\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) foundBookmarks.push(m);\n }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) return;\n }\n if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)\n buildCollapsedSpan(builder, 0, foundBookmarks[j]);\n }\n if (pos >= len) break;\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", title, css);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }", "function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans,\n allText = line.text,\n at = 0;\n\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1 += 2) {\n builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1 + 1], builder.cm.options));\n }\n\n return;\n }\n\n var len = allText.length,\n pos = 0,\n i = 1,\n text = \"\",\n style,\n css;\n var nextChange = 0,\n spanStyle,\n spanEndStyle,\n spanStartStyle,\n collapsed,\n attributes;\n\n for (;;) {\n if (nextChange == pos) {\n // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null;\n nextChange = Infinity;\n var foundBookmarks = [],\n endStyles = void 0;\n\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j],\n m = sp.marker;\n\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n\n if (m.className) {\n spanStyle += \" \" + m.className;\n }\n\n if (m.css) {\n css = (css ? css + \";\" : \"\") + m.css;\n }\n\n if (m.startStyle && sp.from == pos) {\n spanStartStyle += \" \" + m.startStyle;\n }\n\n if (m.endStyle && sp.to == nextChange) {\n (endStyles || (endStyles = [])).push(m.endStyle, sp.to);\n } // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n\n\n if (m.title) {\n (attributes || (attributes = {})).title = m.title;\n }\n\n if (m.attributes) {\n for (var attr in m.attributes) {\n (attributes || (attributes = {}))[attr] = m.attributes[attr];\n }\n }\n\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) {\n collapsed = sp;\n }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n\n if (endStyles) {\n for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) {\n if (endStyles[j$1 + 1] == nextChange) {\n spanEndStyle += \" \" + endStyles[j$1];\n }\n }\n }\n\n if (!collapsed || collapsed.from == pos) {\n for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) {\n buildCollapsedSpan(builder, 0, foundBookmarks[j$2]);\n }\n }\n\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, collapsed.marker, collapsed.from == null);\n\n if (collapsed.to == null) {\n return;\n }\n\n if (collapsed.to == pos) {\n collapsed = false;\n }\n }\n }\n\n if (pos >= len) {\n break;\n }\n\n var upto = Math.min(len, nextChange);\n\n while (true) {\n if (text) {\n var end = pos + text.length;\n\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n\n if (end >= upto) {\n text = text.slice(upto - pos);\n pos = upto;\n break;\n }\n\n pos = end;\n spanStartStyle = \"\";\n }\n\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n } // These objects are used to represent the visible (currently drawn)", "function addMarkedSpan(line, span) {\n\t\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t\t span.marker.attachLine(line);\n\t\t }", "function Q(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n\t line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n\t span.marker.attachLine(line);\n\t }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }", "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n }", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]\n span.marker.attachLine(line)\n}", "function addMarkedSpan(line, span) {\r\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\r\n span.marker.attachLine(line);\r\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n}", "function removeMarkedSpan(spans, span) {\n var r;\n\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i] != span) {\n (r || (r = [])).push(spans[i]);\n }\n }\n\n return r;\n } // Add a span to a line.", "markWords(array, index1, index2){\r\n let modArr = [];\r\n array.forEach(function(value, i) {\r\n if (i == index1 || i == index2){\r\n if (i == array.length - 1){\r\n modArr.push(<mark key={i}>{value}</mark>);\r\n }\r\n else{\r\n modArr.push(<span key={i}><mark>{value}</mark>, </span>);\r\n }\r\n }\r\n else{\r\n let val = \"\";\r\n if (i == array.length - 1){\r\n val = value;\r\n }\r\n else{\r\n val = value + \", \"\r\n }\r\n modArr.push(val);\r\n }\r\n });\r\n console.log();\r\n return modArr;\r\n }", "function paintFirstSpanInLine(){\n var oldTop;\n // target = our text\n var $selected = $('#selectme');\n //$selectedArray = $selected.text().split(' ');\n // separate each word into its own span\n $selected.html(\"<span>\" + $selected.text().split(' ').join(\"</span> <span>\") + \"</span>\");\n oldTop = -1;\n $selected.find('span').each(function(){\n var $this = $(this),\n top = $this.position().top;\n if (top > oldTop){\n $this.css(\"color\", \"rgb(0, 255, 180)\");\n oldTop = top;\n }\n });\n}", "function renderSpans(text, spans) {\n if (!spans) {\n return [text];\n }\n if (spans.length > 1000) {\n console.warn(`Not highlighting excessive number of spans to avoid browser hang: ${spans.length}`);\n return [text];\n }\n var out = [];\n var c = 0;\n for (var i = 0; i < spans.length; i += 2) {\n out.push(text.slice(c, c + spans[i]));\n c += spans[i];\n if (i + 1 < spans.length) {\n out.push(createElement('span',\n {className: 'mm', title: 'not present in all failure messages'},\n text.slice(c, c + spans[i+1])));\n c += spans[i + 1];\n }\n }\n return out;\n}", "function insertLineBreaks() {\n var el = d3.select(this);\n var words=d3.select(this).text().split('#');\n \n el.text('');\n \n for (var i = 0; i < words.length; i++) {\n var tspan = el.append('tspan').text(words[i]);\n if (i > 0) {\n tspan.attr('x', 0).attr('dy', '15');\n }\n };\n }" ]
[ "0.66128546", "0.66100127", "0.65788186", "0.65693355", "0.6565026", "0.6565026", "0.65456927", "0.65310436", "0.65214396", "0.6516241", "0.65070486", "0.64916986", "0.64916986", "0.64916986", "0.6460765", "0.6460765", "0.6460765", "0.6459775", "0.6459647", "0.6459492", "0.6459492", "0.6451384", "0.6448003", "0.6448003", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.64446634", "0.6414574", "0.6414574", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6411903", "0.6393469", "0.63081366", "0.6261141", "0.6244841", "0.6244841", "0.6244841", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.622497", "0.62113637", "0.6144652", "0.6144652", "0.61441076", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.613759", "0.60757536", "0.6038767", "0.60241073", "0.60022473", "0.59938765" ]
0.6499411
12
These objects are used to represent the visible (currently drawn) part of the document. A LineView may correspond to multiple logical lines, if those are connected by collapsed ranges.
function LineView(doc, line, lineN) { // The starting line this.line = line; // Continuing lines, if any this.rest = visualLineContinued(line); // Number of logical lines in this visual line this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; this.node = this.text = null; this.hidden = lineIsHidden(doc, line); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line; // Continuing lines, if any\n\n this.rest = visualLineContinued(line); // Number of logical lines in this visual line\n\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n } // Create a range of LineView objects for the given lines.", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n}", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "_calcVisibleLines() {\n this._lines.qtMaxVisible = Math.floor(this._matrixHeight / this._cell.heightMin);\n if (this._lines.qtMaxVisible > 3)\n this._lines.qtMinVisible = 3;\n else\n this._lines.qtMinVisible = 1;\n if (this._lines.qtMaxVisible > this._lines.qtTotal)\n this._lines.qtMaxVisible = this._lines.qtTotal;\n if (this._lines.qtMaxVisible < this._lines.qtVisible && this._lines.qtMaxVisible != 0)\n this._lines.qtVisible = this._lines.qtMaxVisible;\n }", "function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = _lineAtHeight(doc, top),\n to = _lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n\n\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line,\n ensureTo = viewport.ensure.to.line;\n\n if (ensureFrom < from) {\n from = ensureFrom;\n to = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n\n return {\n from: from,\n to: Math.max(to, from + 1)\n };\n } // SCROLLING THINGS INTO VIEW", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\t\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)};\n\t\t }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from)\r\n return {from: ensureFrom,\r\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\r\n if (Math.min(ensureTo, doc.lastLine()) >= to)\r\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\r\n to: ensureTo};\r\n }\r\n return {from: from, to: Math.max(to, from + 1)};\r\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)}\n\t\t }", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array;\n\t\t }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line) {\n return {\n map: lineView.measure.map,\n cache: lineView.measure.cache\n };\n }\n\n for (var i = 0; i < lineView.rest.length; i++) {\n if (lineView.rest[i] == line) {\n return {\n map: lineView.measure.maps[i],\n cache: lineView.measure.caches[i]\n };\n }\n }\n\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) {\n if (lineNo(lineView.rest[i$1]) > lineN) {\n return {\n map: lineView.measure.maps[i$1],\n cache: lineView.measure.caches[i$1],\n before: true\n };\n }\n }\n } // Render a line into the hidden node display.externalMeasured. Used", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array\n\t\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from) {\r\n from = ensureFrom;\r\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\r\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\r\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\r\n to = ensureTo;\r\n }\r\n }\r\n return {from: from, to: Math.max(to, from + 1)}\r\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "get viewportLineBlocks() {\n return this.viewState.viewportLines;\n }", "function buildViewArray(cm, from, to) {\r\n var array = [], nextPos;\r\n for (var pos = from; pos < to; pos = nextPos) {\r\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\r\n nextPos = pos + view.size;\r\n array.push(view);\r\n }\r\n return array;\r\n }" ]
[ "0.7760929", "0.7357687", "0.7357687", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.73421013", "0.7306697", "0.7291144", "0.7291144", "0.7290077", "0.7269108", "0.7269108", "0.7269108", "0.6657288", "0.6441774", "0.6399326", "0.6341864", "0.63160396", "0.63068837", "0.63068837", "0.63068837", "0.62908494", "0.6288782", "0.6287962", "0.62819123", "0.6274909", "0.62693274", "0.62693274", "0.62629044", "0.6253536", "0.6253536", "0.6253536", "0.6253536", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.6252711", "0.625053", "0.625053", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6231075", "0.6202478", "0.6202478", "0.6202478", "0.6202151", "0.6180797" ]
0.7328642
32
Create a range of LineView objects for the given lines.
function buildViewArray(cm, from, to) { var array = [], nextPos; for (var pos = from; pos < to; pos = nextPos) { var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); nextPos = pos + view.size; array.push(view); } return array }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line; // Continuing lines, if any\n\n this.rest = visualLineContinued(line); // Number of logical lines in this visual line\n\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n } // Create a range of LineView objects for the given lines.", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array;\n }", "function createLines() {\n var moesLine = new self.StoogeLine();\n moesLine.set('Scene', 1);\n moesLine.set('SetID', self.indoorSet.get('id'));\n moesLine.set('StoogeID', self.moe.get('id'));\n moesLine.set('Line', 'To be or not to be?');\n var larrysLine = new self.StoogeLine();\n larrysLine.set('Scene', 2);\n larrysLine.set('SetID', self.desertSet.get('id'));\n larrysLine.set('StoogeID', self.larry.get('id'));\n larrysLine.set('Line', 'That is the question!');\n spec.integrationStore.putModel(moesLine, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n spec.integrationStore.putModel(larrysLine, function (model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n } else {\n createView();\n }\n });\n }\n });\n }", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array;\n\t\t }", "function buildViewArray(cm, from, to) {\r\n var array = [], nextPos;\r\n for (var pos = from; pos < to; pos = nextPos) {\r\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\r\n nextPos = pos + view.size;\r\n array.push(view);\r\n }\r\n return array;\r\n }", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array\n\t\t }", "function buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)\n nextPos = pos + view.size\n array.push(view)\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "function buildViewArray(cm, from, to) {\n\t var array = [], nextPos;\n\t for (var pos = from; pos < to; pos = nextPos) {\n\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t nextPos = pos + view.size;\n\t array.push(view);\n\t }\n\t return array;\n\t }", "function buildViewArray(cm, from, to) {\r\n var array = [], nextPos;\r\n for (var pos = from; pos < to; pos = nextPos) {\r\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\r\n nextPos = pos + view.size;\r\n array.push(view);\r\n }\r\n return array\r\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n }", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n}", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function addLines(lines) {\n for (var j=0; j<lines.length;j++) {\n // create new line\n var linechart = newLine(lines[j].id)\n // attach data\n linechart\n .data(lines[j].values)\n // refresh\n linechart(); \n }\n }", "function drawForLine(from, to, line) {\n let top = 1e9, bottom = -1e9, horizontal = [];\n function addSpan(from, fromOpen, to, toOpen, dir) {\n // Passing 2/-2 is a kludge to force the view to return\n // coordinates on the proper side of block widgets, since\n // normalizing the side there, though appropriate for most\n // coordsAtPos queries, would break selection drawing.\n let fromCoords = view.coordsAtPos(from, (from == line.to ? -2 : 2));\n let toCoords = view.coordsAtPos(to, (to == line.from ? 2 : -2));\n if (!fromCoords || !toCoords)\n return;\n top = Math.min(fromCoords.top, toCoords.top, top);\n bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);\n if (dir == exports.Direction.LTR)\n horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);\n else\n horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);\n }\n let start = from !== null && from !== void 0 ? from : line.from, end = to !== null && to !== void 0 ? to : line.to;\n // Split the range by visible range and document line\n for (let r of view.visibleRanges)\n if (r.to > start && r.from < end) {\n for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end);;) {\n let docLine = view.state.doc.lineAt(pos);\n for (let span of view.bidiSpans(docLine)) {\n let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;\n if (spanFrom >= endPos)\n break;\n if (spanTo > pos)\n addSpan(Math.max(spanFrom, pos), from == null && spanFrom <= start, Math.min(spanTo, endPos), to == null && spanTo >= end, span.dir);\n }\n pos = docLine.to + 1;\n if (pos >= endPos)\n break;\n }\n }\n if (horizontal.length == 0)\n addSpan(start, from == null, end, to == null, view.textDirection);\n return { top, bottom, horizontal };\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\r\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\r\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\r\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\r\n }" ]
[ "0.7717119", "0.6600235", "0.6600235", "0.6600235", "0.6600235", "0.6600235", "0.6600235", "0.6600235", "0.6600235", "0.65828633", "0.6580781", "0.6575102", "0.65602607", "0.65524656", "0.65524656", "0.65368026", "0.65368026", "0.65368026", "0.6533305", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.65162045", "0.64710057", "0.64710057", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452998", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6452009", "0.6416754", "0.6411178", "0.6385614", "0.6385614", "0.6385614", "0.638472", "0.638472", "0.6362688", "0.632729", "0.62821835", "0.62821835", "0.62821835", "0.62821835", "0.62821835", "0.62821835", "0.625045" ]
0.6588617
24
Often, we want to signal events at a point where we are in the middle of some work, but don't want the handler to start calling other methods on the editor, which might be in an inconsistent state or simply not expect any other events to happen. signalLater looks whether there are any handlers, and schedules them to be executed when the last operation ends, or, if no operation is active, when a timeout fires.
function signalLater(emitter, type /*, values...*/) { var arr = getHandlers(emitter, type); if (!arr.length) { return } var args = Array.prototype.slice.call(arguments, 2), list; if (operationGroup) { list = operationGroup.delayedCallbacks; } else if (orphanDelayedCallbacks) { list = orphanDelayedCallbacks; } else { list = orphanDelayedCallbacks = []; setTimeout(fireOrphanDelayed, 0); } var loop = function ( i ) { list.push(function () { return arr[i].apply(null, args); }); }; for (var i = 0; i < arr.length; ++i) loop( i ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signalLater(emitter, type /*, values...*/) {\n\t\t var arr = getHandlers(emitter, type, false)\n\t\t if (!arr.length) return;\n\t\t var args = Array.prototype.slice.call(arguments, 2), list;\n\t\t if (operationGroup) {\n\t\t list = operationGroup.delayedCallbacks;\n\t\t } else if (orphanDelayedCallbacks) {\n\t\t list = orphanDelayedCallbacks;\n\t\t } else {\n\t\t list = orphanDelayedCallbacks = [];\n\t\t setTimeout(fireOrphanDelayed, 0);\n\t\t }\n\t\t function bnd(f) {return function(){f.apply(null, args);};};\n\t\t for (var i = 0; i < arr.length; ++i)\n\t\t list.push(bnd(arr[i]));\n\t\t }", "function signalLater(emitter, type /*, values...*/) {\n\t var arr = getHandlers(emitter, type, false)\n\t if (!arr.length) return;\n\t var args = Array.prototype.slice.call(arguments, 2), list;\n\t if (operationGroup) {\n\t list = operationGroup.delayedCallbacks;\n\t } else if (orphanDelayedCallbacks) {\n\t list = orphanDelayedCallbacks;\n\t } else {\n\t list = orphanDelayedCallbacks = [];\n\t setTimeout(fireOrphanDelayed, 0);\n\t }\n\t function bnd(f) {return function(){f.apply(null, args);};};\n\t for (var i = 0; i < arr.length; ++i)\n\t list.push(bnd(arr[i]));\n\t }", "function signalLater(emitter, type /*, values...*/) {\n\t var arr = getHandlers(emitter, type, false)\n\t if (!arr.length) return;\n\t var args = Array.prototype.slice.call(arguments, 2), list;\n\t if (operationGroup) {\n\t list = operationGroup.delayedCallbacks;\n\t } else if (orphanDelayedCallbacks) {\n\t list = orphanDelayedCallbacks;\n\t } else {\n\t list = orphanDelayedCallbacks = [];\n\t setTimeout(fireOrphanDelayed, 0);\n\t }\n\t function bnd(f) {return function(){f.apply(null, args);};};\n\t for (var i = 0; i < arr.length; ++i)\n\t list.push(bnd(arr[i]));\n\t }", "function signalLater(emitter, type /*, values...*/) {\n\t var arr = getHandlers(emitter, type, false)\n\t if (!arr.length) return;\n\t var args = Array.prototype.slice.call(arguments, 2), list;\n\t if (operationGroup) {\n\t list = operationGroup.delayedCallbacks;\n\t } else if (orphanDelayedCallbacks) {\n\t list = orphanDelayedCallbacks;\n\t } else {\n\t list = orphanDelayedCallbacks = [];\n\t setTimeout(fireOrphanDelayed, 0);\n\t }\n\t function bnd(f) {return function(){f.apply(null, args);};};\n\t for (var i = 0; i < arr.length; ++i)\n\t list.push(bnd(arr[i]));\n\t }", "function signalLater(emitter, type /*, values...*/) {\n\t\t var arr = getHandlers(emitter, type);\n\t\t if (!arr.length) { return }\n\t\t var args = Array.prototype.slice.call(arguments, 2), list;\n\t\t if (operationGroup) {\n\t\t list = operationGroup.delayedCallbacks;\n\t\t } else if (orphanDelayedCallbacks) {\n\t\t list = orphanDelayedCallbacks;\n\t\t } else {\n\t\t list = orphanDelayedCallbacks = [];\n\t\t setTimeout(fireOrphanDelayed, 0);\n\t\t }\n\t\t var loop = function ( i ) {\n\t\t list.push(function () { return arr[i].apply(null, args); });\n\t\t };\n\n\t\t for (var i = 0; i < arr.length; ++i)\n\t\t loop( i );\n\t\t }", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type, false)\n if (!arr.length) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type /*, values...*/) {\r\n var arr = emitter._handlers && emitter._handlers[type];\r\n if (!arr) return;\r\n var args = Array.prototype.slice.call(arguments, 2), list;\r\n if (operationGroup) {\r\n list = operationGroup.delayedCallbacks;\r\n } else if (orphanDelayedCallbacks) {\r\n list = orphanDelayedCallbacks;\r\n } else {\r\n list = orphanDelayedCallbacks = [];\r\n setTimeout(fireOrphanDelayed, 0);\r\n }\r\n function bnd(f) {return function(){f.apply(null, args);};};\r\n for (var i = 0; i < arr.length; ++i)\r\n list.push(bnd(arr[i]));\r\n }", "function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type /*, values...*/) {\n var arr = emitter._handlers && emitter._handlers[type];\n if (!arr) return;\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n function bnd(f) {return function(){f.apply(null, args);};};\n for (var i = 0; i < arr.length; ++i)\n list.push(bnd(arr[i]));\n }", "function signalLater(emitter, type\n /*, values...*/\n ) {\n var arr = getHandlers(emitter, type);\n\n if (!arr.length) {\n return;\n }\n\n var args = Array.prototype.slice.call(arguments, 2),\n list;\n\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n\n var loop = function loop(i) {\n list.push(function () {\n return arr[i].apply(null, args);\n });\n };\n\n for (var i = 0; i < arr.length; ++i) {\n loop(i);\n }\n }", "function signalLater(emitter, type /*, values...*/) {\r\n var arr = getHandlers(emitter, type);\r\n if (!arr.length) { return }\r\n var args = Array.prototype.slice.call(arguments, 2), list;\r\n if (operationGroup) {\r\n list = operationGroup.delayedCallbacks;\r\n } else if (orphanDelayedCallbacks) {\r\n list = orphanDelayedCallbacks;\r\n } else {\r\n list = orphanDelayedCallbacks = [];\r\n setTimeout(fireOrphanDelayed, 0);\r\n }\r\n var loop = function ( i ) {\r\n list.push(function () { return arr[i].apply(null, args); });\r\n };\r\n\r\n for (var i = 0; i < arr.length; ++i)\r\n loop( i );\r\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type)\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list\n if (operationGroup) {\n list = operationGroup.delayedCallbacks\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks\n } else {\n list = orphanDelayedCallbacks = []\n setTimeout(fireOrphanDelayed, 0)\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); })\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n}", "afterHandlers (event) {\n\n }", "function _setEmergencyHandlers() {\n $( '.side-slider__advanced__button.flush-db' ).on( 'click', () => {\n gui.confirm( {\n msg: t( 'confirm.deleteall.msg' ),\n heading: t( 'confirm.deleteall.heading' )\n }, {\n posButton: t( 'confirm.deleteall.posButton' ),\n } )\n .then( confirmed => {\n if ( !confirmed ) {\n throw new Error( 'Cancelled by user' );\n }\n return store.flush();\n } )\n .then( () => {\n location.reload();\n } )\n .catch( () => {} );\n } );\n}", "function clearNotifyHandlers() {\n notTicked.length = 0;\n notTicked = undefined;\n }", "function updateLater() {\n\t\t\t\t\t\t// save the laterTimeoutId for canceling\n\t\t\t\t\t\tlaterTimeoutId = $timeout(function() {\n\t\t\t\t\t\t\tcurrentIndex++;\n\t\t\t\t\t\t\t$scope.$digest();\n\t\t\t\t\t\t\tupdateLater(); // schedule another update\n\t\t\t\t\t\t}, 5000);\n\t\t\t\t\t}", "function startLater() {\n Q.delay(80).then(start)\n}", "function shadowTree_signalASlotChange(slot) {\n /**\n * 1. Append slot to slot’s relevant agent’s signal slots.\n * 2. Queue a mutation observer microtask.\n */\n var window = DOMImpl_1.dom.window;\n window._signalSlots.add(slot);\n MutationObserverAlgorithm_1.observer_queueAMutationObserverMicrotask();\n}", "function emit(sender, signal, args) {\n var list = senderMap.get(sender);\n if (!list) {\n return;\n }\n list.refs++;\n try {\n var dirty = invokeList(list, sender, signal, args);\n }\n finally {\n list.refs--;\n }\n if (dirty && list.refs === 0) {\n cleanList(list);\n }\n}", "afterHandling() {}", "function doLaterAlbuns(defer, what) {\n $timeout(function() {\n defer[what]();\n }, 900);\n }", "signalSolved()\n {\n this.solved = true;\n this.trigger('solved');\n return this;\n }", "function somethingChanged()\r\n\t\t{\r\n\t\t\tif (timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\ttimer = setTimeout( function() {\r\n\t\t\t\ttimer = 0;\r\n\t\t\t\teditor.fire( 'change' );\r\n\t\t\t}, editor.config.minimumChangeMilliseconds || 100);\r\n\t\t}", "function Signal() {\n\n this.listenerBoxes = [];\n\n this._valueClasses = null;\n\n this.listenersNeedCloning = false;\n\n this.setValueClasses(arguments);\n }", "function addHandlers() {\n notesPanel = $('#georapbox-notes-panel');\n\n notesPanel\n .on('click', '.close', togglePanel)\n .on('click', '.georapbox-notes-delete', function (e) {\n e.preventDefault();\n\n var tableRow = $(this).parents('tr');\n var id = tableRow.find('.id').html();\n var date = tableRow.find('.labelIcon').html();\n var note = tableRow.find('.note textarea').val();\n\n id = parseInt(id, 10);\n\n showDeleteNoteDialog(function () {\n deleteNote(id);\n localStorage.removeItem(STORAGE_KEY);\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n renderNotes();\n });\n })\n .on('click', '.georapbox-notes-edit', function () {\n var tableRow = $(this).parents('tr');\n var textArea = tableRow.find('textarea');\n var textareaTd = tableRow.find('.note');\n var previewTd = tableRow.find('.preview');\n\n textareaTd.show();\n previewTd.hide();\n makeEditable(textArea);\n })\n .on('focusout', 'td.note textarea', function () {\n var self = $(this);\n var noteValue, noteMarkup, noteId;\n var markupArea = self.parent().parent().find('article');\n\n if (self.hasClass('editable')) {\n noteValue = self.val();\n noteId = parseInt(self.parent().parent().find('td.id').html(), 10);\n makeReadOnly(self);\n previewMarkDown(markupArea, self.val());\n noteMarkup = self.parent().next().find('article').html();\n updateNote(noteId, noteValue, noteMarkup);\n localStorage.removeItem(STORAGE_KEY);\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n renderNotes();\n }\n })\n .on('click', '[data-id=\"georapbox-notes-new-btn\"]', showNewNoteModal)\n .on('click', '[data-id=\"georapbox-notes-import-btn\"]', showImportNotesDialog)\n .on('click', '.georapbox-notes-options-handler', function (e) {\n var options = $(this).next();\n\n e.preventDefault();\n\n if (options.is(':visible')) {\n $(this).removeClass('active');\n options.hide();\n } else {\n $(this).addClass('active');\n options.show();\n }\n })\n .on('click', '.georapbox-notes-extract', function (e) {\n var textareaVal = $(this).parents('tr').find('td.note textarea').val();\n e.preventDefault();\n openFile(textareaVal, '.md');\n })\n .on('click', '[data-id=\"georapbox-notes-export-btn\"]', function (e) {\n var notes = storageGetObj(localStorage, STORAGE_KEY) || [];\n\n e.preventDefault();\n\n try {\n openFile(JSON.stringify(notes, null, 2), '.json');\n } catch (err) {\n console.error(err);\n }\n })\n .on('dragstart', 'tr', reorder.dragndrop.handleDragStart)\n .on('dragenter', 'tr', reorder.dragndrop.handleDragEnter)\n .on('dragover', 'tr', reorder.dragndrop.handleDragOver)\n .on('dragleave', 'tr', reorder.dragndrop.handleDragLeave)\n .on('drop', 'tr', reorder.dragndrop.handleDrop)\n .on('dragend', 'tr', function () {\n var rows = notesPanel.find('tr');\n\n reorder.dragndrop.handleDragEnd(rows);\n\n _notes = [];\n\n rows.each(function () {\n var row = $(this);\n var id = row.find('td.id').html();\n var date = row.find('td.date .labelIcon').html();\n var note = row.find('td.note textarea').val();\n var noteMarkup = row.find('td.preview article').html();\n\n _notes.push({\n id: parseInt(id, 10),\n date: date,\n note: note,\n noteMarkup: noteMarkup\n });\n });\n\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n });\n\n noteIcon.on('click', togglePanel).appendTo('#main-toolbar .buttons');\n }", "function somethingChanged() {\r\n\t\t\tif (timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\ttimer = setTimeout(function() {\r\n\t\t\t\ttimer = 0;\r\n\t\t\t\teditor.fire('changing');\r\n\t\t\t}, editor.config.minimumChangeMilliseconds || 100);\r\n\t\t}", "function onEventHandlersChanged() {\n if ((eventHandlers.length > 0) && !eventSocketManager.isStarted) {\n eventSocketManager.start();\n } else if ((eventHandlers.length == 0) && eventSocketManager.isStarted) {\n eventSocketManager.stop();\n }\n }", "function Signal() { }", "function updateLater() {\n // save the timeoutId for canceling\n timeoutId = $timeout(function() {\n updateTime(); // update DOM\n updateLater(); // schedule another update\n }, 1000);\n }", "internalSignalChanged(signal) {\n if (signal.id == this.publishedSignalId) {\n if (this.ready) {\n this.clock++;\n let clocks = new Map();\n if (this.amSource()) {\n clocks.set(this.ownType.tagVal, this.clock);\n }\n else {\n this.lastMatch.forEach((pv) => {\n pv.sClocks.forEach((clockVal, source) => {\n clocks.set(source, clockVal);\n });\n });\n }\n this.lastProp = new this.PropagationValue(this.ownType, signal, clocks, this.clock);\n this.sendToAllChildren(() => {\n this.childRefs.forEach((child) => {\n child.prePropagation(this.lastProp);\n //child.prePropagation(this.ownType.tagVal,signal.getState(),JSON.stringify([...clocks]),this.clock,true)\n });\n });\n }\n else {\n let sigClone = this.libs.clone(signal);\n this.readyListeners.push(() => {\n this.internalSignalChanged(sigClone);\n });\n }\n }\n }", "function updateLater() {\n // save the timeoutId for canceling\n timeoutId = $timeout(function () {\n updateTime(); // update DOM\n updateLater(); // schedule another update\n }, 1000);\n }", "function updateLater() {\n // save the timeoutId for canceling\n timeoutId = $timeout(function() {\n updateTime();\n updateLater(); // schedule another update\n }, 1000);\n }", "function updateLater() {\n \t\t\t// save the timeoutId for canceling\n \t\t\ttimeoutId = $timeout(function() {\n \t\t\t\tupdateTime(); // update DOM\n \t\t\t\tupdateLater(); // schedule another update\n \t\t\t}, 1000);\n \t\t}", "function registerNotificationHandlers() {\n notificationHandlersRegistered = true;\n\n // Attach an onClicked event handler.\n paragon.notifications.onClicked.addListener(function (notificationId) {\n // Bring the main Symphony window to the foreground.\n symphony.app.window.showWindow(\"main\");\n\n // Extract the callback for the current notification.\n var cb = notificationIds[notificationId];\n if (cb) {\n // We found stored callback info, execute it.\n execCallback(cb.method, cb.args);\n }\n });\n\n // Attach an onClosed event handler.\n paragon.notifications.onClosed.addListener(function (notificationId) {\n // Remove the callback info for the notification that has closed.\n delete notificationIds[notificationId];\n });\n }", "function updateLater() {\n\t // save the timeoutId for canceling\n\t timeoutId = $timeout(function() {\n\t updateTime(); // update DOM\n\t updateLater(); // schedule another update\n\t }, 1000);\n\t }", "async function setupQueueFunctionHandlers() {\n // The queue function panel should be modified properly\n // when the active instance is changed to a different instance selection.\n panel.elements.instanceTable.on(\"click\", \".instance-select\", updateQueueFunctions);\n\n // Searching for a function should modify the content to only\n // display functions that match based on name.\n panel.elements.customSearch.keyup(function() {\n // Regenerate all available queueables to match the search\n // terms provided.\n generateAvailableQueueables($(this).val());\n });\n\n // Make sure our custom duration type buttons all properly update\n // the main duration type button's text.\n panel.elements.customDurationSeconds.click(function() {\n // Update main dropdown button to use proper seconds text.\n panel.elements.customDurationType.text(\"Seconds\");\n });\n panel.elements.customDurationMinutes.click(function() {\n // Update main dropdown button to use proper minutes text.\n panel.elements.customDurationType.text(\"Minutes\");\n });\n panel.elements.customDurationHours.click(function() {\n // Update main dropdown button to use proper hours text.\n panel.elements.customDurationType.text(\"Hours\");\n });\n\n\n // Setup the listeners that deal with selecting a certain duration\n // amount for the queued function, \"now\" or \"custom\" can be chosen.\n panel.elements.customNow.click(function() {\n // Make sure the custom now button is set to a disabled state.\n // and the custom custom button is enabled.\n panel.elements.customNow.attr(\"disabled\", true);\n panel.elements.customCustom.attr(\"disabled\", false);\n\n // Make sure we modify the \"Custom\" button to use the\n // proper border radius, since no additional options are present now.\n panel.elements.customCustom.css({\n \"border-top-right-radius\": \"5px\",\n \"border-bottom-right-radius\": \"5px\"\n });\n\n // Hide any of our custom custom content that is only\n // enabled when the custom button is enabled.\n panel.elements.customDuration.attr(\"disabled\", true).fadeOut(100);\n panel.elements.customDurationType.attr(\"disabled\", true).fadeOut(100);\n });\n\n // Setup the listeners that deal with selecting the custom option\n // for choosing queued function durations.\n panel.elements.customCustom.click(function() {\n // Make sure the custom custom button is set to a disabled state\n // and the custom now button is enabled.\n panel.elements.customCustom.attr(\"disabled\", true);\n panel.elements.customNow.attr(\"disabled\", false);\n\n // Make sure we modify the \"custom\" button to now use\n // proper border radius.\n panel.elements.customCustom.css({\n \"border-top-right-radius\": \"0\",\n \"border-bottom-right-radius\": \"0\"\n });\n\n // Display the custom content that is only enabled when\n // the custom button is enabled.\n panel.elements.customDuration.attr(\"disabled\", false).fadeIn(100);\n panel.elements.customDurationType.attr(\"disabled\", false).fadeIn(100);\n });\n\n // Clicking on the queue flush button should attempt to clear\n // out all functions currently queued for the selected instance.\n panel.elements.flushQueue.click(function() {\n // Collect some information before deciding how to\n // deal with the queue flushing.\n let instance = activeInstance();\n let name = activeInstanceName();\n let state = activeInstanceStatus();\n\n // We should only even try to flush a queue if\n // the selected instance is running.\n if (state === \"stopped\") {\n // Instance selected is stopped, notify user about\n // inability to handle flushing.\n generateToast(\"Flush Queue\", `Queued functions cannot be flushed while <em>${name}</em> is stopped.`, \"warning\");\n } else {\n // Instance selected is running or paused, generate a warning if no queued\n // functions are even present, or run functionality to flush.\n if (panel.elements.queuedTableBody.find(\"tr\").length === 0) {\n // No queued functions.\n generateToast(\"Flush Queue\", `No functions are currently queued up to execute against <em>${name}</em>.`, \"warning\");\n } else {\n // Some queued functions are present, let's go ahead and remove them.\n eel.dashboard_queue_function_flush(instance)();\n }\n }\n\n });\n\n // Clicking on any of the function buttons should attempt to\n // queue up the function for the instance that's selected.\n panel.elements.queueablesContent.on(\"click\", \".queue-function\", function() {\n // Collect some information before deciding how to\n // treat the potential queued function.\n let _function = $(this).data(\"function\");\n let formatted = $(this).data(\"formatted\").toLowerCase();\n // Instance information.\n let instance = activeInstance();\n let name = activeInstanceName();\n let state = activeInstanceStatus();\n\n // We should only ever actually send the queue function\n // signal if the selected instance is running.\n if (state === \"stopped\") {\n // Instance selected is stopped, generate a toast letting\n // the user know that they can not queue functions yet.\n generateToast(\"Queue Function\", `Function: <strong>${formatted}</strong> cannot be queued while <em>${name}</em> is stopped.`, \"warning\");\n } else {\n let duration = 0;\n let durationType = panel.elements.customDurationType.text();\n\n // We need to derive some information about what kind of duration\n // or wait period will be used for the function.\n if (panel.elements.customCustom.is(\":disabled\")) {\n // A custom duration is being used. Make sure the user\n // has entered a custom value of some sort.\n if (panel.elements.customDuration.val()) {\n duration = panel.elements.customDuration.val();\n } else {\n return generateToast(\"Queue Function\", `You must enter a valid <strong>duration</strong> if the <em>custom</em> duration button is selected.`, \"danger\");\n }\n }\n\n // The instance selected is either running or paused,\n // we can go ahead and queue up our function.\n // Messages and modifications to the content are handled\n // by our websockets, so we can fire and forget this function.\n eel.dashboard_queue_function(instance, _function, duration, durationType)();\n }\n });\n }", "function SignalDispatcher() {\n return _super.call(this) || this;\n }", "_processDelayedTriggers() {\n if (this.isDestroyed) return;\n let hasChange = false;\n this._delayedTriggers = this._delayedTriggers.filter((evt) => {\n if (evt[0] === 'message-type-model:change' && !hasChange) {\n hasChange = true;\n return true;\n } else if (evt[0] === 'message-type-model:change') {\n return false;\n } else {\n return true;\n }\n });\n super._processDelayedTriggers();\n }", "function T(e,t,n){Q.reference.addEventListener(e,t),n.push({eventType:e,handler:t})}", "function wrapEventHandler(externalHandler) {\n return function (instance) {\n externalHandler(editor);\n };\n }", "handleTimer() {\n this.setTimerInterrupt(true);\n }", "constructor(options) {\n this._cleared = new Signal(this);\n this._disposed = new Signal(this);\n this._editor = null;\n this._inspected = new Signal(this);\n this._isDisposed = false;\n this._pending = 0;\n this._standby = true;\n this._connector = options.connector;\n this._rendermime = options.rendermime;\n this._debouncer = new Debouncer(this.onEditorChange.bind(this), 250);\n }", "function terminate() {\n\tt.murder(eventHandlers.cb);\n}", "function clearNextQueuedFunction () {\n if(bto) {\n clearTimeout(bto);\n bto = null; }\n }", "handlerWillAdd (event, when, handler) {\n\n }", "function Signal() {\n /**\n * @type Array.<SignalBinding>\n * @private\n */\n this._bindings = [];\n this._prevParams = null;\n\n // enforce dispatch to aways work on same context (#47)\n var self = this;\n this.dispatch = function(){\n Signal.prototype.dispatch.apply(self, arguments);\n };\n }", "function ckEditorContentChanged() {\r\n if (timer)\r\n return;\r\n\r\n timer = setTimeout(function() {\r\n timer = 0;\r\n self.fireEvent('contentChanged', self);\r\n }, 100);\r\n }", "function notify(){\n var l = onChangeQueue.length;\n\n while(l--){\n try{\n onChangeQueue[l](service.current);\n }catch(err){\n onChangeQueue.splice(l, 1);\n }\n }\n }", "static get none() {\n return new AbortSignal();\n }", "static get none() {\n return new AbortSignal();\n }", "static get none() {\n return new AbortSignal();\n }", "function Signal() {\n var subs = [];\n return {\n subscribe: function subscribe(cb) {\n subs.push(cb);\n },\n unsubscribe: function unsubscribe(cb) {\n var index = subs.indexOf(cb);\n\n if (index > -1) {\n subs.splice(index, 1);\n }\n },\n abort: function abort() {\n var tmp = [].concat(subs);\n subs.length = 0;\n tmp.forEach(function (cb) {\n try {\n cb();\n } catch (err) {\n logger.error('abort', err);\n }\n });\n }\n };\n}", "function sayHiLater(anyFunctionReference)\n{\n // simulate some code running \n // takes some time ...\n // and more time ...\n anyFunctionReference();\n}", "function Signal() {\n /**\n * @type Array.<SignalBinding>\n * @private\n */\n this._bindings = [];\n this._prevParams = null;\n\n // enforce dispatch to aways work on same context (#47)\n var self = this;\n this.dispatch = function () {\n Signal.prototype.dispatch.apply(self, arguments);\n };\n }", "function y(t){if(null!=t&&null!=t._parent)for(const e in t._handlers)t._parent.removeListener(e,t._handlers[e])}", "function ir(e,t,a,n){var r=e.history,f=n&&n.origin;\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n a==r.lastSelOp||f&&r.lastSelOrigin==f&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==f||or(e,f,p(r.done),t))?r.done[r.done.length-1]=t:sr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=f,r.lastSelOp=a,n&&!1!==n.clearRedo&&nr(r.undone)}", "function _registerEventHandler() {\n\t\t$.$TASMA.find('.button.new').on('click', TaskManager.add);\n\t\t$.$TASMA.find('.tasks-list').on('click', '.button.remove', TaskManager.remove);\n\t\t$.$TASMA.find('.button.remove-all').on('click', TaskManager.removeAll);\n\t\t$.$TASMA.find('.button.save').on('click', TaskManager.save);\n\t\t$.$TASMA.find('.button.cancel').on('click', TaskManager.cancel);\n\t}", "_handleAnyTextareaChanges() {\n const oldValue = this._textarea.value;\n setTimeout(() => {\n // Ignore if a composition has started since the timeout\n if (!this._isComposing) {\n const newValue = this._textarea.value;\n const diff = newValue.replace(oldValue, '');\n if (diff.length > 0) {\n this._dataAlreadySent = diff;\n this._coreService.triggerDataEvent(diff, true);\n }\n }\n }, 0);\n }", "function abortSignal(signal) {\n if (abortedFlags.get(signal) !== false) {\n return;\n }\n abortedFlags.set(signal, true);\n signal.dispatchEvent({ type: \"abort\" });\n}", "function abortSignal(signal) {\n if (abortedFlags.get(signal) !== false) {\n return;\n }\n abortedFlags.set(signal, true);\n signal.dispatchEvent({ type: \"abort\" });\n}", "function eventHandlersOnce() {\n\tif (globalDebug) {console.group(\"Event Handlers Once\");}\n\n\tmenuTrigger();\n\n\tif (globalDebug) {console.groupEnd();}\n}", "function handleEarlyInteraction() {\n clearTimeout(tId);\n cleanup();\n }", "function FP_RMSGB_PRIVATE_Submit(QueuedObject)\n//#else\n//# static function FP_RMSGB_PRIVATE_Submit ( QueuedObject )\n//#endif \n{\n var thisObject = QueuedObject.thisObject;\n var strEvent = QueuedObject.strEvent;\n \n if ((strEvent == \"CONFIRMED\") || (QueuedObject.flaguSignalCanceled)) VF_SY506_PRIVATE_HandleEvent(thisObject, strEvent);\n}", "function onEventTimer() {\n triggerEvents(inbandEvents);\n triggerEvents(inlineEvents);\n removeEvents();\n }", "setSignal(signal) {\n this.signal = signal;\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}" ]
[ "0.6554211", "0.64453864", "0.64453864", "0.64453864", "0.6413596", "0.64093375", "0.62302804", "0.6220109", "0.6220109", "0.6220109", "0.6220109", "0.6220109", "0.6048615", "0.60203564", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.6013591", "0.60090977", "0.60090977", "0.5096462", "0.4568947", "0.45465416", "0.45205972", "0.44782802", "0.44594532", "0.4449275", "0.4397897", "0.43962827", "0.43734676", "0.43732667", "0.43678492", "0.43562448", "0.43318558", "0.4313008", "0.42997205", "0.42709923", "0.42595136", "0.4255116", "0.4254913", "0.4230653", "0.4229143", "0.42247507", "0.42227006", "0.41925505", "0.41921175", "0.41769725", "0.41644102", "0.41428706", "0.41280675", "0.41215047", "0.4114243", "0.41095835", "0.41049272", "0.4099984", "0.40893966", "0.408283", "0.408283", "0.408283", "0.4082448", "0.40805674", "0.40805274", "0.4077982", "0.40659955", "0.40629295", "0.40629286", "0.4058616", "0.4058616", "0.40522432", "0.4047971", "0.4038365", "0.40376893", "0.40339482", "0.40121672", "0.40121672", "0.40121672", "0.40121672" ]
0.615517
25
When an aspect of a line changes, a string is added to lineView.changes. This updates the relevant part of the line's DOM structure.
function updateLineForChanges(cm, lineView, lineN, dims) { for (var j = 0; j < lineView.changes.length; j++) { var type = lineView.changes[j]; if (type == "text") { updateLineText(cm, lineView); } else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } else if (type == "class") { updateLineClasses(cm, lineView); } else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } } lineView.changes = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") updateLineText(cm, lineView);\n\t\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t\t else if (type == \"class\") updateLineClasses(lineView);\n\t\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t\t }\n\t\t lineView.changes = null;\n\t\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") { updateLineText(cm, lineView); }\n\t\t else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n\t\t else if (type == \"class\") { updateLineClasses(cm, lineView); }\n\t\t else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n\t\t }\n\t\t lineView.changes = null;\n\t\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n\n if (type == \"text\") {\n updateLineText(cm, lineView);\n } else if (type == \"gutter\") {\n updateLineGutter(cm, lineView, lineN, dims);\n } else if (type == \"class\") {\n updateLineClasses(cm, lineView);\n } else if (type == \"widget\") {\n updateLineWidgets(cm, lineView, dims);\n }\n }\n\n lineView.changes = null;\n } // Lines with gutter elements, widgets or a background class need to", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\r\n for (var j = 0; j < lineView.changes.length; j++) {\r\n var type = lineView.changes[j];\r\n if (type == \"text\") updateLineText(cm, lineView);\r\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\r\n else if (type == \"class\") updateLineClasses(lineView);\r\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\r\n }\r\n lineView.changes = null;\r\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(cm, lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\r\n for (var j = 0; j < lineView.changes.length; j++) {\r\n var type = lineView.changes[j];\r\n if (type == \"text\") { updateLineText(cm, lineView); }\r\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\r\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\r\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\r\n }\r\n lineView.changes = null;\r\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n\n if (lineView.text == lineView.node) {\n lineView.node = built.pre;\n }\n\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(cm, lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n}", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) { lineView.node = built.pre; }\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(cm, lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(cm, lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) lineView.node = built.pre;\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t display.externalMeasured = null;\n\t\t\n\t\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) return;\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) arr.push(type);\n\t\t }", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t { display.externalMeasured = null; }\n\n\t\t if (line < display.viewFrom || line >= display.viewTo) { return }\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) { return }\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) { arr.push(type); }\n\t\t }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }" ]
[ "0.763215", "0.7629618", "0.76102537", "0.76102537", "0.76102537", "0.7600088", "0.7600088", "0.7600088", "0.7600088", "0.7600088", "0.7600088", "0.7596398", "0.7595506", "0.7595506", "0.7583259", "0.75558984", "0.75515914", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.75047183", "0.7480335", "0.70524156", "0.70225304", "0.7014686", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7010554", "0.7008914", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7006375", "0.7005238", "0.69955885", "0.6994049", "0.6994049", "0.6994049", "0.6994049", "0.6994049", "0.6994049", "0.6994049", "0.6994049", "0.6991837", "0.6991837", "0.6991837", "0.6990097", "0.6979463", "0.6974144", "0.69623524", "0.69623524", "0.69623524", "0.69623524", "0.69623524", "0.69623524", "0.69623524" ]
0.75885326
27
Lines with gutter elements, widgets or a background class need to be wrapped, and have the extra elements added to the wrapper div
function ensureLineWrapped(lineView) { if (lineView.node == lineView.text) { lineView.node = elt("div", null, null, "position: relative"); if (lineView.text.parentNode) { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } lineView.node.appendChild(lineView.text); if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } } return lineView.node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}", "function Rn(e){var a=e.display.gutters,r=e.options.gutters;t(a);for(var f=0;f<r.length;++f){var o=r[f],i=a.appendChild(n(\"div\",null,\"CodeMirror-gutter \"+o));\"CodeMirror-linenumbers\"==o&&(e.display.lineGutter=i,i.style.width=(e.display.lineNumWidth||1)+\"px\")}a.style.display=f?\"\":\"none\",In(e)}", "function wrapContent() {\n canvas.find('.column').each(function() {\n var col = $(this);\n var contents = $();\n col.children().each(function() {\n var child = $(this);\n if (child.is('.row, .ge-tools-drawer, .ge-content')) {\n doWrap(contents);\n } else {\n contents = contents.add(child);\n }\n });\n doWrap(contents);\n });\n }", "function addLineClassToWraps(change) {\n var view = change.view;\n change.eachLine(function (info) {\n info.handles.all.forEach(function (handle) {\n view.addLineClass(handle, 'wrap', 'line');\n });\n });\n }", "addGridLines () {\n }", "wrap(wrapper){wrapper.appendChild(this.range.extractContents());this.range.insertNode(wrapper)}", "function _formatWrapper() {\n\t\t\tif ( _settings.wrapper && _settings.wrapper.children().length ) {\n\t\t\t\tif ( _settings.wrapper.css( 'overflow-y' ) !== 'scroll' ) {\n\t\t\t\t\t_settings.wrapper.css( 'overflow-y', 'scroll' );\n\t\t\t\t}\n\t\t\t\tif ( _settings.wrapper.css( 'overflow-x' ) !== 'hidden' ) {\n\t\t\t\t\t_settings.wrapper.css( 'overflow-x', 'hidden' );\n\t\t\t\t}\n\t\t\t\tif ( !_settings.wrapper.children().first().hasClass( 'smoothScrollContainer' ) ) {\n\t\t\t\t\t_settings.wrapper.children().wrapAll( '<div class=\"smoothScrollContainer\" style=\"position:relative; overflow:hidden;\" />' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function createCustomLineNumberGutter(editor, lineNumbers, gutterWidth, options = {}) {\n const {\n extraName,\n onClick\n } = options; // 'nuclide-ui-file-changes-line-number-gutter-wX' makes a gutter Xem wide.\n // 'nuclide-ui-file-changes-line-number-gutter' makes a gutter 5em wide\n\n const suffix = gutterWidth > 0 && gutterWidth < MAX_GUTTER_WIDTH ? `-w${gutterWidth}` : '';\n let name = `nuclide-ui-file-changes-line-number-gutter${suffix}`;\n\n if (extraName != null) {\n name += ` ${extraName}`;\n }\n\n const gutter = editor.addGutter({\n name\n });\n let index = -1;\n\n for (const lineNumber of lineNumbers) {\n index++;\n\n if (lineNumber == null) {\n continue;\n }\n\n const marker = editor.markBufferPosition([index, 0], {\n invalidate: 'touch'\n });\n const item = createGutterItem(lineNumber, gutterWidth, onClick);\n gutter.decorateMarker(marker, {\n type: 'gutter',\n item\n });\n gutter.onDidDestroy(() => {\n marker.destroy();\n\n _reactDom.default.unmountComponentAtNode(item);\n });\n }\n\n return gutter;\n}", "function SVGWrap() {}", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "wrap(body, spacing = this.indentSpacing) {\n return wrap(this.render(body), this.opts.maxWidth - spacing, { hard: true });\n }", "function createWrapperForGrid(){\n let classMainWrapper = \"wrapper\";\n let idWrapper = \"wrp\";\n let wrap = `\n <div class=${classMainWrapper} id=${idWrapper}></div>\n `;\n document.getElementsByTagName(\"BODY\")[0].innerHTML = wrap;\n}", "function gutter(config) {\n return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults), config))];\n}", "_createLineNumbers(editor) {\n const {\n changes,\n newStart: initialOffset\n } = this.props.hunk;\n const changeCount = changes.length;\n const maxDisplayLineNumber = initialOffset + changeCount - 1; // The maximum required gutter width for this hunk, in characters:\n\n const gutterWidth = String(maxDisplayLineNumber).length;\n let deletedLinesInSection = 0;\n let deletedLines = 0; // use a generator to avoid having to precalculate and store an array of\n // line numbers\n\n function* lineNumberGenerator() {\n for (let line = 0; line < changeCount; line++) {\n if (changes[line].type === 'del') {\n deletedLinesInSection++;\n } else {\n deletedLines += deletedLinesInSection;\n deletedLinesInSection = 0;\n }\n\n yield line + initialOffset - deletedLines;\n }\n }\n\n const gutter = createCustomLineNumberGutter(editor, lineNumberGenerator(), gutterWidth, {\n onClick: this.props.onClickLine\n });\n\n this._disposables.add(() => {\n gutter.destroy();\n });\n }", "function insertLineWidgets(cm, lineView, dims) {\n\t\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t\t if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n\t\t { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n\t\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t\t }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function _initLinesForBoxes() {\n var self = this;\n var $rowsWithBoxes = void 0;\n\n $('.row').each(function () {\n if ($(this).find('> * > .nk-box-line').length) {\n $rowsWithBoxes = $rowsWithBoxes ? $rowsWithBoxes.add($(this)) : $(this);\n }\n });\n\n // support for VC\n $('.vc_row').each(function () {\n if ($(this).find('> div > div > div > .nk-box-line').length) {\n $rowsWithBoxes = $rowsWithBoxes ? $rowsWithBoxes.add($(this)) : $(this);\n }\n });\n\n if (!$rowsWithBoxes) {\n return;\n }\n\n function calculate() {\n $rowsWithBoxes.each(function () {\n var currentRowStart = 0;\n var rowDivs = [];\n var topPosition = 0;\n var $this = $(this);\n\n // check all rows and add in array\n $this.children('*').each(function () {\n topPosition = $(this).position().top;\n if (currentRowStart !== topPosition) {\n currentRowStart = topPosition;\n rowDivs.push($(this));\n } else {\n if (rowDivs[rowDivs.length - 1]) {\n rowDivs[rowDivs.length - 1] = rowDivs[rowDivs.length - 1].add($(this));\n } else {\n rowDivs[(rowDivs.length || 1) - 1] = $(this);\n }\n }\n });\n\n // support for VC\n if ($this.hasClass('vc_row')) {\n // remove additional classnames\n $(this).find('> div > div > div > .nk-box-line').removeClass('nk-box-line-top nk-box-last');\n\n // add new classnames\n for (var k = 0; k < rowDivs.length; k++) {\n rowDivs[k].last().find('> div > div > .nk-box-line').addClass('nk-box-last');\n if (k > 0) {\n rowDivs[k].find('> div > div > .nk-box-line').addClass('nk-box-line-top');\n }\n }\n }\n\n // bootstrap\n else {\n // remove additional classnames\n $this.find('> * > .nk-box-line').removeClass('nk-box-line-top nk-box-last');\n\n // add new classnames\n for (var _k = 0; _k < rowDivs.length; _k++) {\n rowDivs[_k].last().children('.nk-box-line').addClass('nk-box-last');\n if (_k > 0) {\n rowDivs[_k].children('.nk-box-line').addClass('nk-box-line-top');\n }\n }\n }\n });\n }\n\n calculate();\n self.debounceResize(calculate);\n}", "function renderGutters(display) {\n\t\t var gutters = display.gutters, specs = display.gutterSpecs;\n\t\t removeChildren(gutters);\n\t\t display.lineGutter = null;\n\t\t for (var i = 0; i < specs.length; ++i) {\n\t\t var ref = specs[i];\n\t\t var className = ref.className;\n\t\t var style = ref.style;\n\t\t var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n\t\t if (style) { gElt.style.cssText = style; }\n\t\t if (className == \"CodeMirror-linenumbers\") {\n\t\t display.lineGutter = gElt;\n\t\t gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n\t\t }\n\t\t }\n\t\t gutters.style.display = specs.length ? \"\" : \"none\";\n\t\t updateGutterSpace(display);\n\t\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function updateGutters(cm) {\n\t\t var gutters = cm.display.gutters, specs = cm.options.gutters;\n\t\t removeChildren(gutters);\n\t\t for (var i = 0; i < specs.length; ++i) {\n\t\t var gutterClass = specs[i];\n\t\t var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n\t\t if (gutterClass == \"CodeMirror-linenumbers\") {\n\t\t cm.display.lineGutter = gElt;\n\t\t gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n\t\t }\n\t\t }\n\t\t gutters.style.display = i ? \"\" : \"none\";\n\t\t updateGutterSpace(cm);\n\t\t }", "function processLineNumbers() {\n if ($(\"#editorDiv\").length > 0) {\n var lineHeight = parseInt($(\"#editorDiv\").css('line-height'));\n var scrollHeight = $(\"#editorDiv\")[0].scrollHeight;\n var numberOfLines = scrollHeight / lineHeight;\n\n for (var i = 1; i < numberOfLines; i++) {\n $('.line-numbers').append('<p>' + i + '</p>');\n //console.log(i);\n }\n\n //set width of line-numbers bar dynamically\n var maxWidth = 0;\n var widestSpan = null;\n var $element;\n $('#lineNumbers p').each(function () {\n $element = $(this);\n if ($element.width() > maxWidth) {\n maxWidth = $element.width();\n widestSpan = $element;\n }\n });\n\n var lineNumberExtraWidthPadding = 10;\n //console.log('widest width line numbers ' + maxWidth);\n $('#lineNumbers').css('width', maxWidth + lineNumberExtraWidthPadding + 'px');\n //$('#editorDiv').css('padding-left', maxWidth + lineNumberExtraWidthPadding + 'px');\n $('.editor-wrapper').css('padding-left', maxWidth + lineNumberExtraWidthPadding + 'px');\n }\n}", "function renderGutters(display) {\n var gutters = display.gutters,\n specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n\n if (style) {\n gElt.style.cssText = style;\n }\n\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function applyMapsDividers() {\n\t\tmyMapsContainer.find('#mapsListContainer .clearfix').remove();\n\t\tmyMapsContainer.find('#mapsListContainer .mappreview').not('.hidden').each(function(index, elem) {\n\t\t\t// Handle row breaks\n\t\t\tvar myMapsDividerHtml = '';\n\t\t\tif (index > 0) {\n\t\t\t\tif (index % 2 == 0) {\n\t\t\t\t\tmyMapsDividerHtml += '<div class=\"clearfix visible-xs-block\"></div>';\n\t\t\t\t}\n\t\t\t\tif (index % 3 == 0) {\n\t\t\t\t\tmyMapsDividerHtml += '<div class=\"clearfix visible-md-block\"></div>';\n\t\t\t\t}\n\t\t\t\tif (index % 4 == 0) {\n\t\t\t\t\tmyMapsDividerHtml += '<div class=\"clearfix visible-lg-block\"></div>';\n\t\t\t\t}\n\t\t\t\tif (myMapsDividerHtml !== '') {\n\t\t\t\t\t$(elem).before(myMapsDividerHtml);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}", "wrap() {\n\t\tlet wrapper;\n\t\tif (!this.wrapper) {\n\t\t\twrapper = document.createElement(\"span\");\n\t\t\twrapper.id = this.hiddenId;\n\t\t\tthis.wrapper = wrapper;\n\t\t} else {\n\t\t\twrapper = this.wrapper;\n\t\t}\n\t\telements = [...elements, this];\n\t\treturn wrapper;\n\t}", "function updateGutters(cm) {\r\n var gutters = cm.display.gutters, specs = cm.options.gutters;\r\n removeChildren(gutters);\r\n var i = 0;\r\n for (; i < specs.length; ++i) {\r\n var gutterClass = specs[i];\r\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\r\n if (gutterClass == \"CodeMirror-linenumbers\") {\r\n cm.display.lineGutter = gElt;\r\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\r\n }\r\n }\r\n gutters.style.display = i ? \"\" : \"none\";\r\n updateGutterSpace(cm);\r\n}", "function initLinesForBoxes() {\n var self = this;\n var $rowsWithBoxes = void 0;\n\n (0, _utility.$)('.row').each(function eachRow() {\n if ((0, _utility.$)(this).find('> * > .nk-box-line').length) {\n $rowsWithBoxes = $rowsWithBoxes ? $rowsWithBoxes.add((0, _utility.$)(this)) : (0, _utility.$)(this);\n }\n });\n\n // support for VC\n (0, _utility.$)('.vc_row').each(function eachVCRow() {\n if ((0, _utility.$)(this).find('> div > div > div > .nk-box-line').length) {\n $rowsWithBoxes = $rowsWithBoxes ? $rowsWithBoxes.add((0, _utility.$)(this)) : (0, _utility.$)(this);\n }\n });\n\n if (!$rowsWithBoxes) {\n return;\n }\n\n function calculate() {\n $rowsWithBoxes.each(function eachRowWithBoxes() {\n var currentRowStart = 0;\n var rowDivs = [];\n var topPosition = 0;\n var $this = (0, _utility.$)(this);\n\n // check all rows and add in array\n $this.children('*').each(function eachChildrenRow() {\n topPosition = (0, _utility.$)(this).position().top;\n if (currentRowStart !== topPosition) {\n currentRowStart = topPosition;\n rowDivs.push((0, _utility.$)(this));\n } else if (rowDivs[rowDivs.length - 1]) {\n rowDivs[rowDivs.length - 1] = rowDivs[rowDivs.length - 1].add((0, _utility.$)(this));\n } else {\n rowDivs[(rowDivs.length || 1) - 1] = (0, _utility.$)(this);\n }\n });\n\n // support for VC\n if ($this.hasClass('vc_row')) {\n // remove additional classnames\n (0, _utility.$)(this).find('> div > div > div > .nk-box-line').removeClass('nk-box-line-top nk-box-last');\n\n // add new classnames\n for (var k = 0; k < rowDivs.length; k++) {\n rowDivs[k].last().find('> div > div > .nk-box-line').addClass('nk-box-last');\n if (k > 0) {\n rowDivs[k].find('> div > div > .nk-box-line').addClass('nk-box-line-top');\n }\n }\n\n // bootstrap\n } else {\n // remove additional classnames\n $this.find('> * > .nk-box-line').removeClass('nk-box-line-top nk-box-last');\n\n // add new classnames\n for (var _k = 0; _k < rowDivs.length; _k++) {\n rowDivs[_k].last().children('.nk-box-line').addClass('nk-box-last');\n if (_k > 0) {\n rowDivs[_k].children('.nk-box-line').addClass('nk-box-line-top');\n }\n }\n }\n });\n }\n\n calculate();\n self.debounceResize(calculate);\n}", "function updateGutters(cm) {\r\n var gutters = cm.display.gutters, specs = cm.options.gutters;\r\n removeChildren(gutters);\r\n for (var i = 0; i < specs.length; ++i) {\r\n var gutterClass = specs[i];\r\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\r\n if (gutterClass == \"CodeMirror-linenumbers\") {\r\n cm.display.lineGutter = gElt;\r\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\r\n }\r\n }\r\n gutters.style.display = i ? \"\" : \"none\";\r\n updateGutterSpace(cm);\r\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n for (var i = 0; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "renderFiller() {\n if (this.state.currentPane != \"myposts\") return <div class=\"AccountsContainerFiller\" />;\n return null;\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++) {\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }\n }\n }", "insertSplittedCellWidgets(viewer, tableCollection, rowWidget, previousRowIndex) {\n let left = rowWidget.x;\n let tableWidth = 0;\n tableWidth = HelperMethods.convertPointToPixel(rowWidget.ownerTable.tableHolder.tableWidth);\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellWidget = rowWidget.childWidgets[i];\n if (Math.round(left) < Math.round(cellWidget.x - cellWidget.margin.left)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, i)) {\n i--;\n continue;\n }\n let length = rowWidget.childWidgets.length;\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, i, previousRowIndex);\n if (length < rowWidget.childWidgets.length) {\n i--;\n continue;\n }\n }\n left += cellWidget.margin.left + cellWidget.width + cellWidget.margin.right;\n if (i === rowWidget.childWidgets.length - 1 && Math.round(left) < Math.round(rowWidget.x + tableWidth)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, i + 1)) {\n continue;\n }\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, i + 1, previousRowIndex);\n continue;\n }\n }\n // tslint:disable-next-line:max-line-length\n // Special case: when the child widgets of row is equal to 0 then the splitted widgets in the viewer is added in the table row widgets. \n if ((isNullOrUndefined(rowWidget.childWidgets) || rowWidget.childWidgets.length === 0) && viewer.splittedCellWidgets.length > 0) {\n for (let j = 0; j < viewer.splittedCellWidgets.length; j++) {\n let widget = viewer.splittedCellWidgets[j];\n if (Math.round(left) <= Math.round(widget.x - widget.margin.left)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, j)) {\n j--;\n continue;\n }\n let count = rowWidget.childWidgets.length;\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, j, previousRowIndex);\n if (count < rowWidget.childWidgets.length) {\n j--;\n continue;\n }\n }\n left += widget.margin.left + widget.width + widget.margin.right;\n if (j === rowWidget.childWidgets.length - 1 && Math.round(left) <\n Math.round(rowWidget.x + tableWidth)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, j + 1)) {\n continue;\n }\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, j + 1, previousRowIndex);\n continue;\n }\n }\n }\n if (viewer.splittedCellWidgets.length > 0) {\n viewer.splittedCellWidgets = [];\n }\n }", "wrapAll(elements, wrapper) {\n elements[0].parentNode.insertBefore(wrapper, elements[0]);\n elements.forEach(x => wrapper.appendChild(x));\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function Ga(e){var t=e.display,a=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,f=n+\"px\",o=0;o<a.length;o++)if(!a[o].hidden){e.options.fixedGutter&&(a[o].gutter&&(a[o].gutter.style.left=f),a[o].gutterBackground&&(a[o].gutterBackground.style.left=f));var i=a[o].alignable;if(i)for(var s=0;s<i.length;s++)i[s].style.left=f}e.options.fixedGutter&&(t.gutters.style.left=n+r+\"px\")}}", "function insertLineWidgets(cm, lineView, dims) {\r\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\r\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\r\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\r\n}", "function splitLineText() {\r\n\t\t\t\t\t$('.nectar-recent-posts-single_featured.multiple_featured').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $slideClass = ($(this).find('.project-slides').length > 0) ? '.project-slide' : '.nectar-recent-post-slide',\r\n\t\t\t\t\t\t$slideInfoClass = ($(this).find('.project-slides').length > 0) ? '.project-info h1' : '.inner-wrap h2 a';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find($slideClass).each(function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).find($slideInfoClass).each(function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar textArr = $(this).text();\r\n\t\t\t\t\t\t\t\ttextArr = textArr.trim();\r\n\t\t\t\t\t\t\t\ttextArr = textArr.split(' ');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this)[0].innerHTML = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < textArr.length; i++) {\r\n\t\t\t\t\t\t\t\t\t$(this)[0].innerHTML += '<span>' + textArr[i] + '</span> ';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).find($slideInfoClass + ' > span').wrapInner('<span class=\"inner\" />');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function updateGutters(cm) {\n\t var gutters = cm.display.gutters, specs = cm.options.gutters;\n\t removeChildren(gutters);\n\t for (var i = 0; i < specs.length; ++i) {\n\t var gutterClass = specs[i];\n\t var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n\t if (gutterClass == \"CodeMirror-linenumbers\") {\n\t cm.display.lineGutter = gElt;\n\t gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n\t }\n\t }\n\t gutters.style.display = i ? \"\" : \"none\";\n\t updateGutterSpace(cm);\n\t }" ]
[ "0.63632977", "0.6069341", "0.5751022", "0.5679903", "0.5651658", "0.5588519", "0.556342", "0.553486", "0.55187905", "0.54814893", "0.54814893", "0.54814196", "0.5474681", "0.5456173", "0.54542214", "0.54488885", "0.54252946", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.5404445", "0.53881395", "0.5377993", "0.53586805", "0.53586805", "0.53586805", "0.53545266", "0.5353154", "0.5346651", "0.5343074", "0.5343074", "0.5343074", "0.5343074", "0.53326756", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5326951", "0.5325171", "0.5325171", "0.532271", "0.53205585", "0.53098756", "0.5300807", "0.5289637", "0.5289637", "0.52823496", "0.52823496", "0.52823496", "0.52823496", "0.52823496", "0.52823496", "0.52823496", "0.52823496", "0.5266047", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.52509457", "0.5244766", "0.52431995", "0.52421755", "0.52338326", "0.52338326", "0.52338326", "0.52338326", "0.52338326", "0.52338326", "0.5224455", "0.5220243", "0.5210871", "0.5209465" ]
0.0
-1
Wrapper around buildLineContent which will reuse the structure in display.externalMeasured when possible.
function getLineContent(cm, lineView) { var ext = cm.display.externalMeasured; if (ext && ext.line == lineView.line) { cm.display.externalMeasured = null; lineView.measure = ext.measure; return ext.built } return buildLineContent(cm, lineView) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built\n\t\t }\n\t\t return buildLineContent(cm, lineView)\n\t\t }", "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built;\n\t\t }\n\t\t return buildLineContent(cm, lineView);\n\t\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built;\r\n }\r\n return buildLineContent(cm, lineView);\r\n }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built\r\n }\r\n return buildLineContent(cm, lineView)\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\r\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\r\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\r\n builder.map = [];\r\n insertLineContent(line, builder, getLineStyles(cm, line));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\r\n if (line.styleClasses.textClass)\r\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\r\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\r\n return builder;\r\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n\n return buildLineContent(cm, lineView);\n } // Redraw the line's text. Interacts with the background and text", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: eltP(\"pre\", [content], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {}; // Iterate over the logical lines that make up this visual line.\n\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n } // Ensure at least a single node is present, for measuring.\n\n\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n } // Store the map and a cache object for the current logical line\n\n\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n } // See issue #2901\n\n\n if (webkit) {\n var last = builder.content.lastChild;\n\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\r\n builder.map = [];\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild;\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\"; }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\r\n\r\n return builder\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n } // Get a {top, bottom, left, right} box (in line-local coordinates)", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view;\n\t\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view\n\t\t }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }" ]
[ "0.748073", "0.7472988", "0.7391853", "0.7391853", "0.7391853", "0.7391853", "0.7391853", "0.7391853", "0.7391853", "0.7391853", "0.73904085", "0.73904085", "0.73904085", "0.73616403", "0.7268476", "0.7261051", "0.72579", "0.7256298", "0.7244589", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7222309", "0.7208453", "0.7208453", "0.72044367", "0.71714795", "0.71714795", "0.71714795", "0.7144089", "0.7092671", "0.7092671", "0.7046029", "0.7034891", "0.7032088", "0.7025004", "0.69972557", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.6962627", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69268394", "0.69233257", "0.6917006", "0.6917006", "0.6830696", "0.6762487", "0.6748738", "0.67392415", "0.67392415", "0.67392415", "0.67350054", "0.66614014", "0.66614014", "0.66614014", "0.66614014" ]
0.7383217
26
Redraw the line's text. Interacts with the background and text classes because the mode may output tokens that influence these classes.
function updateLineText(cm, lineView) { var cls = lineView.text.className; var built = getLineContent(cm, lineView); if (lineView.text == lineView.node) { lineView.node = built.pre; } lineView.text.parentNode.replaceChild(built.pre, lineView.text); lineView.text = built.pre; if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { lineView.bgClass = built.bgClass; lineView.textClass = built.textClass; updateLineClasses(cm, lineView); } else if (cls) { lineView.text.className = cls; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function updateLineText(cm, lineView) {\n\t\t var cls = lineView.text.className;\n\t\t var built = getLineContent(cm, lineView);\n\t\t if (lineView.text == lineView.node) { lineView.node = built.pre; }\n\t\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t\t lineView.text = built.pre;\n\t\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t\t lineView.bgClass = built.bgClass;\n\t\t lineView.textClass = built.textClass;\n\t\t updateLineClasses(cm, lineView);\n\t\t } else if (cls) {\n\t\t lineView.text.className = cls;\n\t\t }\n\t\t }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) lineView.node = built.pre;\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\n\t var cls = lineView.text.className;\n\t var built = getLineContent(cm, lineView);\n\t if (lineView.text == lineView.node) lineView.node = built.pre;\n\t lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n\t lineView.text = built.pre;\n\t if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n\t lineView.bgClass = built.bgClass;\n\t lineView.textClass = built.textClass;\n\t updateLineClasses(lineView);\n\t } else if (cls) {\n\t lineView.text.className = cls;\n\t }\n\t }", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) lineView.node = built.pre;\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n }", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n\n if (lineView.text == lineView.node) {\n lineView.node = built.pre;\n }\n\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }", "function updateLineText(cm, lineView) {\r\n var cls = lineView.text.className;\r\n var built = getLineContent(cm, lineView);\r\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\r\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\r\n lineView.text = built.pre;\r\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\r\n lineView.bgClass = built.bgClass;\r\n lineView.textClass = built.textClass;\r\n updateLineClasses(cm, lineView);\r\n } else if (cls) {\r\n lineView.text.className = cls;\r\n }\r\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function updateLineText(cm, lineView) {\n var cls = lineView.text.className\n var built = getLineContent(cm, lineView)\n if (lineView.text == lineView.node) { lineView.node = built.pre }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text)\n lineView.text = built.pre\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass\n lineView.textClass = built.textClass\n updateLineClasses(cm, lineView)\n } else if (cls) {\n lineView.text.className = cls\n }\n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "draw() {\n this.checkContext();\n this.setRendered();\n\n if (!this.formatted) this.format();\n\n const num_lines = this.options.num_lines;\n const width = this.width;\n const x = this.x;\n let y;\n\n // Render lines\n for (let line = 0; line < num_lines; line++) {\n y = this.getYForLine(line);\n\n this.applyStyle();\n if (this.options.line_config[line].visible) {\n this.context.beginPath();\n this.context.moveTo(x, y);\n this.context.lineTo(x + width, y);\n this.context.stroke();\n }\n this.restoreStyle();\n }\n\n // Draw the modifiers (bar lines, coda, segno, repeat brackets, etc.)\n for (let i = 0; i < this.modifiers.length; i++) {\n // Only draw modifier if it has a draw function\n if (typeof this.modifiers[i].draw === 'function') {\n this.modifiers[i].applyStyle(this.context);\n this.modifiers[i].draw(this, this.getModifierXShift(i));\n this.modifiers[i].restoreStyle(this.context);\n }\n }\n\n // Render measure numbers\n if (this.measure > 0) {\n this.context.save();\n this.context.setFont(this.font.family, this.font.size, this.font.weight);\n const text_width = this.context.measureText('' + this.measure).width;\n y = this.getYForTopText(0) + 3;\n this.context.fillText('' + this.measure, this.x - text_width / 2, y);\n this.context.restore();\n }\n\n return this;\n }", "function highlightLine(cm, line, context, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n\t\t lineClasses, forceToEnd);\n\t\t var state = context.state;\n\n\t\t // Run overlays, adjust style array.\n\t\t var loop = function ( o ) {\n\t\t context.baseTokens = st;\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t context.state = true;\n\t\t runMode(cm, line.text, overlay.mode, context, function (end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t { st.splice(i, 1, end, st[i+1], i_end); }\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) { return }\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t context.state = state;\n\t\t context.baseTokens = null;\n\t\t context.baseTokenPos = 1;\n\t\t };\n\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n\t\t }", "function highlightLine(cm, line, state, forceToEnd) {\n\t\t // A styles array always starts with a number identifying the\n\t\t // mode/overlays that it is based on (for easy invalidation).\n\t\t var st = [cm.state.modeGen], lineClasses = {};\n\t\t // Compute the base array of styles\n\t\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t\t st.push(end, style);\n\t\t }, lineClasses, forceToEnd);\n\t\t\n\t\t // Run overlays, adjust style array.\n\t\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t\t var start = i;\n\t\t // Ensure there's a token end at the current position, and that i points at it\n\t\t while (at < end) {\n\t\t var i_end = st[i];\n\t\t if (i_end > end)\n\t\t st.splice(i, 1, end, st[i+1], i_end);\n\t\t i += 2;\n\t\t at = Math.min(end, i_end);\n\t\t }\n\t\t if (!style) return;\n\t\t if (overlay.opaque) {\n\t\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t\t i = start + 2;\n\t\t } else {\n\t\t for (; start < i; start += 2) {\n\t\t var cur = st[start+1];\n\t\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t\t }\n\t\t }\n\t\t }, lineClasses);\n\t\t }\n\t\t\n\t\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t\t }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen],\n lineClasses = {}; // Compute the base array of styles\n\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) {\n return st.push(end, style);\n }, lineClasses, forceToEnd);\n var state = context.state; // Run overlays, adjust style array.\n\n var loop = function loop(o) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o],\n i = 1,\n at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i; // Ensure there's a token end at the current position, and that i points at it\n\n while (at < end) {\n var i_end = st[i];\n\n if (i_end > end) {\n st.splice(i, 1, end, st[i + 1], i_end);\n }\n\n i += 2;\n at = Math.min(end, i_end);\n }\n\n if (!style) {\n return;\n }\n\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start + 1];\n st[start + 1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n loop(o);\n }\n\n return {\n styles: st,\n classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null\n };\n }", "function update() {\n requestAnimationFrame(update);\n context.fillStyle = \"#000\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n context.textBaseline = \"middle\";\n textObjects.forEach(textObject => {\n textObject.draw();\n });\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n context.state = state;\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\r\n lineClasses, forceToEnd);\r\n var state = context.state;\r\n\r\n // Run overlays, adjust style array.\r\n var loop = function ( o ) {\r\n context.baseTokens = st;\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n context.state = true;\r\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n { st.splice(i, 1, end, st[i+1], i_end); }\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) { return }\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n context.state = state;\r\n context.baseTokens = null;\r\n context.baseTokenPos = 1;\r\n };\r\n\r\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\r\n}", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {}\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd)\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n var overlay = cm.state.overlays[o], i = 1, at = 0\n runMode(cm, line.text, overlay.mode, true, function (end, style) {\n var start = i\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i]\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end) }\n i += 2\n at = Math.min(end, i_end)\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style)\n i = start + 2\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1]\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style\n }\n }\n }, lineClasses)\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n}", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }", "function highlightLine(cm, line, state, forceToEnd) {\r\n // A styles array always starts with a number identifying the\r\n // mode/overlays that it is based on (for easy invalidation).\r\n var st = [cm.state.modeGen], lineClasses = {};\r\n // Compute the base array of styles\r\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\r\n st.push(end, style);\r\n }, lineClasses, forceToEnd);\r\n\r\n // Run overlays, adjust style array.\r\n for (var o = 0; o < cm.state.overlays.length; ++o) {\r\n var overlay = cm.state.overlays[o], i = 1, at = 0;\r\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\r\n var start = i;\r\n // Ensure there's a token end at the current position, and that i points at it\r\n while (at < end) {\r\n var i_end = st[i];\r\n if (i_end > end)\r\n st.splice(i, 1, end, st[i+1], i_end);\r\n i += 2;\r\n at = Math.min(end, i_end);\r\n }\r\n if (!style) return;\r\n if (overlay.opaque) {\r\n st.splice(start, i - start, end, \"cm-overlay \" + style);\r\n i = start + 2;\r\n } else {\r\n for (; start < i; start += 2) {\r\n var cur = st[start+1];\r\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\r\n }\r\n }\r\n }, lineClasses);\r\n }\r\n\r\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\r\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "function highlightLine(cm, line, state, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n st.push(end, style);\n }, lineClasses, forceToEnd);\n\n // Run overlays, adjust style array.\n for (var o = 0; o < cm.state.overlays.length; ++o) {\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n runMode(cm, line.text, overlay.mode, true, function(end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n st.splice(i, 1, end, st[i+1], i_end);\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) return;\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"cm-overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n }\n }\n }, lineClasses);\n }\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n }", "render() {\n\t\tif (!this.visible || !this.ctx) return;\n\t\tthis.ctx.font = this.textStyle.font;\n\t\tthis.ctx.fillStyle = this.textStyle.fillStyle;\n\t\tthis.ctx.textAlign = this.textStyle.textAlign;\n\t\tthis.ctx.fillText(this.text, this.x, this.y);\n\t}", "doDraw() {\n draw_context.strokeStyle = \"#000\";\n draw_context.fillStyle = \"#eee\";\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\t\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\t\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function xTextRefresh() {\r\n\txText.attr(\r\n\t\t\"transform\",\r\n\t\t\"translate(\" +\r\n\t\t((width - labelArea) / 2 + labelArea) +\r\n\t\t\", \" +\r\n\t\t(height - margin - tPadBot) +\r\n\t\t\")\"\r\n\t);\r\n}", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "function highlightLine(cm, line, state, forceToEnd) {\n\t // A styles array always starts with a number identifying the\n\t // mode/overlays that it is based on (for easy invalidation).\n\t var st = [cm.state.modeGen], lineClasses = {};\n\t // Compute the base array of styles\n\t runMode(cm, line.text, cm.doc.mode, state, function(end, style) {\n\t st.push(end, style);\n\t }, lineClasses, forceToEnd);\n\n\t // Run overlays, adjust style array.\n\t for (var o = 0; o < cm.state.overlays.length; ++o) {\n\t var overlay = cm.state.overlays[o], i = 1, at = 0;\n\t runMode(cm, line.text, overlay.mode, true, function(end, style) {\n\t var start = i;\n\t // Ensure there's a token end at the current position, and that i points at it\n\t while (at < end) {\n\t var i_end = st[i];\n\t if (i_end > end)\n\t st.splice(i, 1, end, st[i+1], i_end);\n\t i += 2;\n\t at = Math.min(end, i_end);\n\t }\n\t if (!style) return;\n\t if (overlay.opaque) {\n\t st.splice(start, i - start, end, \"cm-overlay \" + style);\n\t i = start + 2;\n\t } else {\n\t for (; start < i; start += 2) {\n\t var cur = st[start+1];\n\t st[start+1] = (cur ? cur + \" \" : \"\") + \"cm-overlay \" + style;\n\t }\n\t }\n\t }, lineClasses);\n\t }\n\n\t return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null};\n\t }", "draw() { \n // redraw the row that have been modified using the current drawMethod \n for (var i = 0; i < this.charArray.length; i++) {\n if (this.charArray[i].modified) {\n this.charArray[i].modified = false;\n if (this.drawMethod == 'DOM') {\n this.drawRowDOM(i);\n }\n else if (this.drawMethod == 'canvas') {\n this.drawRowCanvas(i);\n }\n }\n }\n\n // reposition the cursor node\n this.cursorNode.style.left = this.cursor.x * this.charWidth + \"px\";\n this.cursorNode.style.top = this.cursor.y * this.charHeight + \"px\";\n }", "update(redrawOnly = false) {\n this.graphics.clear();\n if (redrawOnly) {\n this.drawAppropriateLine();\n } else {\n this.draw(true);\n }\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n\n return buildLineContent(cm, lineView);\n } // Redraw the line's text. Interacts with the background and text", "function onChangeLine(txt) {\n changeCurrMeme('line-txt', txt);\n renderCanvas();\n}" ]
[ "0.74870175", "0.7475659", "0.74642247", "0.74642247", "0.74642247", "0.74642247", "0.74642247", "0.74642247", "0.74642247", "0.74642247", "0.74571306", "0.74571306", "0.74571306", "0.74498487", "0.7411686", "0.7344041", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.732451", "0.73128694", "0.73083806", "0.6452401", "0.6438814", "0.6351048", "0.63095754", "0.6254128", "0.6239789", "0.62371564", "0.62371564", "0.62156254", "0.6203489", "0.6203489", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.61928034", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.6181789", "0.61519015", "0.6149164", "0.6149164", "0.6149164", "0.6149164", "0.6149164", "0.6149164", "0.6149164", "0.6146081", "0.61270547", "0.6123454", "0.61008537", "0.60620624", "0.60620624", "0.6050085", "0.6025824", "0.59936607", "0.59914005" ]
0.74458647
25
Build a line's DOM representation from scratch
function buildLineElement(cm, lineView, lineN, dims) { var built = getLineContent(cm, lineView); lineView.text = lineView.node = built.pre; if (built.bgClass) { lineView.bgClass = built.bgClass; } if (built.textClass) { lineView.textClass = built.textClass; } updateLineClasses(cm, lineView); updateLineGutter(cm, lineView, lineN, dims); insertLineWidgets(cm, lineView, dims); return lineView.node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) { lineView.bgClass = built.bgClass; }\n\t\t if (built.textClass) { lineView.textClass = built.textClass; }\n\n\t\t updateLineClasses(cm, lineView);\n\t\t updateLineGutter(cm, lineView, lineN, dims);\n\t\t insertLineWidgets(cm, lineView, dims);\n\t\t return lineView.node\n\t\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t\t var built = getLineContent(cm, lineView);\n\t\t lineView.text = lineView.node = built.pre;\n\t\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t\t if (built.textClass) lineView.textClass = built.textClass;\n\t\t\n\t\t updateLineClasses(lineView);\n\t\t updateLineGutter(cm, lineView, lineN, dims);\n\t\t insertLineWidgets(cm, lineView, dims);\n\t\t return lineView.node;\n\t\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\t\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n\t var built = getLineContent(cm, lineView);\n\t lineView.text = lineView.node = built.pre;\n\t if (built.bgClass) lineView.bgClass = built.bgClass;\n\t if (built.textClass) lineView.textClass = built.textClass;\n\n\t updateLineClasses(lineView);\n\t updateLineGutter(cm, lineView, lineN, dims);\n\t insertLineWidgets(cm, lineView, dims);\n\t return lineView.node;\n\t }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(cm, lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) lineView.bgClass = built.bgClass;\n if (built.textClass) lineView.textClass = built.textClass;\n\n updateLineClasses(lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(lineView, dims);\n return lineView.node;\n }", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView)\n lineView.text = lineView.node = built.pre\n if (built.bgClass) { lineView.bgClass = built.bgClass }\n if (built.textClass) { lineView.textClass = built.textClass }\n\n updateLineClasses(lineView)\n updateLineGutter(cm, lineView, lineN, dims)\n insertLineWidgets(cm, lineView, dims)\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n}", "function buildLineElement(cm, lineView, lineN, dims) {\r\n var built = getLineContent(cm, lineView);\r\n lineView.text = lineView.node = built.pre;\r\n if (built.bgClass) lineView.bgClass = built.bgClass;\r\n if (built.textClass) lineView.textClass = built.textClass;\r\n\r\n updateLineClasses(lineView);\r\n updateLineGutter(cm, lineView, lineN, dims);\r\n insertLineWidgets(lineView, dims);\r\n return lineView.node;\r\n }", "function buildLineElement(cm, lineView, lineN, dims) {\r\n var built = getLineContent(cm, lineView);\r\n lineView.text = lineView.node = built.pre;\r\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\r\n if (built.textClass) { lineView.textClass = built.textClass; }\r\n\r\n updateLineClasses(cm, lineView);\r\n updateLineGutter(cm, lineView, lineN, dims);\r\n insertLineWidgets(cm, lineView, dims);\r\n return lineView.node\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\r\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\r\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\r\n builder.map = [];\r\n insertLineContent(line, builder, getLineStyles(cm, line));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\r\n if (line.styleClasses.textClass)\r\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\r\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\r\n return builder;\r\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content]), content: content, col: 0, pos: 0, cm: cm};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if ((ie || webkit) && cm.getOption(\"lineWrapping\"))\n builder.addToken = buildTokenSplitSpaces(builder.addToken);\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n insertLineContent(line, builder, getLineStyles(cm, line));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n return builder;\n }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t trailingSpace: false,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit) {\n\t var last = builder.content.lastChild\n\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t }\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\t\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\t\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\t\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n // hide from accessibility tree\n content.setAttribute(\"role\", \"presentation\")\n builder.pre.setAttribute(\"role\", \"presentation\")\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {\n pre: eltP(\"pre\", [content], \"CodeMirror-line\"),\n content: content,\n col: 0,\n pos: 0,\n cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")\n };\n lineView.measure = {}; // Iterate over the logical lines that make up this visual line.\n\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line,\n order = void 0;\n builder.pos = 0;\n builder.addToken = buildToken; // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) {\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n }\n\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\n if (line.styleClasses) {\n if (line.styleClasses.bgClass) {\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n }\n\n if (line.styleClasses.textClass) {\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n } // Ensure at least a single node is present, for measuring.\n\n\n if (builder.map.length == 0) {\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n } // Store the map and a cache object for the current logical line\n\n\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n } // See issue #2901\n\n\n if (webkit) {\n var last = builder.content.lastChild;\n\n if (/\\bcm-tab\\b/.test(last.className) || last.querySelector && last.querySelector(\".cm-tab\")) {\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\n if (builder.pre.className) {\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n }\n\n return builder;\n }", "function createLine() {\n\t\tlet element = document.createElement('span')\n\t\telement.className = 'line'\n\t\treturn element\n\t}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n builder.content.className = \"cm-tab-wrap-hack\";\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order;\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n builder.addToken = buildTokenBadBidi(builder.addToken, order);\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n if (line.styleClasses.textClass)\n builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n builder.content.className = \"cm-tab-wrap-hack\";\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n return builder;\n }", "function createLine(previousLine){\n let element = document.createElement(\"div\");\n element.setAttribute(\"class\", \"line\");\n element.setAttribute(\"id\", lineCounter);\n element.setAttribute(\"contenteditable\", \"true\");\n\n if(document.getElementById(\"starter\").nextElementSibling == null){ /* root level */\n document.getElementById(\"mainTextArea\").appendChild(element);\n element.focus();\n }else if(previousLine.parentElement.classList.contains(\"header\") || previousLine.parentElement.classList.contains(\"headerMargin\")){\n while(previousLine.parentElement.classList.contains(\"root\") != true){\n previousLine = previousLine.parentElement;\n }\n element.classList.add(\"headerMargin\");\n document.getElementById(previousLine.parentElement.id).appendChild(element);\n element.focus();\n }else{\n document.getElementById(\"mainTextArea\").appendChild(element);\n element.focus();\n }\n setLineType(\"paragraph\");\n countersOperations(\"line\",\"add\");\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null)\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")}\n lineView.measure = {}\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)\n builder.pos = 0\n builder.addToken = buildToken\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order) }\n builder.map = []\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\") }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\") }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map\n lineView.measure.cache = {}\n } else {\n ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\" }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre)\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\") }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\r\n builder.map = [];\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild;\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\"; }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\r\n\r\n return builder\r\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function ensureLineWrapped(lineView) {\r\n if (lineView.node == lineView.text) {\r\n lineView.node = elt(\"div\", null, null, \"position: relative\");\r\n if (lineView.text.parentNode)\r\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\r\n lineView.node.appendChild(lineView.text);\r\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\r\n }\r\n return lineView.node;\r\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n}", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }", "function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n lineView.text.parentNode.replaceChild(lineView.node, lineView.text);\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) lineView.node.style.zIndex = 2;\n }\n return lineView.node;\n }" ]
[ "0.76377565", "0.7593533", "0.75463307", "0.75371295", "0.75371295", "0.747941", "0.747941", "0.74740374", "0.7469086", "0.7469086", "0.7469086", "0.7469086", "0.7469086", "0.7469086", "0.74606705", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.74196446", "0.73994017", "0.73661304", "0.69635916", "0.69635916", "0.69635916", "0.69514", "0.6928653", "0.6928653", "0.68790907", "0.6873031", "0.6825713", "0.6823993", "0.67934614", "0.6780282", "0.67136586", "0.6692151", "0.66493946", "0.66482425", "0.66391253", "0.6618051", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.66133654", "0.65925074", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6537725", "0.6536965", "0.6533687", "0.6533687", "0.65240157", "0.65240157", "0.65240157", "0.65240157", "0.65240157", "0.65240157", "0.65240157", "0.65240157" ]
0.7543531
15
A lineView may contain multiple logical lines (when merged by collapsed spans). The widgets for all of them need to be drawn.
function insertLineWidgets(cm, lineView, dims) { insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(lineView, dims) {\r\n insertLineWidgetsFor(lineView.line, lineView, dims, true);\r\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\r\n insertLineWidgetsFor(lineView.rest[i], lineView, dims, false);\r\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line; // Continuing lines, if any\n\n this.rest = visualLineContinued(line); // Number of logical lines in this visual line\n\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n } // Create a range of LineView objects for the given lines.", "function insertLineWidgets(cm, lineView, dims) {\n\t\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t\t if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n\t\t { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n\t\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t\t }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++) {\n insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n }\n }\n }", "function insertLineWidgets(cm, lineView, dims) {\r\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\r\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\r\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\r\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n}", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function insertLineWidgets(cm, lineView, dims) {\n\t insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n\t if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)\n\t insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);\n\t }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n }", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n}", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function applyLines(){\t\t\t\n\t\t\tscope.clearLines();\n\t\t\t_.chain(controller.lines).each(function(line){\n\t\t\t\t_.chain(line.columns).each(function(column, columnIdx){\t\t\t\t\n\t\t\t\t\tvar $cell = $findCell(line.row, column);\n\t\t\t\t\tscope.addCellState($cell, line, columnIdx);\n\t\t\t\t\tcontroller.onLineCellDrawn(controller, $cell, line, columnIdx);\n\t\t\t\t});\n\t\t\t\tcontroller.onLineDrawn(controller, line);\n\t\t\t});\n\t\t}", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n\t\t { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n\t\t if (line.styleClasses.textClass)\n\t\t { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n\t\t }\n\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n\t\t ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild;\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t { builder.content.className = \"cm-tab-wrap-hack\"; }\n\t\t }\n\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n\t\t return builder\n\t\t }", "function buildLineContent(cm, lineView) {\r\n // The padding-right forces the element to have a 'border', which\r\n // is needed on Webkit to be able to get line-level bounding\r\n // rectangles for it (in measureChar).\r\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\r\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\r\n col: 0, pos: 0, cm: cm,\r\n trailingSpace: false,\r\n splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\r\n lineView.measure = {};\r\n\r\n // Iterate over the logical lines that make up this visual line.\r\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\r\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\r\n builder.pos = 0;\r\n builder.addToken = buildToken;\r\n // Optionally wire in some hacks into the token-rendering\r\n // algorithm, to deal with browser quirks.\r\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\r\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\r\n builder.map = [];\r\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\r\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\r\n if (line.styleClasses) {\r\n if (line.styleClasses.bgClass)\r\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\r\n if (line.styleClasses.textClass)\r\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\r\n }\r\n\r\n // Ensure at least a single node is present, for measuring.\r\n if (builder.map.length == 0)\r\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\r\n\r\n // Store the map and a cache object for the current logical line\r\n if (i == 0) {\r\n lineView.measure.map = builder.map;\r\n lineView.measure.cache = {};\r\n } else {\r\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\r\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\r\n }\r\n }\r\n\r\n // See issue #2901\r\n if (webkit) {\r\n var last = builder.content.lastChild;\r\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\r\n { builder.content.className = \"cm-tab-wrap-hack\"; }\r\n }\r\n\r\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\r\n if (builder.pre.className)\r\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\r\n\r\n return builder\r\n}", "function buildLineContent(cm, lineView) {\n\t // The padding-right forces the element to have a 'border', which\n\t // is needed on Webkit to be able to get line-level bounding\n\t // rectangles for it (in measureChar).\n\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t col: 0, pos: 0, cm: cm,\n\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t lineView.measure = {};\n\n\t // Iterate over the logical lines that make up this visual line.\n\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t builder.pos = 0;\n\t builder.addToken = buildToken;\n\t // Optionally wire in some hacks into the token-rendering\n\t // algorithm, to deal with browser quirks.\n\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t builder.map = [];\n\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t if (line.styleClasses) {\n\t if (line.styleClasses.bgClass)\n\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t if (line.styleClasses.textClass)\n\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t }\n\n\t // Ensure at least a single node is present, for measuring.\n\t if (builder.map.length == 0)\n\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\n\t // Store the map and a cache object for the current logical line\n\t if (i == 0) {\n\t lineView.measure.map = builder.map;\n\t lineView.measure.cache = {};\n\t } else {\n\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t }\n\t }\n\n\t // See issue #2901\n\t if (webkit && /\\bcm-tab\\b/.test(builder.content.lastChild.className))\n\t builder.content.className = \"cm-tab-wrap-hack\";\n\n\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t if (builder.pre.className)\n\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\n\t return builder;\n\t }", "function buildLineContent(cm, lineView) {\n\t\t // The padding-right forces the element to have a 'border', which\n\t\t // is needed on Webkit to be able to get line-level bounding\n\t\t // rectangles for it (in measureChar).\n\t\t var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n\t\t var builder = {pre: elt(\"pre\", [content], \"CodeMirror-line\"), content: content,\n\t\t col: 0, pos: 0, cm: cm,\n\t\t trailingSpace: false,\n\t\t splitSpaces: (ie || webkit) && cm.getOption(\"lineWrapping\")};\n\t\t lineView.measure = {};\n\t\t\n\t\t // Iterate over the logical lines that make up this visual line.\n\t\t for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n\t\t var line = i ? lineView.rest[i - 1] : lineView.line, order;\n\t\t builder.pos = 0;\n\t\t builder.addToken = buildToken;\n\t\t // Optionally wire in some hacks into the token-rendering\n\t\t // algorithm, to deal with browser quirks.\n\t\t if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))\n\t\t builder.addToken = buildTokenBadBidi(builder.addToken, order);\n\t\t builder.map = [];\n\t\t var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n\t\t insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n\t\t if (line.styleClasses) {\n\t\t if (line.styleClasses.bgClass)\n\t\t builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\");\n\t\t if (line.styleClasses.textClass)\n\t\t builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\");\n\t\t }\n\t\t\n\t\t // Ensure at least a single node is present, for measuring.\n\t\t if (builder.map.length == 0)\n\t\t builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure)));\n\t\t\n\t\t // Store the map and a cache object for the current logical line\n\t\t if (i == 0) {\n\t\t lineView.measure.map = builder.map;\n\t\t lineView.measure.cache = {};\n\t\t } else {\n\t\t (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map);\n\t\t (lineView.measure.caches || (lineView.measure.caches = [])).push({});\n\t\t }\n\t\t }\n\t\t\n\t\t // See issue #2901\n\t\t if (webkit) {\n\t\t var last = builder.content.lastChild\n\t\t if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n\t\t builder.content.className = \"cm-tab-wrap-hack\";\n\t\t }\n\t\t\n\t\t signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n\t\t if (builder.pre.className)\n\t\t builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\");\n\t\t\n\t\t return builder;\n\t\t }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }", "function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }" ]
[ "0.70284724", "0.70284724", "0.70284724", "0.70284724", "0.70284724", "0.70284724", "0.7015939", "0.69332486", "0.6856498", "0.6850479", "0.68453354", "0.68453354", "0.68340856", "0.68340856", "0.6829853", "0.6813645", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6791258", "0.6755607", "0.6755607", "0.6755607", "0.66770685", "0.66770685", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.6657389", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66480196", "0.66361195", "0.66274166", "0.6574477", "0.6574477", "0.6574477", "0.65716475", "0.65716475", "0.6434326", "0.6247045", "0.6201877", "0.61364096", "0.6131021", "0.6123358", "0.6123358", "0.6123358", "0.6123358" ]
0.68490326
21
Return true when the given mouse event happened in a widget
function eventInWidget(display, e) { for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || (n.parentNode == display.sizer && n != display.mover)) { return true } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseClicked() {\n // If it has been clicked return true\n return true;\n }", "mouseClicked(){\n //If we are highlighted and we clicked, return true\n if(this.highlighted){\n return true\n }\n //Else return false\n return false;\n }", "hovered(){\n //if mouse is over butotn\n if (mouse.x > this.x1 && mouse.x < this.x2 && mouse.y > this.y1 && mouse.y < this.y2){\n //return that button is being hovered over\n return true;\n }\n }", "function isClicked(rect) {\n if (!rect) return false;\n if (preventInput.left) {\n console.log(\"preventinput\");\n return false;\n }\n\n var clicked = mousePressed.left && isMouseOver(rect);\n if (clicked) {\n // make sure we don't process 2 clicks in 2 subsequent frames if the button is held down\n mousePressed.left = false;\n }\n return clicked;\n}", "function isInside() {\n //mouseX, mouseY\n\n\n\n return bool\n}", "clicked(mouseX, mouseY) {\n if (dist(this.pos.x, this.pos.y, mouseX, mouseY) <= this.r / 2) {\n return true;\n } else {\n return false;\n }\n }", "function handleMouseDown(xpos, ypos, state, evnt, widgets) {\n\tfor(var i = 0; i < widgets.length; i++) {\n\t\tvar widg = widgets[i];\n\t\tif(xpos > widg.x - widg.width/2 && xpos < widg.x + widg.width/2 && ypos > widg.y - widg.height/2 && ypos < widg.y + widg.height/2) {\n\t\t\tisWidgetLocked = true;\n\t\t\tlockedWidget = widg;\n\t\t\tstate = widg.listener.mouseDown(xpos, ypos, state, evnt);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn state;\n}", "mouseMoved(e){\n //Construct a very small rectangle on the mouse position\n var mouseRect = {x: e.clientX - 5, y: e.clientY - 5, width: 2, height: 2};\n\n //Check if the mouse rect collides with our button rectangle\n //And assign the bool that returns from the function\n this.highlighted = this.collides(this.rect, mouseRect);\n }", "function OnMouseOver(buttonRect : Rect):boolean{\n\tif(buttonRect.Contains(Event.current.mousePosition)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\t\t\n}", "mouseDown(x, y, _isLeftButton) {}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\n }\n }", "_isClickInSelection(event) {\n const coords = this._getMouseBufferCoords(event);\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end || !coords) {\n return false;\n }\n return this._areCoordsInSelection(coords, start, end);\n }", "uiEvtMouseMovePerformed(x, y) {\r\n if(this.m_common.m_isDrawColorPicker){\r\n return this.m_common.m_colorPicker.uiEvtMouseMovePerformed(x, y);\r\n }\r\n for (let i = 0; i < this.m_slider.length; ++i){\r\n if(this.m_slider[i] !== null){\r\n if(this.m_slider[i].uiEvtMouseMovePerformed(x, y)){\r\n return true;\r\n }\r\n }\r\n if(this.m_colorLabel[i] !== null){\r\n if(this.m_btnModColor[i].uiEvtMouseMovePerformed(x, y)){\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "function eventInWidget(display, e) {\r\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\r\n if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;\r\n }\r\n }", "function eventInWidget(display, e) {\n\t\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t\t (n.parentNode == display.sizer && n != display.mover))\n\t\t { return true }\n\t\t }\n\t\t }", "clickedOn(xPos, yPos) {\n return(xPos > this.x && xPos < this.x + this.w && yPos > this.y && yPos < this.y +this.w);\n }", "checkCursorIsInSelection(widget, point) {\n if (isNullOrUndefined(this.start) || this.isEmpty || isNullOrUndefined(widget)) {\n return false;\n }\n let isSelected = false;\n do {\n if (this.selectedWidgets.containsKey(widget)) {\n let top;\n let left;\n if (widget instanceof LineWidget) {\n top = this.owner.selection.getTop(widget);\n left = this.owner.selection.getLeft(widget);\n }\n else {\n top = widget.y;\n left = widget.x;\n }\n let widgetInfo = this.selectedWidgets.get(widget);\n isSelected = widgetInfo.left <= point.x && top <= point.y &&\n top + widget.height >= point.y && widgetInfo.left + widgetInfo.width >= point.x;\n }\n widget = (widget instanceof LineWidget) ? widget.paragraph : widget.containerWidget;\n } while (!isNullOrUndefined(widget) && !isSelected);\n return isSelected;\n }", "function eventInWidget(display, e) {\n\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t (n.parentNode == display.sizer && n != display.mover))\n\t return true;\n\t }\n\t }", "function eventInWidget(display, e) {\n\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t (n.parentNode == display.sizer && n != display.mover))\n\t return true;\n\t }\n\t }", "function eventInWidget(display, e) {\n\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t (n.parentNode == display.sizer && n != display.mover))\n\t return true;\n\t }\n\t }", "function eventInWidget(display, e) {\n\t\t for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n\t\t if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n\t\t (n.parentNode == display.sizer && n != display.mover))\n\t\t return true;\n\t\t }\n\t\t }", "function isClicked(mouse) {\n for(var i=0;i<Object.keys(icons).length;i++) {\n curr_x = icons[Object.keys(icons)[i]][1];\n curr_y = icons[Object.keys(icons)[i]][2];\n curr_height = icons[Object.keys(icons)[i]][3];\n curr_width = icons[Object.keys(icons)[i]][4];\n if (mouse[0] < curr_x + curr_width && mouse[0] > curr_x - curr_width) {\n if (mouse[1] < curr_y + curr_height && mouse[1] > curr_y - curr_height) {\n return (icons[Object.keys(icons)[i]][0]);\n }\n }\n else {\n }\n }\n return false;\n }", "is_clicked(image, event) {\n var width = image.width\n var height = image.height\n var begin_x = image.x\n var begin_y = image.y\n var end_x = begin_x + width\n var end_y = begin_y + height \n var buffer = 10\n var click_x = event.offsetX\n var click_y = event.offsetY\n var has_been_clicked = false\n\n if (click_x >= begin_x - buffer && click_x <= end_x + buffer && click_y >= begin_y - buffer && click_y <= end_y + buffer) {\n has_been_clicked = true\n } else {\n has_been_clicked = false\n }\n\n return has_been_clicked\n }", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "click(e) {\n this._modifiers(e);\n const _leftClick = Event.isLeftClick(e);\n this.status.button1 = _leftClick;\n this.status.button2 = !_leftClick;\n const [xd, yd] = this.status.mouseDownDiff;\n if (xd > 20 || yd > 20) {\n return true;\n }\n else {\n return this.handleClick(e);\n }\n }", "uiEvtMouseInPerformed() {\r\n if (this.m_headerTree.uiEvtMouseInPerformed()) {\r\n return true;\r\n }\r\n this.m_mosPushStat = false;\r\n this.m_mosPushPrvX = 0;\r\n return false;\r\n }", "mouseUp() {\n for (let i = this.children.length - 1; i >= 0; i--) {\n //Breakout of clicks when object found\n let ret = this.children[i].mouseUp();\n if (ret === true) {\n return true\n }\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n return true;\n }\n }", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n return true;\n }\n }", "function eventInWidget(display, e) {\r\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\r\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\r\n (n.parentNode == display.sizer && n != display.mover))\r\n { return true }\r\n }\r\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n}", "uiEvtMouseLeftPerformed(x, y) {\r\n if(this.m_common.m_isDrawColorPicker){\r\n return this.m_common.m_colorPicker.uiEvtMouseLeftPerformed(x, y);\r\n }\r\n for (let i = 0; i < this.m_slider.length; ++i) {\r\n if(this.m_slider[i] !== null){\r\n if (this.m_slider[i].uiEvtMouseLeftPerformed(x, y)) {\r\n return true;\r\n }\r\n }\r\n if(this.m_colorLabel[i] !== null){\r\n if (this.m_btnModColor[i].uiEvtMouseLeftPerformed(x, y)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }", "function mouse_clicked(){\n\t\treturn M.mouse_clicked;\n\t}", "mouseUp(x, y, _isLeftButton) {}", "function mouseIsInCanvas(p) {\n if (p.mouseX < 0)\n return false;\n if (p.mouseX > p.width)\n return false;\n if (p.mouseY < 0)\n return false;\n if (p.mouseY > p.height)\n return false;\n return true;\n }", "function mousePressEvent(event) {\n var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});\n for (i = 0; i < NUMBER_OF_COLLISION_BUTTONS; i++) {\n if (clickedOverlay == buttons[i]) {\n var enabled = !(buttonStates[i]);\n updateButton(i, enabled);\n }\n }\n}", "function isMouseEvent(value) {\n return isType(value, 'MouseEvent');\n}", "function isLeftClickEvent(ev) { return ev.button === 0; }", "function cursorInBounds() {\n var boundOb = $(event.currentTarget);\n try {boundOb.offset();} catch {return false;}\n var xTest = boundOb.offset().left;\n var yTest = boundOb.offset().top;\n\n if(event.pageX >= xTest && event.pageY >= yTest && event.pageX <= xTest+boundOb.width() && event.pageY <= yTest+boundOb.height()) {\n return true;\n }\n return false;\n}", "function isEvent() {\n trigger = 1;\n if (label === eventLabel) {\n eventTrigger = true;\n return true;\n } else {\n eventTrigger = false;\n return false;\n }\n}", "isMouseOver() {\n return mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2\n && mouseY > this.y - this.h / 2 && mouseY < this.y + this.h / 2;\n }", "isMouseOver(element) {\n if (!element) {\n element = this.$el\n }\n let { x, y } = this.$store.state.mousePosition\n let rect = element.getBoundingClientRect()\n return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom\n }", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n }", "function eltWithPressEvent(elt, who)\n {\n var m_e, attr;\n var events = new Array();\n var res = false;\n\n if (! who)\n who = 'both';\n if (who == 'keyboard' || who == 'both')\n events = new Array('ONKEYPRESS','ONKEYDOWN','ONKEYUP');\n if (who == 'mouse' || who == 'both')\n {\n m_e = new Array('ONCLICK','ONDBLCLICK','ONMOUSEDOWN','ONMOUSEUP');\n events = events.concat(m_e);\n }\n\n for (var i = 0; i < events.length; i++)\n {\n attr = elt.getAttribute(events[i]);\n if (isDefinedAttr(attr))\n {\n res = true;\n break;\n }\n }\n return res;\n }", "function _clicked_ele_trigger(oEle,e)\r\n{\r\n\tif(isNaN(e))\r\n\t{\r\n\t\tvar mLeft = app.findMousePos(e)[0];\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvar mLeft = e;\r\n\t}\r\n\r\n\tvar eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);\r\n\tvar eleMinRight = eleMaxRight - 16;\r\n\r\n\tif((mLeft>eleMinRight)&&(mLeft<eleMaxRight))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n}", "function isFakeMousedownFromScreenReader(event) {\n return event.buttons === 0;\n}", "clicked(x, y)\r\n {\r\n var d = dist(x, y, this.x, this.y);\r\n if(d < this.radius)\r\n {\r\n return true;\r\n }\r\n }", "function clickedScrollbar(evt) {\n\t return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n\t}", "function mouseOnScrollbar() {\n var clickOnScrollbar = false;\n if (ev && (ev.currentTarget.children.length > 0)) {\n var child = ev.currentTarget.children[0];\n var hasScrollbar = child.scrollHeight > child.clientHeight;\n if (hasScrollbar && child.children.length > 0) {\n var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;\n if (relPosX > child.querySelector('md-option').offsetWidth)\n clickOnScrollbar = true;\n }\n }\n return clickOnScrollbar;\n }", "function mouseOnScrollbar() {\n var clickOnScrollbar = false;\n if (ev && (ev.currentTarget.children.length > 0)) {\n var child = ev.currentTarget.children[0];\n var hasScrollbar = child.scrollHeight > child.clientHeight;\n if (hasScrollbar && child.children.length > 0) {\n var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;\n if (relPosX > child.querySelector('md-option').offsetWidth)\n clickOnScrollbar = true;\n }\n }\n return clickOnScrollbar;\n }", "function mouseOnScrollbar() {\n var clickOnScrollbar = false;\n if (ev && (ev.currentTarget.children.length > 0)) {\n var child = ev.currentTarget.children[0];\n var hasScrollbar = child.scrollHeight > child.clientHeight;\n if (hasScrollbar && child.children.length > 0) {\n var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;\n if (relPosX > child.querySelector('md-option').offsetWidth)\n clickOnScrollbar = true;\n }\n }\n return clickOnScrollbar;\n }", "function mouseOnScrollbar() {\n var clickOnScrollbar = false;\n if (ev && (ev.currentTarget.children.length > 0)) {\n var child = ev.currentTarget.children[0];\n var hasScrollbar = child.scrollHeight > child.clientHeight;\n if (hasScrollbar && child.children.length > 0) {\n var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;\n if (relPosX > child.querySelector('md-option').offsetWidth)\n clickOnScrollbar = true;\n }\n }\n return clickOnScrollbar;\n }", "onIntersectedByMouse(){\n }", "function mousePosIsInSelectableArea(pos) {\n\t\tif(pos.x > leftMarg - 2 && pos.x <= leftMarg + drawW + 2 && pos.y > topMarg - 2 && pos.y <= topMarg + drawH + 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}" ]
[ "0.7195247", "0.7060024", "0.68767476", "0.68530965", "0.675996", "0.67556345", "0.6753403", "0.6686263", "0.6671799", "0.6648398", "0.6615036", "0.6615036", "0.6615036", "0.6615036", "0.65915", "0.65672505", "0.65455943", "0.64909726", "0.64862204", "0.6464711", "0.6462003", "0.6462003", "0.6462003", "0.64618635", "0.6456426", "0.6448336", "0.64282054", "0.64282054", "0.6423708", "0.6410165", "0.6393491", "0.6393491", "0.6393491", "0.6393491", "0.639191", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.63835573", "0.6375198", "0.63665855", "0.6355687", "0.6327397", "0.63261205", "0.62660384", "0.6236068", "0.6219009", "0.6214245", "0.6193374", "0.61873823", "0.61871976", "0.61733663", "0.6169826", "0.6164421", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.6162576", "0.61552906", "0.61551964", "0.6150717", "0.6149372", "0.6149372", "0.6149372", "0.6149372", "0.6141767", "0.61211973" ]
0.643237
42
Ensure the lineView.wrapping.heights array is populated. This is an array of bottom offsets for the lines that make up a drawn line. When lineWrapping is on, there might be more than one height.
function ensureLineHeights(cm, lineView, rect) { var wrapping = cm.options.lineWrapping; var curWidth = wrapping && displayWidth(cm); if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { var heights = lineView.measure.heights = []; if (wrapping) { lineView.measure.width = curWidth; var rects = lineView.text.firstChild.getClientRects(); for (var i = 0; i < rects.length - 1; i++) { var cur = rects[i], next = rects[i + 1]; if (Math.abs(cur.bottom - next.bottom) > 2) { heights.push((cur.bottom + next.top) / 2 - rect.top); } } } heights.push(rect.bottom - rect.top); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && cm.display.scroller.clientWidth;\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\r\n var wrapping = cm.options.lineWrapping;\r\n var curWidth = wrapping && cm.display.scroller.clientWidth;\r\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\r\n var heights = lineView.measure.heights = [];\r\n if (wrapping) {\r\n lineView.measure.width = curWidth;\r\n var rects = lineView.text.firstChild.getClientRects();\r\n for (var i = 0; i < rects.length - 1; i++) {\r\n var cur = rects[i], next = rects[i + 1];\r\n if (Math.abs(cur.bottom - next.bottom) > 2)\r\n heights.push((cur.bottom + next.top) / 2 - rect.top);\r\n }\r\n }\r\n heights.push(rect.bottom - rect.top);\r\n }\r\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }", "function ensureLineHeights(cm, lineView, rect) {\n\t\t var wrapping = cm.options.lineWrapping;\n\t\t var curWidth = wrapping && displayWidth(cm);\n\t\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t\t var heights = lineView.measure.heights = [];\n\t\t if (wrapping) {\n\t\t lineView.measure.width = curWidth;\n\t\t var rects = lineView.text.firstChild.getClientRects();\n\t\t for (var i = 0; i < rects.length - 1; i++) {\n\t\t var cur = rects[i], next = rects[i + 1];\n\t\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t\t }\n\t\t }\n\t\t heights.push(rect.bottom - rect.top);\n\t\t }\n\t\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t\t var wrapping = cm.options.lineWrapping;\n\t\t var curWidth = wrapping && displayWidth(cm);\n\t\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t\t var heights = lineView.measure.heights = [];\n\t\t if (wrapping) {\n\t\t lineView.measure.width = curWidth;\n\t\t var rects = lineView.text.firstChild.getClientRects();\n\t\t for (var i = 0; i < rects.length - 1; i++) {\n\t\t var cur = rects[i], next = rects[i + 1];\n\t\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t\t { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n\t\t }\n\t\t }\n\t\t heights.push(rect.bottom - rect.top);\n\t\t }\n\t\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n\t var wrapping = cm.options.lineWrapping;\n\t var curWidth = wrapping && displayWidth(cm);\n\t if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n\t var heights = lineView.measure.heights = [];\n\t if (wrapping) {\n\t lineView.measure.width = curWidth;\n\t var rects = lineView.text.firstChild.getClientRects();\n\t for (var i = 0; i < rects.length - 1; i++) {\n\t var cur = rects[i], next = rects[i + 1];\n\t if (Math.abs(cur.bottom - next.bottom) > 2)\n\t heights.push((cur.bottom + next.top) / 2 - rect.top);\n\t }\n\t }\n\t heights.push(rect.bottom - rect.top);\n\t }\n\t }", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping\n var curWidth = wrapping && displayWidth(cm)\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = []\n if (wrapping) {\n lineView.measure.width = curWidth\n var rects = lineView.text.firstChild.getClientRects()\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1]\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top) }\n }\n }\n heights.push(rect.bottom - rect.top)\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n}", "function ensureLineHeights(cm, lineView, rect) {\r\n var wrapping = cm.options.lineWrapping;\r\n var curWidth = wrapping && displayWidth(cm);\r\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\r\n var heights = lineView.measure.heights = [];\r\n if (wrapping) {\r\n lineView.measure.width = curWidth;\r\n var rects = lineView.text.firstChild.getClientRects();\r\n for (var i = 0; i < rects.length - 1; i++) {\r\n var cur = rects[i], next = rects[i + 1];\r\n if (Math.abs(cur.bottom - next.bottom) > 2)\r\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\r\n }\r\n }\r\n heights.push(rect.bottom - rect.top);\r\n }\r\n}", "function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i],\n next = rects[i + 1];\n\n if (Math.abs(cur.bottom - next.bottom) > 2) {\n heights.push((cur.bottom + next.top) / 2 - rect.top);\n }\n }\n }\n\n heights.push(rect.bottom - rect.top);\n }\n } // Find a line map (mapping character offsets to text nodes) and a", "ensureLineGaps(current, mayMeasure) {\n let wrapping = this.heightOracle.lineWrapping;\n let margin = wrapping ? 10000 /* MarginWrap */ : 2000 /* Margin */, halfMargin = margin >> 1, doubleMargin = margin << 1;\n // The non-wrapping logic won't work at all in predominantly right-to-left text.\n if (this.defaultTextDirection != exports.Direction.LTR && !wrapping)\n return [];\n let gaps = [];\n let addGap = (from, to, line, structure) => {\n if (to - from < halfMargin)\n return;\n let sel = this.state.selection.main, avoid = [sel.from];\n if (!sel.empty)\n avoid.push(sel.to);\n for (let pos of avoid) {\n if (pos > from && pos < to) {\n addGap(from, pos - 10 /* SelectionMargin */, line, structure);\n addGap(pos + 10 /* SelectionMargin */, to, line, structure);\n return;\n }\n }\n let gap = find(current, gap => gap.from >= line.from && gap.to <= line.to &&\n Math.abs(gap.from - from) < halfMargin && Math.abs(gap.to - to) < halfMargin &&\n !avoid.some(pos => gap.from < pos && gap.to > pos));\n if (!gap) {\n // When scrolling down, snap gap ends to line starts to avoid shifts in wrapping\n if (to < line.to && mayMeasure && wrapping &&\n mayMeasure.visibleRanges.some(r => r.from <= to && r.to >= to)) {\n let lineStart = mayMeasure.moveToLineBoundary(state.EditorSelection.cursor(to), false, true).head;\n if (lineStart > from)\n to = lineStart;\n }\n gap = new LineGap(from, to, this.gapSize(line, from, to, structure));\n }\n gaps.push(gap);\n };\n for (let line of this.viewportLines) {\n if (line.length < doubleMargin)\n continue;\n let structure = lineStructure(line.from, line.to, this.stateDeco);\n if (structure.total < doubleMargin)\n continue;\n let target = this.scrollTarget ? this.scrollTarget.range.head : null;\n let viewFrom, viewTo;\n if (wrapping) {\n let marginHeight = (margin / this.heightOracle.lineLength) * this.heightOracle.lineHeight;\n let top, bot;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line.height;\n top = targetFrac - spaceFrac;\n bot = targetFrac + spaceFrac;\n }\n else {\n top = (this.visibleTop - line.top - marginHeight) / line.height;\n bot = (this.visibleBottom - line.top + marginHeight) / line.height;\n }\n viewFrom = findPosition(structure, top);\n viewTo = findPosition(structure, bot);\n }\n else {\n let totalWidth = structure.total * this.heightOracle.charWidth;\n let marginWidth = margin * this.heightOracle.charWidth;\n let left, right;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;\n left = targetFrac - spaceFrac;\n right = targetFrac + spaceFrac;\n }\n else {\n left = (this.pixelViewport.left - marginWidth) / totalWidth;\n right = (this.pixelViewport.right + marginWidth) / totalWidth;\n }\n viewFrom = findPosition(structure, left);\n viewTo = findPosition(structure, right);\n }\n if (viewFrom > line.from)\n addGap(line.from, viewFrom, line, structure);\n if (viewTo < line.to)\n addGap(viewTo, line.to, line, structure);\n }\n return gaps;\n }", "get lineWrapping() { return this.viewState.heightOracle.lineWrapping; }", "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "function setHLinePos(hlinesInGap) {\n for (var i = 0; i < hlinesInGap.length; ++i) {\n if (i > 0) {\n totalHeight += 0.25;\n }\n\n hlines.push({\n pos: totalHeight,\n isDashed: hlinesInGap[i]\n });\n }\n }", "function setHLinePos(hlinesInGap) {\n for (var i = 0; i < hlinesInGap.length; ++i) {\n if (i > 0) {\n totalHeight += 0.25;\n }\n\n hlines.push({\n pos: totalHeight,\n isDashed: hlinesInGap[i]\n });\n }\n }", "function setHLinePos(hlinesInGap) {\n for (var i = 0; i < hlinesInGap.length; ++i) {\n if (i > 0) {\n totalHeight += 0.25;\n }\n\n hlines.push({\n pos: totalHeight,\n isDashed: hlinesInGap[i]\n });\n }\n }", "function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight / lineHeight), 0);\n }", "lineBlockAtHeight(height) {\n this.readMeasured();\n return this.viewState.lineBlockAtHeight(height);\n }", "function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight/lineHeight), 0);\n }", "function handerLines() {\n if (lines) {\n return Object.keys(lines).forEach(key => {\n var row = lines[key];\n var start = lines[key].start;\n var end = lines[key].end;\n\n if (start) {\n // For now we focus on the horiztonal and vertical first. \n if (start.x === '0' && start.y === '0') {\n x1 = DEFAULT_X;\n y1 = DEFAULT_Y;\n }\n\n else if (start.y !== '0') {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + (DEFAULT_Y * parseInt(start.y));\n }\n\n // For some reason, second and fourth row in ys are showing off the corridation. \n else {\n x1 = (parseInt(start.x) * 80) + DEFAULT_X;\n y1 = (parseInt(start.y) * 72) + DEFAULT_Y;\n }\n }\n\n if (end) {\n if (end.x === '0' && end.y === '0') {\n x2 = DEFAULT_X;\n y2 = DEFAULT_Y;\n }\n else if (end.y !== '0') {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + (DEFAULT_Y * parseInt(end.y));\n }\n else {\n x2 = parseInt(end.x) * 80 + DEFAULT_X;\n y2 = (parseInt(end.y) * 72) + DEFAULT_Y;\n }\n }\n return temp.push([x1, y1, x2, y2]);\n // temp.push(<line x1={x1} y1={y1} x2={x2} y2={y2} />) // DON'T TOUCH THIS!\n });\n\n }\n // setTest(prevState => [prevState, x1])\n }", "function getMaxLines(height) {\n var availHeight = height || getElemHeight(element),\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight/lineHeight), 0);\n }", "get defaultLineHeight() { return this.viewState.heightOracle.lineHeight; }", "_calcVisibleLines() {\n this._lines.qtMaxVisible = Math.floor(this._matrixHeight / this._cell.heightMin);\n if (this._lines.qtMaxVisible > 3)\n this._lines.qtMinVisible = 3;\n else\n this._lines.qtMinVisible = 1;\n if (this._lines.qtMaxVisible > this._lines.qtTotal)\n this._lines.qtMaxVisible = this._lines.qtTotal;\n if (this._lines.qtMaxVisible < this._lines.qtVisible && this._lines.qtMaxVisible != 0)\n this._lines.qtVisible = this._lines.qtMaxVisible;\n }", "buildScrollMap() {\n if (!this.totalLineCount) {\n return null;\n }\n const scrollMap = [];\n const nonEmptyList = [];\n for (let i = 0; i < this.totalLineCount; i++) {\n scrollMap.push(-1);\n }\n nonEmptyList.push(0);\n scrollMap[0] = 0;\n // write down the offsetTop of element that has 'data-line' property to scrollMap\n const lineElements = this.previewElement.getElementsByClassName(\"sync-line\");\n for (let i = 0; i < lineElements.length; i++) {\n let el = lineElements[i];\n let t = el.getAttribute(\"data-line\");\n if (!t) {\n continue;\n }\n t = parseInt(t, 10);\n if (!t) {\n continue;\n }\n // this is for ignoring footnote scroll match\n if (t < nonEmptyList[nonEmptyList.length - 1]) {\n el.removeAttribute(\"data-line\");\n }\n else {\n nonEmptyList.push(t);\n let offsetTop = 0;\n while (el && el !== this.previewElement) {\n offsetTop += el.offsetTop;\n el = el.offsetParent;\n }\n scrollMap[t] = Math.round(offsetTop);\n }\n }\n nonEmptyList.push(this.totalLineCount);\n scrollMap.push(this.previewElement.scrollHeight);\n let pos = 0;\n for (let i = 0; i < this.totalLineCount; i++) {\n if (scrollMap[i] !== -1) {\n pos++;\n continue;\n }\n const a = nonEmptyList[pos - 1];\n const b = nonEmptyList[pos];\n scrollMap[i] = Math.round((scrollMap[b] * (i - a) + scrollMap[a] * (b - i)) / (b - a));\n }\n return scrollMap; // scrollMap's length == screenLineCount (vscode can't get screenLineCount... sad)\n }", "function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "drawLines() {\n // Early bailout for timeaxis without start date\n if (!this.client.timeAxis.startDate) {\n return;\n }\n\n // We cannot rely on timeAxisViewModel because rendered header may not include full top header.\n // This means we should generate whole top level tick and then iterate over ticks, calculating lines position\n // depending on header config\n const me = this,\n { client } = me,\n { timeAxis } = client,\n axisStart = timeAxis.startDate,\n viewModel = client.timeAxisViewModel,\n tickSize = viewModel.tickSize,\n element = client.backgroundCanvas,\n canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n linesForLevel = viewModel.columnLinesFor,\n // header to draw lines for\n targetHeader = viewModel.headerConfig[linesForLevel],\n headers = viewModel.headers,\n // header which is used to draw major lines\n upperHeader = headers[headers.indexOf(targetHeader) - 1] || headers[0],\n // header defining ticks\n lowerHeader = headers[headers.length - 1],\n // when unit is year we should use 1 as increment\n startDate = timeAxis.floorDate(\n axisStart,\n false,\n upperHeader.unit,\n upperHeader.unit === 'year' ? 1 : upperHeader.increment || 1\n ),\n endDate = DateHelper.getNext(startDate, upperHeader.unit, upperHeader.increment || 1, timeAxis.weekStartDay),\n // we rendered one upper header and need to calculate how many ticks fit in it\n ticksInHeader =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, lowerHeader.unit)) / (lowerHeader.increment || 1),\n nbrLinesToDraw =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, targetHeader.unit)) / (targetHeader.increment || 1),\n // shows how many ticks should we skip before drawing next line\n ratio = ticksInHeader / nbrLinesToDraw;\n\n if (client.isHorizontal) {\n if (axisStart) {\n const doUnitsAlign = headers.length > 1 && DateHelper.doesUnitsAlign(upperHeader.unit, targetHeader.unit),\n offsetDate = doUnitsAlign\n ? startDate\n : timeAxis.floorDate(axisStart, false, targetHeader.unit, targetHeader.increment),\n // TODO: isContinuous check solved the issue I was seeing but not very generic\n offset = !timeAxis.isContinuous\n ? 0\n : (DateHelper.getDurationInUnit(offsetDate, axisStart, lowerHeader.unit, true) / timeAxis.increment) *\n tickSize,\n // this is position from left side of the canvas to draw first line, otherwi\n startPos = 10,\n height = 20;\n\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n let isMajor = false,\n majorHeaderIsRegular = true;\n\n if (\n targetHeader !== upperHeader &&\n doUnitsAlign &&\n lowerHeader.unit === 'day' &&\n DateHelper.compareUnits(upperHeader.unit, 'month') !== -1\n ) {\n // This condition means, that major lines are irregular, e.g. when lower level is days and upper is\n // months. Since months have different duration, we cannot safely repeat images\n majorHeaderIsRegular = false;\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `left:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = Math.min(ticksInHeader * 2 * tickSize, 32767);\n canvas.height = height;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n for (let i = 0; i < nbrLinesToDraw; i++) {\n // Only first interval may be major\n if (i === 0) {\n // Filtered time axis should not have any major lines\n isMajor = upperHeader !== targetHeader && doUnitsAlign && majorHeaderIsRegular && timeAxis.isContinuous;\n } else {\n isMajor = false;\n }\n\n const tickStyle = (isMajor && me.majorTickStyle) || (!isMajor && me.tickStyle);\n if (tickStyle !== 'solid') {\n switch (tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n ctx.beginPath();\n ctx.strokeStyle = isMajor ? me.majorTickColor : me.tickColor;\n\n // draw ticks\n ctx.moveTo(i * ratio * tickSize * 2 + startPos - 1, 0);\n ctx.lineTo(i * ratio * tickSize * 2 + startPos - 1, height + 2);\n ctx.stroke();\n }\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = `${-(startPos / 2 + offset)}px`;\n }\n } else {\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = client.timeAxisColumn.resourceColumns.columnWidth * 2;\n canvas.height = 2;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n if (axisStart) {\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n // Major lines always as divs to not get so large image\n if (targetHeader !== upperHeader) {\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `top:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n if (me.tickStyle !== 'solid') {\n switch (me.tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n const height = ratio * tickSize * 2;\n\n canvas.height = height;\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n ctx.lineWidth = 2;\n\n // draw ticks\n ctx.moveTo(0, height - 1);\n ctx.lineTo(canvas.width + 2, height - 1);\n ctx.stroke();\n }\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n\n // draw ticks\n ctx.moveTo(canvas.width - 1, 0);\n ctx.lineTo(canvas.width - 1, canvas.height + 2);\n ctx.stroke();\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = '0';\n }\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function linesOnScroll() {\n $('.line-container').each(function () {\n w_h = $(window).height();\n winTop = $(window).scrollTop();\n elOffTop = $(this).offset().top;\n line = $(this).find('.vertical-line');\n elOffTop < winTop + w_h - 300 ? ($(this).addClass('active'), line.css({height: line.attr('data-height') + 'px'})) : ($(this).removeClass('active'), line.css({height: 0 + 'px'}));\n });\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = _lineAtHeight(doc, top),\n to = _lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n\n\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line,\n ensureTo = viewport.ensure.to.line;\n\n if (ensureFrom < from) {\n from = ensureFrom;\n to = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n\n return {\n from: from,\n to: Math.max(to, from + 1)\n };\n } // SCROLLING THINGS INTO VIEW", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "scroll(eraseAttr, isWrapped = false) {\n const buffer = this._bufferService.buffer;\n let newLine;\n newLine = this._cachedBlankLine;\n if (!newLine || newLine.length !== this.cols || newLine.getFg(0) !== eraseAttr.fg || newLine.getBg(0) !== eraseAttr.bg) {\n newLine = buffer.getBlankLine(eraseAttr, isWrapped);\n this._cachedBlankLine = newLine;\n }\n newLine.isWrapped = isWrapped;\n const topRow = buffer.ybase + buffer.scrollTop;\n const bottomRow = buffer.ybase + buffer.scrollBottom;\n if (buffer.scrollTop === 0) {\n // Determine whether the buffer is going to be trimmed after insertion.\n const willBufferBeTrimmed = buffer.lines.isFull;\n // Insert the line using the fastest method\n if (bottomRow === buffer.lines.length - 1) {\n if (willBufferBeTrimmed) {\n buffer.lines.recycle().copyFrom(newLine);\n }\n else {\n buffer.lines.push(newLine.clone());\n }\n }\n else {\n buffer.lines.splice(bottomRow + 1, 0, newLine.clone());\n }\n // Only adjust ybase and ydisp when the buffer is not trimmed\n if (!willBufferBeTrimmed) {\n buffer.ybase++;\n // Only scroll the ydisp with ybase if the user has not scrolled up\n if (!this._bufferService.isUserScrolling) {\n buffer.ydisp++;\n }\n }\n else {\n // When the buffer is full and the user has scrolled up, keep the text\n // stable unless ydisp is right at the top\n if (this._bufferService.isUserScrolling) {\n buffer.ydisp = Math.max(buffer.ydisp - 1, 0);\n }\n }\n }\n else {\n // scrollTop is non-zero which means no line will be going to the\n // scrollback, instead we can just shift them in-place.\n const scrollRegionHeight = bottomRow - topRow + 1 /* as it's zero-based */;\n buffer.lines.shiftElements(topRow + 1, scrollRegionHeight - 1, -1);\n buffer.lines.set(bottomRow, newLine.clone());\n }\n // Move the viewport to the bottom of the buffer unless the user is\n // scrolling.\n if (!this._bufferService.isUserScrolling) {\n buffer.ydisp = buffer.ybase;\n }\n // Flag rows that need updating\n this._dirtyRowService.markRangeDirty(buffer.scrollTop, buffer.scrollBottom);\n this._onScroll.fire(buffer.ydisp);\n }", "get viewportLineBlocks() {\n return this.viewState.viewportLines;\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from)\r\n return {from: ensureFrom,\r\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\r\n if (Math.min(ensureTo, doc.lastLine()) >= to)\r\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\r\n to: ensureTo};\r\n }\r\n return {from: from, to: Math.max(to, from + 1)};\r\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)}\n\t\t }", "function appSalesLines(element, height) {}" ]
[ "0.7546182", "0.7546182", "0.7546182", "0.7546182", "0.7498462", "0.73648065", "0.73648065", "0.73648065", "0.73648065", "0.7262307", "0.7261923", "0.72531855", "0.72531855", "0.72531855", "0.72389436", "0.72389436", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.71971226", "0.7183894", "0.69939774", "0.64053094", "0.6336004", "0.6295537", "0.606671", "0.606671", "0.606671", "0.60153365", "0.6012496", "0.5951712", "0.5945131", "0.5883071", "0.58672553", "0.5631831", "0.54943", "0.5490949", "0.54804903", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5453016", "0.5451039", "0.5451039", "0.5451039", "0.5451039", "0.54141736", "0.54131866", "0.5410151", "0.5403668", "0.5403668", "0.5403668", "0.5398929", "0.5398929", "0.53972524", "0.539282", "0.53916323", "0.53916323", "0.5379176", "0.53673357", "0.5364082", "0.5364082", "0.5363413", "0.53531545" ]
0.7377386
18
Find a line map (mapping character offsets to text nodes) and a measurement cache for the given line number. (A line view might contain multiple lines when collapsed ranges are present.)
function mapFromLineView(lineView, line, lineN) { if (lineView.line == line) { return {map: lineView.measure.map, cache: lineView.measure.cache} } for (var i = 0; i < lineView.rest.length; i++) { if (lineView.rest[i] == line) { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) { if (lineNo(lineView.rest[i$1]) > lineN) { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line) {\n return {\n map: lineView.measure.map,\n cache: lineView.measure.cache\n };\n }\n\n for (var i = 0; i < lineView.rest.length; i++) {\n if (lineView.rest[i] == line) {\n return {\n map: lineView.measure.maps[i],\n cache: lineView.measure.caches[i]\n };\n }\n }\n\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) {\n if (lineNo(lineView.rest[i$1]) > lineN) {\n return {\n map: lineView.measure.maps[i$1],\n cache: lineView.measure.caches[i$1],\n before: true\n };\n }\n }\n } // Render a line into the hidden node display.externalMeasured. Used", "function mapFromLineView(lineView, line, lineN) {\n\t\t if (lineView.line == line)\n\t\t { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n\t\t if (lineView.rest) {\n\t\t for (var i = 0; i < lineView.rest.length; i++)\n\t\t { if (lineView.rest[i] == line)\n\t\t { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n\t\t for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n\t\t { if (lineNo(lineView.rest[i$1]) > lineN)\n\t\t { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n\t\t }\n\t\t }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }", "function mapFromLineView(lineView, line, lineN) {\r\n if (lineView.line == line)\r\n { return { map: lineView.measure.map, cache: lineView.measure.cache, before: false }; }\r\n for (var i = 0; i < lineView.rest.length; i++)\r\n { if (lineView.rest[i] == line)\r\n { return { map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: false }; } }\r\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\r\n { if (lineView.rest[i$1].lineNo() > lineN)\r\n { return { map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true }; } }\r\n }", "function mapFromLineView(lineView, line, lineN) {\n\t\t if (lineView.line == line)\n\t\t return {map: lineView.measure.map, cache: lineView.measure.cache};\n\t\t for (var i = 0; i < lineView.rest.length; i++)\n\t\t if (lineView.rest[i] == line)\n\t\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n\t\t for (var i = 0; i < lineView.rest.length; i++)\n\t\t if (lineNo(lineView.rest[i]) > lineN)\n\t\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n\t\t }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n return {map: lineView.measure.map, cache: lineView.measure.cache};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineView.rest[i] == line)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n for (var i = 0; i < lineView.rest.length; i++)\n if (lineNo(lineView.rest[i]) > lineN)\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n\t if (lineView.line == line)\n\t return {map: lineView.measure.map, cache: lineView.measure.cache};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineView.rest[i] == line)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineNo(lineView.rest[i]) > lineN)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n\t }", "function mapFromLineView(lineView, line, lineN) {\n\t if (lineView.line == line)\n\t return {map: lineView.measure.map, cache: lineView.measure.cache};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineView.rest[i] == line)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineNo(lineView.rest[i]) > lineN)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n\t }", "function mapFromLineView(lineView, line, lineN) {\n\t if (lineView.line == line)\n\t return {map: lineView.measure.map, cache: lineView.measure.cache};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineView.rest[i] == line)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\n\t for (var i = 0; i < lineView.rest.length; i++)\n\t if (lineNo(lineView.rest[i]) > lineN)\n\t return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\n\t }", "function mapFromLineView(lineView, line, lineN) {\r\n if (lineView.line == line)\r\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\r\n for (var i = 0; i < lineView.rest.length; i++)\r\n { if (lineView.rest[i] == line)\r\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\r\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\r\n { if (lineNo(lineView.rest[i$1]) > lineN)\r\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\r\n}", "function mapFromLineView(lineView, line, lineN) {\r\n if (lineView.line == line)\r\n return {map: lineView.measure.map, cache: lineView.measure.cache};\r\n for (var i = 0; i < lineView.rest.length; i++)\r\n if (lineView.rest[i] == line)\r\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};\r\n for (var i = 0; i < lineView.rest.length; i++)\r\n if (lineNo(lineView.rest[i]) > lineN)\r\n return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};\r\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built\r\n }\r\n return buildLineContent(cm, lineView)\r\n}", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built;\r\n }\r\n return buildLineContent(cm, lineView);\r\n }", "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built;\n\t\t }\n\t\t return buildLineContent(cm, lineView);\n\t\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built\n\t\t }\n\t\t return buildLineContent(cm, lineView)\n\t\t }", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n\t\t var lineN = lineNo(line);\n\t\t var view = findViewForLine(cm, lineN);\n\t\t if (view && !view.text) {\n\t\t view = null;\n\t\t } else if (view && view.changes) {\n\t\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t\t cm.curOp.forceUpdate = true;\n\t\t }\n\t\t if (!view)\n\t\t view = updateExternalMeasurement(cm, line);\n\t\t\n\t\t var info = mapFromLineView(view, line, lineN);\n\t\t return {\n\t\t line: line, view: view, rect: null,\n\t\t map: info.map, cache: info.cache, before: info.before,\n\t\t hasHeights: false\n\t\t };\n\t\t }", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\t\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }" ]
[ "0.7548595", "0.7491739", "0.7420152", "0.7420152", "0.7412574", "0.7411052", "0.7395382", "0.7395382", "0.7395382", "0.7395382", "0.7395382", "0.7395382", "0.7395382", "0.7395382", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7393325", "0.7375441", "0.7375441", "0.7375441", "0.7354234", "0.73517317", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.60484576", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6043278", "0.6035659", "0.6035659", "0.6034662", "0.6034662", "0.6034662", "0.6034662", "0.6034662", "0.6034662", "0.6034662", "0.6034662", "0.6013349", "0.6008746", "0.6002634", "0.5998453", "0.5998453", "0.5998453", "0.5997873", "0.5943776", "0.5943776", "0.59436", "0.59253186", "0.59229565", "0.59229565", "0.59229565", "0.59229565", "0.59229565" ]
0.74399936
12
Render a line into the hidden node display.externalMeasured. Used when measurement is needed for a line that's not in the viewport.
function updateExternalMeasurement(cm, line) { line = visualLine(line); var lineN = lineNo(line); var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); view.lineN = lineN; var built = view.built = buildLineContent(cm, view); view.text = built.pre; removeChildrenAndAdd(cm.display.lineMeasure, built.pre); return view }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n } // Get a {top, bottom, left, right} box (in line-local coordinates)", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view;\r\n }", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view\n\t\t }", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view;\n\t\t }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view\r\n}", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built\n\t\t }\n\t\t return buildLineContent(cm, lineView)\n\t\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n return buildLineContent(cm, lineView);\n }", "function getLineContent(cm, lineView) {\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && ext.line == lineView.line) {\n\t\t cm.display.externalMeasured = null;\n\t\t lineView.measure = ext.measure;\n\t\t return ext.built;\n\t\t }\n\t\t return buildLineContent(cm, lineView);\n\t\t }", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built;\r\n }\r\n return buildLineContent(cm, lineView);\r\n }", "function getLineContent(cm, lineView) {\r\n var ext = cm.display.externalMeasured;\r\n if (ext && ext.line == lineView.line) {\r\n cm.display.externalMeasured = null;\r\n lineView.measure = ext.measure;\r\n return ext.built\r\n }\r\n return buildLineContent(cm, lineView)\r\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null\n lineView.measure = ext.measure\n return ext.built\n }\n return buildLineContent(cm, lineView)\n}", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n\t var ext = cm.display.externalMeasured;\n\t if (ext && ext.line == lineView.line) {\n\t cm.display.externalMeasured = null;\n\t lineView.measure = ext.measure;\n\t return ext.built;\n\t }\n\t return buildLineContent(cm, lineView);\n\t }", "function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built;\n }\n\n return buildLineContent(cm, lineView);\n } // Redraw the line's text. Interacts with the background and text", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }" ]
[ "0.75339967", "0.7487011", "0.74840844", "0.7474399", "0.7469101", "0.7469101", "0.7469101", "0.7469101", "0.7469101", "0.7469101", "0.7469101", "0.7469101", "0.7464697", "0.74602306", "0.74602306", "0.74602306", "0.7459474", "0.7459474", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.7430819", "0.6882869", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6874159", "0.6796998", "0.6796998", "0.6796998", "0.6796998", "0.6796998", "0.6796998", "0.6796998", "0.6796998", "0.67885834", "0.6768796", "0.6741235", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.67381954", "0.6734127", "0.6734127", "0.6705823", "0.6705823", "0.6705823", "0.6443505", "0.6294594", "0.6285044", "0.6259193", "0.6239708", "0.6239708", "0.6239708", "0.6236193", "0.6234746", "0.6234746" ]
0.74756694
16
Find a line view that corresponds to the given line number.
function findViewForLine(cm, lineN) { if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) { return cm.display.view[findViewIndex(cm, lineN)] } var ext = cm.display.externalMeasured; if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) { return ext } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)] }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext }\r\n}", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)]; }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext; }\r\n }", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t return cm.display.view[findViewIndex(cm, lineN)];\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t return ext;\n\t\t }", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t { return cm.display.view[findViewIndex(cm, lineN)] }\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t { return ext }\n\t\t }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n return cm.display.view[findViewIndex(cm, lineN)];\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n return ext;\r\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line; // Continuing lines, if any\n\n this.rest = visualLineContinued(line); // Number of logical lines in this visual line\n\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n } // Create a range of LineView objects for the given lines.", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line) {\n return {\n map: lineView.measure.map,\n cache: lineView.measure.cache\n };\n }\n\n for (var i = 0; i < lineView.rest.length; i++) {\n if (lineView.rest[i] == line) {\n return {\n map: lineView.measure.maps[i],\n cache: lineView.measure.caches[i]\n };\n }\n }\n\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) {\n if (lineNo(lineView.rest[i$1]) > lineN) {\n return {\n map: lineView.measure.maps[i$1],\n cache: lineView.measure.caches[i$1],\n before: true\n };\n }\n }\n } // Render a line into the hidden node display.externalMeasured. Used", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n}", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t // The starting line\n\t this.line = line;\n\t // Continuing lines, if any\n\t this.rest = visualLineContinued(line);\n\t // Number of logical lines in this visual line\n\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t this.node = this.text = null;\n\t this.hidden = lineIsHidden(doc, line);\n\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function LineView(doc, line, lineN) {\n\t\t // The starting line\n\t\t this.line = line;\n\t\t // Continuing lines, if any\n\t\t this.rest = visualLineContinued(line);\n\t\t // Number of logical lines in this visual line\n\t\t this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n\t\t this.node = this.text = null;\n\t\t this.hidden = lineIsHidden(doc, line);\n\t\t }", "function mapFromLineView(lineView, line, lineN) {\r\n if (lineView.line == line)\r\n { return { map: lineView.measure.map, cache: lineView.measure.cache, before: false }; }\r\n for (var i = 0; i < lineView.rest.length; i++)\r\n { if (lineView.rest[i] == line)\r\n { return { map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: false }; } }\r\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\r\n { if (lineView.rest[i$1].lineNo() > lineN)\r\n { return { map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true }; } }\r\n }", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}", "function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n}" ]
[ "0.7490927", "0.7490927", "0.7490927", "0.7490927", "0.7490927", "0.7490927", "0.7490927", "0.7490927", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7483591", "0.7482409", "0.7482409", "0.7431888", "0.7431888", "0.7431888", "0.7408409", "0.7397154", "0.7397056", "0.73809403", "0.7378883", "0.6917708", "0.6896633", "0.6896633", "0.6887552", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.68677217", "0.6866819", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.6849949", "0.68485063", "0.6824352", "0.6824352", "0.6824352", "0.68003535", "0.68003535", "0.6610603", "0.6582387", "0.6582387", "0.6582387", "0.6582387", "0.6582387", "0.6582387", "0.6582387" ]
0.7498672
12
Measurement can be split in two steps, the setup work that applies to the whole line, and the measurement of the actual character. Functions like coordsChar, that need to do a lot of measurements in a row, can thus ensure that the setup work is only done once.
function prepareMeasureForLine(cm, line) { var lineN = lineNo(line); var view = findViewForLine(cm, lineN); if (view && !view.text) { view = null; } else if (view && view.changes) { updateLineForChanges(cm, view, lineN, getDimensions(cm)); cm.curOp.forceUpdate = true; } if (!view) { view = updateExternalMeasurement(cm, line); } var info = mapFromLineView(view, line, lineN); return { line: line, view: view, rect: null, map: info.map, cache: info.cache, before: info.before, hasHeights: false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n\n if (!view) {\n view = updateExternalMeasurement(cm, line);\n }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line,\n view: view,\n rect: null,\n map: info.map,\n cache: info.cache,\n before: info.before,\n hasHeights: false\n };\n } // Given a prepared measurement object, measures the position of an", "function prepareMeasureForLine(cm, line) {\n\t\t var lineN = lineNo(line);\n\t\t var view = findViewForLine(cm, lineN);\n\t\t if (view && !view.text) {\n\t\t view = null;\n\t\t } else if (view && view.changes) {\n\t\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t\t cm.curOp.forceUpdate = true;\n\t\t }\n\t\t if (!view)\n\t\t view = updateExternalMeasurement(cm, line);\n\t\t\n\t\t var info = mapFromLineView(view, line, lineN);\n\t\t return {\n\t\t line: line, view: view, rect: null,\n\t\t map: info.map, cache: info.cache, before: info.before,\n\t\t hasHeights: false\n\t\t };\n\t\t }", "function prepareMeasureForLine(cm, line) {\n\t\t var lineN = lineNo(line);\n\t\t var view = findViewForLine(cm, lineN);\n\t\t if (view && !view.text) {\n\t\t view = null;\n\t\t } else if (view && view.changes) {\n\t\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t\t cm.curOp.forceUpdate = true;\n\t\t }\n\t\t if (!view)\n\t\t { view = updateExternalMeasurement(cm, line); }\n\n\t\t var info = mapFromLineView(view, line, lineN);\n\t\t return {\n\t\t line: line, view: view, rect: null,\n\t\t map: info.map, cache: info.cache, before: info.before,\n\t\t hasHeights: false\n\t\t }\n\t\t }", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\t\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\r\n var lineN = lineNo(line);\r\n var view = findViewForLine(cm, lineN);\r\n if (view && !view.text) {\r\n view = null;\r\n } else if (view && view.changes) {\r\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\r\n cm.curOp.forceUpdate = true;\r\n }\r\n if (!view)\r\n { view = updateExternalMeasurement(cm, line); }\r\n\r\n var info = mapFromLineView(view, line, lineN);\r\n return {\r\n line: line, view: view, rect: null,\r\n map: info.map, cache: info.cache, before: info.before,\r\n hasHeights: false\r\n }\r\n}", "function prepareMeasureForLine(cm, line) {\r\n var lineN = lineNo(line);\r\n var view = findViewForLine(cm, lineN);\r\n if (view && !view.text)\r\n view = null;\r\n else if (view && view.changes)\r\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\r\n if (!view)\r\n view = updateExternalMeasurement(cm, line);\r\n\r\n var info = mapFromLineView(view, line, lineN);\r\n return {\r\n line: line, view: view, rect: null,\r\n map: info.map, cache: info.cache, before: info.before,\r\n hasHeights: false\r\n };\r\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "drawShallowLine(xInit, yInit, xFinal, deltaX, deltaY, keyCharacter) {\n\n let gridSquares = getSquaresForShallowLine(xInit, yInit, xFinal, deltaX, deltaY, keyCharacter);\n\n // clear any characters previously added to the grid square\n gridSquares.clear.forEach(square => {\n this.clearPreviousCharacter(square);\n });\n\n // add the required character to the square at location (x,y)\n gridSquares.add.forEach(square => {\n this.addCharacterToSquare(square.x, square.y, square.char);\n })\n }", "_updateDimensions() {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n // Calculate the scaled character width. Width is floored as it must be\n // drawn to an integer grid in order for the CharAtlas \"stamps\" to not be\n // blurry. When text is drawn to the grid not using the CharAtlas, it is\n // clipped to ensure there is no overlap with the next cell.\n this.dimensions.scaledCharWidth = Math.floor(this._charSizeService.width * window.devicePixelRatio);\n // Calculate the scaled character height. Height is ceiled in case\n // devicePixelRatio is a floating point number in order to ensure there is\n // enough space to draw the character to the cell.\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n // Calculate the scaled cell height, if lineHeight is not 1 then the value\n // will be floored because since lineHeight can never be lower then 1, there\n // is a guarentee that the scaled line height will always be larger than\n // scaled char height.\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.options.lineHeight);\n // Calculate the y coordinate within a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharTop = this._optionsService.options.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);\n // Calculate the scaled cell width, taking the letterSpacing into account.\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.options.letterSpacing);\n // Calculate the x coordinate with a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharLeft = Math.floor(this._optionsService.options.letterSpacing / 2);\n // Recalculate the canvas dimensions; scaled* define the actual number of\n // pixel in the canvas\n this.dimensions.scaledCanvasHeight = this._bufferService.rows * this.dimensions.scaledCellHeight;\n this.dimensions.scaledCanvasWidth = this._bufferService.cols * this.dimensions.scaledCellWidth;\n // The the size of the canvas on the page. It's very important that this\n // rounds to nearest integer and not ceils as browsers often set\n // window.devicePixelRatio as something like 1.100000023841858, when it's\n // actually 1.1. Ceiling causes blurriness as the backing canvas image is 1\n // pixel too large for the canvas element size.\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n // Get the _actual_ dimensions of an individual cell. This needs to be\n // derived from the canvasWidth/Height calculated above which takes into\n // account window.devicePixelRatio. ICharSizeService.width/height by itself\n // is insufficient when the page is not at 100% zoom level as it's measured\n // in CSS pixels, but the actual char size on the canvas can differ.\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n } // Get a {top, bottom, left, right} box (in line-local coordinates)", "function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);\n } // Find a line view that corresponds to the given line number.", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view\n\t\t }", "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view;\n\t\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view\r\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view;\r\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t\t if (x < 0) x = 0;\n\t\t\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var merged = collapsedSpanAtEnd(lineObj);\n\t\t var mergedPos = merged && merged.find(0, true);\n\t\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t\t else\n\t\t return found;\n\t\t }\n\t\t }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\r\n if (x < 0) x = 0;\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n lineN = lineNo(lineObj = mergedPos.to.line);\r\n else\r\n return found;\r\n }\r\n }" ]
[ "0.61007935", "0.6079905", "0.60480803", "0.5923985", "0.5918367", "0.5918367", "0.589796", "0.589796", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5888241", "0.5875767", "0.5873418", "0.5843824", "0.5841723", "0.5841723", "0.5841723", "0.5841723", "0.5841723", "0.5841723", "0.5841723", "0.5650378", "0.5596247", "0.5546035", "0.5452164", "0.5440502", "0.5427535", "0.5394498", "0.5394498", "0.5394498", "0.5393006", "0.5393006", "0.5377188", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.53750944", "0.535572", "0.5354973", "0.5350915", "0.5350915", "0.5350915", "0.5350915", "0.5350915", "0.5350915", "0.5350915", "0.5350915", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.53449893", "0.5313312", "0.5313312", "0.5313312", "0.5310655", "0.5293785" ]
0.5901451
18
Given a prepared measurement object, measures the position of an actual character (or fetches it from the cache).
function measureCharPrepared(cm, prepared, ch, bias, varHeight) { if (prepared.before) { ch = -1; } var key = ch + (bias || ""), found; if (prepared.cache.hasOwnProperty(key)) { found = prepared.cache[key]; } else { if (!prepared.rect) { prepared.rect = prepared.view.text.getBoundingClientRect(); } if (!prepared.hasHeights) { ensureLineHeights(cm, prepared.view, prepared.rect); prepared.hasHeights = true; } found = measureCharInner(cm, prepared, ch, bias); if (!found.bogus) { prepared.cache[key] = found; } } return {left: found.left, right: found.right, top: varHeight ? found.rtop : found.top, bottom: varHeight ? found.rbottom : found.bottom} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) ch = -1;\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n prepared.rect = prepared.view.text.getBoundingClientRect();\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) prepared.cache[key] = found;\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom};\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n\t\t if (prepared.before) ch = -1;\n\t\t var key = ch + (bias || \"\"), found;\n\t\t if (prepared.cache.hasOwnProperty(key)) {\n\t\t found = prepared.cache[key];\n\t\t } else {\n\t\t if (!prepared.rect)\n\t\t prepared.rect = prepared.view.text.getBoundingClientRect();\n\t\t if (!prepared.hasHeights) {\n\t\t ensureLineHeights(cm, prepared.view, prepared.rect);\n\t\t prepared.hasHeights = true;\n\t\t }\n\t\t found = measureCharInner(cm, prepared, ch, bias);\n\t\t if (!found.bogus) prepared.cache[key] = found;\n\t\t }\n\t\t return {left: found.left, right: found.right,\n\t\t top: varHeight ? found.rtop : found.top,\n\t\t bottom: varHeight ? found.rbottom : found.bottom};\n\t\t }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n\t\t if (prepared.before) { ch = -1; }\n\t\t var key = ch + (bias || \"\"), found;\n\t\t if (prepared.cache.hasOwnProperty(key)) {\n\t\t found = prepared.cache[key];\n\t\t } else {\n\t\t if (!prepared.rect)\n\t\t { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n\t\t if (!prepared.hasHeights) {\n\t\t ensureLineHeights(cm, prepared.view, prepared.rect);\n\t\t prepared.hasHeights = true;\n\t\t }\n\t\t found = measureCharInner(cm, prepared, ch, bias);\n\t\t if (!found.bogus) { prepared.cache[key] = found; }\n\t\t }\n\t\t return {left: found.left, right: found.right,\n\t\t top: varHeight ? found.rtop : found.top,\n\t\t bottom: varHeight ? found.rbottom : found.bottom}\n\t\t }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\r\n if (prepared.before) ch = -1;\r\n var key = ch + (bias || \"\"), found;\r\n if (prepared.cache.hasOwnProperty(key)) {\r\n found = prepared.cache[key];\r\n } else {\r\n if (!prepared.rect)\r\n prepared.rect = prepared.view.text.getBoundingClientRect();\r\n if (!prepared.hasHeights) {\r\n ensureLineHeights(cm, prepared.view, prepared.rect);\r\n prepared.hasHeights = true;\r\n }\r\n found = measureCharInner(cm, prepared, ch, bias);\r\n if (!found.bogus) prepared.cache[key] = found;\r\n }\r\n return {left: found.left, right: found.right,\r\n top: varHeight ? found.rtop : found.top,\r\n bottom: varHeight ? found.rbottom : found.bottom};\r\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) {\n ch = -1;\n }\n\n var key = ch + (bias || \"\"),\n found;\n\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect) {\n prepared.rect = prepared.view.text.getBoundingClientRect();\n }\n\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n\n found = measureCharInner(cm, prepared, ch, bias);\n\n if (!found.bogus) {\n prepared.cache[key] = found;\n }\n }\n\n return {\n left: found.left,\n right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom\n };\n }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\r\n if (prepared.before) { ch = -1; }\r\n var key = ch + (bias || \"\"), found;\r\n if (prepared.cache.hasOwnProperty(key)) {\r\n found = prepared.cache[key];\r\n } else {\r\n if (!prepared.rect)\r\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\r\n if (!prepared.hasHeights) {\r\n ensureLineHeights(cm, prepared.view, prepared.rect);\r\n prepared.hasHeights = true;\r\n }\r\n found = measureCharInner(cm, prepared, ch, bias);\r\n if (!found.bogus) { prepared.cache[key] = found; }\r\n }\r\n return {left: found.left, right: found.right,\r\n top: varHeight ? found.rtop : found.top,\r\n bottom: varHeight ? found.rbottom : found.bottom}\r\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1 }\n var key = ch + (bias || \"\"), found\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key]\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect() }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect)\n prepared.hasHeights = true\n }\n found = measureCharInner(cm, prepared, ch, bias)\n if (!found.bogus) { prepared.cache[key] = found }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n\t if (prepared.before) ch = -1;\n\t var key = ch + (bias || \"\"), found;\n\t if (prepared.cache.hasOwnProperty(key)) {\n\t found = prepared.cache[key];\n\t } else {\n\t if (!prepared.rect)\n\t prepared.rect = prepared.view.text.getBoundingClientRect();\n\t if (!prepared.hasHeights) {\n\t ensureLineHeights(cm, prepared.view, prepared.rect);\n\t prepared.hasHeights = true;\n\t }\n\t found = measureCharInner(cm, prepared, ch, bias);\n\t if (!found.bogus) prepared.cache[key] = found;\n\t }\n\t return {left: found.left, right: found.right,\n\t top: varHeight ? found.rtop : found.top,\n\t bottom: varHeight ? found.rbottom : found.bottom};\n\t }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n\t if (prepared.before) ch = -1;\n\t var key = ch + (bias || \"\"), found;\n\t if (prepared.cache.hasOwnProperty(key)) {\n\t found = prepared.cache[key];\n\t } else {\n\t if (!prepared.rect)\n\t prepared.rect = prepared.view.text.getBoundingClientRect();\n\t if (!prepared.hasHeights) {\n\t ensureLineHeights(cm, prepared.view, prepared.rect);\n\t prepared.hasHeights = true;\n\t }\n\t found = measureCharInner(cm, prepared, ch, bias);\n\t if (!found.bogus) prepared.cache[key] = found;\n\t }\n\t return {left: found.left, right: found.right,\n\t top: varHeight ? found.rtop : found.top,\n\t bottom: varHeight ? found.rbottom : found.bottom};\n\t }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n\t if (prepared.before) ch = -1;\n\t var key = ch + (bias || \"\"), found;\n\t if (prepared.cache.hasOwnProperty(key)) {\n\t found = prepared.cache[key];\n\t } else {\n\t if (!prepared.rect)\n\t prepared.rect = prepared.view.text.getBoundingClientRect();\n\t if (!prepared.hasHeights) {\n\t ensureLineHeights(cm, prepared.view, prepared.rect);\n\t prepared.hasHeights = true;\n\t }\n\t found = measureCharInner(cm, prepared, ch, bias);\n\t if (!found.bogus) prepared.cache[key] = found;\n\t }\n\t return {left: found.left, right: found.right,\n\t top: varHeight ? found.rtop : found.top,\n\t bottom: varHeight ? found.rbottom : found.bottom};\n\t }", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n}", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t\t if (x < 0) x = 0;\n\t\t\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var merged = collapsedSpanAtEnd(lineObj);\n\t\t var mergedPos = merged && merged.find(0, true);\n\t\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t\t else\n\t\t return found;\n\t\t }\n\t\t }", "function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);\n } // Find a line view that corresponds to the given line number.", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\r\n if (x < 0) x = 0;\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n lineN = lineNo(lineObj = mergedPos.to.line);\r\n else\r\n return found;\r\n }\r\n }", "coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }", "convertPointToCharacterPosition(text, point) {\n var position = 0;\n var w = 0;\n for (var i = 0, n = text.length; i < n; i++) {\n\n var charWidth = this.calculateCharacterSize(text.charAt(i))[0];\n var halfWidth = charWidth / 2;\n\n if (i > 0) {\n w = this.calculateSize(text.substr(0, i))[0];\n }\n\n // basic rounding calculation bast on character\n // width\n if (w + halfWidth > point) {\n break;\n }\n\n position++;\n }\n\n return position;\n }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n\t\t if (x < 0) { x = 0; }\n\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n\t\t if (!collapsed) { return found }\n\t\t var rangeEnd = collapsed.find(1);\n\t\t if (rangeEnd.line == lineN) { return rangeEnd }\n\t\t lineObj = getLine(doc, lineN = rangeEnd.line);\n\t\t }\n\t\t }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\r\n if (x < 0) { x = 0; }\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n { lineN = lineNo(lineObj = mergedPos.to.line); }\r\n else\r\n { return found }\r\n }\r\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}" ]
[ "0.69571626", "0.69571626", "0.69571626", "0.69571626", "0.69571626", "0.69571626", "0.69571626", "0.69571626", "0.69455224", "0.69363755", "0.69285154", "0.69267726", "0.69008875", "0.689963", "0.689963", "0.68910486", "0.68910486", "0.68910486", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.68891644", "0.6080123", "0.6059886", "0.6059886", "0.6049331", "0.6016762", "0.6014974", "0.6014974", "0.6014974", "0.6014974", "0.6014974", "0.6014974", "0.6014974", "0.6014974", "0.6009663", "0.5977568", "0.5976339", "0.59709865", "0.596838", "0.596838", "0.596838", "0.596838", "0.5961237", "0.5961237", "0.5961237", "0.5944927", "0.5938098", "0.59330827", "0.5927902", "0.5927902", "0.5927902", "0.5927902", "0.5927902", "0.5927902", "0.5927902", "0.5927902", "0.5904336", "0.5904336", "0.5904336", "0.5904336", "0.5904336", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.5890291", "0.58835375", "0.58835375", "0.58835375" ]
0.6948618
21
Work around problem with bounding client rects on ranges being returned incorrectly when zoomed on IE10 and below.
function maybeUpdateRectForZooming(measure, rect) { if (!window.screen || screen.logicalXDPI == null || screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) { return rect } var scaleX = screen.logicalXDPI / screen.deviceXDPI; var scaleY = screen.logicalYDPI / screen.deviceYDPI; return {left: rect.left * scaleX, right: rect.right * scaleX, top: rect.top * scaleY, bottom: rect.bottom * scaleY} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRangeBoundingClientRect(range){// \"Return a DOMRect object describing the smallest rectangle that includes\r\n\t// the first rectangle in list and all of the remaining rectangles of which\r\n\t// the height or width is not zero.\"\r\n\t// http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\r\n\tvar rects=getRangeClientRects(range);var top=0;var right=0;var bottom=0;var left=0;if(rects.length){var _rects$=rects[0];top=_rects$.top;right=_rects$.right;bottom=_rects$.bottom;left=_rects$.left;for(var ii=1;ii<rects.length;ii++){var rect=rects[ii];if(rect.height!==0||rect.width!==0){top=Math.min(top,rect.top);right=Math.max(right,rect.right);bottom=Math.max(bottom,rect.bottom);left=Math.min(left,rect.left);}}}return{top:top,right:right,bottom:bottom,left:left,width:right-left,height:bottom-top};}", "function actuallyGetRangeBoundingRect(range) {\n\t // XXX: to be revised when this Chrome bug is fixed:\n\t // https://bugs.chromium.org/p/chromium/issues/detail?id=612459\n\t if (microsoft || browser$3.chrome) {\n\t // Workaround browser bugs: IE and Chrome would sometimes\n\t // return 0 or 1-width rectangles before or after the main\n\t // one. https://github.com/telerik/kendo/issues/4674\n\t\n\t // Actually Chrome 50 got worse, since the rectangles can now have the width of a\n\t // full character, making it hard to tell whether it's a bogus rectangle or valid\n\t // selection location. The workaround is to ignore rectangles that fall on the\n\t // previous line. https://github.com/telerik/kendo/issues/5740\n\t var rectangles = range.getClientRects(), box = {\n\t top : Infinity,\n\t right : -Infinity,\n\t bottom : -Infinity,\n\t left : Infinity\n\t }, done = false;\n\t for (var i = 0; i < rectangles.length; ++i) {\n\t var b = rectangles[i];\n\t if (b.width <= 1 || b.bottom === prevLineBottom) {\n\t continue; // bogus rectangle\n\t }\n\t box.left = Math.min(b.left , box.left);\n\t box.top = Math.min(b.top , box.top);\n\t box.right = Math.max(b.right , box.right);\n\t box.bottom = Math.max(b.bottom , box.bottom);\n\t done = true;\n\t }\n\t if (!done) {\n\t return range.getBoundingClientRect();\n\t }\n\t box.width = box.right - box.left;\n\t box.height = box.bottom - box.top;\n\t return box;\n\t }\n\t return range.getBoundingClientRect();\n\t }", "function actuallyGetRangeBoundingRect(range) {\n // XXX: to be revised when this Chrome bug is fixed:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=612459\n if (browser$2.msie || browser$2.chrome) {\n // Workaround browser bugs: IE and Chrome would sometimes\n // return 0 or 1-width rectangles before or after the main\n // one. https://github.com/telerik/kendo/issues/4674\n\n // Actually Chrome 50 got worse, since the rectangles can now have the width of a\n // full character, making it hard to tell whether it's a bogus rectangle or valid\n // selection location. The workaround is to ignore rectangles that fall on the\n // previous line. https://github.com/telerik/kendo/issues/5740\n var rectangles = range.getClientRects(), box = {\n top : Infinity,\n right : -Infinity,\n bottom : -Infinity,\n left : Infinity\n };\n for (var i = 0; i < rectangles.length; ++i) {\n var b = rectangles[i];\n if (b.width <= 1 || b.bottom === prevLineBottom) {\n continue; // bogus rectangle\n }\n box.left = Math.min(b.left , box.left);\n box.top = Math.min(b.top , box.top);\n box.right = Math.max(b.right , box.right);\n box.bottom = Math.max(b.bottom , box.bottom);\n }\n box.width = box.right - box.left;\n box.height = box.bottom - box.top;\n return box;\n }\n return range.getBoundingClientRect();\n }", "function supportRangeBounds() {\r\n var r, testElement, rangeBounds, rangeHeight, support = false;\r\n\r\n if (doc.createRange) {\r\n r = doc.createRange();\r\n if (r.getBoundingClientRect) {\r\n testElement = doc.createElement('boundtest');\r\n testElement.style.height = \"123px\";\r\n testElement.style.display = \"block\";\r\n doc.body.appendChild(testElement);\r\n\r\n r.selectNode(testElement);\r\n rangeBounds = r.getBoundingClientRect();\r\n rangeHeight = rangeBounds.height;\r\n\r\n if (rangeHeight === 123) {\r\n support = true;\r\n }\r\n doc.body.removeChild(testElement);\r\n }\r\n }\r\n\r\n return support;\r\n }", "function supportRangeBounds() {\r\n var r, testElement, rangeBounds, rangeHeight, support = false;\r\n\r\n if (doc.createRange) {\r\n r = doc.createRange();\r\n if (r.getBoundingClientRect) {\r\n testElement = doc.createElement('boundtest');\r\n testElement.style.height = \"123px\";\r\n testElement.style.display = \"block\";\r\n doc.body.appendChild(testElement);\r\n\r\n r.selectNode(testElement);\r\n rangeBounds = r.getBoundingClientRect();\r\n rangeHeight = rangeBounds.height;\r\n\r\n if (rangeHeight === 123) {\r\n support = true;\r\n }\r\n doc.body.removeChild(testElement);\r\n }\r\n }\r\n\r\n return support;\r\n }", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function getRangeBoundingClientRect(range) {\n // \"Return a DOMRect object describing the smallest rectangle that includes\n // the first rectangle in list and all of the remaining rectangles of which\n // the height or width is not zero.\"\n // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n var rects = getRangeClientRects(range);\n var top = 0;\n var right = 0;\n var bottom = 0;\n var left = 0;\n\n if (rects.length) {\n // If the first rectangle has 0 width, we use the second, this is needed\n // because Chrome renders a 0 width rectangle when the selection contains\n // a line break.\n if (rects.length > 1 && rects[0].width === 0) {\n var _rects$ = rects[1];\n top = _rects$.top;\n right = _rects$.right;\n bottom = _rects$.bottom;\n left = _rects$.left;\n } else {\n var _rects$2 = rects[0];\n top = _rects$2.top;\n right = _rects$2.right;\n bottom = _rects$2.bottom;\n left = _rects$2.left;\n }\n\n for (var ii = 1; ii < rects.length; ii++) {\n var rect = rects[ii];\n if (rect.height !== 0 && rect.width !== 0) {\n top = Math.min(top, rect.top);\n right = Math.max(right, rect.right);\n bottom = Math.max(bottom, rect.bottom);\n left = Math.min(left, rect.left);\n }\n }\n }\n\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: right - left,\n height: bottom - top\n };\n}", "function actuallyGetRangeBoundingRect(range) {\n // XXX: to be revised when this Chrome bug is fixed:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=612459\n if (microsoft || browser.chrome) {\n // Workaround browser bugs: IE and Chrome would sometimes\n // return 0 or 1-width rectangles before or after the main\n // one. https://github.com/telerik/kendo/issues/4674\n\n // Actually Chrome 50 got worse, since the rectangles can now have the width of a\n // full character, making it hard to tell whether it's a bogus rectangle or valid\n // selection location. The workaround is to ignore rectangles that fall on the\n // previous line. https://github.com/telerik/kendo/issues/5740\n var rectangles = range.getClientRects(), box = {\n top : Infinity,\n right : -Infinity,\n bottom : -Infinity,\n left : Infinity\n }, done = false;\n for (var i = 0; i < rectangles.length; ++i) {\n var b = rectangles[i];\n if (b.width <= 1 || b.bottom === prevLineBottom) {\n continue; // bogus rectangle\n }\n box.left = Math.min(b.left , box.left);\n box.top = Math.min(b.top , box.top);\n box.right = Math.max(b.right , box.right);\n box.bottom = Math.max(b.bottom , box.bottom);\n done = true;\n }\n if (!done) {\n return range.getBoundingClientRect();\n }\n box.width = box.right - box.left;\n box.height = box.bottom - box.top;\n return box;\n }\n return range.getBoundingClientRect();\n }", "function actuallyGetRangeBoundingRect(range) {\n // XXX: to be revised when this Chrome bug is fixed:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=612459\n if (microsoft || browser.chrome) {\n // Workaround browser bugs: IE and Chrome would sometimes\n // return 0 or 1-width rectangles before or after the main\n // one. https://github.com/telerik/kendo/issues/4674\n\n // Actually Chrome 50 got worse, since the rectangles can now have the width of a\n // full character, making it hard to tell whether it's a bogus rectangle or valid\n // selection location. The workaround is to ignore rectangles that fall on the\n // previous line. https://github.com/telerik/kendo/issues/5740\n var rectangles = range.getClientRects(), box = {\n top : Infinity,\n right : -Infinity,\n bottom : -Infinity,\n left : Infinity\n }, done = false;\n for (var i = 0; i < rectangles.length; ++i) {\n var b = rectangles[i];\n if (b.width <= 1 || b.bottom === prevLineBottom) {\n continue; // bogus rectangle\n }\n box.left = Math.min(b.left , box.left);\n box.top = Math.min(b.top , box.top);\n box.right = Math.max(b.right , box.right);\n box.bottom = Math.max(b.bottom , box.bottom);\n done = true;\n }\n if (!done) {\n return range.getBoundingClientRect();\n }\n box.width = box.right - box.left;\n box.height = box.bottom - box.top;\n return box;\n }\n return range.getBoundingClientRect();\n }", "function supportRangeBounds() {\n var r, testElement, rangeBounds, rangeHeight, support = false;\n\n if (doc.createRange) {\n r = doc.createRange();\n if (r.getBoundingClientRect) {\n testElement = doc.createElement('boundtest');\n testElement.style.height = \"123px\";\n testElement.style.display = \"block\";\n doc.body.appendChild(testElement);\n\n r.selectNode(testElement);\n rangeBounds = r.getBoundingClientRect();\n rangeHeight = rangeBounds.height;\n\n if (rangeHeight === 123) {\n support = true;\n }\n doc.body.removeChild(testElement);\n }\n }\n\n return support;\n }", "function supportRangeBounds() {\n var r, testElement, rangeBounds, rangeHeight, support = false;\n\n if (doc.createRange) {\n r = doc.createRange();\n if (r.getBoundingClientRect) {\n testElement = doc.createElement('boundtest');\n testElement.style.height = \"123px\";\n testElement.style.display = \"block\";\n doc.body.appendChild(testElement);\n\n r.selectNode(testElement);\n rangeBounds = r.getBoundingClientRect();\n rangeHeight = rangeBounds.height;\n\n if (rangeHeight === 123) {\n support = true;\n }\n doc.body.removeChild(testElement);\n }\n }\n\n return support;\n }", "function BoundingBoxRect() { }", "function getRangeClientRectsChrome(range){var tempRange=range.cloneRange();var clientRects=[];for(var ancestor=range.endContainer;ancestor!=null;ancestor=ancestor.parentNode){// If we've climbed up to the common ancestor, we can now use the\r\n\t// original start point and stop climbing the tree.\r\n\tvar atCommonAncestor=ancestor===range.commonAncestorContainer;if(atCommonAncestor){tempRange.setStart(range.startContainer,range.startOffset);}else{tempRange.setStart(tempRange.endContainer,0);}var rects=Array.from(tempRange.getClientRects());clientRects.push(rects);if(atCommonAncestor){var _ref;clientRects.reverse();return(_ref=[]).concat.apply(_ref,clientRects);}tempRange.setEndBefore(ancestor);}true?true?invariant(false,'Found an unexpected detached subtree when getting range client rects.'):invariant(false):void 0;}", "function getClippingBBox(bounds) {\n return [[bounds.xmin, bounds.ymin],\n [bounds.xmin, bounds.ymax],\n [bounds.xmax, bounds.ymax],\n [bounds.xmax, bounds.ymin]];\n }", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "function getRangeBoundingClientRect(range) {\n\t // \"Return a DOMRect object describing the smallest rectangle that includes\n\t // the first rectangle in list and all of the remaining rectangles of which\n\t // the height or width is not zero.\"\n\t // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n\t var rects = getRangeClientRects(range);\n\t var top = 0;\n\t var right = 0;\n\t var bottom = 0;\n\t var left = 0;\n\n\t if (rects.length) {\n\t var _rects$ = rects[0];\n\t top = _rects$.top;\n\t right = _rects$.right;\n\t bottom = _rects$.bottom;\n\t left = _rects$.left;\n\n\t for (var ii = 1; ii < rects.length; ii++) {\n\t var rect = rects[ii];\n\t if (rect.height !== 0 || rect.width !== 0) {\n\t top = Math.min(top, rect.top);\n\t right = Math.max(right, rect.right);\n\t bottom = Math.max(bottom, rect.bottom);\n\t left = Math.min(left, rect.left);\n\t }\n\t }\n\t }\n\n\t return {\n\t top: top,\n\t right: right,\n\t bottom: bottom,\n\t left: left,\n\t width: right - left,\n\t height: bottom - top\n\t };\n\t}", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? true ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : undefined : undefined;\n}", "function mergeRectOffsets(rects) {\n return rects.reduce((previousRect, rect) => {\n if (previousRect == null) {\n return rect;\n }\n\n return {\n top: previousRect.top + rect.top,\n left: previousRect.left + rect.left,\n width: previousRect.width,\n height: previousRect.height,\n bottom: previousRect.bottom + rect.bottom,\n right: previousRect.right + rect.right,\n };\n });\n} // Calculate a boundingClientRect for a node relative to boundaryWindow,", "function _getBounds ( collection, bounds ) {\n var clipGroupElems, i, j;\n\n if ( collection.typename != 'GroupItem' ) { // ����� ��������� ������� �����������\n return collection.geometricBounds;\n }\n if ( collection.clipped ) { // ������ � ������ => ���� �����\n clipGroupElems = collection.pathItems;\n\n for ( i = 0; i < clipGroupElems.length; i++ ) {\n if ( clipGroupElems[ i ].clipping ) {\n if ( bounds == '' ) {\n bounds = clipGroupElems[ i ].geometricBounds;\n continue;\n }\n bounds = _compareBounds ( clipGroupElems[ i ], bounds );\n }\n }\n return bounds;\n }\n\n // ������ ��� ����������� ����� => ���� �� ��������� ������\n for ( j = 0; j < collection.pageItems.length; j++ ) {\n\n var el = collection.pageItems [ j ];\n\n if ( el.typename != 'GroupItem' ) { // ����� pageItem ����� ������\n if ( bounds == '' ) {\n bounds = el.geometricBounds;\n continue;\n }\n bounds = _compareBounds ( el, bounds );\n }\n\n if ( el.typename == 'GroupItem' && el.clipped ) { // ������ � ������ => ���� �����\n clipGroupElems = el.pathItems;\n for ( i = 0; i < clipGroupElems.length; i++ ) {\n if ( clipGroupElems[ i ].clipping ) {\n if ( bounds == '' ) {\n bounds = clipGroupElems[ i ].geometricBounds;\n continue;\n }\n bounds = _compareBounds ( clipGroupElems[ i ], bounds );\n }\n }\n continue;\n }\n\n if ( el.typename == 'GroupItem' && !el.groupItems && !el.clipped ) { // ������ ��� ����� � ��� �����\n if ( bounds == '' ) {\n bounds = el.geometricBounds;\n// bounds = getBoundsExtend ( el.pageItems, bounds );\n continue;\n }\n bounds = _compareBounds ( el.geometricBounds, bounds );\n continue;\n }\n\n if ( el.typename == 'GroupItem' && el.groupItems ) { // ������ ��� �����, �� � �������� => ��������\n for ( var l = 0; l < el.pageItems.length; l++ ) {\n /* if ( bounds == '' ) {\n bounds = getBoundsExtend ( el.pageItems[l], '' );\n }*/\n bounds = getBoundsExtend ( el.pageItems[ l ], bounds );\n }\n continue;\n }\n }\n return bounds;\n\n // �������� � ������� ����� ������� geometricBounds ��������\n function _compareBounds ( elem, boundsToCompare ) {\n var elemBounds = elem.geometricBounds;\n elemBounds[ 0 ] < boundsToCompare[ 0 ] ? boundsToCompare[ 0 ] = elemBounds[ 0 ] : '';\n elemBounds[ 1 ] > boundsToCompare[ 1 ] ? boundsToCompare[ 1 ] = elemBounds[ 1 ] : '';\n elemBounds[ 2 ] > boundsToCompare[ 2 ] ? boundsToCompare[ 2 ] = elemBounds[ 2 ] : '';\n elemBounds[ 3 ] < boundsToCompare[ 3 ] ? boundsToCompare[ 3 ] = elemBounds[ 3 ] : '';\n return boundsToCompare;\n }\n }", "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n !false ? 'development' !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "rectifyBBox (bbox) {\n // horizontal top\n if (bbox[0].y != bbox[1].y) {\n let ymin = Math.min(bbox[0].y, bbox[1].y)\n bbox[0].y = ymin\n bbox[1].y = ymin\n }\n\n // horizontal bottom\n if (bbox[3].y != bbox[2].y) {\n let ymax = Math.max(bbox[3].y, bbox[2].y)\n bbox[3].y = ymax\n bbox[2].y = ymax\n }\n\n // vertical right\n if (bbox[1].x != bbox[2].x) {\n let xmax = Math.max(bbox[1].x, bbox[2].x)\n bbox[1].x = xmax\n bbox[2].x = xmax\n }\n\n // vertical left\n if (bbox[0].x != bbox[3].x) {\n let xmin = Math.min(bbox[0].x, bbox[3].x)\n bbox[0].x = xmin\n bbox[3].x = xmin\n }\n\n return bbox\n }", "getBounds() {}", "function getRangeClientRectsChrome(range) {\n\t var tempRange = range.cloneRange();\n\t var clientRects = [];\n\n\t for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t if (atCommonAncestor) {\n\t tempRange.setStart(range.startContainer, range.startOffset);\n\t } else {\n\t tempRange.setStart(tempRange.endContainer, 0);\n\t }\n\t var rects = Array.from(tempRange.getClientRects());\n\t clientRects.push(rects);\n\t if (atCommonAncestor) {\n\t var _ref;\n\n\t clientRects.reverse();\n\t return (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\n\t true ? false ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n\t}", "get bounds () {\n const xMin = Math.min.apply(null, this.pointArr.map(pt => pt.x))\n const yMin = Math.min.apply(null, this.pointArr.map(pt => pt.y))\n const xMax = Math.max.apply(null, this.pointArr.map(pt => pt.x))\n const yMax = Math.max.apply(null, this.pointArr.map(pt => pt.y))\n\n return {\n x: xMin,\n y: yMin,\n width: xMax - xMin,\n height: yMax - yMax\n }\n }", "getRects() {\n if (!this.moving) { return this.clientRects; }\n else { return this.DOMcontainer.getBoundingClientRect(); }\n }", "bounds() {\n const _bounds = new HRect(this.rect);\n _bounds.offsetTo(0, 0);\n return _bounds;\n }", "bbox() {\n var maxX = -Infinity;\n var maxY = -Infinity;\n var minX = Infinity;\n var minY = Infinity;\n this.forEach(function (el) {\n maxX = Math.max(el[0], maxX);\n maxY = Math.max(el[1], maxY);\n minX = Math.min(el[0], minX);\n minY = Math.min(el[1], minY);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "get bounds() { return this._bounds; }", "get bounds() {}", "_calculateBounds() {\n // FILL IN//\n }", "get boundsValue() {}", "calc_range() {\n let z = this.zoom / this.drug.z\n let zk = (1 / z - 1) / 2\n\n let range = this.y_range.slice()\n let delta = range[0] - range[1]\n range[0] = range[0] + delta * zk\n range[1] = range[1] - delta * zk\n\n return range\n }", "function getBounds(bounds){\n\t var bbox = [];\n\t\n\t bbox.push(parseFloat(bounds.attrib[\"minlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"minlat\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlat\"]));\n\t\n\t return bbox;\n\t}", "function makeRangeBox(lon0, lat0, lon1, lat1) {\n\t var dlon4 = (lon1 - lon0) / 4;\n\t\n\t // TODO is this enough to handle ALL cases?\n\t // -- this makes scaling less precise than using d3.geo.graticule\n\t // as great circles can overshoot the boundary\n\t // (that's not a big deal I think)\n\t return {\n\t type: 'Polygon',\n\t coordinates: [\n\t [ [lon0, lat0],\n\t [lon0, lat1],\n\t [lon0 + dlon4, lat1],\n\t [lon0 + 2 * dlon4, lat1],\n\t [lon0 + 3 * dlon4, lat1],\n\t [lon1, lat1],\n\t [lon1, lat0],\n\t [lon1 - dlon4, lat0],\n\t [lon1 - 2 * dlon4, lat0],\n\t [lon1 - 3 * dlon4, lat0],\n\t [lon0, lat0] ]\n\t ]\n\t };\n\t}", "function makeRangeBox(lon0, lat0, lon1, lat1) {\n\t var dlon4 = (lon1 - lon0) / 4;\n\t\n\t // TODO is this enough to handle ALL cases?\n\t // -- this makes scaling less precise than using d3.geo.graticule\n\t // as great circles can overshoot the boundary\n\t // (that's not a big deal I think)\n\t return {\n\t type: 'Polygon',\n\t coordinates: [\n\t [ [lon0, lat0],\n\t [lon0, lat1],\n\t [lon0 + dlon4, lat1],\n\t [lon0 + 2 * dlon4, lat1],\n\t [lon0 + 3 * dlon4, lat1],\n\t [lon1, lat1],\n\t [lon1, lat0],\n\t [lon1 - dlon4, lat0],\n\t [lon1 - 2 * dlon4, lat0],\n\t [lon1 - 3 * dlon4, lat0],\n\t [lon0, lat0] ]\n\t ]\n\t };\n\t}", "getMapInnerBounds() {\n const mb = this.getMap()\n .getDiv()\n .getBoundingClientRect();\n\n let mib = {\n top: mb.top,\n right: mb.right,\n bottom: mb.bottom,\n left: mb.left\n };\n\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function getBounds() {\n let body = d3.select('body');\n let bounds = body.node().getBoundingClientRect();\n\n let bound = {height: bounds.height, width: bounds.width, margin:\n {top: 50, right: 30, bottom: 30, left: 100}};\n\n bound.height -= 100; // because of header\n bound.width -= (bound.margin.left + bound.margin.right);\n bound.height -= (bound.margin.top + bound.margin.bottom);\n\n return bound;\n}", "get getBoundingClientRects() {\n if (!this._boundingClientRects) {\n const innerBox = this._innerBoxHelper.nativeElement.getBoundingClientRect();\n const clientRect = this.element.getBoundingClientRect();\n this._boundingClientRects = {\n clientRect,\n innerWidth: innerBox.width,\n innerHeight: innerBox.height,\n scrollBarWidth: clientRect.width - innerBox.width,\n scrollBarHeight: clientRect.height - innerBox.height,\n };\n const resetCurrentBox = () => this._boundingClientRects = undefined;\n if (this._isScrolling) {\n this.scrolling.pipe(filter(scrolling => scrolling === 0), take(1)).subscribe(resetCurrentBox);\n }\n else {\n requestAnimationFrame(resetCurrentBox);\n }\n }\n return this._boundingClientRects;\n }", "_getNarrowedViewportRect() {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement.clientWidth;\n const height = this._document.documentElement.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - (2 * this._viewportMargin),\n height: height - (2 * this._viewportMargin),\n };\n }", "function getPixelRange() {\r\n\t\t$this = $['mapsettings'].element;\r\n\t\tvar xstart = 0;\r\n\t\tvar ystart = 0;\r\n\t\tif($['mapsettings'].initLeft<0) xstart = Math.abs($['mapsettings'].initLeft);\r\n\t\tif($['mapsettings'].initTop<0) ystart = Math.abs($['mapsettings'].initTop);\r\n\t\txstart = getFirstXPosInRange(xstart);\r\n\t\t// Makes sure that ystart values are multiples of 256 and start before viewport\r\n\t\tif(ystart%256!=0) ystart=((parseInt(ystart/256))-1)*256;\r\n\t\tvar xend = $this.innerWidth() - $['mapsettings'].initLeft;\r\n\t\tvar yend = $this.innerHeight() - $['mapsettings'].initTop;\r\n\t\treturn {\r\n\t\t\t\"start\": {\r\n\t\t\t\t\"x\": xstart,\r\n\t\t\t\t\"y\": ystart\r\n\t\t\t},\r\n\t\t\t\"end\": {\r\n\t\t\t\t\"x\": xend,\r\n\t\t\t\t\"y\": yend\r\n\t\t\t}\r\n\t\t};\r\n\t}", "function currentBounds(){var cntr=element?element.parent():null;var parent=cntr?cntr.parent():null;return parent?self.clientRect(parent):null;}", "_getRange() {\n const that = this;\n\n if (that.logarithmicScale) {\n that._range = that._drawMax - that._drawMin;\n return;\n }\n\n if (that.scaleType === 'floatingPoint') {\n that._range = (that._drawMax - that._drawMin).toString();\n }\n else {\n that._range = new JQX.Utilities.BigNumber(that._drawMax).subtract(that._drawMin).toString();\n }\n }", "_updateBoundingRect() {\n this._elBoundingRect = this.$el.getBoundingClientRect();\n\n // this has been introduced in 6c8234bb83d2df3e56f1b21a0caea4e4ef657eb4 and\n // breaks a lot of things... respecify the behavior when\n // normalizeCoordinates === false, because is not related to the given\n // element (this.$el) as implemented.\n // (the only app that depends on this option is probably coloop, so check it)\n // this._elBoundingRect = {\n // top: 0,\n // bottom: 0,\n // left: 0,\n // right: 0,\n // width: window.innerWidth,\n // height: window.innerHeight,\n // };\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "function itemBoundsDiff(item) {\r\r var itemVB = item.visibleBounds,\r itemVW = itemVB[2] - itemVB[0],\r itemVH = itemVB[1] - itemVB[3],\r\r itemGB = item.geometricBounds,\r itemGW = itemGB[2] - itemGB[0],\r itemGH = itemGB[1] - itemGB[3],\r\r deltaX = itemVW - itemGW,\r deltaY = itemVH - itemGH,\r\r diff = {\r deltaX: deltaX,\r deltaY: deltaY\r };\r\r return diff;\r}", "function computeAlternateBoundingBox(range) {\r\n\r\n\t\t// If the end of selection isn't at offset 0 into an element node (rather than a text node), then we just return the\r\n\t\t// original matching rectangle.\r\n\t\tif ((range.endOffset !== 0) && (range.endContainer.nodeType !== Node.ELEMENT_NODE)) {\r\n\t\t\tvar rect = range.getBoundingClientRect();\r\n\t\t\tvar mutableRect = {\r\n\t\t\t\ttop : rect.top,\r\n\t\t\t\tbottom : rect.bottom,\r\n\t\t\t\tleft : rect.left,\r\n\t\t\t\tright : rect.right,\r\n\t\t\t\twidth : rect.width,\r\n\t\t\t\theight : rect.height\r\n\t\t\t};\r\n\t\t\treturn mutableRect;\r\n\t\t}\r\n\r\n\t\t// This is the one we don't want.\r\n\t\tvar endElementRect = null;\r\n\t\ttry {\r\n\t\t\tendElementRect = range.endContainer.getBoundingClientRect();\r\n\t\t} catch(ex) {\r\n\t\t\tconsole.warn(\"Couldn't get a bounding client rect for our end element, maybe it's a text node.\");\r\n\t\t}\r\n\r\n\t\t// We look for a rectangle matching our end element, and if we find it, we don't copy it to our list to keep.\r\n\t\t// You'd think we could just grab the last element in range.getClientRects() here and trim that one, which might be\r\n\t\t// true, but the spec makes no claim that these are returned in order, so I don't want torely on that.\r\n\t\t// We keep track if we remove a rectangle, as we're only trying to remove one for the trailnig element. If there are\r\n\t\t// more than one matching rectangle, we want to keep all but one of them.\r\n\t\tvar foundEnd = false;\r\n\t\tvar keptRects = [];\r\n\t\tvar initialRects = range.getClientRects();\r\n\t\tfor (var i = 0; i < initialRects.length; i++) {\r\n\t\t\tif (rectanglesEqual(endElementRect, initialRects[i]) && !foundEnd) {\r\n\t\t\t\tfoundEnd = true;\r\n\t\t\t\tconsole.log(\"Omitting empty trailing selection element from preview.\");\r\n\t\t\t} else {\r\n\t\t\t\tkeptRects.push(initialRects[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Now compute our new bounding box and return that.\r\n\t\tif (keptRects.length == 0)\r\n\t\t\treturn range.getBoundingClientRect();\r\n\t\tif (keptRects.length == 1)\r\n\t\t\treturn keptRects[0];\r\n\r\n\t\tvar rect = keptRects[0];\r\n\t\tfor (var i = 1; i < keptRects.length; i++) {\r\n\t\t\trect = unionRectangles(rect, keptRects[i]);\r\n\t\t}\r\n\r\n\t\treturn rect;\r\n\t}", "function getVisibleBounds(object) {\n var bounds, clippedItem;\n if (object.typename == \"GroupItem\") {\n // if the object is clipped\n if (object.clipped) {\n // check all sub objects to find the clipping path\n for (var i = 0; i < object.pageItems.length; i++) {\n if (object.pageItems[i].clipping) {\n clippedItem = object.pageItems[i];\n break;\n } else if (object.pageItems[i].typename == \"CompoundPathItem\") {\n if (object.pageItems[i].pathItems[0].clipping) {\n clippedItem = object.pageItems[i];\n break;\n }\n } else {\n clippedItem = object.pageItems[i];\n break;\n }\n }\n bounds = clippedItem.geometricBounds;\n } else {\n // if the object is not clipped\n var subObjectBounds;\n var allBoundPoints = [[], [], [], []];\n // get the bounds of every object in the group\n for (var i = 0; i < object.pageItems.length; i++) {\n subObjectBounds = getVisibleBounds(object.pageItems[i]);\n allBoundPoints[0].push(subObjectBounds[0]);\n allBoundPoints[1].push(subObjectBounds[1]);\n allBoundPoints[2].push(subObjectBounds[2]);\n allBoundPoints[3].push(subObjectBounds[3]);\n }\n // determine the groups bounds from it sub object bound points\n bounds = [\n Math.min.apply(Math, allBoundPoints[0]),\n Math.max.apply(Math, allBoundPoints[1]),\n Math.max.apply(Math, allBoundPoints[2]),\n Math.min.apply(Math, allBoundPoints[3]),\n ];\n }\n } else {\n bounds = object.geometricBounds;\n }\n return bounds;\n}", "function getVisibleBounds(object) {\n var bounds, clippedItem;\n if (object.typename == \"GroupItem\") {\n // if the object is clipped\n if (object.clipped) {\n // check all sub objects to find the clipping path\n for (var i = 0; i < object.pageItems.length; i++) {\n if (object.pageItems[i].clipping) {\n clippedItem = object.pageItems[i];\n break;\n } else if (object.pageItems[i].typename == \"CompoundPathItem\") {\n if (object.pageItems[i].pathItems[0].clipping) {\n clippedItem = object.pageItems[i];\n break;\n }\n } else {\n clippedItem = object.pageItems[i];\n break;\n }\n }\n bounds = clippedItem.geometricBounds;\n } else {\n // if the object is not clipped\n var subObjectBounds;\n var allBoundPoints = [[], [], [], []];\n // get the bounds of every object in the group\n for (var i = 0; i < object.pageItems.length; i++) {\n subObjectBounds = getVisibleBounds(object.pageItems[i]);\n allBoundPoints[0].push(subObjectBounds[0]);\n allBoundPoints[1].push(subObjectBounds[1]);\n allBoundPoints[2].push(subObjectBounds[2]);\n allBoundPoints[3].push(subObjectBounds[3]);\n }\n // determine the groups bounds from it sub object bound points\n bounds = [\n Math.min.apply(Math, allBoundPoints[0]),\n Math.max.apply(Math, allBoundPoints[1]),\n Math.max.apply(Math, allBoundPoints[2]),\n Math.min.apply(Math, allBoundPoints[3]),\n ];\n }\n } else {\n bounds = object.geometricBounds;\n }\n return bounds;\n}", "function rectangle_zoom(pos) {\n\tif (! ('x' in pos && 'y' in pos && 'width' in pos && 'height' in pos) || typeof pos.x == 'undefined' || typeof pos.y == 'undefined' || typeof pos.width == 'undefined' || typeof pos.height == 'undefined' ||\n\t(pos.width < 10 && pos.height < 10)) {\n\t\t$(\"selection-box\").hide();\n\t\tzoom_vals = {};\n\t\treturn;\n\t}\n\t\n\tvar $container = $('#canvas');\n\tvar loc = {\t\n\t\t'start1': pos.x - margin.left - $container.position().left,\n\t\t'end1': pos.x + pos.width - margin.left - $container.position().left,\n\t\t'start2': pos.y - margin.top - $container.position().top,\n\t\t'end2': pos.y + pos.height - margin.top - $container.position().top\n\t};\n\t\n\tvar nloc = {\n\t\t'start1': parseInt( scales.xback( loc.start1 ) ),\n\t\t'end1': parseInt( scales.xback( loc.end1 ) ),\n\t\t'start2': parseInt( scales.yback( loc.start2 ) ),\n\t\t'end2': parseInt( scales.yback( loc.end2 ) )\n\t};\n\tif (nloc.start1 > nloc.end1) {\n\t\tvar s1 = nloc.start1;\n\t\tnloc.start1 = nloc.end1;\n\t\tnloc.end1 = nloc.start1;\n\t}\n\tif (nloc.start2 > nloc.end2) {\n\t\tvar s2 = nloc.start2;\n\t\tnloc.start2 = nloc.end2;\n\t\tnloc.end2 = s2;\n\t}\n\t\n\t// Check limits\n\tvar max1 = cached_genomes.genomes[ get_par( 'sp1' ) ].max_pnum_display;\n\tvar max2 = cached_genomes.genomes[ get_par( 'sp2' ) ].max_pnum_display;\n\tif ( nloc.start1 < 0 ) { nloc.start1 = 0; }\n\tif ( nloc.start2 < 0 ) { nloc.start2 = 0; }\n\tif ( nloc.end1 > max1) { nloc.end1 = max1; }\n\tif ( nloc.end2 > max2) { nloc.end2 = max2; }\n\t\n\t// Update coordinates\n\tzoom_vals = nloc;\n}", "function drawBounds(bounds) {\n var boundsGroup = doc.groupItems.add();\n boundsGroup.name = \"BOUNDS\";\n var topLeft = drawBoundMark([\n [bounds[0], bounds[1] - 10],\n [bounds[0], bounds[1]],\n [bounds[0] + 10, bounds[1]],\n ]);\n topLeft.moveToEnd(boundsGroup);\n var topRight = drawBoundMark([\n [bounds[2], bounds[1] - 10],\n [bounds[2], bounds[1]],\n [bounds[2] - 10, bounds[1]],\n ]);\n topRight.moveToEnd(boundsGroup);\n var bottomLeft = drawBoundMark([\n [bounds[0], bounds[3] + 10],\n [bounds[0], bounds[3]],\n [bounds[0] + 10, bounds[3]],\n ]);\n bottomLeft.moveToEnd(boundsGroup);\n var bottomRight = drawBoundMark([\n [bounds[2], bounds[3] + 10],\n [bounds[2], bounds[3]],\n [bounds[2] - 10, bounds[3]],\n ]);\n bottomRight.moveToEnd(boundsGroup);\n}", "function clientToWinRTRect(e) {\n var zoomFactor = document.documentElement.msContentZoomFactor;\n return {\n x: e.pageX,\n y: e.pageY,\n width: 80,\n height: 80\n };\n }", "getBounds() {\n throw \"Abstract method\" \n }", "computeDomainsFromBounds (bounds) {\n var xmin = bounds[0][0]\n var xmax = bounds[1][0]\n var ymin = bounds[0][1]\n var ymax = bounds[1][1]\n var xRange = xmax - xmin\n var yRange = ymax - ymin\n\n const { options } = this.transitive\n\n var paddingFactor = (options && options.paddingFactor)\n ? options.paddingFactor\n : 0.1\n\n var margins = this.getMargins()\n\n var usableHeight = this.height - margins.top - margins.bottom\n var usableWidth = this.width - margins.left - margins.right\n var displayAspect = this.width / this.height\n var usableDisplayAspect = usableWidth / usableHeight\n var graphAspect = xRange / (yRange === 0 ? -Infinity : yRange)\n\n var padding\n var dispX1, dispX2, dispY1, dispY2\n var dispXRange, dispYRange\n\n if (usableDisplayAspect > graphAspect) { // y-axis is limiting\n padding = paddingFactor * yRange\n dispY1 = ymin - padding\n dispY2 = ymax + padding\n dispYRange = yRange + 2 * padding\n var addedYRange = (this.height / usableHeight * dispYRange) - dispYRange\n if (margins.top > 0 || margins.bottom > 0) {\n dispY1 -= margins.bottom / (margins.bottom + margins.top) * addedYRange\n dispY2 += margins.top / (margins.bottom + margins.top) * addedYRange\n }\n dispXRange = (dispY2 - dispY1) * displayAspect\n var xOffset = (margins.left - margins.right) / this.width\n var xMidpoint = (xmax + xmin - dispXRange * xOffset) / 2\n dispX1 = xMidpoint - dispXRange / 2\n dispX2 = xMidpoint + dispXRange / 2\n } else { // x-axis limiting\n padding = paddingFactor * xRange\n dispX1 = xmin - padding\n dispX2 = xmax + padding\n dispXRange = xRange + 2 * padding\n var addedXRange = (this.width / usableWidth * dispXRange) - dispXRange\n if (margins.left > 0 || margins.right > 0) {\n dispX1 -= margins.left / (margins.left + margins.right) * addedXRange\n dispX2 += margins.right / (margins.left + margins.right) * addedXRange\n }\n\n dispYRange = (dispX2 - dispX1) / displayAspect\n var yOffset = (margins.bottom - margins.top) / this.height\n var yMidpoint = (ymax + ymin - dispYRange * yOffset) / 2\n dispY1 = yMidpoint - dispYRange / 2\n dispY2 = yMidpoint + dispYRange / 2\n }\n\n return [\n [dispX1, dispX2],\n [dispY1, dispY2]\n ]\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get bounds() {\r\n\t\treturn {\r\n\t\t\tx: this.origin.x * (this.tileSize + this.spacing),\r\n\t\t\ty: this.origin.y * (this.tileSize + this.spacing),\r\n\t\t\tw: this.w * (this.tileSize + this.spacing) - this.spacing,\r\n\t\t\th: this.h * (this.tileSize + this.spacing) - this.spacing\r\n\t\t};\r\n\t}", "function computeAlternateBoundingBox(range) {\n \n // If the end of selection isn't at offset 0 into an element node (rather than a text node), then we just return the\n // original matching rectangle.\n if ((range.endOffset !== 0) && (range.endContainer.nodeType !== Node.ELEMENT_NODE)) {\n var rect = range.getBoundingClientRect();\n var mutableRect = {\n top: rect.top,\n bottom: rect.bottom,\n left: rect.left,\n right: rect.right,\n width: rect.width,\n height: rect.height\n };\n return mutableRect;\n }\n\n // This is the one we don't want.\n var endElementRect = null;\n try {\n endElementRect = range.endContainer.getBoundingClientRect();\n }\n catch(ex) {\n console.warn(\"Couldn't get a bounding client rect for our end element, maybe it's a text node.\");\n }\n\n // We look for a rectangle matching our end element, and if we find it, we don't copy it to our list to keep.\n // You'd think we could just grab the last element in range.getClientRects() here and trim that one, which might be\n // true, but the spec makes no claim that these are returned in order, so I don't want torely on that.\n // We keep track if we remove a rectangle, as we're only trying to remove one for the trailnig element. If there are\n // more than one matching rectangle, we want to keep all but one of them.\n var foundEnd = false;\n var keptRects = [];\n var initialRects = range.getClientRects();\n for (var i = 0; i < initialRects.length; i++) {\n if (rectanglesEqual(endElementRect, initialRects[i]) && !foundEnd) {\n foundEnd = true;\n console.log(\"Omitting empty trailing selection element from preview.\");\n }\n else {\n keptRects.push(initialRects[i]);\n }\n }\n\n // Now compute our new bounding box and return that.\n if (keptRects.length == 0) return range.getBoundingClientRect();\n if (keptRects.length == 1) return keptRects[0];\n\n var rect = keptRects[0];\n for (var i = 1; i < keptRects.length; i++) {\n rect = unionRectangles(rect, keptRects[i]);\n }\n\n return rect;\n }", "function normBounds( bounds ) {\n\n\t\tfor ( var i = ticks.length; i >= 0; i-- ) {\n\t\t\tif ( bounds[0] + unit / 2 >= ticks[i] ) {\n\t\t\t\tbounds[0] = ticks[i] - 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor ( var i = 0; i <= ticks.length; i++ ) {\n\t\t\tif ( bounds[1] - unit / 2 <= ticks[i] ) {\n\t\t\t\tbounds[1] = ticks[i] + 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn bounds;\n\t}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect(); // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n\n var rect = {};\n\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n }", "function get_bounds(){\n\t\t\t\t\n\t\t\t\treturn {\n\t\t\t\t\t\n\t\t\t\t\tsw_lat : map.getBounds().getSouthWest().lat(),\n\t\t\t\t\t\n\t\t\t\t\tsw_lng : map.getBounds().getSouthWest().lng(),\n\t\t\t\t\t\n\t\t\t\t\tne_lat : map.getBounds().getNorthEast().lat(),\n\t\t\t\t\t\n\t\t\t\t\tne_lng : map.getBounds().getNorthEast().lng()\n\t\t\t\t\n\t\t\t\t};\n\t\t\t\n\t\t\t}", "function getBoundingRectLocs (center, grid) {\n var jQueryDoc = $(window.document),\n jQH = jQueryDoc.height(),\n jQW = jQueryDoc.width(),\n R = jQH/jQW,\n size = (grid ||.002);\n\n center.latitude = Math.round(center.latitude/(2*size))*(2*size);\n center.longitude = Math.round(center.longitude/(2*size/R))*(2*size/R);\n\n return [\n center.latitude + size,\n center.longitude - size/R,\n center.latitude - size,\n center.longitude + size/R\n ];\n\n }", "getBounds() {\n return new Rectangle(new Point(this.x, this.y), new Vector(0, 0));\n }", "function getBoundingBox () {\n let boundingBox = map.getBounds()\n xmin = parseFloat(boundingBox._sw.lng)\n ymin = parseFloat(boundingBox._sw.lat)\n xmax = parseFloat(boundingBox._ne.lng)\n ymax = parseFloat(boundingBox._ne.lat)\n\n //console.log(`${xmin}, ${ymin}, ${xmax}, ${ymax}`)\n}", "function getBoundingBox(selectables) {\n const box = {\n top: Infinity,\n left: Infinity,\n bottom: -Infinity,\n right: -Infinity,\n width: 0,\n height: 0,\n };\n selectables.forEach(s => {\n box.top = Math.min(box.top, s.metrics.clientRect.top);\n box.left = Math.min(box.left, s.metrics.clientRect.left);\n box.bottom = Math.max(box.bottom, s.metrics.clientRect.bottom);\n box.right = Math.max(box.right, s.metrics.clientRect.right);\n });\n return Object.assign({}, box, { width: box.right - box.left, height: box.bottom - box.top });\n }", "function _getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect(); // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n\n var rect = {};\n\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n try {\n if (node.ownerDocument !== document) {\n var frameElement = node.ownerDocument.defaultView.frameElement;\n\n if (frameElement) {\n var frameRect = _getActualBoundingClientRect(frameElement);\n\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n } catch (err) {// Ignore \"Access is denied\" in IE11/Edge\n }\n\n return rect;\n }", "calculateBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n if (this.graphicsData.length) {\n var shape = null;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineStyle ? data.lineStyle.width : 0;\n shape = data.shape;\n if (type === ShapeSettings_1.ShapeSettings.SHAPES.RECT || type === ShapeSettings_1.ShapeSettings.SHAPES.RREC) {\n x = shape.x - (lineWidth / 2);\n y = shape.y - (lineWidth / 2);\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + (lineWidth / 2);\n h = shape.radius + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + (lineWidth / 2);\n h = shape.height + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt((dx * dx) + (dy * dy));\n if (w < 1e-9) {\n continue;\n }\n rw = ((h / w * dy) + dx) / 2;\n rh = ((h / w * dx) + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var padding = this.boundsPadding;\n this._bounds.minX = minX - padding;\n this._bounds.maxX = maxX + padding;\n this._bounds.minY = minY - padding;\n this._bounds.maxY = maxY + padding;\n }", "getMapInnerBounds() {\n const mb = this.getMap().getDiv().getBoundingClientRect();\n const mib = {\n top: mb.top + this._opts.edgeOffset.top,\n right: mb.right - this._opts.edgeOffset.right,\n bottom: mb.bottom - this._opts.edgeOffset.bottom,\n left: mb.left + this._opts.edgeOffset.left\n };\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function getWindowBoundaries() {\n\tconst { pageXOffset, pageYOffset } = getWindowScrollPosition();\n\tconst { width, height } = getWindowSize();\n\tconst xMin = pageXOffset;\n\tconst xMax = pageXOffset + width;\n\tconst yMin = pageYOffset;\n\tconst yMax = pageYOffset + height;\n\treturn { xMin, xMax, yMin, yMax };\n}", "function myGetBounds(myPage, myDocument)\n{\n var array = new Array()\n var item = 0;\n with (myDocument.documentPreferences)\n {\n var myPageHeight = pageHeight;\n var myPageWidth = pageWidth;\n }\n\n with(myPage.marginPreferences)\n {\n var myX1 = left;\n var myY1 = top;\n var myY2 = bottom;\n var myX2 = right;\n }\n\n array[item++] = myY1;\n array[item++] = myX1;\n array[item++] = myPageHeight - myY2;\n array[item++] = myPageWidth - myX2;\n\n return array;\n}", "_computeRects(props) {\n var {\n highlight,\n offsetParent\n } = props; // Get the set of rectangles that covers the range's text, relative to\n // the offset parent.\n\n var clientRects = getClientRectsForTextInRange(highlight.domRange);\n var offsetParentRect = offsetParent.getBoundingClientRect();\n var relativeRects = clientRects.map(rect => getRelativeRect(rect, offsetParentRect));\n return relativeRects;\n }", "function getBoundariesFor(obj) {\r\n\t\treturn {\r\n\t\t\ttop: obj.center.y - (obj.size.height / 2.5),\r\n\t\t\tbottom: obj.center.y + (obj.size.height / 2.5),\r\n\t\t\tleft: obj.center.x - (obj.size.width / 2.5),\r\n\t\t\tright: obj.center.x + (obj.size.width / 2.5)\r\n\t\t};\r\n\t}", "get localBounds() {\n return {\n x: this.x, //I changed this, it was \"x: 0,\"\n y: this.y, //I changed this, it was \"y: 0,\"\n width: this.width,\n height: this.height\n } \n }", "get localBounds() {}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "function getActualBoundingClientRect(node) {\n var boundingRect = node.getBoundingClientRect();\n\n // The original object returned by getBoundingClientRect is immutable, so we clone it\n // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9\n var rect = {};\n for (var k in boundingRect) {\n rect[k] = boundingRect[k];\n }\n\n if (node.ownerDocument !== document) {\n var _frameElement = node.ownerDocument.defaultView.frameElement;\n if (_frameElement) {\n var frameRect = getActualBoundingClientRect(_frameElement);\n rect.top += frameRect.top;\n rect.bottom += frameRect.top;\n rect.left += frameRect.left;\n rect.right += frameRect.left;\n }\n }\n\n return rect;\n}", "get rects() {\n return this.layers\n .filter(layer => layer.active)\n .map(layer => this.getLayerRects(layer)).reduce((cur, prev) => {\n return prev.concat(cur);\n }, []);\n }" ]
[ "0.6959988", "0.68512255", "0.67454785", "0.6735959", "0.6735959", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.6730091", "0.67230105", "0.67230105", "0.6667721", "0.6667721", "0.66466224", "0.6546593", "0.6540454", "0.64944816", "0.64944816", "0.64944816", "0.64944816", "0.64944816", "0.64944816", "0.64944816", "0.64778495", "0.64715075", "0.6459528", "0.64344627", "0.64207214", "0.64063513", "0.63714635", "0.6355642", "0.6335036", "0.6311311", "0.6290875", "0.6263119", "0.62556446", "0.6239307", "0.62042594", "0.61924076", "0.61562645", "0.61317545", "0.610392", "0.6078972", "0.6070021", "0.6063876", "0.6050787", "0.60449404", "0.60358053", "0.6029309", "0.60240453", "0.60210615", "0.60146993", "0.6009604", "0.6009604", "0.60087985", "0.6004719", "0.59905165", "0.59905165", "0.59856635", "0.5985136", "0.59849244", "0.59844315", "0.5982487", "0.5977752", "0.5977752", "0.5977752", "0.5974725", "0.59408605", "0.59403044", "0.5933426", "0.593115", "0.59278476", "0.59266317", "0.59172606", "0.590708", "0.59028727", "0.5897988", "0.5896758", "0.5884676", "0.58815056", "0.58732677", "0.5849293", "0.58441836", "0.5843681", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.5814959", "0.58143944" ]
0.0
-1
Coverts a box from "div" coords to another coordinate system. Context may be "window", "page", "div", or "local"./null.
function fromCoordSystem(cm, coords, context) { if (context == "div") { return coords } var left = coords.left, top = coords.top; // First move into "page" coordinate system if (context == "page") { left -= pageScrollX(); top -= pageScrollY(); } else if (context == "local" || !context) { var localBox = cm.display.sizer.getBoundingClientRect(); left += localBox.left; top += localBox.top; } var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = getRect(cm.display.sizer);\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = getRect(cm.display.lineSpace);\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height;\n rect.bottom += height;\n }\n\n if (context == \"line\") {\n return rect;\n }\n\n if (!context) {\n context = \"local\";\n }\n\n var yOff = _heightAtLine(lineObj);\n\n if (context == \"local\") {\n yOff += paddingTop(cm.display);\n } else {\n yOff -= cm.display.viewOffset;\n }\n\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff;\n rect.right += xOff;\n }\n\n rect.top += yOff;\n rect.bottom += yOff;\n return rect;\n } // Coverts a box from \"div\" coords to another coordinate system.", "function fromCoordSystem(cm, coords, context) {\n\t\t if (context == \"div\") return coords;\n\t\t var left = coords.left, top = coords.top;\n\t\t // First move into \"page\" coordinate system\n\t\t if (context == \"page\") {\n\t\t left -= pageScrollX();\n\t\t top -= pageScrollY();\n\t\t } else if (context == \"local\" || !context) {\n\t\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t\t left += localBox.left;\n\t\t top += localBox.top;\n\t\t }\n\t\t\n\t\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t\t }", "function fromCoordSystem(cm, coords, context) {\n\t\t if (context == \"div\") { return coords }\n\t\t var left = coords.left, top = coords.top;\n\t\t // First move into \"page\" coordinate system\n\t\t if (context == \"page\") {\n\t\t left -= pageScrollX(doc(cm));\n\t\t top -= pageScrollY(doc(cm));\n\t\t } else if (context == \"local\" || !context) {\n\t\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t\t left += localBox.left;\n\t\t top += localBox.top;\n\t\t }\n\n\t\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n\t\t }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") return coords;\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n }", "function fromCoordSystem(cm, coords, context) {\r\n if (context == \"div\") return coords;\r\n var left = coords.left, top = coords.top;\r\n // First move into \"page\" coordinate system\r\n if (context == \"page\") {\r\n left -= pageScrollX();\r\n top -= pageScrollY();\r\n } else if (context == \"local\" || !context) {\r\n var localBox = cm.display.sizer.getBoundingClientRect();\r\n left += localBox.left;\r\n top += localBox.top;\r\n }\r\n\r\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\r\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\r\n }", "function fromCoordSystem(cm, coords, context) {\n\t if (context == \"div\") return coords;\n\t var left = coords.left, top = coords.top;\n\t // First move into \"page\" coordinate system\n\t if (context == \"page\") {\n\t left -= pageScrollX();\n\t top -= pageScrollY();\n\t } else if (context == \"local\" || !context) {\n\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t left += localBox.left;\n\t top += localBox.top;\n\t }\n\t\n\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }", "function fromCoordSystem(cm, coords, context) {\n\t if (context == \"div\") return coords;\n\t var left = coords.left, top = coords.top;\n\t // First move into \"page\" coordinate system\n\t if (context == \"page\") {\n\t left -= pageScrollX();\n\t top -= pageScrollY();\n\t } else if (context == \"local\" || !context) {\n\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t left += localBox.left;\n\t top += localBox.top;\n\t }\n\n\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t }", "function fromCoordSystem(cm, coords, context) {\n\t if (context == \"div\") return coords;\n\t var left = coords.left, top = coords.top;\n\t // First move into \"page\" coordinate system\n\t if (context == \"page\") {\n\t left -= pageScrollX();\n\t top -= pageScrollY();\n\t } else if (context == \"local\" || !context) {\n\t var localBox = cm.display.sizer.getBoundingClientRect();\n\t left += localBox.left;\n\t top += localBox.top;\n\t }\n\n\t var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n\t return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};\n\t }", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\r\n if (context == \"div\") { return coords }\r\n var left = coords.left, top = coords.top;\r\n // First move into \"page\" coordinate system\r\n if (context == \"page\") {\r\n left -= pageScrollX();\r\n top -= pageScrollY();\r\n } else if (context == \"local\" || !context) {\r\n var localBox = cm.display.sizer.getBoundingClientRect();\r\n left += localBox.left;\r\n top += localBox.top;\r\n }\r\n\r\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\r\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\r\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX()\n top -= pageScrollY()\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect()\n left += localBox.left\n top += localBox.top\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n}", "function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") {\n return coords;\n }\n\n var left = coords.left,\n top = coords.top; // First move into \"page\" coordinate system\n\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {\n left: left - lineSpaceBox.left,\n top: top - lineSpaceBox.top\n };\n }", "function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect(); // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n\n lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;\n }\n\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || top + (obj.height || height);\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n } // Move the box along a particular axis. Optionally pass in an amount to move", "function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}", "function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}", "function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}", "function placeDiv(div, x, y) {\n\t// div.x = Math.round(x*CELL);\n\t// div.y = Math.round(y*CELL);\n\tdiv.css({\n\t\tleft: units(x),\n\t\ttop: units(y),\n\t});\n\treturn div;\n}", "function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects =\n (rects = obj.div.childNodes) &&\n (rects = rects[0]) &&\n rects.getClientRects &&\n rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects\n ? Math.max(\n (rects[0] && rects[0].height) || 0,\n obj.height / rects.length\n )\n : 0;\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || top + (obj.height || height);\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n }", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n}", "function BoxPosition(obj) {\n var isIE8 = (/MSIE\\s8\\.0/).test(navigator.userAgent);\n\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n\n if (isIE8 && !this.lineHeight) {\n this.lineHeight = 13;\n }\n}", "function positionDivToCursor(e,divId) {\n\t\n\tvar mousex = e.clientX;\n\tvar mousey = e.clientY;\n\tvar innerHeight = window.innerHeight;\n\t\n\t// Adjust Y for IE\n\tif (globalBrowser != \"ie\")\n\t\tmousey = parseInt(mousey) + 15;\n\t\n\t// Adjust height\n\tif ((parseInt(mousey) + globalContextHeight) > innerHeight)\n\t\tmousey = mousey - globalContextHeight;\n\t\n\t// Set coordinates for context menu and display\n\tdocument.getElementById(divId).style.left = mousex + 'px';\n\tdocument.getElementById(divId).style.top = mousey + 'px';\n\tdocument.getElementById(divId).style.visibility = 'visible';\n\tdocument.getElementById(divId).style.display = '';\n}", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function copyBoxInto(box, originBox) {\n copyAxisInto(box.x, originBox.x);\n copyAxisInto(box.y, originBox.y);\n}", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function getBox(o) {\n return {\n xMin: o.position.x,\n xMax: o.position.x + o.width,\n yMin: o.position.y,\n yMax: o.position.y + o.height\n };\n }", "function getBox(o) {\n return {\n xMin: o.position.x,\n xMax: o.position.x + o.width,\n yMin: o.position.y,\n yMax: o.position.y + o.height\n };\n }", "function drawBoxwh(x1,y1, width, height, color)\r\n{\t\r\n\t//set position to be relative\r\n\tx1 = x1 - world_coords.x;\r\n\ty1 = y1 - world_coords.y;\r\n\t\r\n\t//fix y\r\n\ty1 = window.height - y1;\r\n\t\r\n\t//draw\r\n\tif(squareOnScreen(x1, y1, width, height))\r\n\t{\r\n\t\tcontext.beginPath();\r\n\t\tcontext.strokeStyle = color;\r\n\t\tcontext.strokeRect(x1,y1,width,-height);\r\n\t\tcontext.stroke();\r\n\t\tcontext.closePath();\r\n\t}\r\n}", "positionDiv() {\n const point = this.getProjection().fromLatLngToDivPixel(this.latlng);\n if (point) {\n this.div.style.left = `${point.x}px`;\n this.div.style.top = `${point.y}px`;\n }\n }", "function renderBox(context, frame, options) {\n const { fill, stroke } = options || {};\n const locs = locsFrameTrans(\n [[-1, -1], [1, -1], [1, 1], [-1, 1]], \n frame,\n identityFrame\n );\n context.beginPath();\n context.moveTo(...locs[0]);\n [1, 2, 3, 0].forEach(i => context.lineTo(...locs[i]));\n if (fill) { context.fill(); }\n if (stroke) { context.stroke(); }\n}", "merge(box) {\n let x = Math.min(this.x, box.x);\n let y = Math.min(this.y, box.y);\n let width = Math.max(this.x + this.width, box.x + box.width) - x;\n let height = Math.max(this.y + this.height, box.y + box.height) - y;\n return new Box_Box(x, y, width, height);\n }", "function mouseCoordsToElem(div,mouseEvent){//y coords not verified \n //var div=document.getElementById(divId);\n var documentCoords=findDocumentCoords(mouseEvent);\n var div0 = div.getBoundingClientRect();\n var x=documentCoords.x- div0.left - window.pageXOffset;\n //var x=documentCoords.x-(div0.left+document.body.scrollLeft);\n var y=documentCoords.y- div0.top - window.pageYOffset;\n return{\n x:x,\n y:y//y coords not verified \n };\n}", "function setBox(/*DomNode*/ node, /*Number?*/ l, /*Number?*/ t, /*Number?*/ w, /*Number?*/ h, /*String?*/ u){\n\t\t// summary:\n\t\t//\t\tsets width/height/left/top in the current (native) box-model\n\t\t//\t\tdimensions. Uses the unit passed in u.\n\t\t// node:\n\t\t//\t\tDOM Node reference. Id string not supported for performance\n\t\t//\t\treasons.\n\t\t// l:\n\t\t//\t\tleft offset from parent.\n\t\t// t:\n\t\t//\t\ttop offset from parent.\n\t\t// w:\n\t\t//\t\twidth in current box model.\n\t\t// h:\n\t\t//\t\twidth in current box model.\n\t\t// u:\n\t\t//\t\tunit measure to use for other measures. Defaults to \"px\".\n\t\tu = u || \"px\";\n\t\tvar s = node.style;\n\t\tif(!isNaN(l)){\n\t\t\ts.left = l + u;\n\t\t}\n\t\tif(!isNaN(t)){\n\t\t\ts.top = t + u;\n\t\t}\n\t\tif(w >= 0){\n\t\t\ts.width = w + u;\n\t\t}\n\t\tif(h >= 0){\n\t\t\ts.height = h + u;\n\t\t}\n\t}", "function setCoordinates(divId, containerId, x, y) {\n const div = document.getElementById(divId);\n\n div.style.position = 'absolute';\n div.style.left = x - div.offsetWidth/2 + 'px';\n div.style.top = y - div.offsetHeight/2 + 'px';\n}", "getWorldHitbox() {\n\t\tvar worldPoint = this.convertCoordinates();\n\t\tvar diff = this.getWidth() - this.getHeight();\n\t\treturn new Hitbox(worldPoint.x + diff/2, worldPoint.y, this.getWidth() - 7 - diff, this.getHeight() - 7);\n\t}", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function boundingBox( jqNode, jqGraph, box ) {\n var v = jqNode.offset();\n var graphOffset = jqGraph.offset();\n var top = v.top - graphOffset.top;\n var left = v.left - graphOffset.left;\n box = box || {};\n box.top = top;\n box.left = left;\n box.right = left + jqNode.width();\n box.bottom = top + jqNode.height();\n return box;\n }", "function _(e){var i=q(w);e.within={element:i,isWindow:true,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.width(),height:i.height()};e.collisionPosition={marginLeft:0,marginTop:0};return e;}", "function _(e){var i=q(w);e.within={element:i,isWindow:true,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.width(),height:i.height()};e.collisionPosition={marginLeft:0,marginTop:0};return e;}", "function _(e){var f=q(w);e.within={element:f,isWindow:true,offset:f.offset()||{left:0,top:0},scrollLeft:f.scrollLeft(),scrollTop:f.scrollTop(),width:f.width(),height:f.height()};e.collisionPosition={marginLeft:0,marginTop:0};return e;}", "function getDivCenter(obj) {\n var pos = new esri.geometry.Point();\n pos.spatialReference = map.spatialReference;\n // divHeight = obj.style.height;\n // divWidth = obj.style.width;\n // pos.y = parseInt(divHeight.substr(0, divHeight.length)) / 2;\n // pos.x = parseInt(divWidth.substr(0, divWidth.length)) / 2;\n pos.y = obj.offsetHeight / 2;\n pos.x = obj.offsetWidth / 2;\n return pos;\n}", "setBoxCoords(_id, _coords) {\n const [x, y, w, h] = _coords;\n this.setStyle(_id, 'left', `${x}px`);\n this.setStyle(_id, 'top', `${y}px`);\n this.setStyle(_id, 'width', `${w}px`);\n this.setStyle(_id, 'height', `${h}px`);\n }", "setBoxCoords(_id, _coords) {\n const [x, y, w, h] = _coords;\n this.setStyle(_id, 'left', `${x}px`);\n this.setStyle(_id, 'top', `${y}px`);\n this.setStyle(_id, 'width', `${w}px`);\n this.setStyle(_id, 'height', `${h}px`);\n }", "function boxToBox(box1, box2) {\n var bb1 = box1.getBoundingBox();\n var bb2 = box2.getBoundingBox();\n \n var dx = box1.getPos().posX - box2.getPos().posX;\n var dy = box1.getPos().posX - box2.getPos().posY;\n \n var w = bb1.width/2 + bb2.width/2;\n var h = bb1.height/2 + bb2.height/2;\n \n if(Math.abs(dx) <= w && Math.abs(dy) <= h)\n return true;\n }", "function setBoxPosition (x, y){\n gsap.to('.center-box', 0.1, {x, y, ease: \"slow(0.7, 0.7, false)\"})\n gsap.to('.float', 0.1, {x: -(x/2), y: -(y/2), ease: 'slow(0.7, 0.7, false)'})\n}", "updatePosition(sqr) {\n\t\tif(sqr.x > window.innerWidth - sqr.width) sqr.x = window.innerWidth - sqr.width;\n\t\tif(sqr.x < sqr.width) sqr.x = sqr.width;\n\t\tif(sqr.y > window.innerHeight - sqr.height) sqr.y = window.innerHeight - sqr.height;\n\t\tif(sqr.y < sqr.height) sqr.y = sqr.height;\t\t\n\t\tsqr.div.style.left = sqr.x + \"px\";\n\t\tsqr.div.style.top = sqr.y + \"px\";\n\t}", "function createDivContainer(id,frm,zValue) {\r\n\tid = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000);\r\n\tvar objRef, divContainer = layerReference(id);\r\n\r\n\tif (divContainer == null) {\r\n\t\tif (olNs4) {\r\n\t\t\tdivContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);\r\n\t\t\tobjRef = divContainer;\r\n\t\t} else {\r\n\t\t\tvar body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName(\"BODY\")[0]);\r\n\t\t\tif (olIe4&&!document.getElementById) {\r\n\t\t\t\tbody.insertAdjacentHTML(\"beforeEnd\",'<div id=\"'+id+'\"></div>');\r\n\t\t\t\tdivContainer=layerReference(id);\r\n\t\t\t} else {\r\n\t\t\t\tdivContainer = frm.document.createElement(\"DIV\");\r\n\t\t\t\tdivContainer.id = id;\r\n\t\t\t\tbody.appendChild(divContainer);\r\n\t\t\t}\r\n\t\t\tobjRef = divContainer.style;\r\n\t\t}\r\n\r\n\t\tobjRef.position = 'absolute';\r\n\t\tobjRef.visibility = 'hidden';\r\n\t\tobjRef.zIndex = zValue;\r\n\t\tif (olIe4&&!olOp) objRef.left = objRef.top = '0px';\r\n\t\telse objRef.left = objRef.top = -10000 + (!olNs4 ? 'px' : 0);\r\n\t}\r\n\r\n\treturn divContainer;\r\n}", "function box(x,y,width,height){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n}", "function AssignPosition(divEl, width) {\n\tif(self.pageYOffset) {\n\t\trX = self.pageXOffset;\n\t\trY = self.pageYOffset;\n\t\t}\n\telse if(document.documentElement && document.documentElement.scrollTop) {\n\t\trX = document.documentElement.scrollLeft;\n\t\trY = document.documentElement.scrollTop;\n\t\t}\n\telse if(document.body) {\n\t\trX = document.body.scrollLeft;\n\t\trY = document.body.scrollTop;\n\t\t}\n\tif(document.all) {\n\t\tcX += rX; \n\t\tcY += rY;\n\t\t}\n\t// position verschieben wenn zu weit rechts\n\tvar iw = window.getWinWidth();\n\tif (iw-width<cX) {\n\t\tcX = iw-width;\n\t\t};\n\t// position verschieben wenn zu weit rechts\n\tdivEl.style.left = (cX+10) + \"px\";\n\tdivEl.style.top = (cY+10) + \"px\";\n\t}", "function putInWindow(frame, width, height) {\n return {\n type: 'root',\n width,\n height,\n children: [\n { \n type: 'window',\n worldMatrix: [\n [width/2, 0, width/2],\n [0, -height/2, height/2],\n [0, 0, 1],\n ],\n },\n frame,\n ]\n };\n}", "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function pointToRect (point) {\n return { left: point.x, top: point.y, \n right: point.x, bottom: point.y };\n }", "function getPosition(_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n var x = 0;\n var y = 0;\n\n if (width) {\n if (window.outerWidth) {\n x = Math.round((window.outerWidth - width) / 2) + window.screenX;\n } else if (window.screen.width) {\n x = Math.round((window.screen.width - width) / 2);\n }\n }\n\n if (height) {\n if (window.outerHeight) {\n y = Math.round((window.outerHeight - height) / 2) + window.screenY;\n } else if (window.screen.height) {\n y = Math.round((window.screen.height - height) / 2);\n }\n }\n\n return {\n x: x,\n y: y\n };\n}" ]
[ "0.65572524", "0.65572524", "0.65572524", "0.65572524", "0.646069", "0.6408957", "0.6359543", "0.6357952", "0.6357952", "0.6357952", "0.6357952", "0.6357952", "0.6357952", "0.6357952", "0.6357952", "0.6357601", "0.63432693", "0.63292056", "0.63292056", "0.6328615", "0.6328615", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.6316064", "0.630995", "0.63047457", "0.63047457", "0.6295636", "0.5919799", "0.59172267", "0.59172267", "0.59172267", "0.59085435", "0.58962226", "0.5839475", "0.5839475", "0.5839475", "0.5839475", "0.5839475", "0.5810907", "0.5810907", "0.5673926", "0.55864483", "0.55864483", "0.55864483", "0.55864483", "0.55640817", "0.5433073", "0.5433073", "0.5433073", "0.54106194", "0.53840476", "0.52926904", "0.5254762", "0.5236196", "0.5199477", "0.5199342", "0.51924354", "0.5122865", "0.5078822", "0.50613856", "0.50608647", "0.50558907", "0.50558907", "0.50432146", "0.5026016", "0.49783006", "0.49783006", "0.49775004", "0.49761653", "0.49713752", "0.4957608", "0.49557835", "0.4955014", "0.4919288", "0.49063557", "0.49005035", "0.4891099" ]
0.6333931
27
Returns a box for a given cursor position, which may have an 'other' property containing the position of the secondary cursor on a bidi boundary. A cursor Pos(line, char, "before") is on the same visual line as `char 1` and after `char 1` in writing order of `char 1` A cursor Pos(line, char, "after") is on the same visual line as `char` and before `char` in writing order of `char` Examples (uppercase letters are RTL, lowercase are LTR): Pos(0, 1, ...) before after ab a|b a|b aB a|B aB| Ab |Ab A|b AB B|A B|A Every position after the last character on a line is considered to stick to the last character on the line.
function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { lineObj = lineObj || getLine(cm.doc, pos.line); if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } function get(ch, right) { var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); if (right) { m.left = m.right; } else { m.right = m.left; } return intoCoordSystem(cm, lineObj, m, context) } var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; if (ch >= lineObj.text.length) { ch = lineObj.text.length; sticky = "before"; } else if (ch <= 0) { ch = 0; sticky = "after"; } if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } function getBidi(ch, partPos, invert) { var part = order[partPos], right = part.level == 1; return get(invert ? ch - 1 : ch, right != invert) } var partPos = getBidiPartAt(order, ch, sticky); var other = bidiOther; var val = getBidi(ch, partPos, sticky == "before"); if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } return val }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos]\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1)\n right = true\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos]\n ch = bidiLeft(part) - part.level % 2\n right = false\n }\n if (right && ch == part.to && ch > part.from) { return get(ch - 1) }\n return get(ch, right)\n }\n var order = getOrder(lineObj), ch = pos.ch\n if (!order) { return get(ch) }\n var partPos = getBidiPartAt(order, ch)\n var val = getBidi(ch, partPos)\n if (bidiOther != null) { val.other = getBidi(ch, bidiOther) }\n return val\n}", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) m.left = m.right; else m.right = m.left;\n return intoCoordSystem(cm, lineObj, m, context);\n }\n function getBidi(ch, partPos) {\n var part = order[partPos], right = part.level % 2;\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n part = order[--partPos];\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n right = true;\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n part = order[++partPos];\n ch = bidiLeft(part) - part.level % 2;\n right = false;\n }\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\n return get(ch, right);\n }\n var order = getOrder(lineObj), ch = pos.ch;\n if (!order) return get(ch);\n var partPos = getBidiPartAt(order, ch);\n var val = getBidi(ch, partPos);\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n return val;\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\r\n lineObj = lineObj || getLine(cm.doc, pos.line);\r\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\r\n function get(ch, right) {\r\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\r\n if (right) { m.left = m.right; } else { m.right = m.left; }\r\n return intoCoordSystem(cm, lineObj, m, context)\r\n }\r\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\r\n if (ch >= lineObj.text.length) {\r\n ch = lineObj.text.length;\r\n sticky = \"before\";\r\n } else if (ch <= 0) {\r\n ch = 0;\r\n sticky = \"after\";\r\n }\r\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\r\n\r\n function getBidi(ch, partPos, invert) {\r\n var part = order[partPos], right = part.level == 1;\r\n return get(invert ? ch - 1 : ch, right != invert)\r\n }\r\n var partPos = getBidiPartAt(order, ch, sticky);\r\n var other = bidiOther;\r\n var val = getBidi(ch, partPos, sticky == \"before\");\r\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\r\n return val\r\n}", "renderCursorAt(position, textType) {\n let adjH = 0;\n let adjY = 0;\n if (!this.updatedMetrics) {\n this._calculateBlockIndex();\n }\n const group = this.context.openGroup();\n group.id = 'inlineCursor';\n const h = this.fontSize;\n if (this.blocks.length <= position || position < 0) {\n svgHelpers.renderCursor(group, this.startX, this.startY - h, h);\n this.context.closeGroup();\n return;\n }\n const block = this.blocks[position];\n adjH = block.symbolType === SuiInlineText.symbolTypes.GLYPH ? h / 2 : h;\n // For glyph, add y adj back to the cursor since it's not a glyph\n adjY = block.symbolType === SuiInlineText.symbolTypes.GLYPH ? block.y - this._glyphOffset(block) :\n block.y;\n if (typeof(textType) === 'number' && textType !== SuiInlineText.textTypes.normal) {\n const ratio = textType !== SuiInlineText.textTypes.normal ? VF.ChordSymbol.superSubRatio : 1.0;\n adjH = adjH * ratio;\n if (textType !== block.textType) {\n if (textType === SuiInlineText.textTypes.superScript) {\n adjY -= h / 2;\n } else {\n adjY += h / 2;\n }\n }\n }\n svgHelpers.renderCursor(group, block.x + block.width, adjY - (adjH * block.scale), adjH * block.scale);\n this.context.closeGroup();\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t\t if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\t\t function get(ch, right) {\n\t\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t\t if (right) m.left = m.right; else m.right = m.left;\n\t\t return intoCoordSystem(cm, lineObj, m, context);\n\t\t }\n\t\t function getBidi(ch, partPos) {\n\t\t var part = order[partPos], right = part.level % 2;\n\t\t if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n\t\t part = order[--partPos];\n\t\t ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n\t\t right = true;\n\t\t } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n\t\t part = order[++partPos];\n\t\t ch = bidiLeft(part) - part.level % 2;\n\t\t right = false;\n\t\t }\n\t\t if (right && ch == part.to && ch > part.from) return get(ch - 1);\n\t\t return get(ch, right);\n\t\t }\n\t\t var order = getOrder(lineObj), ch = pos.ch;\n\t\t if (!order) return get(ch);\n\t\t var partPos = getBidiPartAt(order, ch);\n\t\t var val = getBidi(ch, partPos);\n\t\t if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n\t\t return val;\n\t\t }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t\t if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n\t\t function get(ch, right) {\n\t\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t\t if (right) { m.left = m.right; } else { m.right = m.left; }\n\t\t return intoCoordSystem(cm, lineObj, m, context)\n\t\t }\n\t\t var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n\t\t if (ch >= lineObj.text.length) {\n\t\t ch = lineObj.text.length;\n\t\t sticky = \"before\";\n\t\t } else if (ch <= 0) {\n\t\t ch = 0;\n\t\t sticky = \"after\";\n\t\t }\n\t\t if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n\t\t function getBidi(ch, partPos, invert) {\n\t\t var part = order[partPos], right = part.level == 1;\n\t\t return get(invert ? ch - 1 : ch, right != invert)\n\t\t }\n\t\t var partPos = getBidiPartAt(order, ch, sticky);\n\t\t var other = bidiOther;\n\t\t var val = getBidi(ch, partPos, sticky == \"before\");\n\t\t if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n\t\t return val\n\t\t }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\r\n lineObj = lineObj || getLine(cm.doc, pos.line);\r\n if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\r\n function get(ch, right) {\r\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\r\n if (right) m.left = m.right; else m.right = m.left;\r\n return intoCoordSystem(cm, lineObj, m, context);\r\n }\r\n function getBidi(ch, partPos) {\r\n var part = order[partPos], right = part.level % 2;\r\n if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\r\n part = order[--partPos];\r\n ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\r\n right = true;\r\n } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\r\n part = order[++partPos];\r\n ch = bidiLeft(part) - part.level % 2;\r\n right = false;\r\n }\r\n if (right && ch == part.to && ch > part.from) return get(ch - 1);\r\n return get(ch, right);\r\n }\r\n var order = getOrder(lineObj), ch = pos.ch;\r\n if (!order) return get(ch);\r\n var partPos = getBidiPartAt(order, ch);\r\n var val = getBidi(ch, partPos);\r\n if (bidiOther != null) val.other = getBidi(ch, bidiOther);\r\n return val;\r\n }", "static cursor(pos, assoc = 0, bidiLevel, goalColumn) {\n return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 4 /* RangeFlag.AssocBefore */ : 8 /* RangeFlag.AssocAfter */) |\n (bidiLevel == null ? 3 : Math.min(2, bidiLevel)) |\n ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431 /* RangeFlag.NoGoalColumn */) << 5 /* RangeFlag.GoalColumnOffset */));\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\t function get(ch, right) {\n\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t if (right) m.left = m.right; else m.right = m.left;\n\t return intoCoordSystem(cm, lineObj, m, context);\n\t }\n\t function getBidi(ch, partPos) {\n\t var part = order[partPos], right = part.level % 2;\n\t if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n\t part = order[--partPos];\n\t ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n\t right = true;\n\t } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n\t part = order[++partPos];\n\t ch = bidiLeft(part) - part.level % 2;\n\t right = false;\n\t }\n\t if (right && ch == part.to && ch > part.from) return get(ch - 1);\n\t return get(ch, right);\n\t }\n\t var order = getOrder(lineObj), ch = pos.ch;\n\t if (!order) return get(ch);\n\t var partPos = getBidiPartAt(order, ch);\n\t var val = getBidi(ch, partPos);\n\t if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n\t return val;\n\t }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\t function get(ch, right) {\n\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t if (right) m.left = m.right; else m.right = m.left;\n\t return intoCoordSystem(cm, lineObj, m, context);\n\t }\n\t function getBidi(ch, partPos) {\n\t var part = order[partPos], right = part.level % 2;\n\t if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n\t part = order[--partPos];\n\t ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n\t right = true;\n\t } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n\t part = order[++partPos];\n\t ch = bidiLeft(part) - part.level % 2;\n\t right = false;\n\t }\n\t if (right && ch == part.to && ch > part.from) return get(ch - 1);\n\t return get(ch, right);\n\t }\n\t var order = getOrder(lineObj), ch = pos.ch;\n\t if (!order) return get(ch);\n\t var partPos = getBidiPartAt(order, ch);\n\t var val = getBidi(ch, partPos);\n\t if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n\t return val;\n\t }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);\n\t function get(ch, right) {\n\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t if (right) m.left = m.right; else m.right = m.left;\n\t return intoCoordSystem(cm, lineObj, m, context);\n\t }\n\t function getBidi(ch, partPos) {\n\t var part = order[partPos], right = part.level % 2;\n\t if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {\n\t part = order[--partPos];\n\t ch = bidiRight(part) - (part.level % 2 ? 0 : 1);\n\t right = true;\n\t } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {\n\t part = order[++partPos];\n\t ch = bidiLeft(part) - part.level % 2;\n\t right = false;\n\t }\n\t if (right && ch == part.to && ch > part.from) return get(ch - 1);\n\t return get(ch, right);\n\t }\n\t var order = getOrder(lineObj), ch = pos.ch;\n\t if (!order) return get(ch);\n\t var partPos = getBidiPartAt(order, ch);\n\t var val = getBidi(ch, partPos);\n\t if (bidiOther != null) val.other = getBidi(ch, bidiOther);\n\t return val;\n\t }", "function posCursor(obj) {\n\tobj = getObj(obj);\n\n var cursor = -1;\n\n if (document.selection && (document.selection != 'undefined')) {\n var _range = document.selection.createRange();\n var contador = 0;\n while (_range.move('character', -1)) contador ++;\n cursor = contador;\n } else if (obj.selectionStart >= 0) cursor = obj.selectionStart;\n\n return cursor;\n}", "function Cursor (position, selectionEnd) {\n this.position = position;\n this.selectionEnd = selectionEnd;\n }", "function Cursor (position, selectionEnd) {\n this.position = position;\n this.selectionEnd = selectionEnd;\n }", "getCursor(state$1, from = 0, to) {\n let st = state$1.doc ? state$1 : state.EditorState.create({ doc: state$1 });\n if (to == null)\n to = st.doc.length;\n return this.regexp ? regexpCursor(this, st, from, to) : stringCursor(this, st, from, to);\n }", "function postBoxGetCursor(input)\n{\n\tvar result = {start: 0, end: 0};\n\tif (input.setSelectionRange)\n\t{\n\t\tresult.start= input.selectionStart;\n\t\tresult.end = input.selectionEnd;\n\t} else if (!document.selection)\n\t{\n\t\treturn false;\n\t} else if (document.selection && document.selection.createRange)\n\t{\n\t\tvar range = document.selection.createRange();\n\t\tvar stored_range = range.duplicate();\n\t\tstored_range.moveToElementText(input);\n\t\tstored_range.setEndPoint('EndToEnd', range);\n\t\tresult.start = stored_range.text.length - range.text.length;\n\t\tresult.end = result.start + range.text.length;\n\t}\n\treturn result;\n}", "function cursorPosition(star, en, zon){\r\nvar textarea = document.getElementById(zon);\r\ntextarea.focus();\r\n\r\nvar selection_range = document.selection.createRange().duplicate();\r\n\r\nif (selection_range.parentElement() == textarea) { // Check that the selection is actually in our textarea\r\n// Create three ranges, one containing all the text before the selection,\r\n// one containing all the text in the selection (this already exists), and one containing all\r\n// the text after the selection.\r\nvar before_range = document.body.createTextRange();\r\nbefore_range.moveToElementText(textarea); // Selects all the text\r\nbefore_range.setEndPoint(\"EndToStart\", selection_range); // Moves the end where we need it\r\n\r\nvar after_range = document.body.createTextRange();\r\nafter_range.moveToElementText(textarea); // Selects all the text\r\nafter_range.setEndPoint(\"StartToEnd\", selection_range); // Moves the start where we need it\r\n\r\nvar before_finished = false, selection_finished = false, after_finished = false;\r\nvar before_text, untrimmed_before_text, selection_text, untrimmed_selection_text, after_text, untrimmed_after_text;\r\n\r\n// Load the text values we need to compare\r\nbefore_text = untrimmed_before_text = before_range.text;\r\nselection_text = untrimmed_selection_text = selection_range.text;\r\nafter_text = untrimmed_after_text = after_range.text;\r\n\r\n// Check each range for trimmed newlines by shrinking the range by 1 character and seeing\r\n// if the text property has changed. If it has not changed then we know that IE has trimmed\r\n// a \\r\\n from the end.\r\ndo {\r\nif (!before_finished) {\r\nif (before_range.compareEndPoints(\"StartToEnd\", before_range) == 0) {\r\nbefore_finished = true;\r\n} else {\r\nbefore_range.moveEnd(\"character\", -1)\r\nif (before_range.text == before_text) {\r\nuntrimmed_before_text += \"\\n\";\r\n} else {\r\nbefore_finished = true;\r\n}\r\n}\r\n}\r\nif (!selection_finished) {\r\nif (selection_range.compareEndPoints(\"StartToEnd\", selection_range) == 0) {\r\nselection_finished = true;\r\n} else {\r\nselection_range.moveEnd(\"character\", -1)\r\nif (selection_range.text == selection_text) {\r\nuntrimmed_selection_text += \"\\r\\n\";\r\n} else {\r\nselection_finished = true;\r\n}\r\n}\r\n}\r\nif (!after_finished) {\r\nif (after_range.compareEndPoints(\"StartToEnd\", after_range) == 0) {\r\nafter_finished = true;\r\n} else {\r\nafter_range.moveEnd(\"character\", -1)\r\nif (after_range.text == after_text) {\r\nuntrimmed_after_text += \"\\r\\n\";\r\n} else {\r\nafter_finished = true;\r\n}\r\n}\r\n}\r\n\r\n} while ((!before_finished || !selection_finished || !after_finished));\r\n\r\n// ** END Untrimmed success test\r\n\r\n// Define into an array the start, and end of selected text, and the final text\r\nvar re = new Array();\r\nre['startPos'] = untrimmed_before_text.length;\r\nre['endPos'] = re['startPos'] + untrimmed_selection_text.length;\r\nre['final_text'] = untrimmed_before_text +star+ untrimmed_selection_text +en+ untrimmed_after_text;\r\n\r\n return re;\r\n}\r\n}", "function cursor_box_size() { return { x: 10, y: 10 }; }", "function posFromMouse(cm, e, liberal, forRect) {\n\t\t var display = cm.display;\n\t\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n\t\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t\t catch (e$1) { return null }\n\t\t var coords = coordsChar(cm, x, y), line;\n\t\t if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t\t }\n\t\t return coords\n\t\t }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n\t\t var display = cm.display;\n\t\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\t\t\n\t\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t\t catch (e) { return null; }\n\t\t var coords = coordsChar(cm, x, y), line;\n\t\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t\t }\n\t\t return coords;\n\t\t }", "function posFromMouse(cm, e, liberal, forRect) {\r\n var display = cm.display;\r\n if (!liberal) {\r\n var target = e_target(e);\r\n if (target == display.scrollbarH || target == display.scrollbarV ||\r\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\r\n }\r\n var x, y, space = display.lineSpace.getBoundingClientRect();\r\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\r\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\r\n catch (e) { return null; }\r\n var coords = coordsChar(cm, x, y), line;\r\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\r\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\r\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\r\n }\r\n return coords;\r\n }", "function cursorIndex() {\r\n var current = selection.createRange(),\r\n diff = current.duplicate();\r\n\r\n diff.moveToElementText(this);\r\n diff.setEndPoint('EndToEnd', current);\r\n\r\n return diff.text.length - current.text.length;\r\n }", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\t\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function clipCursorToContent(cm, cur) {\n var vim = cm.state.vim;\n var includeLineBreak = vim.insertMode || vim.visualMode;\n var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );\n var maxCh = lineLength(cm, line) - 1 + !!includeLineBreak;\n var ch = Math.min(Math.max(0, cur.ch), maxCh);\n return Pos(line, ch);\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }", "function deriveCursorForDocument(paramMouseX, paramMouseY, paramDocument) {\r\n\r\n\t// Calculate line and column number based on mouse position\r\n\tvar currow = Math.floor((mouseY - PADDING_TOP)/FONT_HEIGHT);\r\n\tvar curcol = Math.floor((mouseX - PADDING_LEFT)/FONT_WIDTH);\r\n\t\r\n\t// Perform sanity check on calculated values:\r\n\t// If the calculated line is below the last line, then set cursor at last character in document\r\n\tif (currow > paramDocument.getDocumentLength()-1) {\r\n\t\tcurrow = paramDocument.getDocumentLength()-1;\r\n\t\tcurcol = paramDocument.getLineLength( paramDocument.getDocumentLength() );\r\n\t}\r\n\t// If the calculated cursor is beyond the first or last character in a line, \r\n\t// then set the cursor to the first or last character, respectively\r\n\telse {\t\t\r\n\t\tif ( curcol < 0 ) curcol = 0;\r\n\t\tif ( curcol > paramDocument.getLineLength(currow) ) curcol = paramDocument.getLineLength(currow);\r\n\t}\r\n\t\r\n\t// Before we move the cursor there, make sure that the line isn't locked\r\n\tif( paramDocument.getLineLockingUser( currow ) != null ){\r\n\t\talert(\"Another user is currently on line \"+currow+\", and it is locked.\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// Store the calculated values\r\n\tsetCursor(currow,curcol);\r\n}", "cursorAt(pos, side = 0, mode = 0) {\n let scope = CachedNode.get(this) || this.topNode;\n let cursor = new TreeCursor(scope);\n cursor.moveTo(pos, side);\n CachedNode.set(this, cursor._tree);\n return cursor;\n }", "function getPositionRect(position) {\n if (!position) {\n return null;\n }\n var range = createRange_1.default(position);\n // 1) try to get rect using range.getBoundingClientRect()\n var rect = range.getBoundingClientRect && normalizeRect(range.getBoundingClientRect());\n if (rect) {\n return rect;\n }\n // 2) try to get rect using range.getClientRects\n position = position.normalize();\n var rects = range.getClientRects && range.getClientRects();\n rect = rects && rects.length == 1 && normalizeRect(rects[0]);\n if (rect) {\n return rect;\n }\n // 3) if node is text node, try inserting a SPAN and get the rect of SPAN for others\n if (position.node.nodeType == 3 /* Text */) {\n var span = document.createElement('SPAN');\n span.innerHTML = '\\u200b';\n range = createRange_1.default(position);\n range.insertNode(span);\n rect = span.getBoundingClientRect && normalizeRect(span.getBoundingClientRect());\n span.parentNode.removeChild(span);\n if (rect) {\n return rect;\n }\n }\n // 4) try getBoundingClientRect on element\n var element = position.element;\n if (element && element.getBoundingClientRect) {\n rect = normalizeRect(element.getBoundingClientRect());\n if (rect) {\n return rect;\n }\n }\n return null;\n}", "function posFromMouse(cm, e, liberal, forRect) {\r\n var display = cm.display;\r\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\r\n\r\n var x, y, space = display.lineSpace.getBoundingClientRect();\r\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\r\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\r\n catch (e) { return null }\r\n var coords = coordsChar(cm, x, y), line;\r\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\r\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\r\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\r\n }\r\n return coords\r\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") {\n return null;\n }\n\n var x,\n y,\n space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\n try {\n x = e.clientX - space.left;\n y = e.clientY - space.top;\n } catch (e) {\n return null;\n }\n\n var coords = _coordsChar(cm, x, y),\n line;\n\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n\n return coords;\n } // Find the view element corresponding to a given line. Return null", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}" ]
[ "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61579114", "0.61518496", "0.6137645", "0.6125479", "0.609435", "0.6078191", "0.6078191", "0.6078191", "0.6078191", "0.6078191", "0.6078191", "0.6078191", "0.6078191", "0.6076416", "0.60623133", "0.6031724", "0.6026745", "0.59932244", "0.594697", "0.58736295", "0.58736295", "0.58736295", "0.58442664", "0.55966485", "0.55966485", "0.5560021", "0.5484602", "0.5475618", "0.5374772", "0.53182316", "0.5311731", "0.5311731", "0.5311731", "0.5311731", "0.53040683", "0.529307", "0.52820617", "0.52723527", "0.52723527", "0.5263007", "0.5259102", "0.5259102", "0.5259102", "0.5259102", "0.5259102", "0.5259102", "0.5259102", "0.5259102", "0.52563536", "0.52563536", "0.52558565", "0.5254401", "0.5254401", "0.52471733", "0.52471733", "0.52471733", "0.52471733", "0.52471733", "0.52471733", "0.52471733", "0.5244461", "0.5244461", "0.5242172", "0.5229466", "0.52242917", "0.51875466", "0.5183944", "0.5182158", "0.5179532", "0.5179532", "0.5179532", "0.5179532", "0.5179532", "0.5179532", "0.5179532" ]
0.6194518
14
Used to cheaply estimate the coordinates for a position. Used for intermediate scroll updates.
function estimateCoords(cm, pos) { var left = 0; pos = clipPos(cm.doc, pos); if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } var lineObj = getLine(cm.doc, pos.line); var top = heightAtLine(lineObj) + paddingTop(cm.display); return {left: left, right: left, top: top, bottom: top + lineObj.height} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate_coordinates () {\n\t }", "coordinates () {\n return this._position.coordinates()\n }", "function calcPos() {\n\t\t// Current coordinates\n\t\tvar coords = sphoords.getCoordinates();\n\t\tvar coords_deg = sphoords.getCoordinatesInDegrees();\n\n\t\t// Corresponding position on the sphere\n\t\treturn {\n\t\t\t\tx: radius * Math.cos(coords.latitude) * Math.sin(coords.longitude),\n\t\t\t\ty: radius * Math.cos(coords.latitude) * Math.cos(coords.longitude),\n\t\t\t\tz: radius * Math.sin(coords.latitude),\n\t\t\t\tlong: coords_deg.longitude,\n\t\t\t\tlat: coords_deg.latitude,\n\t\t\t\torientation: sphoords.getScreenOrientation()\n\t\t\t};\n\t}", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t var left = 0, pos = clipPos(cm.doc, pos);\n\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t var lineObj = getLine(cm.doc, pos.line);\n\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t }", "function estimateCoords(cm, pos) {\n\t\t var left = 0, pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height};\n\t\t }", "function estimateCoords(cm, pos) {\n\t\t var left = 0;\n\t\t pos = clipPos(cm.doc, pos);\n\t\t if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n\t\t var lineObj = getLine(cm.doc, pos.line);\n\t\t var top = heightAtLine(lineObj) + paddingTop(cm.display);\n\t\t return {left: left, right: left, top: top, bottom: top + lineObj.height}\n\t\t }", "posAtCoords(coords) {\n return posAtCoords(this, coords);\n }", "function getCoords () {\n return {\n x: 10,\n y: 22\n }\n }", "get _positionRect() {\n if (!this._positionRectMemo && this.positionTarget) {\n this._positionRectMemo = this.positionTarget.getBoundingClientRect();\n }\n\n return this._positionRectMemo;\n }", "getPosition() {\n\t\t\tconst {overrides} = this.impl;\n\t\t\tif (overrides !== undefined) {\n\t\t\t\treturn overrides.getPosition(this);\n\t\t\t}\n\n\t\t\tconst index = this.getIndex();\n\t\t\tconst cached = this.indexTracker.cachedPositions.get(index.valueOf());\n\t\t\tif (cached !== undefined) {\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst pos = {\n\t\t\t\tline: this.currLine,\n\t\t\t\tcolumn: this.currColumn,\n\t\t\t};\n\t\t\tthis.indexTracker.setPositionIndex(pos, index);\n\t\t\treturn pos;\n\t\t}", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\n var left = 0, pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\n }", "function estimateCoords(cm, pos) {\r\n var left = 0, pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch;\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height};\r\n }", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0\n pos = clipPos(cm.doc, pos)\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }\n var lineObj = getLine(cm.doc, pos.line)\n var top = heightAtLine(lineObj) + paddingTop(cm.display)\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\r\n var left = 0;\r\n pos = clipPos(cm.doc, pos);\r\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\r\n var lineObj = getLine(cm.doc, pos.line);\r\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\r\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\r\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n}", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "function getCoordinates(el) {\n\txCor = (el.getBoundingClientRect()).x;\n\tyCor = (el.getBoundingClientRect()).y;\n\tCoor = [(xCor + window.scrollX), (yCor + window.scrollY)];\n\tconsole.log(Coor);\n\tconsole.log(el.getBoundingClientRect());\n\treturn Coor;\n}", "function getRealPosition( index ) {\n var stage = app.getDrawStage();\n return { 'x': stage.offset().x + index.x / stage.scale().x,\n 'y': stage.offset().y + index.y / stage.scale().y };\n }", "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "function _calcCoords() {\n // use the first element jQuery finds\n var el = jQuery(_element)[0],\n coords = {};\n coords.t = KingToolz.getTop(el) - _padding;\n coords.r = KingToolz.getRight(el) + _padding;\n coords.b = KingToolz.getBottom(el) + _padding;\n coords.l = KingToolz.getLeft(el) - _padding;\n coords.w = KingToolz.getWidth(el) + _padding * 2;\n coords.h = KingToolz.getHeight(el) + _padding * 2;\n return coords;\n }", "calculatePositions() {\n this.x1 = this.from.getCenterX()\n this.y1 = this.from.getCenterY()\n this.x2 = this.to.getCenterX()\n this.y2 = this.to.getCenterY()\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getPosition(pos) {\n //getBoundingClientRect() renvoie la taille du canvas et sa position par rapport au viewport.\n const canvas = this.canvas.getBoundingClientRect();\n const x = (pos.x - canvas.left) / (canvas.right - canvas.left) * this.canvas.width; //récupère la position exacte de la souris (position X)\n const y = (pos.y - canvas.top) / (canvas.bottom - canvas.top) * this.canvas.height;\n return {\n x,\n y\n };\n }", "calculateCellsPosition(x, y) {\n let position = {};\n\n position.x = (Cell.config.cellSize + Cell.config.cellMargin) * x;\n position.y = (Cell.config.cellSize + Cell.config.cellMargin) * y;\n\n return position;\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "calculatePosition() {\n const x = (this.mCornerRTF.x + this.mCornerLBB.x) * 0.5;\n const y = (this.mCornerRTF.y + this.mCornerLBB.y) * 0.5;\n const z = (this.mCornerRTF.z + this.mCornerLBB.z) * 0.5;\n const position = new THREE.Vector3(x, y, z);\n\n return position;\n }", "function getXYPosition(image) {\n\tconst { top, left, bottom, right } = image.getBoundingClientRect();\n\tconst { pageXOffset, pageYOffset } = window;\n return {\n top: top + pageYOffset,\n left: left + pageXOffset,\n bottom: bottom + pageYOffset,\n right: right + pageXOffset\n };\n}", "computeCoords() {\n this.distanceFromEarthCenter = bv3.length(this.position)\n this.distanceFromEarthSurface = this.distanceFromEarthCenter - 6378\n\n this.lat = radians2degrees(Math.asin(-this.position[1] / this.distanceFromEarthCenter))\n\n\n const posAtEquator = [this.position[0], 0, this.position[2]]\n\n\n const distanceFromEarthCenterAtEquator = bv3.length(posAtEquator)\n const l90 = radians2degrees(Math.asin(-this.position[0] / distanceFromEarthCenterAtEquator))\n\n\n if (this.position[0] > 0 != this.position[2] > 0) {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c1\")\n this.lon = l90;\n } else {\n //CCconsole.log(\"c2\")\n this.lon = 180 - l90;\n }\n } else {\n if (this.position[0] > 0) {\n //CCconsole.log(\"c3\")\n this.lon = -180 - l90;\n } else {\n //CCconsole.log(\"c4\")\n this.lon = l90;\n }\n }\n\n \n }", "_computePositionOnScreen(position, result) {\n return SceneTransforms.wgs84ToWindowCoordinates(this.scene, position, result);\n }", "function getCoords(elem) {\r\n var box = elem.getBoundingClientRect();\r\n return {\r\n top: box.top + pageYOffset,\r\n left: box.left + pageXOffset\r\n };\r\n }", "function getCoords() {\n return {\n x: 10,\n y: 22\n };\n}", "function getCoordinates(a) {\n var b = a.position(),\n c = {\n x: b.left + a.width() / 2,\n y: b.top + a.height() / 2\n };\n return c\n }", "pos() {\n if (this.is_vertex()) {\n return this.position;\n } else {\n return this.offset;\n }\n }", "function getCoords(elem){\n let box = elem.getBoundingClientRect();\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset,\n width: box.width\n }\n }", "function getCoords(elem){\n let box = elem.getBoundingClientRect();\n return {\n top: box.top + pageYOffset,\n left: box.left + pageXOffset,\n width: box.width\n }\n }", "function _getPos(elem) {\n const bbox = elem.getBoundingClientRect();\n return {\n x: bbox.left,\n y: bbox.top,\n bbox\n };\n}", "function getPos() {\n\t\treturn _this.position;\n\t}", "function getCoords(ev) {\n var x, y, w, h, el;\n // ignore browsers without pageX for now\n if (ev.pageX == null)\n return;\n x = ev.pageX;\n y = ev.pageY;\n el = self.element;\n // should probably check offsetParent\n // but this is more portable\n while (el && el !== self.document.documentElement) {\n x -= el.offsetLeft;\n y -= el.offsetTop;\n el = 'offsetParent' in el\n ? el.offsetParent\n : el.parentNode;\n }\n // convert to cols/rows\n w = self.element.clientWidth;\n h = self.element.clientHeight;\n x = Math.ceil((x / w) * self.cols);\n y = Math.ceil((y / h) * self.rows);\n // be sure to avoid sending\n // bad positions to the program\n if (x < 0)\n x = 0;\n if (x > self.cols)\n x = self.cols;\n if (y < 0)\n y = 0;\n if (y > self.rows)\n y = self.rows;\n // xterm sends raw bytes and\n // starts at 32 (SP) for each.\n x += 32;\n y += 32;\n return {\n x: x,\n y: y,\n type: 'wheel'\n };\n }", "function offset() {\n //technically, vX.pos works too and I should probably use whatever I built here, but I have jQuery instead.\n if (window.Ext)\n return Ext.get(elem).getXY();\n if (window.jQuery) {\n var pos = jQuery(elem).offset();\n return [pos.left, pos.top];\n }\n if (window.vx) { //vx support\n var pos = vx.pos(elem);\n return [pos.l, pos.t];\n }\n return [0, 0];\n }", "function determineDrawPos(){\n let pos ={\n x: 0,\n y: 0\n }\n arms.forEach(function(index){\n let indexPos = findXY(index.radius,degToRad(index.direction))\n\n pos.x += indexPos.x\n\n pos.y += indexPos.y\n })\n\n return pos\n}", "_positionFromMouseEvent(event, element, mouseService) {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }", "getPos() {\n return this.positions;\n }", "function storeposition() {\n if (calc < points) {\n numx.push(x);\n numy.push(y);\n calc += 1;\n } else {\n numx.splice(0, 1);\n numy.splice(0, 1);\n calc -= 1;\n }\n}", "function getCoords(e) {\t\t\n\t\treturn { x: e.pageX - theCanvas.offsetLeft, y: e.pageY - theCanvas.offsetTop };\n\t }", "function _getPos(elem) {\n var bbox = elem.getBoundingClientRect();\n return {\n x: bbox.left,\n y: bbox.top,\n bbox: bbox\n };\n}", "function getPosition(el) {\n var xPosition = 0;\n var yPosition = 0;\n \n while (el) {\n if (el.tagName == \"BODY\") {\n // deal with browser quirks with body/window/document and page scroll\n var xScrollPos = el.scrollLeft || document.documentElement.scrollLeft;\n var yScrollPos = el.scrollTop || document.documentElement.scrollTop;\n \n xPosition += (el.offsetLeft - xScrollPos + el.clientLeft);\n yPosition += (el.offsetTop - yScrollPos + el.clientTop);\n } else {\n xPosition += (el.offsetLeft - el.scrollLeft + el.clientLeft);\n yPosition += (el.offsetTop - el.scrollTop + el.clientTop);\n }\n \n el = el.offsetParent;\n }\n console.log('gp: xpos:', xPosition);\n return {\n x: xPosition,\n y: yPosition\n };\n }", "get position() {\n return {x: this.x, y: this.y}\n }", "function getLocation(x, y) {\n return {\n x: (x - canvas.getBoundingClientRect().left) > 0 ? (x - canvas.getBoundingClientRect().left) : 0,\n y: (y - canvas.getBoundingClientRect().top) > 0 ? (y - canvas.getBoundingClientRect().top) : 0,\n }\n}", "getLocation(x, y) {\n return [Math.floor(x / CELL.WIDTH), Math.floor(y / CELL.HEIGHT)];\n }", "static getCoords(t, c, p) {\r\n\t\tlet m = MathTools.matMul(t.t, [\r\n\t\t\t[p.x],\r\n\t\t\t[p.y],\r\n\t\t\t[1]\r\n\t\t])\r\n\t\tm[0][0] += (t.x - c.x)\r\n\t\tm[1][0] += (t.y - c.y)\r\n\t\tm = MathTools.matMul(c.t, m)\r\n\t\treturn {\r\n\t\t\tx: m[0][0]+window.innerWidth/2,\r\n\t\t\ty: window.innerHeight - (m[1][0]+window.innerHeight/2)\r\n\t\t}\r\n\t}", "function determinePosition(x, y) {\n return new Point(x, y);\n}", "function get_xy(el) {\n\tvar box = el.getBoundingClientRect();\n\treturn {\n\t\tx: box.left,\n\t\ty: box.top\n\t};\n}", "function getCoords(elem) {\n\t\tvar elemCoords = elem.getBoundingClientRect();\n\n\t\treturn {\n\t\t\ttop: elemCoords.top + pageYOffset,\n\t\t\tleft: elemCoords.left + pageXOffset\n\t\t};\n\t}", "function getUpdatedPos(x, y, M) {\n var W = x*M[6] + y*M[7] + M[8];\n var X = x*M[0]/W + y*M[1]/W + M[2]/W;\n var Y = x*M[3]/W + y*M[4]/W + M[5]/W;\n return [X, Y];\n}", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function getPos(obj) {\n\t\tvar offsets = obj.offset();\n\t\tobjHeight = obj.height();\n\t\tobjWidth = obj.width();\n\t\texcldH = objHeight / 3; //Caculating 10% height\n\t\t(top = offsets.top),\n\t\t\t(left = offsets.left),\n\t\t\t(bottom = top + objHeight),\n\t\t\t(right = left + objWidth);\n\t}", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for", "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "positionpx(j, m, i, n, spec) {\n var height, left, top, width;\n left = 0;\n top = 0;\n width = 0;\n height = 0;\n [left, top, width, height] = this.position(j, m, i, n, spec, this.wscale, this.hscale);\n return [width * this.wpx / 100, height * this.hpx / 100];\n }", "getAbsolutePosition(size) {\n if (this.position !== undefined) {\n if (this.unitMode === 'Absolute') {\n return this.position;\n }\n else {\n return {\n x: this.position.x * size.width, y: this.position.y * size.height\n };\n }\n }\n return undefined;\n }" ]
[ "0.6924864", "0.68540347", "0.6801893", "0.6704743", "0.6704743", "0.6704743", "0.6693841", "0.6687542", "0.66735756", "0.66457653", "0.66426927", "0.6631689", "0.66203284", "0.66203284", "0.66203284", "0.66203284", "0.66203284", "0.66203284", "0.66203284", "0.66203284", "0.66082126", "0.6557608", "0.6557608", "0.65465075", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.6540806", "0.65183157", "0.64939713", "0.6459685", "0.643975", "0.6428307", "0.6427801", "0.641559", "0.641559", "0.641559", "0.641559", "0.641559", "0.6414955", "0.64047843", "0.639738", "0.6371895", "0.6371322", "0.6351164", "0.6347614", "0.6323038", "0.63111174", "0.63020015", "0.6301005", "0.629532", "0.629532", "0.6289885", "0.62835723", "0.6275044", "0.6274468", "0.62580645", "0.62577295", "0.62404627", "0.6237452", "0.623281", "0.6232566", "0.6212569", "0.6211628", "0.6201002", "0.619833", "0.61901563", "0.6188243", "0.6179832", "0.61699784", "0.6165228", "0.6153729", "0.6145496", "0.6137337", "0.61332834", "0.6132315", "0.6129284" ]
0.6604912
33
Positions returned by coordsChar contain some extra information. xRel is the relative x position of the input coordinates compared to the found position (so xRel > 0 means the coordinates are to the right of the character position, for example). When outside is true, that means the coordinates lie outside the line's vertical range.
function PosWithInfo(line, ch, sticky, outside, xRel) { var pos = Pos(line, ch, sticky); pos.xRel = xRel; if (outside) { pos.outside = true; } return pos }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n\n if (outside) {\n pos.outside = outside;\n }\n\n return pos;\n } // Compute the character position closest to the given coordinates.", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t\t if (x < 0) x = 0;\n\t\t\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var merged = collapsedSpanAtEnd(lineObj);\n\t\t var mergedPos = merged && merged.find(0, true);\n\t\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t\t else\n\t\t return found;\n\t\t }\n\t\t }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch);\n pos.xRel = xRel;\n if (outside) pos.outside = true;\n return pos;\n }", "function PosWithInfo(line, ch, outside, xRel) {\r\n var pos = Pos(line, ch);\r\n pos.xRel = xRel;\r\n if (outside) pos.outside = true;\r\n return pos;\r\n }", "function PosWithInfo(line, ch, outside, xRel) {\n\t\t var pos = Pos(line, ch);\n\t\t pos.xRel = xRel;\n\t\t if (outside) pos.outside = true;\n\t\t return pos;\n\t\t }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n\t\t if (x < 0) { x = 0; }\n\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n\t\t if (!collapsed) { return found }\n\t\t var rangeEnd = collapsed.find(1);\n\t\t if (rangeEnd.line == lineN) { return rangeEnd }\n\t\t lineObj = getLine(doc, lineN = rangeEnd.line);\n\t\t }\n\t\t }", "function PosWithInfo(line, ch, outside, xRel) {\n var pos = Pos(line, ch)\n pos.xRel = xRel\n if (outside) { pos.outside = true }\n return pos\n}", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "function PosWithInfo(line, ch, outside, xRel) {\n\t var pos = Pos(line, ch);\n\t pos.xRel = xRel;\n\t if (outside) pos.outside = true;\n\t return pos;\n\t }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\r\n if (x < 0) x = 0;\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n lineN = lineNo(lineObj = mergedPos.to.line);\r\n else\r\n return found;\r\n }\r\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function _coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n\n if (y < 0) {\n return PosWithInfo(doc.first, 0, null, -1, -1);\n }\n\n var lineN = _lineAtHeight(doc, y),\n last = doc.first + doc.size - 1;\n\n if (lineN > last) {\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1);\n }\n\n if (x < 0) {\n x = 0;\n }\n\n var lineObj = getLine(doc, lineN);\n\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n\n if (!collapsed) {\n return found;\n }\n\n var rangeEnd = collapsed.find(1);\n\n if (rangeEnd.line == lineN) {\n return rangeEnd;\n }\n\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\r\n if (x < 0) { x = 0; }\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n { lineN = lineNo(lineObj = mergedPos.to.line); }\r\n else\r\n { return found }\r\n }\r\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function getCoordinates(charPosX, charPosY, move = \"next\") {\n console.log(move, {\n x: charPosX / MAP_CELL_SIZE,\n y: charPosY / MAP_CELL_SIZE,\n });\n const x = Math.floor(charPosX / MAP_CELL_SIZE);\n const y = Math.floor(charPosY / MAP_CELL_SIZE);\n //console.log(\"CURRENT\", { x, y });\n return { x, y };\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t\t if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n\t\t function get(ch, right) {\n\t\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t\t if (right) { m.left = m.right; } else { m.right = m.left; }\n\t\t return intoCoordSystem(cm, lineObj, m, context)\n\t\t }\n\t\t var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n\t\t if (ch >= lineObj.text.length) {\n\t\t ch = lineObj.text.length;\n\t\t sticky = \"before\";\n\t\t } else if (ch <= 0) {\n\t\t ch = 0;\n\t\t sticky = \"after\";\n\t\t }\n\t\t if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n\t\t function getBidi(ch, partPos, invert) {\n\t\t var part = order[partPos], right = part.level == 1;\n\t\t return get(invert ? ch - 1 : ch, right != invert)\n\t\t }\n\t\t var partPos = getBidiPartAt(order, ch, sticky);\n\t\t var other = bidiOther;\n\t\t var val = getBidi(ch, partPos, sticky == \"before\");\n\t\t if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n\t\t return val\n\t\t }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}" ]
[ "0.64862144", "0.63672876", "0.63672876", "0.63672876", "0.63325423", "0.63268346", "0.63268346", "0.63268346", "0.63268346", "0.63268346", "0.63268346", "0.63268346", "0.63268346", "0.6316676", "0.6310989", "0.6296272", "0.6296272", "0.6296272", "0.6296272", "0.6282995", "0.6282995", "0.6282995", "0.6282995", "0.6282995", "0.6282995", "0.6282995", "0.6282995", "0.6268856", "0.6255301", "0.6255301", "0.6246913", "0.6245691", "0.6242493", "0.6242493", "0.6242493", "0.6234656", "0.62105453", "0.6192476", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61767775", "0.61714375", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.61621535", "0.613983", "0.613983", "0.613983", "0.613983", "0.613983", "0.613983", "0.613983", "0.613983", "0.6131919", "0.61148775", "0.60672027", "0.60672027", "0.60672027", "0.6064822", "0.6064822", "0.6064822", "0.60520005", "0.592", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5902977", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256", "0.5877256" ]
0.0
-1
Compute the character position closest to the given coordinates. Input must be lineSpacelocal ("div" coordinate system).
function coordsChar(cm, x, y) { var doc = cm.doc; y += cm.display.viewOffset; if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) } var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; if (lineN > last) { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) } if (x < 0) { x = 0; } var lineObj = getLine(doc, lineN); for (;;) { var found = coordsCharInner(cm, lineObj, lineN, x, y); var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0)); if (!collapsed) { return found } var rangeEnd = collapsed.find(1); if (rangeEnd.line == lineN) { return rangeEnd } lineObj = getLine(doc, lineN = rangeEnd.line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n\n if (outside) {\n pos.outside = outside;\n }\n\n return pos;\n } // Compute the character position closest to the given coordinates.", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineNo > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n if (x < 0) x = 0;\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n lineN = lineNo(lineObj = mergedPos.to.line);\n else\n return found;\n }\n }", "function closestXY(line, mx, my) {\n x0 = line.x0;\n y0 = line.y0;\n x1 = line.x1;\n y1 = line.y1;\n dx = x1 - x0;\n dy = y1 - y0;\n var t = ((mx - x0) * dx + (my - y0) * dy) / (dx * dx + dy * dy);\n t = Math.max(0, Math.min(1, t));\n var x = lerp(x0, x1, t);\n var y = lerp(y0, y1, t);\n if (line === lines[2]) {\n var d0 = Math.sqrt((x - line.x0) * (x - line.x0) + (y - line.y0) * (y - line.y0));\n var d1 = Math.sqrt((line.x1 - x) * (line.x1 - x) + (line.y1 - y) * (line.y1 - y));\n if (d0 < d1) {\n return {\n x: x0,\n y: y0\n }\n } else {\n return {\n x: x1,\n y: y1\n }\n }\n } else {\n return ({\n x: x,\n y: y\n });\n }\n}", "function nearestPointOnLine( x, y, x1, y1, x2, y2 ) {\n let vx = x2 - x1,\n vy = y2 - y1,\n ux = x1 - x,\n uy = y1 - y,\n vu = vx * ux + vy * uy,\n vv = vx * vx + vy * vy,\n t = -vu / vv\n return { t, x: t * x2 + ( 1 - t ) * x1, y: t * y2 + ( 1 - t ) * y1 }\n}", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\t\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t var doc = cm.doc;\n\t y += cm.display.viewOffset;\n\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t if (lineN > last)\n\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t if (x < 0) x = 0;\n\n\t var lineObj = getLine(doc, lineN);\n\t for (;;) {\n\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t var merged = collapsedSpanAtEnd(lineObj);\n\t var mergedPos = merged && merged.find(0, true);\n\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t else\n\t return found;\n\t }\n\t }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t\t if (x < 0) x = 0;\n\t\t\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var merged = collapsedSpanAtEnd(lineObj);\n\t\t var mergedPos = merged && merged.find(0, true);\n\t\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t\t else\n\t\t return found;\n\t\t }\n\t\t }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\r\n if (x < 0) x = 0;\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n lineN = lineNo(lineObj = mergedPos.to.line);\r\n else\r\n return found;\r\n }\r\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc\n y += cm.display.viewOffset\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0 }\n\n var lineObj = getLine(doc, lineN)\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y)\n var merged = collapsedSpanAtEnd(lineObj)\n var mergedPos = merged && merged.find(0, true)\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line) }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.view.doc;\n y += cm.display.viewOffset;\n if (y < 0) return {line: 0, ch: 0, outside: true};\n var lineNo = lineAtHeight(doc, y);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc, doc.size - 1).text.length};\n if (x < 0) x = 0;\n\n for (;;) {\n var lineObj = getLine(doc, lineNo);\n var found = coordsCharInner(cm, lineObj, lineNo, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find();\n if (merged && found.ch >= mergedPos.from.ch)\n lineNo = mergedPos.to.line;\n else\n return found;\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var merged = collapsedSpanAtEnd(lineObj);\n var mergedPos = merged && merged.find(0, true);\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n { lineN = lineNo(lineObj = mergedPos.to.line); }\n else\n { return found }\n }\n}", "function _coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n\n if (y < 0) {\n return PosWithInfo(doc.first, 0, null, -1, -1);\n }\n\n var lineN = _lineAtHeight(doc, y),\n last = doc.first + doc.size - 1;\n\n if (lineN > last) {\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1);\n }\n\n if (x < 0) {\n x = 0;\n }\n\n var lineObj = getLine(doc, lineN);\n\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n\n if (!collapsed) {\n return found;\n }\n\n var rangeEnd = collapsed.find(1);\n\n if (rangeEnd.line == lineN) {\n return rangeEnd;\n }\n\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\r\n if (x < 0) { x = 0; }\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n { lineN = lineNo(lineObj = mergedPos.to.line); }\r\n else\r\n { return found }\r\n }\r\n}", "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }", "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n\t\t if (x < 0) { x = 0; }\n\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n\t\t if (!collapsed) { return found }\n\t\t var rangeEnd = collapsed.find(1);\n\t\t if (rangeEnd.line == lineN) { return rangeEnd }\n\t\t lineObj = getLine(doc, lineN = rangeEnd.line);\n\t\t }\n\t\t }", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n}", "function distance_to_point(x, y) {\r\n\treturn Math.sqrt(Math.pow(character.real_x - x, 2) + Math.pow(character.real_y - y, 2));\r\n}", "function _cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n\n if (!preparedMeasure) {\n preparedMeasure = prepareMeasureForLine(cm, lineObj);\n }\n\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\n if (right) {\n m.left = m.right;\n } else {\n m.right = m.left;\n }\n\n return intoCoordSystem(cm, lineObj, m, context);\n }\n\n var order = getOrder(lineObj, cm.doc.direction),\n ch = pos.ch,\n sticky = pos.sticky;\n\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n\n if (!order) {\n return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\");\n }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos],\n right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert);\n }\n\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n\n if (other != null) {\n val.other = getBidi(ch, other, sticky != \"before\");\n }\n\n return val;\n } // Used to cheaply estimate the coordinates for a position. Used for", "function distance_to_point(x, y) {\n return Math.sqrt(Math.pow(character.real_x - x, 2) + Math.pow(character.real_y - y, 2));\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }", "function nearestIndex(xpos) {\r\n var begin = 0;\r\n var fin = g_linedata.length - 1;\r\n var middle;\r\n while (begin < fin) {\r\n middle = Math.floor((begin + fin) / 2);\r\n if (g_linedata[middle][0] < xpos) begin = middle + 1;\r\n else fin = middle;\r\n }\r\n var nearest = 0;\r\n if (fin != 0) nearest = xpos - g_linedata[fin - 1][0] < g_linedata[fin][0] - xpos ? fin - 1 : fin;\r\n return nearest;\r\n }", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line)\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight)\n if (right) { m.left = m.right; } else { m.right = m.left }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length\n sticky = \"before\"\n } else if (ch <= 0) {\n ch = 0\n sticky = \"after\"\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky)\n var other = bidiOther\n var val = getBidi(ch, partPos, sticky == \"before\")\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\") }\n return val\n}", "function findNearestGridlineValue(position) {\n\tif ((position % gridlineSpacing) > gridlineSpacing / 2) {\n\t\treturn position - (position % gridlineSpacing) + gridlineSpacing\n\t} else {\n\t\treturn position - (position % gridlineSpacing)\n\t}\n}", "function position(line_r, line_s, point){\n\treturn Math.sign((line_s.x - line_r.x)*(point.y - line_r.y) - (line_s.y - line_r.y)*(point.x - line_r.x));\t\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = (part.level % 2) != 0;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\r\n lineObj = lineObj || getLine(cm.doc, pos.line);\r\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\r\n function get(ch, right) {\r\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\r\n if (right) { m.left = m.right; } else { m.right = m.left; }\r\n return intoCoordSystem(cm, lineObj, m, context)\r\n }\r\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\r\n if (ch >= lineObj.text.length) {\r\n ch = lineObj.text.length;\r\n sticky = \"before\";\r\n } else if (ch <= 0) {\r\n ch = 0;\r\n sticky = \"after\";\r\n }\r\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\r\n\r\n function getBidi(ch, partPos, invert) {\r\n var part = order[partPos], right = part.level == 1;\r\n return get(invert ? ch - 1 : ch, right != invert)\r\n }\r\n var partPos = getBidiPartAt(order, ch, sticky);\r\n var other = bidiOther;\r\n var val = getBidi(ch, partPos, sticky == \"before\");\r\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\r\n return val\r\n}", "function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n\t\t lineObj = lineObj || getLine(cm.doc, pos.line);\n\t\t if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n\t\t function get(ch, right) {\n\t\t var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n\t\t if (right) { m.left = m.right; } else { m.right = m.left; }\n\t\t return intoCoordSystem(cm, lineObj, m, context)\n\t\t }\n\t\t var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n\t\t if (ch >= lineObj.text.length) {\n\t\t ch = lineObj.text.length;\n\t\t sticky = \"before\";\n\t\t } else if (ch <= 0) {\n\t\t ch = 0;\n\t\t sticky = \"after\";\n\t\t }\n\t\t if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n\t\t function getBidi(ch, partPos, invert) {\n\t\t var part = order[partPos], right = part.level == 1;\n\t\t return get(invert ? ch - 1 : ch, right != invert)\n\t\t }\n\t\t var partPos = getBidiPartAt(order, ch, sticky);\n\t\t var other = bidiOther;\n\t\t var val = getBidi(ch, partPos, sticky == \"before\");\n\t\t if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n\t\t return val\n\t\t }", "function cmpClosest(a, b, c) {\n var ret = a.line - c.line\n if (ret) { return ret; }\n if (a.ch <= c.ch && c.ch <= b.ch) { return 0; }\n if (Math.abs(a.ch - c.ch) < Math.abs(b.ch - c.ch)) { return a.ch - c.ch; }\n return b.ch - c.ch;\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }", "function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }" ]
[ "0.7138674", "0.6260495", "0.6260495", "0.6260495", "0.6260495", "0.62046933", "0.62046933", "0.62046933", "0.62046933", "0.62046933", "0.62046933", "0.62046933", "0.62046933", "0.6193592", "0.61757505", "0.6175573", "0.6170065", "0.6170065", "0.6162911", "0.6151872", "0.6130793", "0.6119267", "0.6119137", "0.6119137", "0.6119137", "0.6098636", "0.6098636", "0.6098636", "0.60980624", "0.60980624", "0.60980624", "0.60980624", "0.60980624", "0.60980624", "0.60980624", "0.60980624", "0.6097384", "0.60849315", "0.60498977", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6048248", "0.6030889", "0.5994335", "0.5994335", "0.5994335", "0.5936044", "0.59247524", "0.5924296", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5903942", "0.5891267", "0.5873805", "0.5860601", "0.58588773", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.58520776", "0.5851291", "0.58093864", "0.58038086", "0.57955915", "0.5730531", "0.5730531", "0.5730531" ]
0.6033124
53
Returns true if the given side of a box is after the given coordinates, in toptobottom, lefttoright order.
function boxIsAfter(box, x, y, left) { return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boxIsAfter(box, x, y, left) {\n\t\t return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n\t\t }", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x;\n }", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n}", "function boxIsAfter(box, x, y, left) {\r\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\r\n}", "isAfter(point, another) {\n return Point.compare(point, another) === 1;\n }", "isAfter(point, another) {\n return Point.compare(point, another) === 1;\n }", "contains(aPoint)\n {\n let top = new Point()\n\t top.setPoint(this.x + this.size / 2, this.y)\n let right = new Point()\n\t right.setPoint(this.x + this.size, this.y + this.size / 2)\n let bottom = new Point()\n\t bottom.setPoint(this.x + this.size / 2, this.y + this.size)\n let left = new Point()\n\t left.setPoint(this.x, this.y + this.size / 2)\n\n return this.toRightOf(top, right, aPoint)\n && this.toRightOf(right, bottom, aPoint)\n && this.toRightOf(bottom, left, aPoint)\n && this.toRightOf(left, top, aPoint)\n }", "contains(x, y) {\n return x > this.left && x < this.right && y > this.top && y < this.bot;\n }", "inBoundary(mouseCoordinates){\n if (this.x <= mouseCoordinates.x && this.y<=mouseCoordinates.y) {\n const boxEdgeX = this.x + this.width;\n const boxEdgeY = this.y + this.height;\n if (mouseCoordinates.x <= boxEdgeX && mouseCoordinates.y <= boxEdgeY) {\n return true;\n }\n }\n return false;\n }", "collidedBy(obj) {\n if (obj.left > this.right ||\n obj.top > this.bottom ||\n obj.right < this.left ||\n obj.bottom < this.top)\n return false;\n \n return true;\n }", "function is_at_edge(pos) {\n var board = get_board();\n\n if (pos.x > (board.length-1) || pos.x < 0 ||\n pos.y > (board[0].length-1) || pos.y < 0) {\n return true;\n }\n return false;\n}", "contains(x, y) {\n return x < this.right && x > this.left && y < this.bottom && y > this.top;\n }", "inside(x, y) {\n let box = this.bbox();\n return x > box.x && y > box.y && x < box.x + box.width && y < box.y + box.height;\n }", "function _inBox(point,box) {\n return box && point[0] >= box[0][0] && point[0] <= box[1][0] && point[1] >= box[0][1] && point[1] <= box[1][1];\n }", "function in_box(x, y, box) {\n return x >= box.x && x <= box.x + box.w && y >= box.y && y <= box.y + box.h;\n }", "function isRectAOutsideRectB(a, b) {\n if (a.left > b.left + b.width) return true; // to the right\n if (a.left + a.width < b.left) return true; // to the left\n if (a.top > b.top + b.height) return true; // below\n if (a.top + a.height < b.top) return true; // above\n return false;\n }", "function inRect(x, y, left, top, right, bottom) {\n\t\tif ((x > left) && (x < right) && (y > top) && (y < bottom)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function check_top_left_bottom_right(row, col, color) {\n let count = 1\n let temp_row = row\n let temp_col = col\n while (row > 0 && col > 0) {\n let $next_cell = get_cell(--row, --col)\n if ($next_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n row = temp_row\n col = temp_col\n while (row < that.row && col < that.col) {\n let $up_cell = get_cell(++row, ++col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }", "overlaps(box) {\n return (this.x < box.x + box.w) && (this.x + this.w > box.x)\n && (this.y < box.y + box.h) && (this.y + this.h > box.y);\n }", "function isAtRight() {\n\t\treturn current.some((index) => (currentPosition + index + 1) % width === 0);\n\t}", "function isNodeAfter(node1, node2) {\n return !!(node1 &&\n node2 &&\n (node2.compareDocumentPosition(node1) & 4 /* Following */) ==\n 4 /* Following */);\n}", "function inBorder(position){\n return position.x>=0 && position.y >=0 && position.x < COLS && position.y < ROWS;\n}", "isMoveStraight(args){\n if ((args[0] - args[1] == this.basicMoveObj.y) && (args[2] - args[3] == this.basicMoveObj.x)) {\n return true\n } else {\n return false\n }\n }", "function isAtRight() {\r\n return current.some((index) => (currentPosition + index + 1) % width === 0);\r\n }", "function middleInside( a, b ) {\n\n\t\tlet p = a,\n\t\t\tinside = false;\n\t\tconst px = ( a.x + b.x ) / 2,\n\t\t\tpy = ( a.y + b.y ) / 2;\n\t\tdo {\n\n\t\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\t\tinside = ! inside;\n\t\t\tp = p.next;\n\n\t\t} while ( p !== a );\n\n\t\treturn inside;\n\n\t}", "function isAtRight() {\r\n return current.some((index) => (currentPosition + index + 1) % width === 0);\r\n}", "function inbox(point_x, point_y, box_x, box_y, box_width, box_height) {\n return (point_x >= box_x && point_x <= box_x + box_width && point_y >= box_y && point_y <= box_y + box_height);\n}", "function biggerThanNeighbors(arr, position) {\n\n if (arr[position] > arr[position - 1] && arr[position] > arr[position + 1]) {\n return true;\n }\n return false;\n}", "function isAtRight() {\r\n return current.some(index => (currentPosition + index + 1) % width === 0)\r\n}", "function hasGreaterBottomGap (hitbox1, hitbox2) {\n const topGap = hitbox2.y + hitbox2.height - hitbox1.y;\n const rightGap = hitbox1.x + hitbox1.width - hitbox2.x;\n const bottomGap = hitbox1.y + hitbox1.height - hitbox2.y;\n const leftGap = hitbox2.x + hitbox2.width - hitbox1.x;\n\n return bottomGap > topGap && bottomGap > rightGap && bottomGap > leftGap;\n}", "function ShouldSnap(hitbox_before, hitbox_after, hitbox_obj)\n{\n var upper_before = hitbox_before[0];\n var bottom_before = hitbox_before[1];\n\n var upper_after = hitbox_after[0];\n var bottom_after = hitbox_after[1];\n\n var upper_obj = hitbox_obj[0];\n var bottom_obj = hitbox_obj[1];\n\n var eq_thres = 0.0001;\n var y_eq1 = Math.abs(bottom_before[1] - upper_obj[1]) <= 0.0001;\n var y_eq2 = Math.abs(bottom_after[1] - upper_obj[1]) <= 0.0001;\n\n // First determine if original y is above\n if((bottom_before[1] > upper_obj[1] || y_eq1) && (bottom_after[1] < upper_obj[1] || y_eq2))\n {\n // Then ensure that the x's line up\n if(upper_after[0] <= bottom_obj[0] && bottom_after[0] >= upper_obj[0])\n {\n return true;\n }\n }\n\n return false;\n}", "function onTopOf(obj) {\n\t\treturn (!(this.x + this.boundingBox.left >= obj.x + obj.boundingBox.right ||\n\t\t\tthis.x + this.boundingBox.right <= obj.x + obj.boundingBox.left) &&\n\t\tthis.y + this.boundingBox.bottom === obj.y + obj.boundingBox.top);\n\t}", "playerIsOutSideOfContainer(nextTop, nextLeft) {\n let isOutSide = false;\n if (nextTop > 340 || nextTop < 10 || nextLeft > 550 || nextLeft < 10) {\n isOutSide = true;\n }\n return isOutSide;\n }", "function pa(e,t,a,n){return!(e.bottom<=a)&&(e.top>a||(n?e.left:e.right)>t)}", "function middleInside( a, b ) {\n\n\tlet p = a,\n\t\tinside = false;\n\tconst px = ( a.x + b.x ) / 2,\n\t\tpy = ( a.y + b.y ) / 2;\n\tdo {\n\n\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )\n\t\t\tinside = ! inside;\n\t\tp = p.next;\n\n\t} while ( p !== a );\n\n\treturn inside;\n\n}", "static middleInside(a, b) {\n var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) {\n inside = !inside;\n }\n p = p.next;\n } while (p !== a);\n return inside;\n }", "contains(point) {\n if(!point) return false;\n // Iterate over _edges_\n let windingNumber = 0;\n for(let i = 0; i < this.vertices.length; ++i) {\n const start = this.vertices[i];\n const end = this.vertices[i + 1] || this.vertices[0];\n const edge = new Edge(start, end);\n\n if(edge.crosses(point.y)) {\n if(edge.isLeftOf(point)) {\n // Downward edge\n windingNumber++;\n } else {\n // Upward edge\n windingNumber--;\n }\n }\n }\n\n return windingNumber > 0;\n }", "contains(x, y) {\n let coords = this.getBoundingBox();\n return (x > coords.x && x < coords.x+coords.width && y > coords.y && y < coords.y+coords.height);\n }", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n\t (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t { inside = !inside; }\n\t p = p.next;\n\t } while (p !== a);\n\n\t return inside;\n\t}", "checkBorders(nextLeft, nextTop) {\n const gameContainer = this.getContainerSize();\n const playerSize = this.getPlayerSize();\n\n if (\n !(nextLeft < 0) &&\n !(nextTop < 0) &&\n !(nextLeft > gameContainer.width - playerSize.width) &&\n !(nextTop > gameContainer.height - playerSize.height)\n ) {\n return true;\n } else return false;\n }", "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t inside = !inside;\n\t p = p.next;\n\t } while (p !== a);\n\n\t return inside;\n\t}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t inside = !inside;\n\t p = p.next;\n\t } while (p !== a);\n\t\n\t return inside;\n\t}", "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t inside = !inside;\n\t p = p.next;\n\t } while (p !== a);\n\t\n\t return inside;\n\t}", "function middleInside(a, b) {\n\t var p = a,\n\t inside = false,\n\t px = (a.x + b.x) / 2,\n\t py = (a.y + b.y) / 2;\n\t do {\n\t if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n\t inside = !inside;\n\t p = p.next;\n\t } while (p !== a);\n\t\n\t return inside;\n\t}", "moveEdge() {\n switch(this.pos.x) {\n\t\t\tcase 0: \n\t\t\t\tthis.liveObj.move(RIGHT);\n\t\t\t\treturn true;\n\t\t\tcase 49: \n\t\t\t\tthis.liveObj.move(LEFT);\n\t\t\t\treturn true;\n\t\t}\n\t\tswitch(this.pos.y) {\n\t\t\tcase 0:\n\t\t\t\tthis.liveObj.move(BOTTOM);\n\t\t\t\treturn true;\n\t\t\tcase 49: \n\t\t\t\tthis.liveObj.move(TOP);\n\t\t\t\treturn true;\n\t\t}\n\n return false;\n }", "function middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}", "isOutside(tetroSquare) {\n // If x index is too left or right.\n if (tetroSquare.xIndex < 0 || tetroSquare.xIndex > SQUARES_IN_WIDTH - 1) {\n return true;\n }\n\n // Note it doesn't check the case that y index is too large, which might be a valid case.\n if (tetroSquare.yIndex < 0) {\n return true;\n }\n\n return false;\n }", "upright () {\n return this.content.height <= this.height &&\n this.content.width > this.width\n }", "function middleInside( a, b ) {\n\n\t\tvar p = a,\n\t\t\tinside = false,\n\t\t\tpx = ( a.x + b.x ) / 2,\n\t\t\tpy = ( a.y + b.y ) / 2;\n\n\t\tdo {\n\n\t\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) {\n\n\t\t\t\tinside = ! inside;\n\n\t\t\t}\n\n\t\t\tp = p.next;\n\n\t\t} while ( p !== a );\n\n\t\treturn inside;\n\n\t}", "function middleInside( a, b ) {\n\n\t\tvar p = a,\n\t\t\tinside = false,\n\t\t\tpx = ( a.x + b.x ) / 2,\n\t\t\tpy = ( a.y + b.y ) / 2;\n\n\t\tdo {\n\n\t\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) {\n\n\t\t\t\tinside = ! inside;\n\n\t\t\t}\n\n\t\t\tp = p.next;\n\n\t\t} while ( p !== a );\n\n\t\treturn inside;\n\n\t}", "function middleInside( a, b ) {\n\n\t\tvar p = a,\n\t\t\tinside = false,\n\t\t\tpx = ( a.x + b.x ) / 2,\n\t\t\tpy = ( a.y + b.y ) / 2;\n\n\t\tdo {\n\n\t\t\tif ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&\n\t\t\t\t\t\t\t( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) {\n\n\t\t\t\tinside = ! inside;\n\n\t\t\t}\n\n\t\t\tp = p.next;\n\n\t\t} while ( p !== a );\n\n\t\treturn inside;\n\n\t}", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "function isInRightColumn(location){\r\n return location%BOARDWIDTH === BOARDWIDTH - 1;\r\n}", "function isOver(box, point) {\n return point.x < box.min.x || point.x > box.max.x ||\n point.y < box.max.y || // controllo che la y del point (dito) sia maggiore di quella della figura\n point.z < box.min.z || point.z > box.max.z ? false : true;\n}", "function check_top_right_bottom_left(row, col, color) {\n let count = 1\n let temp_row = row\n let temp_col = col\n while (row < that.row && col > 0) {\n let $next_cell = get_cell(++row, --col)\n if ($next_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n row = temp_row\n col = temp_col\n while (row > 0 && col < that.col) {\n let $up_cell = get_cell(--row, ++col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }", "function checkArea(e, state) {\n var $handle = $(state.handle);\n var offset = $handle.offset();\n var width = $handle.outerWidth();\n var height = $handle.outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t, r, b, l) > state.options.edge;\n }", "function simpleColCheck(shapeA, shapeB){\n\tif(shapeA.x > shapeB.x+shapeB.width){ // Too far to the right\n\t\treturn false;\n\t}\n\tif(shapeA.y > shapeB.y+shapeB.height){ // Is above it\n\t\treturn false;\n\t}\n\tif(shapeA.x+shapeA.width < shapeB.x){ // Too far to the left\n\t\treturn false;\n\t}\n\tif(shapeA.y+shapeA.height < shapeB.y){ // Is below it\n\t\treturn false;\n\t}\n\treturn true;\n}" ]
[ "0.80230653", "0.7990573", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.7967614", "0.79146224", "0.62625074", "0.62625074", "0.6129979", "0.605716", "0.5878628", "0.5862407", "0.5801529", "0.57982314", "0.57153076", "0.56941473", "0.56886363", "0.5629706", "0.5626294", "0.5583726", "0.55605805", "0.555572", "0.55455184", "0.55436826", "0.5521186", "0.55135405", "0.5463547", "0.54559904", "0.54521024", "0.5448115", "0.5444718", "0.5439825", "0.54296935", "0.5428763", "0.54158336", "0.5410605", "0.5409528", "0.54082745", "0.53960335", "0.5389116", "0.5386044", "0.5386044", "0.5386044", "0.5386044", "0.5386044", "0.5386044", "0.5386044", "0.5386044", "0.5379403", "0.5377086", "0.53723973", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.5371481", "0.53705525", "0.53705525", "0.53705525", "0.5366654", "0.53634125", "0.5356821", "0.53491986", "0.53428084", "0.53428084", "0.53428084", "0.53418916", "0.53418916", "0.5338072", "0.5337422", "0.5334087", "0.5333807", "0.5331108" ]
0.8012587
15
Compute the default text height.
function textHeight(display) { if (display.cachedTextHeight != null) { return display.cachedTextHeight } if (measureText == null) { measureText = elt("pre"); // Measure a bunch of lines, for browsers that compute // fractional heights. for (var i = 0; i < 49; ++i) { measureText.appendChild(document.createTextNode("x")); measureText.appendChild(elt("br")); } measureText.appendChild(document.createTextNode("x")); } removeChildrenAndAdd(display.measure, measureText); var height = measureText.offsetHeight / 50; if (height > 3) { display.cachedTextHeight = height; } removeChildren(display.measure); return height || 1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textHeight(display) {\n if (display.cachedTextHeight != null) {\n return display.cachedTextHeight;\n }\n\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\"); // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n\n if (height > 3) {\n display.cachedTextHeight = height;\n }\n\n removeChildren(display.measure);\n return height || 1;\n } // Compute the default character width.", "get defaultLineHeight() { return this.viewState.heightOracle.lineHeight; }", "function getHeight() {\n\tvar height = document.getElementById(\"clientText\").clientHeight - PADDING_PX;\n\theight = height * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn height.toFixed(2);\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }", "fontHeight () {\n return this.koofScreenY > 0 ? 16 * this.koofScreenY : 16;\n }", "function textHeight(display) {\n\t\t if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n\t\t if (measureText == null) {\n\t\t measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n\t\t // Measure a bunch of lines, for browsers that compute\n\t\t // fractional heights.\n\t\t for (var i = 0; i < 49; ++i) {\n\t\t measureText.appendChild(document.createTextNode(\"x\"));\n\t\t measureText.appendChild(elt(\"br\"));\n\t\t }\n\t\t measureText.appendChild(document.createTextNode(\"x\"));\n\t\t }\n\t\t removeChildrenAndAdd(display.measure, measureText);\n\t\t var height = measureText.offsetHeight / 50;\n\t\t if (height > 3) { display.cachedTextHeight = height; }\n\t\t removeChildren(display.measure);\n\t\t return height || 1\n\t\t }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "function textHeight(display) {\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) display.cachedTextHeight = height;\n removeChildren(display.measure);\n return height || 1;\n }", "max_height() {\n\t\treturn this.rectangle_y_pad + N_WORDS * char_image_dimensions.height + (N_WORDS - 1) * this.height_between_words;\n\t}", "function textHeight(display) {\n\t\t if (display.cachedTextHeight != null) return display.cachedTextHeight;\n\t\t if (measureText == null) {\n\t\t measureText = elt(\"pre\");\n\t\t // Measure a bunch of lines, for browsers that compute\n\t\t // fractional heights.\n\t\t for (var i = 0; i < 49; ++i) {\n\t\t measureText.appendChild(document.createTextNode(\"x\"));\n\t\t measureText.appendChild(elt(\"br\"));\n\t\t }\n\t\t measureText.appendChild(document.createTextNode(\"x\"));\n\t\t }\n\t\t removeChildrenAndAdd(display.measure, measureText);\n\t\t var height = measureText.offsetHeight / 50;\n\t\t if (height > 3) display.cachedTextHeight = height;\n\t\t removeChildren(display.measure);\n\t\t return height || 1;\n\t\t }", "function textHeight(display) {\r\n if (display.cachedTextHeight != null) return display.cachedTextHeight;\r\n if (measureText == null) {\r\n measureText = elt(\"pre\");\r\n // Measure a bunch of lines, for browsers that compute\r\n // fractional heights.\r\n for (var i = 0; i < 49; ++i) {\r\n measureText.appendChild(document.createTextNode(\"x\"));\r\n measureText.appendChild(elt(\"br\"));\r\n }\r\n measureText.appendChild(document.createTextNode(\"x\"));\r\n }\r\n removeChildrenAndAdd(display.measure, measureText);\r\n var height = measureText.offsetHeight / 50;\r\n if (height > 3) display.cachedTextHeight = height;\r\n removeChildren(display.measure);\r\n return height || 1;\r\n }", "function textHeight(display) {\n\t if (display.cachedTextHeight != null) return display.cachedTextHeight;\n\t if (measureText == null) {\n\t measureText = elt(\"pre\");\n\t // Measure a bunch of lines, for browsers that compute\n\t // fractional heights.\n\t for (var i = 0; i < 49; ++i) {\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t measureText.appendChild(elt(\"br\"));\n\t }\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t }\n\t removeChildrenAndAdd(display.measure, measureText);\n\t var height = measureText.offsetHeight / 50;\n\t if (height > 3) display.cachedTextHeight = height;\n\t removeChildren(display.measure);\n\t return height || 1;\n\t }", "function textHeight(display) {\n\t if (display.cachedTextHeight != null) return display.cachedTextHeight;\n\t if (measureText == null) {\n\t measureText = elt(\"pre\");\n\t // Measure a bunch of lines, for browsers that compute\n\t // fractional heights.\n\t for (var i = 0; i < 49; ++i) {\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t measureText.appendChild(elt(\"br\"));\n\t }\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t }\n\t removeChildrenAndAdd(display.measure, measureText);\n\t var height = measureText.offsetHeight / 50;\n\t if (height > 3) display.cachedTextHeight = height;\n\t removeChildren(display.measure);\n\t return height || 1;\n\t }", "function textHeight(display) {\n\t if (display.cachedTextHeight != null) return display.cachedTextHeight;\n\t if (measureText == null) {\n\t measureText = elt(\"pre\");\n\t // Measure a bunch of lines, for browsers that compute\n\t // fractional heights.\n\t for (var i = 0; i < 49; ++i) {\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t measureText.appendChild(elt(\"br\"));\n\t }\n\t measureText.appendChild(document.createTextNode(\"x\"));\n\t }\n\t removeChildrenAndAdd(display.measure, measureText);\n\t var height = measureText.offsetHeight / 50;\n\t if (height > 3) display.cachedTextHeight = height;\n\t removeChildren(display.measure);\n\t return height || 1;\n\t }", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\")\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"))\n measureText.appendChild(elt(\"br\"))\n }\n measureText.appendChild(document.createTextNode(\"x\"))\n }\n removeChildrenAndAdd(display.measure, measureText)\n var height = measureText.offsetHeight / 50\n if (height > 3) { display.cachedTextHeight = height }\n removeChildren(display.measure)\n return height || 1\n}", "function textHeight(display) {\r\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\r\n if (measureText == null) {\r\n measureText = elt(\"pre\");\r\n // Measure a bunch of lines, for browsers that compute\r\n // fractional heights.\r\n for (var i = 0; i < 49; ++i) {\r\n measureText.appendChild(document.createTextNode(\"x\"));\r\n measureText.appendChild(elt(\"br\"));\r\n }\r\n measureText.appendChild(document.createTextNode(\"x\"));\r\n }\r\n removeChildrenAndAdd(display.measure, measureText);\r\n var height = measureText.offsetHeight / 50;\r\n if (height > 3) { display.cachedTextHeight = height; }\r\n removeChildren(display.measure);\r\n return height || 1\r\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n}", "function estimateHeight(cm) {\n\t\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t\t return function (line) {\n\t\t if (lineIsHidden(cm.doc, line)) { return 0 }\n\n\t\t var widgetsHeight = 0;\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n\t\t if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n\t\t } }\n\n\t\t if (wrapping)\n\t\t { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n\t\t else\n\t\t { return widgetsHeight + th }\n\t\t }\n\t\t }", "function estimateHeight(cm) {\n\t\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t\t return function(line) {\n\t\t if (lineIsHidden(cm.doc, line)) return 0;\n\t\t\n\t\t var widgetsHeight = 0;\n\t\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t\t }\n\t\t\n\t\t if (wrapping)\n\t\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t\t else\n\t\t return widgetsHeight + th;\n\t\t };\n\t\t }", "function animatedTextIconHeight(){\n\t\"use strict\";\n\t\n\tif($j('.animated_icons_with_text').length){\n\t\tvar $icons = $j('.animated_icons_with_text');\n\t\tvar maxHeight;\n\t\t\n\t\t$icons.find('.animated_text p').each(function() {\n\t\t\tmaxHeight = maxHeight > $j(this).height() ? maxHeight : $j(this).height();\n\t\t});\n\t\t\n\t\tif(maxHeight < 155) {\n\t\t\tmaxHeight = 155;\n\t\t\t\n\t\t}\n\t\t$icons.find('.animated_icon_with_text_inner').height(maxHeight);\n\t}\n}", "function textSize(width, height, fontSize, scale) {\n\t var stageWidth = parseInt(width, 10);\n\t var stageHeight = parseInt(height, 10);\n\n\t var bigSide = Math.max(stageWidth, stageHeight);\n\t var smallSide = Math.min(stageWidth, stageHeight);\n\n\t var newHeight = 0.8 * Math.min(smallSide, bigSide * scale);\n\t return Math.round(Math.max(fontSize, newHeight));\n\t}", "_getEmHeight(font) {\n const sp = document.createElement('span')\n sp.style.font = font\n sp.style.display = 'inline'\n sp.textContent = 'Hello world!'\n\n document.body.appendChild(sp)\n const emHeight = sp.offsetHeight\n document.body.removeChild(sp)\n return emHeight\n }", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\t\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\t\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "textSize (style, text, {transform, text_wrap, max_lines, stroke_width = 0, supersample}) {\n // Check cache first\n TextCanvas.cache.text[style] = TextCanvas.cache.text[style] || {};\n if (TextCanvas.cache.text[style][text]) {\n TextCanvas.cache.stats.text_hits++;\n return TextCanvas.cache.text[style][text];\n }\n TextCanvas.cache.stats.text_misses++;\n TextCanvas.cache.text_count++;\n\n // Calc and store in cache\n let dpr = Utils.device_pixel_ratio * supersample;\n let str = this.applyTextTransform(text, transform);\n let ctx = this.context;\n let vertical_buffer = this.vertical_text_buffer * dpr;\n let horizontal_buffer = dpr * (stroke_width + this.horizontal_text_buffer);\n let leading = 2 * dpr; // make configurable and/or use Canvas TextMetrics when available\n let line_height = this.px_size + leading; // px_size already in device pixels\n\n // Parse string into series of lines if it exceeds the text wrapping value or contains line breaks\n let multiline = MultiLine.parse(str, text_wrap, max_lines, line_height, ctx);\n\n // Final dimensions of text\n let height = multiline.height;\n let width = multiline.width;\n let lines = multiline.lines;\n\n let collision_size = [\n width / dpr,\n height / dpr\n ];\n\n let texture_size = [\n width + 2 * horizontal_buffer,\n height + 2 * vertical_buffer\n ];\n\n let logical_size = [\n texture_size[0] / dpr,\n texture_size[1] / dpr,\n ];\n\n // Returns lines (w/per-line info for drawing) and text's overall bounding box + canvas size\n TextCanvas.cache.text[style][text] = {\n lines,\n size: { collision_size, texture_size, logical_size, line_height }\n };\n return TextCanvas.cache.text[style][text];\n }", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "calculateSize(text) {\n\n // Note that we must calculate the text against a span\n // in its entirety - calculating individual characters yields\n // incorrect values.\n return this.calculateCharacterSize(text);\n\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function(line) {\r\n if (lineIsHidden(cm.doc, line)) return 0;\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\r\n }\r\n\r\n if (wrapping)\r\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\r\n else\r\n return widgetsHeight + th;\r\n };\r\n }", "function get_Height(id_txt) { return (document.getElementById(id_txt).offsetHeight); }", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function (line) {\r\n if (lineIsHidden(cm.doc, line)) { return 0 }\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\r\n } }\r\n\r\n if (wrapping)\r\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\r\n else\r\n { return widgetsHeight + th }\r\n }\r\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display),\n wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) {\n return 0;\n }\n\n var widgetsHeight = 0;\n\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) {\n widgetsHeight += line.widgets[i].height;\n }\n }\n }\n\n if (wrapping) {\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n } else {\n return widgetsHeight + th;\n }\n };\n }", "function getLineHeightPx(element){var computed=getComputedStyle(element);var div=document.createElement('div');div.style.fontFamily=computed.fontFamily;div.style.fontSize=computed.fontSize;div.style.fontStyle=computed.fontStyle;div.style.fontWeight=computed.fontWeight;div.style.lineHeight=computed.lineHeight;div.style.position='absolute';div.textContent='M';// forced layout here\r\n\tdocument.body.appendChild(div);var rect=div.getBoundingClientRect();document.body.removeChild(div);return rect.height;}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size'), 10) * 1.2;\n }\n return parseInt(lh, 10);\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}" ]
[ "0.7177849", "0.6914069", "0.68965995", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68940103", "0.68868273", "0.6880334", "0.67942154", "0.67942154", "0.67942154", "0.67942154", "0.67942154", "0.67942154", "0.67942154", "0.67942154", "0.6777187", "0.672452", "0.6717537", "0.669546", "0.669546", "0.669546", "0.6679584", "0.6679584", "0.6679246", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.6659568", "0.64213496", "0.64171475", "0.64101905", "0.6369962", "0.6359852", "0.6354996", "0.6350215", "0.63439006", "0.63439006", "0.6334722", "0.6291382", "0.6291382", "0.6291382", "0.6291382", "0.6291382", "0.6291382", "0.6291382", "0.6291382", "0.6289886", "0.6284329", "0.62483424", "0.62422776", "0.6239362", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62392557", "0.62214583", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991", "0.6219991" ]
0.6806602
19
Compute the default character width.
function charWidth(display) { if (display.cachedCharWidth != null) { return display.cachedCharWidth } var anchor = elt("span", "xxxxxxxxxx"); var pre = elt("pre", [anchor]); removeChildrenAndAdd(display.measure, pre); var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; if (width > 2) { display.cachedCharWidth = width; } return width || 10 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get defaultCharacterWidth() { return this.viewState.heightOracle.charWidth; }", "function charWidth(display) {\n\t\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t\t var pre = elt(\"pre\", [anchor]);\n\t\t removeChildrenAndAdd(display.measure, pre);\n\t\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t\t if (width > 2) display.cachedCharWidth = width;\n\t\t return width || 10;\n\t\t }", "function charWidth(display) {\n\t\t if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n\t\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t\t var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n\t\t removeChildrenAndAdd(display.measure, pre);\n\t\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t\t if (width > 2) { display.cachedCharWidth = width; }\n\t\t return width || 10\n\t\t }", "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "function charWidth(display) {\n\t if (display.cachedCharWidth != null) return display.cachedCharWidth;\n\t var anchor = elt(\"span\", \"xxxxxxxxxx\");\n\t var pre = elt(\"pre\", [anchor]);\n\t removeChildrenAndAdd(display.measure, pre);\n\t var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n\t if (width > 2) display.cachedCharWidth = width;\n\t return width || 10;\n\t }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) display.cachedCharWidth = width;\n return width || 10;\n }", "function charWidth(display) {\r\n if (display.cachedCharWidth != null) return display.cachedCharWidth;\r\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\r\n var pre = elt(\"pre\", [anchor]);\r\n removeChildrenAndAdd(display.measure, pre);\r\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\r\n if (width > 2) display.cachedCharWidth = width;\r\n return width || 10;\r\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}", "function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\")\n var pre = elt(\"pre\", [anchor])\n removeChildrenAndAdd(display.measure, pre)\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10\n if (width > 2) { display.cachedCharWidth = width }\n return width || 10\n}", "function charWidth(display) {\r\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\r\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\r\n var pre = elt(\"pre\", [anchor]);\r\n removeChildrenAndAdd(display.measure, pre);\r\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\r\n if (width > 2) { display.cachedCharWidth = width; }\r\n return width || 10\r\n}", "function char2width(chr) {\n // Excel Max Digit Width\n // Info: https://github.com/SheetJS/sheetjs/blob/master/docbits/62_colrow.md\n var MDW = 6;\n return Math.ceil((Math.round((chr * MDW + 5) / MDW * 256)) / 256);\n }", "get characterSize() {}", "function va(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n(\"span\",\"xxxxxxxxxx\"),r=n(\"pre\",[t]);a(e.measure,r);var f=t.getBoundingClientRect(),o=(f.right-f.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}", "function lettersWidth(s) {\n\tif (s === null || s === undefined || s === \"\")\n\t\treturn 0;\n\tlet cx = 0;\n\tfor (let i = 0; i < s.length; i++) {\n\t\tlet c = s[i];\n\t\tlet cw = textWidth(c) + spacing;\n\t\tcx += cw;\n\t}\n\treturn cx;\n}", "function _c_width() { \n\t\t\t\t\treturn _width + _padding.l + _padding.r; \n\t\t\t\t}", "function charDisplayWidth(c) {\n if (c >= 0x1100 &&\n (c <= 0x115f || c == 0x2329 || c == 0x232a ||\n (c >= 0x2e80 && c <= 0xa4cf && c != 0x303f) || /* CJK ... Yi */\n (c >= 0xac00 && c <= 0xd7a3) || /* Hangul Syllables */\n (c >= 0xf900 && c <= 0xfaff) || /* CJK Compatibility Ideographs */\n (c >= 0xfe10 && c <= 0xfe19) || /* Vertical forms */\n (c >= 0xfe30 && c <= 0xfe6f) || /* CJK Compatibility Forms */\n (c >= 0xff00 && c <= 0xff60) || /* Fullwidth Forms */\n (c >= 0xffe0 && c <= 0xffe6) ||\n (c >= 0x20000 && c <= 0x2fffd) ||\n (c >= 0x30000 && c <= 0x3fffd))) return 2;\n return 1;\n }", "padWidth() {\n let width = this.largestOptionLength();\n\n if (this.argsDescription && this._args.length) {\n if (this.largestArgLength() > width) {\n width = this.largestArgLength();\n }\n }\n\n if (this.commands && this.commands.length) {\n if (this.largestCommandLength() > width) {\n width = this.largestCommandLength();\n }\n }\n\n return width;\n }", "_padToWidth(s, width, c) {\n c = c || \" \";\n while (s.length < width) s += c;\n return s;\n }", "function strWidth(str){\n\t\tif(str.length == 0)return 0;\n\t\t//We need to calculate how long our string will be in pixels\n\t\tvar strWidths = {\" \":9,\"!\":10,\"\\\"\":15,\"#\":17,\"$\":17,\"%\":27,\"&\":22,\"'\":8,\"(\":10,\")\":10,\"*\":12,\"+\":18,\",\":9,\"-\":10,\".\":9,\"/\":9,\"0\":17,\"1\":17,\"2\":17,\"3\":17,\"4\":17,\"5\":17,\"6\":17,\"7\":17,\"8\":17,\"9\":17,\":\":10,\";\":10,\"<\":18,\"=\":18,\">\":18,\"?\":19,\"@\":30,\"A\":22,\"B\":22,\"C\":22,\"D\":22,\"E\":21,\"F\":19,\"G\":24,\"H\":22,\"I\":9,\"J\":17,\"K\":22,\"L\":19,\"M\":25,\"N\":22,\"O\":24,\"P\":21,\"Q\":24,\"R\":22,\"S\":21,\"T\":19,\"U\":22,\"V\":21,\"W\":29,\"X\":21,\"Y\":21,\"Z\":19,\"[\":10,\"]\":10,\"^\":18,\"_\":17,\"`\":10,\"a\":17,\"b\":19,\"c\":17,\"d\":19,\"e\":17,\"f\":10,\"g\":19,\"h\":19,\"i\":9,\"j\":9,\"k\":17,\"l\":9,\"m\":27,\"n\":19,\"o\":19,\"p\":19,\"q\":19,\"r\":12,\"s\":17,\"t\":10,\"u\":19,\"v\":17,\"w\":24,\"x\":17,\"y\":17,\"z\":15,\"{\":12,\"|\":9,\"}\":12,\"~\":18};\n\t\tvar w = 0;\n\t\tfor(var i = 0; i<str.length; i++){\n\t\t\t//If we dont know how wide the char is, set it to 28.5 that is the width of W and no char is wider than that.\n\t\t\tw += fontSize/30*(strWidths[str[i]]?strWidths[str[i]]:28.5);\n\t\t}\n\t\t//This is for the space between the text and the symbol.\n\t\tw += spaceTextIcon;\n\t\treturn w;\n\t}", "function textWidth(text) {\n\tif (!text){\n\t\treturn 0;\n\t}\n\tlen = 0;\n\tfor(i=0; i<text.length;i++) {\n\t\tlen += text.charCodeAt(i) < 128 ? 1 : 2;\n\t}\n\treturn len;\n}", "set characterSize(value) {}", "get width() { return this.#format.width; }", "function charsWidth( character, charsArray ) {\r\n charsArray = charsArray || _TextRangeElementData.charactersWidthForTheProcess;\r\n var counting = charsArray.length;\r\n while ( counting-- > 0 ) {\r\n var charObject = charsArray [ counting ];\r\n if ( charObject.character == character ) {\r\n return charObject.width;\r\n }\r\n }\r\n return 0;\r\n }", "function wcswidth(str, opts) {\n opts = _WIDTH_DEFAULTS; // FIXME\n if (typeof str !== 'string')\n return _width_wcwidth(str, opts);\n var s = 0;\n for (var i = 0; i < str.length; i++) {\n // FIXME: apply patch for high unicode chars (see print_p)\n var n = _width_wcwidth(str.charCodeAt(i), opts);\n if (n < 0)\n return -1;\n s += n;\n }\n return s\n }", "function calcWidthOfText(text) {\n return text.split('').reduce((width, ch, index) => {\n const chCode = text.charCodeAt(index);\n const chLen = map[chCode];\n /** 13px for the width of non-ascii characters */\n return width += chLen ? chLen : (chCode >= 0 && chCode <= 127 ? 0 : 13);\n }, 0) + 3 /** padding */ * 2;\n}", "function computeFontWidthFactor (font) {\n\t var sum = 0;\n\t var digitsum = 0;\n\t var digits = 0;\n\t font.chars.map(function (ch) {\n\t sum += ch.xadvance;\n\t if (ch.id >= 48 && ch.id <= 57) {\n\t digits++;\n\t digitsum += ch.xadvance;\n\t }\n\t });\n\t return digits ? digitsum / digits : sum / font.chars.length;\n\t}", "stringWidth(_string, _length, _elemId, _customStyle) {\n return this.stringSize(_string, _length, _elemId, false, _customStyle)[0];\n }", "function realLength(value) {\n var length = value.indexOf('\\n')\n return width(length === -1 ? value : value.slice(0, length))\n}", "function wcswidth(str, opts) {\n if (typeof str !== 'string') { return wcwidth(str, opts); }\n var s = 0;\n\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts);\n if (n < 0) { return -1; }\n s += n;\n }\n\n return s;\n }", "function computeFontWidthFactor (font) {\n var sum = 0;\n var digitsum = 0;\n var digits = 0;\n font.chars.map(function (ch) {\n sum += ch.xadvance;\n if (ch.id >= 48 && ch.id <= 57) {\n digits++;\n digitsum += ch.xadvance;\n }\n });\n return digits ? digitsum / digits : sum / font.chars.length;\n}", "getMaxWidthUnit(){return this.__maxWidthUnit}", "function getWidth() {\n\tvar width = document.getElementById(\"clientText\").clientWidth - PADDING_PX;\n\twidth = width * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn width.toFixed(2);\n}", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function calculateWidthForText(text) {\n if (spacer === undefined) { // on first call only.\n spacer = document.createElement('span'); \n spacer.style.visibility = 'hidden';\n spacer.style.position = 'fixed';\n spacer.style.outline = '0';\n spacer.style.margin = '0';\n spacer.style.padding = '0';\n spacer.style.border = '0';\n spacer.style.left = '0';\n spacer.style.whiteSpace = 'pre';\n spacer.style.fontSize = config.fontSize;\n spacer.style.fontFamily = config.fontFamily;\n spacer.style.fontWeight = 'normal';\n document.body.appendChild(spacer); \n } \n \n // Used to encode an HTML string into a plain text.\n // taken from http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding\n spacer.innerHTML = String(text).replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n return spacer.getBoundingClientRect().right;\n }", "function computeCustomizedWidth(){\n\tvar note_div = document.querySelector('#note_div');\n\tvar largeWidth = note_div.offsetWidth;\n\tvar margin = NOTE_MARGIN;\n\t//border = 2px\n\tvar border = window.getComputedStyle(note_div).borderWidth[0];\n\treturn (largeWidth - (2*border))/numOfKey -(2*margin) -1;\n}", "wcwidth(num) {\n return this._activeProvider.wcwidth(num);\n }", "function wcswidth(str, opts) {\n if (typeof str !== 'string') return wcwidth(str, opts)\n\n var s = 0;\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts);\n if (n < 0) return -1\n s += n;\n }\n\n return s\n}", "function wcswidth(str, opts) {\n if (typeof str !== 'string') return wcwidth(str, opts)\n\n var s = 0\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts)\n if (n < 0) return -1\n s += n\n }\n\n return s\n}", "function wcswidth(str, opts) {\n if (typeof str !== 'string') return wcwidth(str, opts)\n\n var s = 0\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts)\n if (n < 0) return -1\n s += n\n }\n\n return s\n}", "function wcswidth(str, opts) {\n if (typeof str !== 'string') return wcwidth(str, opts)\n\n var s = 0\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts)\n if (n < 0) return -1\n s += n\n }\n\n return s\n}", "function wcswidth(str, opts) {\n if (typeof str !== 'string') return wcwidth(str, opts)\n\n var s = 0\n for (var i = 0; i < str.length; i++) {\n var n = wcwidth(str.charCodeAt(i), opts)\n if (n < 0) return -1\n s += n\n }\n\n return s\n}", "function get_num_chars() {\n var cursor = self.find('.cursor');\n var cur_width = cursor.width()\n var result = Math.floor(self.width() / cur_width);\n if (haveScrollbars()) {\n // assume that scrollbars are 20px - in my Laptop with \n // Linux/Chrome they are 16px\n var margins = self.innerWidth() - self.width();\n result -= Math.ceil((20 - margins / 2) / (cur_width-1));\n }\n return result;\n }", "get maxWidth() {}", "static getConsoleWidth() {\n const stdout = process.stdout;\n if (stdout && stdout.columns) {\n return stdout.columns;\n }\n return 80;\n }", "calculateCharacterSize(char) {\n if (this._sizes[char]) return this._sizes[char];\n\n var span = this._getTemporarySpan();\n\n // copy over the styles defined for the text ruler so that\n // we can make an accurate measurement\n var ts = this._style;\n\n Object.assign(span.style, {\n letterSpacing: ts.letterSpacing,\n lineHeight : ts.lineHeight,\n fontSize : ts.fontSize,\n fontFamily : ts.fontFamily,\n fontWeight : ts.fontWeight\n });\n\n // set the encoded\n span.innerHTML = encode(char);\n\n var w = span.offsetWidth; // + this._getLetterSpacing();\n var h = span.offsetHeight;\n\n return this._sizes[char] = [w, h];\n }", "get width() {\n // w = width\n return this._w;\n }", "getWidth() {\n return this.content >> 22 /* WIDTH_SHIFT */;\n }", "function getTextWidth(txt) {\n\t\tvar c = document.getElementById(\"forComputationalProcesses\");\n\t\tvar ctx = c.getContext(\"2d\");\n\t\tctx.font = \"13px Open Sans\";\n\n\t\treturn ctx.measureText(txt).width;\n\t}", "function size$1(value) {\n var match = /\\r?\\n|\\r/.exec(value);\n return width(match ? value.slice(0, match.index) : value)\n}", "get width() {\n return this._getOption('width');\n }", "get displayWidth() {\n\t\treturn this.__Internal__Dont__Modify__.dispWidth;\n\t}", "function setw(pStr, pLen, before)\n{\n var browser=navigator.appName;\n var nbSpace = \"&nbsp;\";\n if (browser==\"Microsoft Internet Explorer\")\n {\n nbSpace = \" \"; \n }\n var rStr = pStr;\n var spaceToAdd = 0;\n if (rStr.length > pLen)\n {\n rStr = rStr.substring(0,pLen);\n }\n else\n {\n spaceToAdd = pLen - rStr.length;\n }\n for(j = 0; j < spaceToAdd; j++) \n {\n if(before)\n { \n rStr = nbSpace + rStr;\n }\n else\n {\n rStr = \"\" + rStr + nbSpace;\n }\n }\n return rStr;\n}", "function tabWidth() {\n\t\t\treturn (new Scintilla(context.handle)).Call(\"SCI_GETTABWIDTH\", 0, 0);\n\t\t}", "getMaxWidth(){return this.__maxWidth}", "set minimumWidth(value) { }", "function countChar(val){\n\t\tvar len = val.value.length;\n\t\tif (len >= 600) {\n\t\t\tval.value = val.value.substring(0, 600);\n\t\t}else {\n\t\t\t$('#charNum').text(600 - len);\n\t\t}\n\t}", "function size(value) {\n var match = /\\r?\\n|\\r/.exec(value)\n return width(match ? value.slice(0, match.index) : value)\n}", "calWidth () {\n let len = 0\n this.queue.forEach(message => {\n len += message.content.length * config.default_font_size\n })\n return len\n }", "function computeNewMaxWidth(field, val, previousMax) {\n // Should not be larger than the max width, unless the field name is really long\n var hardCap = Math.max(config.MAX_FIELD_WIDTH, field.length);\n var longest = Math.max(val.toString().length, previousMax, field.length);\n return Math.min(hardCap, longest);\n }", "function visualLength(text)\n\t{\n\t\tvar ruler = document.getElementById(\"ruler\");\n\t\truler.innerHTML = text;\n\t\treturn ruler.offsetWidth;\n\t}", "get preferredWidth() {\n return this.preferredWidthIn;\n }", "get preferredWidth() {\n return this.preferredWidthIn;\n }", "function gettextareawidth() {\n\n $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());\n\n // Return 65 if we're mozilla\n if($.browser.mozilla) {\n return 65;\n }\n\n // Return 57 if we're chrome\n if($.browser.chrome) {\n return 57;\n }\n\n // Default to 65\n return 65;\n }", "function add_zerowidth(wat) {\n\treturn wat.substring(0, 1) + '\\u200B' + wat.substring(1);\n}" ]
[ "0.7920131", "0.7037969", "0.7021818", "0.7021073", "0.7021073", "0.7021073", "0.7000035", "0.7000035", "0.7000035", "0.7000035", "0.7000035", "0.7000035", "0.7000035", "0.7000035", "0.6951675", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.6948909", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.686542", "0.68631214", "0.68631214", "0.6862812", "0.6742799", "0.673329", "0.66327125", "0.6579472", "0.6548624", "0.6529423", "0.65018266", "0.6473127", "0.6369536", "0.63124263", "0.6209663", "0.6120721", "0.6118149", "0.60966456", "0.6080189", "0.6052982", "0.6047463", "0.6031508", "0.6030071", "0.6012051", "0.6009389", "0.6009256", "0.59844244", "0.59844244", "0.59844244", "0.59456944", "0.5900992", "0.59002346", "0.5899201", "0.5899201", "0.5899201", "0.5899201", "0.5866302", "0.5823036", "0.58224964", "0.5813456", "0.5778198", "0.5770765", "0.5768868", "0.5767599", "0.5767326", "0.5753243", "0.57161325", "0.57116467", "0.5705412", "0.5702974", "0.5681436", "0.5679267", "0.5665617", "0.56633264", "0.5656222", "0.5644156", "0.5644156", "0.56362504", "0.5604593" ]
0.70129645
10
Do a bulkread of the DOM positions and sizes needed to draw the view, so that we don't interleave reading and writing to the DOM.
function getDimensions(cm) { var d = cm.display, left = {}, width = {}; var gutterLeft = d.gutters.clientLeft; for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; width[cm.options.gutters[i]] = n.clientWidth; } return {fixedPos: compensateForHScroll(d), gutterTotalWidth: d.gutters.offsetWidth, gutterLeft: left, gutterWidth: width, wrapperWidth: d.wrapper.clientWidth} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateRendering() {\n this._domElement.style.width = this._width + 'px'\n this._domElement.style.height = this._height + 'px'\n this._adjustAll()\n }", "draw() {\n if (this._page !== currentPage) {\n return;\n }\n this.drawRectangles();\n if (!isReady) {\n return;\n }\n // Only used if using text lines.\n if (this._textLines.length > 0) {\n for (var i = 0; i < this._textLines.length; i++) {\n this._textLines[i].draw();\n }\n }\n // Only used if using input panels.\n if (this._inputPanels.length > 0) {\n for (var i = 0; i < this._inputPanels.length; i++) {\n this._inputPanels[i].draw();\n }\n }\n // Only used if using progress bars.\n if (this._progressBars.length > 0) {\n for (var i = 0; i < this._progressBars.length; i++) {\n this._progressBars[i].draw();\n }\n }\n }", "function readDisplay() {\n // delete all arr item\n while (theFullDisplay.length > 0) {\n theFullDisplay.pop();\n }\n for (let i = 0; i < dispSize; i++) {\n theFullDisplay.push(\n document.querySelectorAll(\".digit.pos\" + (i + 1) + \" .segment\")\n );\n }\n}", "function redraw() {\n canvas.width = root.getAttribute('width');\n canvas.height = root.getAttribute('height');\n for (var child = root.firstChild; child; child = child.nextSibling) draw(child);\n }", "function htmlTocanvas() {\n var useHeight = $('.doiView').prop('scrollHeight');\n html2canvas($my_view[0], {\n height: useHeight,\n onrendered: function(canvas) {\n if ($my_view.height() > h) {\n context.drawImage(canvas, 0, 0, $my_view.width(), $my_view.height());\n h = h + getVisible();\n $ionicScrollDelegate.$getByHandle('doiContent').scrollTo(0, h);\n setTimeout(function() {\n htmlTocanvas();\n }, 0)\n } else {\n var imgSrc = canvasEl.toDataURL(\"image/jpeg\");\n postDOIData(imgSrc, canvasEl.width, canvasEl.height)\n }\n }\n });\n\n }", "refresh() {\n this.viewDiv.node().style.top = this._position.y + \"px\";\n this.viewDiv.node().style.left = this._position.x + \"px\";\n }", "function update_canvas_offsets(){\n // Set initial svg canvas offset\n var container = getById('svg_container');\n var top = 0;\n var left = 0;\n do{\n top += container.offsetTop;\n left += container.offsetLeft;\n container = container.offsetParent;\n }\n while(container != null);\n g['x_offset'] = left;\n g['y_offset'] = top;\n}", "draw()\n\t{\n\t\t// if the scrollbar's marker position has changed then the layout must be updated:\n\t\tif (this._scrollbar.markerPos !== this._prevScrollbarMarkerPos)\n\t\t{\n\t\t\tthis._prevScrollbarMarkerPos = this._scrollbar.markerPos;\n\t\t\tthis._needUpdate = true;\n\t\t}\n\n\t\t// draw the decorations:\n\t\tsuper.draw();\n\n\t\t// draw the stimuli:\n\t\tfor (let i = 0; i < this._items.length; ++i)\n\t\t{\n\t\t\tif (this._visual.visibles[i])\n\t\t\t{\n\t\t\t\tconst textStim = this._visual.textStims[i];\n\t\t\t\ttextStim.draw();\n\n\t\t\t\tconst responseStim = this._visual.responseStims[i];\n\t\t\t\tif (responseStim)\n\t\t\t\t{\n\t\t\t\t\tresponseStim.draw();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// draw the scrollbar:\n\t\tthis._scrollbar.draw();\n\t}", "function init() {\n var layout = getFromStorage();\n if (!layout) {\n layout = readDOMLayout();\n saveToStorage();\n return;\n }\n\n // Cycle through the layout making DOM reordering as necissary\n var i, col, DOMLayout;\n DOMLayout = readDOMLayout().slice(0, 4);// just the arrays\n layout = layout.slice(0, 4);// just the arrays\n for (i = 0;i < 4;i++) {\n col = document.getElementById(adfPrefix + 'column_' + (i + 1));\n adjustDOM(layout[i], DOMLayout[i], col);\n }\n }", "function doUpdate() {\n\n\t\t//console.log(myDoc.defaultView);\n\t\tif (myDoc.defaultView === null) {\n\t\t\talert(\"Window is closed!\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar noview = 0,\n\t\t\tnoshape = 0,\n\t\t\tnodim = 0,\n\t\t\tcurrview = {};\n\n\t\t// Put all data from JSON editor to theObj\n\t\ttheObj = editor.get();\n\t\t// Check if PART or ASSY object\n\t\tif (theObj.Header.Type === \"part\") {\n\t\t\t// no active now. Waiting coding for assy\n\t\t}\n\t\t// replace parameters by value and evaluate formula\n\t\ttheObj = doDeparam(theObj);\n\t\t// put all coordinates in cartesian\n\t\ttheObj = doCoordonate(theObj);\n\n\t\tdoHatchpattern();\n\n\t\t// Create containers for each view or empty them if exist\n\t\tvar gview = [];\n\t\tfor (noview = 0; noview <= theObj.Views.length - 1; noview += 1) {\n\t\t\tvar svgg = theSvgElement.getElementById('view' + noview);\n\t\t\tif (svgg === null) {\n\t\t\t\tgview.push(document.createElementNS(NSSVG, \"g\"));\n\t\t\t\tgview[gview.length - 1].setAttributeNS(null, \"id\", \"view\" + noview);\n\t\t\t\tgview[gview.length - 1].setAttributeNS(null, \"class\", \"basicview\");\n\t\t\t\ttheSvgElement.appendChild(gview[gview.length - 1]);\n\t\t\t} else {\n\t\t\t\twhile (svgg.firstChild) {\n\t\t\t\t\tsvgg.removeChild(svgg.firstChild);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// draw shape (with fillet at corner if specified)\n\t\tfor (noview = 0; noview <= theObj.Views.length - 1; noview += 1) {\n\t\t\tcurrview = theObj.Views[noview];\n\t\t\tfor (noshape = 0; noshape <= currview.Shapes.length - 1; noshape += 1) {\n\t\t\t\tShape(noshape, currview.Shapes[noshape].Points,\n\t\t\t\t\ttheObj.Header.Scale,\n\t\t\t\t\tcurrview.Header.Origine,\n\t\t\t\t\tcurrview.Shapes[noshape].Fill,\n\t\t\t\t\tnoview,\n\t\t\t\t\ttheObj.Format,\n\t\t\t\t\ttheSvgElement);\n\t\t\t}\n\t\t}\n\n\n\t\t// draw Lines from theSvgElement and view #\n\t\tfor (noview = 0; noview <= theObj.Views.length - 1; noview += 1) {\n\t\t\tdrawLine(noview, theSvgElement, theObj);\n\t\t}\n\n\t\t// draw dimension from the SvgElement (after remove old ones)\n\t\tsvgg = theSvgElement.getElementById('dimension');\n\t\twhile (svgg.firstChild) {\n\t\t\tsvgg.removeChild(svgg.firstChild);\n\t\t}\n\t\tfor (nodim = 0; nodim <= theObj.Dimensions.length - 1; nodim += 1) {\n\t\t\tdrawDimension(theSvgElement, theObj, theObj.Dimensions[nodim]);\n\t\t} // for\n\n\t\t// Change Format (mainly linked with CSS)\n\t\tchangeClasscolor('dim', theObj.Format.Dimensions_color, theObj.Format.shape_thick);\n\n\t\t// draw origin point for each view\n\t\tdrawOrigin();\n\t\tdisplayClassToggle('ptsfillet');\n\t\tdisplayClassToggle('squeleton');\n\n\t\tdisplayNodesinfo();\n\n\t\tpanZoomInstance = svgPanZoom(theSvgElement, {\n\t\t\tzoomEnabled: true,\n\t\t\tcontrolIconsEnabled: false\n\t\t});\n\n\t\treturn 0;\n\t}", "function refresh() {\n mapDOMtoPosition();\n // resetDirty();\n markPeaks();\n }", "function GeneratePage() {\n\tthis.generatedPositions = [];\n\n\t// get the size of our sample div, then remove it, it's served it's purpose\n\tconst div = document.querySelector('[data-o-element-visibility-track]');\n\tif (!div) throw new Error('Demo base div missing');\n\tthis.div = div.getBoundingClientRect();\n\tdiv.parentNode.removeChild(div);\n\n\t// set the body size to be 20% larger than the viewport\n\tthis.body = this.setBodySize(1.2);\n\n\t// calculate a sensible amount of divs to display\n\tconst numDivs = this.numDivs = this.maxDivs();\n\tthis.addDivs(numDivs);\n\n\t// counters\n\tthis.inView = document.getElementsByClassName('inview');\n\n\t// initialise the info box\n\tthis.setupInfo();\n}", "function TNodes_doDOM_StageRefresh( znd ){\n // \n // $('#' + this.Ident).css({\n // 'width':znd.width + 'px',\n // 'height':znd.height + 'px'\n // })\n }", "function restoreDom(all) {\n for (var i = 0; i < all.length; i++) {\n all[i].paintItem();\n if (all[i].children.length) {\n restoreDom(all[i].children);\n }\n }\n }", "_updateDOM() {\n this._updateAttributes();\n this._updateStyles();\n }", "function read_dom(){\n google_eles = [\n document.getElementById('viewport'),\n document.getElementById('body'),\n document.getElementById('footer'),\n document.getElementById('fbar')\n ];\n}", "function drawAll() {\n if (!currentViewExtents) {\n currentViewExtents = timelineController.viewExtents;\n }\n\n // update size of main canvas\n var w = timelineController.width + margin.left + margin.right;\n var e = angular.element(main.canvas);\n main.resize(w);\n\n var s = function(v) {\n return v * main.ratio;\n };\n\n main.ctx.clearRect(0, 0, main.canvas.width, main.canvas.height);\n main.ctx.drawImage(lanes.canvas, 0, 0);\n\n // draw all visible regions\n var startX = absolute(currentViewExtents[0]);\n var endX = absolute(currentViewExtents[1]);\n var viewRegions = getContainedRegions(startX, endX);\n\n var effectiveWidth = 0;\n viewRegions.forEach(function(region) {\n effectiveWidth += region.width;\n });\n\n if (effectiveWidth < timelineController.width) {\n // we had to cap the region generation previously, but moved outside of\n // the generated area, so regenerate regions around the current view\n createRegions();\n viewRegions = getContainedRegions(startX, endX);\n }\n\n viewRegions.forEach(function(region) {\n drawRegion(region);\n\n // calculate the cropping area and offsets needed to place the region\n // in the main canvas\n var sx1 = Math.max(0, startX - region.x);\n var sx2 = Math.min(region.width, endX - region.x);\n var sw = sx2 - sx1;\n var dx = Math.max(0, startX - region.x);\n if (Math.floor(sw) === 0) {\n return;\n }\n\n main.ctx.drawImage(\n region.c.canvas,\n s(sx1), 0, Math.floor(s(sw)), s(height),\n s(margin.left + region.x - startX + sx1), 0, s(sw), s(height));\n });\n }", "function refreshDomObjects() {\n // must update this, as sometimes after finishing page load the position changes, like when dnn adds the toolbar\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].bodyOffset = Positioning.getBodyPosition();\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.innerBlocks.enable) {\n // get all content-block lists which are empty, or which allow multiple child-items\n var lists = Object(_interfaces_sxc_controller_in_page__WEBPACK_IMPORTED_MODULE_1__[\"$jq\"])(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.listSelector).filter(\":not(.\" + ___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.singleItem + \"), :empty\");\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].contentBlocks = lists\n .find(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.cb.selector)\n .add(lists);\n }\n if (___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].config.modules.enable)\n ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].modules = ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].cachedPanes\n .find(___WEBPACK_IMPORTED_MODULE_0__[\"QeSelectors\"].blocks.mod.selector)\n .add(___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].cachedPanes);\n}", "function update() {\n\n\t\tif (root == null) {\n\t\t\treturn\n\t\t}\n\n\t\tlet bounds = element.bounds()\n\t\tlet fontSize = element.css('font-size')\n\t\tlet fontWeight = element.css('font-weight')\n\n\t\tif (measuredWidth == bounds.width &&\n\t\t\tmeasuredHeight == bounds.height &&\n\t\t\tmeasuredFontSize == fontSize &&\n\t\t\tmeasuredFontWeight == fontWeight) {\n\n\t\t\t/*\n\t\t\t * The area did not change thus the lines should remain\n\t\t\t * the same.\n\t\t\t */\n\n\t\t\treturn\n\t\t}\n\n\t\tmeasuredWidth = bounds.width\n\t\tmeasuredHeight = bounds.height\n\t\tmeasuredFontSize = fontSize\n\t\tmeasuredFontWeight = fontWeight\n\n\t\troot.innerHTML = html\n\n\t\telement.toggleClass('multiline', false)\n\n\t\tlet fragment = document.createDocumentFragment()\n\n\t\tbreakNode(root, fragment)\n\t\temptyNode(root)\n\n\t\troot.appendChild(fragment)\n\n\t\telement.toggleClass('multiline', true)\n\n\t\telement.find('.line').each((i, line) => {\n\n\t\t\tline = $(line)\n\t\t\tline.attr('data-nth-line', i + 1);\n\n\t\t\tline.attr('data-text', line.text())\n\n\t\t\tlet others = line.find(':not(.word)')\n\t\t\tline.toggleClass('plain', others.length == 0)\n\t\t\tline.toggleClass('mixed', others.length != 0)\n\n\t\t})\n\n\t\tif (options &&\n\t\t\toptions.onComplete) {\n\t\t\toptions.onComplete(element)\n\t\t}\n\n\t\telement.emit('breaklines/complete', element)\n\t}", "function m(e,t,n){for(var r=0;r<D.length;r++)if(!isFinite(e)||D[r]._index===e){t=isFinite(e)&&r===e?t:Q(D[r]._index);var o=be(D[r],t);if(o){var i=S.getSourcePageSize(D[r]._index,t?t.rotation:0);o.clearRect(0,0,i.width,i.height),n&&w(o,t)}}}", "render(){\n this.sbh.reportRendering();\n const { init, end, itemsContainer_hg, ghostView_hg, viewport_hg } = this.sbh;\n\n const visibleItems = this.state.items.slice( init, end ).map( ( obj, index )=> {\n return this.props.renderFunc( obj, index );\n } );\n console.log( 'style', { position:'relative', ...this.props.style } );\n return (\n <Scrollbars2 onScrollFrame={this.onScrollFrame} thumbMinSize={30}>\n <div className=\"ghostViewTop\" ref=\"ghostViewTop\" style={{ ...this.ghostStyle }} />\n <div ref=\"itemsContainer\" style={{ position:'relative', ...this.props.style }}\n className={this.props.className} >\n {visibleItems}\n </div>\n <div className=\"ghostViewBottom\" ref=\"ghostViewBottom\" style={{ ...this.ghostStyle }} />\n </Scrollbars2>\n );\n }", "function drawCanvas() {\n if( drawio.loadedIMG != ''){\n drawio.ctx.drawImage(drawio.loadedIMG, 0, 0);\n }\n for( var i = 0; i < drawio.shapes.length; i++) {\n drawio.shapes[i].render();\n }\n if(drawio.selectedElement) {\n drawio.selectedElement.render();\n }\n }", "function layout () {\n var rem = docEl.clientWidth * 100 / 750;\n docEl.style.fontSize = rem + 'px';\n }", "recalculateSizes() {\n let elem = ReactDOM.findDOMNode(this).parentNode;\n this.width = elem.offsetWidth - 30;\n this.divHeight = elem.offsetHeight;\n this.height = this.data.length * 60;\n this.barHeight = (this.height - 50) / this.data.length / 2;\n const minSize = Math.min(this.width, this.divHeight);\n this.textSize = minSize / 30;\n }", "function SaveTheView()\n{\n console.log($(\".display-area\")[0].children)\n var z=$(\".display-area\")[0].children.length;\n for(i=0;i<z;i++)\n {\n console.log($(\".display-area\")[0].children[i])\n console.log($(\".display-area\")[0].children[i].attributes.name.value)\n console.log($(\".display-area\")[0].children[i].style.position)\n console.log($(\".display-area\")[0].children[i].style.top)\n console.log($(\".display-area\")[0].children[i].style.left)\n \n shapes.id=$(\".display-area\")[0].children[i].id;\n shapes.type=$(\".display-area\")[0].children[i].attributes.name.value;\n shapes.position=$(\".display-area\")[0].children[i].style.position;\n shapes.left=$(\".display-area\")[0].children[i].style.left;\n shapes.top=$(\".display-area\")[0].children[i].style.top;\n }\n console.log(shapes)\n}", "function _redraw() {\n _self.container.style.left = _pixel.x - (_self.container.clientWidth / 2) + 'px';\n _self.container.style.top = _pixel.y - (_self.container.clientHeight) + 'px';\n }", "refreshRect() {\n\t\tvar posX = this.savedPosX + this.offsetX;\n\t\tvar posY = this.savedPosY + this.offsetY;\n\t\tvar sizeX = this.savedSizeX;\n\t\tvar sizeY = this.savedSizeY;\n\t\t\n\t\t// Calculate actual position and scale\n\t\tvar scale = renko.getWindowScale() * (2 / window.devicePixelRatio);\n\t\tposX = posX - sizeX/2 + renko.appWidth/2;\n\t\tposY = posY - sizeY/2 + renko.appHeight/2;\n\t\tposX *= scale;\n\t\tposY *= scale;\n\t\tsizeX *= scale;\n\t\tsizeY *= scale;\n\t\t\n\t\t// Apply transform\n\t\tthis.style.left = String(posX) + \"px\";\n\t\tthis.style.top = String(posY) + \"px\";\n\t\tthis.style.width = String(sizeX) + \"px\";\n\t\tthis.style.height = String(sizeY) + \"px\";\n\t}", "update() {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n // update children...\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n var rect = this.renderer.view.getBoundingClientRect();\n var sx = rect.width / this.renderer.width;\n var sy = rect.height / this.renderer.height;\n var div = this.div;\n div.style.left = (rect.left) + \"px\";\n div.style.top = (rect.top) + \"px\";\n div.style.width = (this.renderer.width) + \"px\";\n div.style.height = (this.renderer.height) + \"px\";\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n UtilsSettings_1.UtilsSettings.removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n i--;\n if (this.children.length === 0) {\n this.deactivate();\n }\n }\n else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n if (child.hitArea) {\n div.style.left = ((wt.tx + (hitArea.x * wt.a)) * sx) + \"px\";\n div.style.top = ((wt.ty + (hitArea.y * wt.d)) * sy) + \"px\";\n div.style.width = (hitArea.width * wt.a * sx) + \"px\";\n div.style.height = (hitArea.height * wt.d * sy) + \"px\";\n }\n else {\n hitArea = child.getBounds();\n this.capHitArea(hitArea);\n div.style.left = (hitArea.x * sx) + \"px\";\n div.style.top = (hitArea.y * sy) + \"px\";\n div.style.width = (hitArea.width * sx) + \"px\";\n div.style.height = (hitArea.height * sy) + \"px\";\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null) {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n }\n }\n // increment the render id..\n this.renderId++;\n }", "static redraw() {\n let i = 0;\n let s = SmartCanvas.collection.length;\n\n for (; i < s; i++) {\n SmartCanvas.collection[i].redraw();\n }\n }", "[positionViews]() {\n\t\tconst self = this;\n\t\tconst viewSize = self[SIZE] === WIDTH ? self.borderWidth() : self.borderHeight();\n\t\tconst altViewSize = self[ALT_SIZE] === WIDTH ? self.borderWidth() : self.borderHeight();\n\t\tconst splitOffset = offsetToPixels(self.splitOffset(), viewSize);\n\n\t\tself[FIRST_VIEW][self[SIZE]](splitOffset)[self[ALT_SIZE]](altViewSize).resize(true);\n\n\t\tself[SECOND_VIEW][self[SIZE]](viewSize - splitOffset)[self[ALT_SIZE]](altViewSize)\n\t\t\t.css(self[SIZE_ORIGIN], splitOffset)\n\t\t\t.css(self[ALT_SIZE_ORIGIN], ZERO_PIXELS)\n\t\t\t.resize(true);\n\t}", "updateChildren(view, pos) {\n let inline = this.node.inlineContent, off = pos;\n let composition = view.composing ? this.localCompositionInfo(view, pos) : null;\n let localComposition = composition && composition.pos > -1 ? composition : null;\n let compositionInChild = composition && composition.pos < 0;\n let updater = new ViewTreeUpdater(this, localComposition && localComposition.node, view);\n iterDeco(this.node, this.innerDeco, (widget, i, insideNode) => {\n if (widget.spec.marks)\n updater.syncToMarks(widget.spec.marks, inline, view);\n else if (widget.type.side >= 0 && !insideNode)\n updater.syncToMarks(i == this.node.childCount ? Mark$1.none : this.node.child(i).marks, inline, view);\n updater.placeWidget(widget, view, off);\n }, (child, outerDeco, innerDeco, i) => {\n updater.syncToMarks(child.marks, inline, view);\n let compIndex;\n if (updater.findNodeMatch(child, outerDeco, innerDeco, i))\n ;\n else if (compositionInChild && view.state.selection.from > off && view.state.selection.to < off + child.nodeSize && (compIndex = updater.findIndexWithChild(composition.node)) > -1 && updater.updateNodeAt(child, outerDeco, innerDeco, compIndex, view))\n ;\n else if (updater.updateNextNode(child, outerDeco, innerDeco, view, i))\n ;\n else {\n updater.addNode(child, outerDeco, innerDeco, view, off);\n }\n off += child.nodeSize;\n });\n updater.syncToMarks([], inline, view);\n if (this.node.isTextblock)\n updater.addTextblockHacks();\n updater.destroyRest();\n if (updater.changed || this.dirty == CONTENT_DIRTY) {\n if (localComposition)\n this.protectLocalComposition(view, localComposition);\n renderDescs(this.contentDOM, this.children, view);\n if (ios)\n iosHacks(this.dom);\n }\n }", "start() {\n this.collectedNodes.length = 0;\n this.visualIndex = 0;\n\n const { rootNode, sizeSet } = this;\n const isShared = this.isSharedViewSet();\n const { nextSize } = sizeSet.getViewSize();\n\n let childElementCount = this.getRenderedChildCount();\n\n while (childElementCount < nextSize) {\n const newNode = this.nodesPool();\n\n if (!isShared || (isShared && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM))) {\n rootNode.appendChild(newNode);\n } else {\n rootNode.insertBefore(newNode, rootNode.firstChild);\n }\n childElementCount += 1;\n }\n\n const isSharedPlacedOnTop = (isShared && sizeSet.isPlaceOn(WORKING_SPACE_TOP));\n\n while (childElementCount > nextSize) {\n rootNode.removeChild(isSharedPlacedOnTop ? rootNode.firstChild : rootNode.lastChild);\n childElementCount -= 1;\n }\n }", "function rebuildScreenOne() {\n\n // set attributes to start value\n totalRowWidth = 0;\n rowWidths = [];\n\n // get new container width\n containerWidth = getContainerWidth();\n\n // set new rows\n setRows(images);\n\n // get new last row index\n lastRowIndex = getLastRowIndex(images);\n\n // calculate new relative percentage of new rows\n calculateRelativePercentage(images);\n\n // scale\n scaleImages(images);\n\n // delete dots\n deleteDots();\n\n // make new dots\n makeDots();\n\n // check if dot of dotIndex still exists\n checkDotExistence(dotIndex);\n\n // show the content of dot dotIndex\n showContentDot(dotIndex);\n}", "refresh() {\n // Read\n this.percentPosition = this.parseWrapperPosition();\n this.size = this.getContentSize();\n this.position = this.getWrapperPosition();\n\n // Write async so that multiple hotspots can be refreshed at a time without\n // causing layout thrashing.\n this.refreshId = requestAnimationFrame(() => {\n this._removeContentPosition();\n this.setPosition();\n });\n }", "function updateAll() {\n\tdrawAll();\n\tblob.move();\n}", "function refresh() {\n\t\t\tself.getNodePosition();\n\t\t\tself.getViewPortSize();\n\t\t\tcheck(null, {});\n\t\t}", "renderAndAdjust() {\n this.hot.render();\n\n // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.\n this.hot.view.adjustElementsSize();\n }", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.gridCoordinates = getGridCoordinates(this);\n }", "update()\n {\n if (!this.renderer.renderingToScreen)\n {\n return;\n }\n\n // update children...\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n\n const rect = this.renderer.view.getBoundingClientRect();\n const sx = rect.width / this.renderer.width;\n const sy = rect.height / this.renderer.height;\n\n let div = this.div;\n\n div.style.left = `${rect.left}px`;\n div.style.top = `${rect.top}px`;\n div.style.width = `${this.renderer.width}px`;\n div.style.height = `${this.renderer.height}px`;\n\n for (let i = 0; i < this.children.length; i++)\n {\n const child = this.children[i];\n\n if (child.renderId !== this.renderId)\n {\n child._accessibleActive = false;\n\n core.utils.removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n\n i--;\n\n if (this.children.length === 0)\n {\n this.deactivate();\n }\n }\n else\n {\n // map div to display..\n div = child._accessibleDiv;\n let hitArea = child.hitArea;\n const wt = child.worldTransform;\n\n if (child.hitArea)\n {\n div.style.left = `${(wt.tx + (hitArea.x * wt.a)) * sx}px`;\n div.style.top = `${(wt.ty + (hitArea.y * wt.d)) * sy}px`;\n\n div.style.width = `${hitArea.width * wt.a * sx}px`;\n div.style.height = `${hitArea.height * wt.d * sy}px`;\n }\n else\n {\n hitArea = child.getBounds();\n\n this.capHitArea(hitArea);\n\n div.style.left = `${hitArea.x * sx}px`;\n div.style.top = `${hitArea.y * sy}px`;\n\n div.style.width = `${hitArea.width * sx}px`;\n div.style.height = `${hitArea.height * sy}px`;\n }\n }\n }\n\n // increment the render id..\n this.renderId++;\n }", "loadElements() {\n\t\tif (this.elementInView()) {\n\t\t\tfor (let i = 0; i < this.elements.length; i++) {\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\tObject.keys(this.options.style).forEach(key => {\n\t\t\t\t\t\tif ([\"scale\", \"rotate\"].includes(key)) {\n\t\t\t\t\t\t\tthis.elements[i].style.transform = this.initialStyles[i].transform;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.elements[i].style[key] = this.initialStyles[i][key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}, this.options.delay * i)\n\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\tthis.elements[i].style.transition = this.initialStyles.transition;\n\t\t\t\t\tthis.elements[i].style.position = this.initialStyles.position;\n\t\t\t\t}, this.options.delay * this.elements.length);\n\t\t\t}\n\t\t\twindow.removeEventListener(\"scroll\", this.loadElements);\n\t\t}\n\t}", "function draw_viewer() {\n canvas.innerHTML = \"\";\n var n = curr_row;\n while(n < data.length && \n n < (curr_row + ROWS_TO_SHOW)) {\n var div = document.createElement(\"div\");\n div.style.width = 8 * IMG_WIDTH + \"px\";\n var h3 = document.createElement(\"span\");\n h3.innerHTML = data[n].timestamp.replace('T', ' ');\n div.appendChild(h3);\n div.appendChild(document.createElement(\"br\"));\n data[n].imageobjs.each(function(imageobj) {\n imageobj.addEventListener(\"click\", function() {\n window.open(imageobj.src);\n }, false);\n div.appendChild(imageobj);\n });\n canvas.appendChild(div); \n n++;\n } \n }", "function layoutUI(sizeObj, scrollObj) {\n //\n }", "function _calculateSize() {\r\n contentWidth = parseInt($(\"#\" + divid).width());\r\n contentHeight = parseInt($(\"#\" + divid).height());\r\n $(\"#\" + divid).remove();\r\n sizeGetCallback(contentOrJQObj, _getLayerPos(clientSize, { Width: contentWidth, Height: contentHeight }));\r\n }", "setPageSize() {\n let height = 0;\n for ( let i = 0; i < this['$content'].rows.all.length; i++ ) {\n height += this['$content'].rows.all[i].size;\n }\n let width = 0;\n for ( let i = 0; i < this['$content'].columns.all.length; i++ ) {\n width += this['$content'].columns.all[i].size;\n }\n this['$container']['$node'].style.width = width + 'px';\n this['$container']['$node'].style.height = height + 'px';\n }", "function updateData() {\n angular.forEach(elements, function (element, id){\n if($(document).find(element).length) {\n data[id] = {\n \"x\": element.offset().left - element.parents('.bpContainer').offset().left,\n \"y\": element.offset().top - element.parents('.bpContainer').offset().top\n }\n }\n else {\n delete elements[id];\n }\n });\n setCoordinates();\n }", "function __zoot_c3d__process_DOM() {\n let containers = document.body.getElementsByTagName('zoot-c3d-root-container');\n for (let i = 0; i < containers.length; i++) {\n __zoot_c3d__process_Component(undefined, containers[i]);\n __zoot_c3d__g_root_containers.push(containers[i]);\n containers[i].zoot_c3d_sync();\n }\n}", "function mapDOMtoPosition() {\n var i;\n var node;\n for (i = 0; i < config.doi.length; i++) {\n node = config.doi[i][\"node\"];\n config.doi[i][\"id\"] = \"doi-\" + i;\n config.doi[i][\"y\"] = node.offsetTop;\n }\n config.doiSnappingPosition = screen.height / 2.5;\n // console.log(config.doi, config.doiSnappingPosition);\n // TODO sort based on offset?\n }", "layout() {\n var d = document.documentElement;\n var oldHeight = d.scrollHeight;\n this.reset()\n this.setOrders()\n this.populateHeights()\n this.setLayout()\n if (autoPosition === true) {\n adjustWindowHeight (oldHeight, d.scrollHeight)\n }\n this.pad()\n }", "applyLayout(){\n let cy = new Cytoscape({\n headless: true,\n elements: makeCyEles( this.elements() ),\n layout: { name: 'grid' },\n styleEnabled: true\n });\n\n let runLayout = () => {\n let layout = cy.layout( _.assign( {}, getCyLayoutOpts(), {\n animate: false,\n randomize: true\n } ) );\n\n let layoutDone = layout.promiseOn('layoutstop');\n\n layout.run();\n\n return layoutDone;\n };\n\n let savePositions = () => Promise.all( this.elements().map( docEl => {\n let el = cy.getElementById( docEl.id() );\n\n return docEl.reposition( _.clone( el.position() ) );\n } ) );\n\n return tryPromise( runLayout ).then( savePositions );\n }", "function draw() {\n\n /*\n * Resize canvas in accordance with size of parent container\n */\n scope.defaultWidth = scope.width;\n scope.width = element[0].clientWidth;\n if (scope.width === 0) {\n scope.width = element[0].parentElement.clientWidth;\n if (scope.width === 0)\n scope.width = scope.defaultWidth; // fallback to passed in width\n }\n\n scope.defaultHeight = scope.height;\n scope.height = element[0].clientHeight;\n if (scope.height === 0) {\n scope.height = element[0].parentElement.clientHeight;\n if (scope.height === 0)\n scope.height = scope.defaultHeight; // fallback to passed in height\n }\n\n svg.attr(D3V.CSS_WIDTH, scope.width)\n .attr(D3V.CSS_HEIGHT, scope.height);\n\n /*\n * clear the elements inside of the directive\n */\n svgGroup.selectAll(SYNTAX.STAR).remove();\n\n var treeData = initNode(scope.vdbEntry);\n\n /*\n * Assign the selection listener to the click event of the svg\n * Call an initial zoom on the svg\n */\n svg.on(D3V.HTML_CLICK, selectionCallback).call(zoomListener);\n\n root = treeData;\n\n // Will call update\n expandCollapseChildCallback(root);\n }", "_updateSize() {\n if (qx.ui.mobile.core.Blocker.ROOT == this.getLayoutParent()) {\n this.getContainerElement().style.top =\n qx.bom.Viewport.getScrollTop() + \"px\";\n this.getContainerElement().style.left =\n qx.bom.Viewport.getScrollLeft() + \"px\";\n this.getContainerElement().style.width =\n qx.bom.Viewport.getWidth() + \"px\";\n this.getContainerElement().style.height =\n qx.bom.Viewport.getHeight() + \"px\";\n } else if (this.getLayoutParent() != null) {\n var dimension = qx.bom.element.Dimension.getSize(\n this.getLayoutParent().getContainerElement()\n );\n\n this.getContainerElement().style.width = dimension.width + \"px\";\n this.getContainerElement().style.height = dimension.height + \"px\";\n }\n }", "function prepareAndStyle(){var viewBoxSize=this.config?this.config.viewBoxSize:config.defaultViewBoxSize;angular.forEach({'fit':'','height':'100%','width':'100%','preserveAspectRatio':'xMidYMid meet','viewBox':this.element.getAttribute('viewBox')||'0 0 '+viewBoxSize+' '+viewBoxSize,'focusable':false// Disable IE11s default behavior to make SVGs focusable\n\t},function(val,attr){this.element.setAttribute(attr,val);},this);}", "drawHTMLBoard() {\r\n for (let column of this.spaces) {\r\n for (let space of column) {\r\n space.drawSVGSpace();\r\n }\r\n }\r\n\t}", "drawHTMLBoard () {\n for (let column of this.spaces) {\n for (let space of column) {\n space.drawSVGSpace();\n }\n }\n }", "render() {\n const { rootNode, sizeSet } = this;\n let visualIndex = this.visualIndex;\n\n if (this.isSharedViewSet() && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {\n visualIndex += sizeSet.sharedSize.nextSize;\n }\n\n let node = rootNode.childNodes[visualIndex];\n\n if (node.tagName !== this.childNodeType) {\n const newNode = this.nodesPool();\n\n rootNode.replaceChild(newNode, node);\n node = newNode;\n }\n\n this.collectedNodes.push(node);\n this.visualIndex += 1;\n }", "_refreshLayout() {\n const that = this;\n const source = that.rows;\n\n if (that._layoutSuspended) {\n return;\n }\n\n that._visibleRows = null;\n that.__viewRows = null;\n that.__clientSize = null;\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that.__parentCells = null;\n\n that.$.columnFarContainer.classList.remove('vscroll');\n that.$.columnNearContainer.classList.remove('vscroll');\n\n that.$.scrollView.classList.remove('hscroll');\n that.$.scrollView.classList.remove('vscroll');\n\n that._refreshElementsVisibility();\n that._refreshColumnHeights();\n that._refreshContentHeight();\n\n if (!(source && source.url)) {\n if (!source || source === null || source.length === 0 || that.columns.length === 0) {\n that.$.placeholder.classList.remove('smart-hidden');\n\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n\n return;\n }\n }\n\n if (!that.__columnHeaderHeight) {\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\n }\n\n if (!that.__filterFooterOffsetHeight) {\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains('smart-hidden') ? 0 : that.$.filterFooter.offsetHeight;\n }\n\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\n\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\n\n\n if (that.paging.spinner.enabled && that.paging.enabled) {\n if (!that.pageScroll) {\n const pageScroll = document.createElement('smart-scroll-bar');\n\n pageScroll.orientation = 'vertical';\n pageScroll.style.height = '100%';\n pageScroll.style.width = '100%';\n pageScroll.max = Math.ceil(that.dataSource.length / that.paging.pageSize);\n pageScroll.step = that.paging.spinner.step;\n pageScroll.largeStep = that.paging.spinner.step;\n pageScroll.setAttribute('spinner', '');\n pageScroll.setAttribute('smart-id', 'spinner');\n pageScroll.ownerElement = that;\n\n that.addPropertyBinding('[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader);\n\n pageScroll.addEventListener('change', function (event) {\n that.paging.pageIndex = event.detail.value;\n });\n\n that.pageScroll = pageScroll;\n }\n\n that.htmlColumnLastChild.appendChild(that.pageScroll);\n }\n else {\n that.htmlColumnLastChild.innerHTML = '';\n }\n\n that._refreshScrollBars();\n\n }", "function main() { // Static publishing only\n\t\tvar rl = regObjArr.length;\n\t\tfor (var i = 0; i < rl; i++) { // For each registered object element\n\t\t\tvar id = regObjArr[i].id;\n var obj = getElementById(id);\n if (obj) {\n regObjArr[i].width = obj.getAttribute(\"width\") ? obj.getAttribute(\"width\") : \"0\";\n regObjArr[i].height = obj.getAttribute(\"height\") ? obj.getAttribute(\"height\") : \"0\";\n setVisibility(id, true);\n }\n\t\t}\n\t}", "function refreshXYIndexes()\r\n{\r\n // redraw text nodes on the X axis\r\n for (var i = 0; i <= xDivisions; i++)\r\n if (typeof xIndexes[i].getBBox != \"undefined\")\r\n try \r\n {\r\n textWidth = xIndexes[i].getBBox().width;\r\n textHeight = xIndexes[i].getBBox().height;\r\n xIndexes[i].setAttribute(\"x\", i*width/xDivisions - textWidth/2);\r\n xIndexes[i].setAttribute(\"y\", height + 10 + textHeight);\r\n xIndexes[i].setAttribute(\"stroke\", \"black\");\r\n } \r\n catch(e) {}\r\n // redraw text nodes on the Y axis\r\n for (var i = 0; i <= yDivisions; i++)\r\n if (typeof yIndexes[i].getBBox != \"undefined\") \r\n try \r\n {\r\n twidth = yIndexes[i].getBBox().width;\r\n theight = yIndexes[i].getBBox().height;\r\n yIndexes[i].setAttribute(\"y\", height-i*height/yDivisions\r\n +theight/2);\r\n yIndexes[i].setAttribute(\"x\", -10 -twidth);\r\n yIndexes[i].setAttribute(\"stroke\", \"black\");\r\n } \r\n catch(e) {} \r\n}", "function updateDOM() {\n\tvar newTree = render(data);\n\tvar patches = diff(tree, newTree);\n\trootNode = patch(rootNode, patches);\n\ttree = newTree;\n}", "makeDragProxy() {\n // create a div to hold the first five blocks at most\n const div = document.createElement('div');\n div.style.display = 'inline-block';\n div.style.position = 'relative';\n const nodes = this.selectedElements.map(elem => this.layout.nodeFromElement(elem));\n const limit = Math.min(5, nodes.length);\n let x = 0;\n let width = 0;\n let height = 0;\n for (let i = 0; i < limit; i += 1) {\n const node = nodes[i].el;\n const clone = node.cloneNode(true);\n clone.style.position = 'absolute';\n clone.style.left = `${x}px`;\n clone.style.top = `0px`;\n clone.style.transform = null;\n clone.style.opacity = (1 / limit) * (limit - i);\n div.appendChild(clone);\n width += node.clientWidth;\n height = Math.max(height, node.clientHeight);\n x += node.clientWidth;\n }\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n return div;\n }", "updateDOM(dom, view) { return false; }", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n let firstVisibleIndex = scrollOffset / this._itemSize;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "_updatePositions() {\n let direction = this.options.direction;\n let largestHeight = 0;\n if(this.lastIndex === -1)\n return;\n\n if(this.options.onPosition && typeof this.options.onPosition === 'function')\n this.options.onPosition.call();\n\n this.rows.forEach(row => {\n row.forEach(rowItem => {\n let itemBottom = rowItem.position.top + rowItem.item.offsetHeight;\n rowItem.item.style.top = rowItem.position.top + 'px';\n rowItem.item.style[direction] = rowItem.position[direction] + 'px';\n if(largestHeight < itemBottom)\n largestHeight = itemBottom;\n });\n });\n\n this.element.style.height = largestHeight + 'px';\n\n if(this.options.onPositioned && typeof this.options.onPositioned === 'function')\n this.options.onPositioned.call();\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "function draw() {\n\t\t\t// Adjust render settings if we switched to multiple viewports or vice versa\n\t\t\tif (medeactx.frame_flags & medeactx.FRAME_VIEWPORT_UPDATED) {\n\t\t\t\tif (medeactx.GetEnabledViewportCount()>1) {\n\t\t\t\t\tmedeactx.gl.enable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmedeactx.gl.disable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform rendering\n\t\t\tvar viewports = medeactx.GetViewports();\n\t\t\tfor(var vn = 0; vn < viewports.length; ++vn) {\n\t\t\t\tviewports[vn].Render(medeactx,dtime);\n\t\t\t}\n\t\t}", "function updateMetrics() {\n\n isVwDirty = false;\n DPR = window.devicePixelRatio;\n cssCache = {};\n sizeLengthCache = {};\n\n pf.DPR = DPR || 1;\n\n units.width = Math.max(window.innerWidth || 0, docElem.clientWidth);\n units.height = Math.max(window.innerHeight || 0, docElem.clientHeight);\n\n units.vw = units.width / 100;\n units.vh = units.height / 100;\n\n evalId = [ units.height, units.width, DPR ].join(\"-\");\n\n units.em = pf.getEmValue();\n units.rem = units.em;\n }", "function generate() {\n for (i = 0; i < points.length; i++ ){ \n points[i].offset = $(`ul.layer li#${[i]}`).offset();\n points[i].width = $(`ul.layer li#${[i]}`).width();\n points[i].height = $(`ul.layer li#${[i]}`).height();\n };\n }", "saveDimensions() {\n this.items.forEach((item) => {\n item.update();\n });\n\n // Window width and height without scrollbars.\n this.viewportHeight = window.innerHeight;\n this.viewportWidth = document.documentElement.clientWidth;\n\n return this;\n }", "updateTextPosition(blobDOM, x, y, width, height) {\n d3.select(blobDOM.node().parentNode).select(\"foreignObject\")\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr('width', width)\n .attr(\"height\", height)\n }", "function update() {\n\t\t\n\t\t// Call measure each time before we update to make sure all our our layout properties are set correctly\n\t\tmeasure();\n\t\t\n\t\t// Layout all of our primary SVG d3.elements.\n\t\tsvg.attr(\"width\", size.measuredWidth).attr(\"height\", size.measuredHeight);\n\t\tbackground.attr(\"width\", size.measuredWidth).attr(\"height\", size.measuredHeight);\n\t\tplot.attr('transform','translate(' + size.left + ',' + size.top + ')')\n\t\t\n\t\tscope.dispatch.apply('updated', viz);\n\t\t\n\t}", "draw() {\n if (!this.layout || typeof this.layout === 'string') {\n return;\n }\n // Calc view dims for the nodes\n this.applyNodeDimensions();\n // Recalc the layout\n const result = this.layout.run(this.graph);\n const result$ = result instanceof rxjs__WEBPACK_IMPORTED_MODULE_7__[\"Observable\"] ? result : Object(rxjs__WEBPACK_IMPORTED_MODULE_7__[\"of\"])(result);\n this.graphSubscription.add(result$.subscribe(graph => {\n this.graph = graph;\n this.tick();\n }));\n if (this.graph.nodes.length === 0) {\n return;\n }\n result$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__[\"first\"])()).subscribe(() => this.applyNodeDimensions());\n }", "function reLayout() {\n var newHeight, newWidth;\n // Figure out what is limiting the size of our container and resize accordingly\n if ($(\"body\").height() * CANVAS_RATIO > $(\"body\").width()) {\n // Limited by width\n newWidth = $(\"body\").width();\n newHeight = $(\"body\").width() / CANVAS_RATIO;\n } else {\n // Limited by height\n if ($(\"body\").height() < parseInt($(\"#draw-container\").css(\"min-height\"))) {\n newWidth = $(\"#draw-container\").css(\"min-height\") * CANVAS_RATIO;\n newHeight = $(\"#draw-container\").css(\"min-height\");\n } else {\n newWidth = $(\"body\").height() * CANVAS_RATIO;\n newHeight = $(\"body\").height();\n }\n }\n\n $(\"#draw-container\").css({\"width\" : newWidth, \"height\": newHeight});\n $(canvas).css({\"width\": newWidth, \"height\": newHeight});\n\n // Save some info about the canvas for later calculations\n canvas.offsetX = $(canvas).offset()[\"left\"];\n canvas.offsetY = $(canvas).offset()[\"top\"];\n }", "function updateObjects() {\n st.removeAllChildren();\n currkeys = null;\n\n var uh = c.height/3*2+c.height/4;\n var bh = c.height-uh;\n\n if (mode==0) {\n generateMouse(0,0,c.width,uh);\n } else {\n generateKeyboard(0,0,c.width,uh);\n }\n generateFooter(0,uh,c.width,bh);\n\n st.update();\n}", "function getSizes()\n {\n sizes.field.rows = 3;\n sizes.field.cols = 6;\n\n sizes.desk.height = DOM.parent.offsetHeight / 3;\n sizes.desk.width = properties.coverSize.width * sizes.desk.height / properties.coverSize.height;\n sizes.deskContainer.marginBottom = sizes.desk.width / 2;\n\n sizes.card.height = DOM.parent.offsetHeight / 4.5;\n sizes.card.width = properties.coverSize.width * sizes.card.height / properties.coverSize.height;\n }", "static svgViewport(svg, xOffset,yOffset,width, height, scale) {\n\t\tsvg.setAttributeNS('', 'width', '' + width);\n\t\tsvg.setAttributeNS('', 'height', '' + height);\n\t\tsvg.setAttributeNS('', 'viewBox', ''+xOffset + ' ' + yOffset + ' ' + Math.round(width / scale) + ' ' +\n\t\t\tMath.round(height / scale));\n\t}", "function onPageLoad() {\n // winResize();\n // winScroll();\n }", "_layoutWords() {\n //sort from most popular to least\n this._positions = [];\n this._data['topics'].sort(function(a, b) {\n return b['volume'] - a['volume'];\n });\n\n //add all elements, measure and then calculate optimal position\n this._data['topics'].map((value, index) => {\n this._targetEl.appendChild(value.el);\n setTimeout((item => {\n item.width = item.el.clientWidth;\n item.height = item.el.clientHeight;\n this._setWordPosition(item);\n }).bind(undefined, value), 100);\n return value;\n });\n }", "applyNodeDimensions() {\n if (this.nodeElements && this.nodeElements.length) {\n this.nodeElements.map(elem => {\n const nativeElement = elem.nativeElement;\n const node = this.graph.nodes.find(n => n.id === nativeElement.id);\n if (!node) {\n return;\n }\n // calculate the height\n let dims;\n try {\n dims = nativeElement.getBBox();\n if (!dims.width || !dims.height) {\n return;\n }\n }\n catch (ex) {\n // Skip drawing if element is not displayed - Firefox would throw an error here\n return;\n }\n if (this.nodeHeight) {\n node.dimension.height =\n node.dimension.height && node.meta.forceDimensions ? node.dimension.height : this.nodeHeight;\n }\n else {\n node.dimension.height =\n node.dimension.height && node.meta.forceDimensions ? node.dimension.height : dims.height;\n }\n if (this.nodeMaxHeight) {\n node.dimension.height = Math.max(node.dimension.height, this.nodeMaxHeight);\n }\n if (this.nodeMinHeight) {\n node.dimension.height = Math.min(node.dimension.height, this.nodeMinHeight);\n }\n if (this.nodeWidth) {\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : this.nodeWidth;\n }\n else {\n // calculate the width\n if (nativeElement.getElementsByTagName('text').length) {\n let maxTextDims;\n try {\n for (const textElem of nativeElement.getElementsByTagName('text')) {\n const currentBBox = textElem.getBBox();\n if (!maxTextDims) {\n maxTextDims = currentBBox;\n }\n else {\n if (currentBBox.width > maxTextDims.width) {\n maxTextDims.width = currentBBox.width;\n }\n if (currentBBox.height > maxTextDims.height) {\n maxTextDims.height = currentBBox.height;\n }\n }\n }\n }\n catch (ex) {\n // Skip drawing if element is not displayed - Firefox would throw an error here\n return;\n }\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : maxTextDims.width + 20;\n }\n else {\n node.dimension.width =\n node.dimension.width && node.meta.forceDimensions ? node.dimension.width : dims.width;\n }\n }\n if (this.nodeMaxWidth) {\n node.dimension.width = Math.max(node.dimension.width, this.nodeMaxWidth);\n }\n if (this.nodeMinWidth) {\n node.dimension.width = Math.min(node.dimension.width, this.nodeMinWidth);\n }\n });\n }\n }", "function refresh() {\n ranArrInd(imgArr.length);\n imgOneEl.src = imgArr[imgInd[0]].path;\n imgTwoEl.src = imgArr[imgInd[1]].path;\n imgThreeEl.src = imgArr[imgInd[2]].path;\n imgOneEl.name = imgArr[imgInd[0]].name;\n imgTwoEl.name = imgArr[imgInd[1]].name;\n imgThreeEl.name = imgArr[imgInd[2]].name;\n imgArr[imgInd[0]].views += 1; //Tracking the number of times the image appears on screen\n imgArr[imgInd[1]].views += 1;\n imgArr[imgInd[2]].views += 1;\n}", "_resizeHandler() {\n\n\t\tconst bounds= this.getBoundingClientRect();\n\n\t\tthis._dimens.width= bounds.width;\n\t\tthis._dimens.height= bounds.width;\n\n\t\tthis._root.querySelector('.wrapper').style.height= `${this._dimens.height}px`;\n\n\t\tfor(let row of this._grid) {\n\n\t\t\tfor(let col of row) {\n\n\t\t\t\tcol.$elem.style.width= (this._dimens.width/this.rows - 10) + 'px';\n\t\t\t\tcol.$elem.style.height= (this._dimens.height/this.cols - 10) + 'px';\n\t\t\t}\n\t\t}\n\t}", "onPaint() {\n const me = this,\n { element, headerContainer, bodyContainer, footerContainer } = me;\n\n if (me.rendered) {\n return;\n }\n\n // apply any responsive configs before rendering columns and rows\n me.updateResponsive(me.width, 0);\n\n let maxDepth = 0;\n\n // Cached, updated on resize. Used by RowManager and by the subgrids upon their render\n me._bodyRectangle = Rectangle.client(me.bodyContainer);\n\n me.eachSubGrid((subGrid) => {\n subGrid.render(me.verticalScroller);\n });\n\n // Note that these are hook methods for features to plug in to. They do not do anything.\n // SubGrids take care of their own rendering.\n me.renderHeader(headerContainer, element);\n me.renderFooter(footerContainer, element);\n\n if (me.autoHeight) {\n me._bodyHeight = me.rowManager.initWithHeight(\n element.offsetHeight - headerContainer.offsetHeight - footerContainer.offsetHeight,\n true\n );\n bodyContainer.style.height = me.bodyHeight + 'px';\n } else {\n me._bodyHeight = me.bodyContainer.offsetHeight;\n me.rowManager.initWithHeight(me._bodyHeight, true);\n }\n\n me.eachSubGrid((subGrid) => {\n if (subGrid.header.maxDepth > maxDepth) {\n maxDepth = subGrid.header.maxDepth;\n }\n });\n\n headerContainer.dataset.maxDepth = maxDepth;\n\n me.fixSizes();\n\n me.renderRows(false);\n\n me.initScroll();\n\n me.initInternalEvents();\n\n me.rendered = true;\n }", "function drawelements() {\n\t// show state\n\tif (showstate) {\n\t\t//eoutstateman.firstChild.nodeValue = \"State \" + state;\n\t\tprintareadraw(eoutstateman,\"State \" + statelist.indexOf(state));\n\t}\n\t\n\t// show scroll\n\tif (showscroll) {\n\t\t//escroll.firstChild.nodeValue = \n\t\t//\t\" sclvel = \" + scrollvelx + \",\" + scrollvely + \" scl = \" + scrollx + \",\" + scrolly;\n\t\tprintareadraw(escroll,\"sclvel = \" + scrollvelx + \",\" + scrollvely + \" scl = \" + scrollx + \",\" + scrolly);\n\t}\n\t\t\n\t// show much stuff\n\tif (showprint) {\n\t\tvar maxsize = 300;\n\t\t// show keystate\n\t\tvar ks = \"keystate = \";\n\t\tvar len = input.keystate.length;\n\t\tvar i;\n\t\tfor (i=0;i<len;++i) {\n\t\t\tif (input.keystate[i])\n\t\t\t\tks += i.toString(16) + \" \";\n\t\t}\n\t\t//eoutkeystate.firstChild.nodeValue = ks;\n\t\tprintareadraw(eoutkeystate,ks);\n\t\t\n\t\t// show input\n\t\t//eoutinputstate.firstChild.nodeValue = \"inputstate = mx \" + input.mx + \" my \" + input.my + \" mbut \" + input.mbut + \" mclick \" + input.mclick + \" key \" + input.key;\n\t\tprintareadraw(eoutinputstate,\"inputstate = mx \" + input.mx + \" my \" + input.my + \" mbut \" + input.mbut + \" mwheel \" + \n\t\tinput.wheelPos + \" mclick0 \" + input.mclick[0] + \" mclick1 \" + input.mclick[1] + \" mclick2 \" + \n\t\tinput.mclick[2] + \" key \" + input.key.toString(16) + \" keybufflen \" + input.keybuff.length);\n\t\t\n\t\t// show inputevents\n\t\tif (inputevents.length > maxsize) {\n\t\t\tinputevents = inputevents.substr(inputevents.length-maxsize,maxsize);\n\t\t}\n\t\t//eoutinputevents.firstChild.nodeValue = inputevents;\n\t\tprintareadraw(eoutinputevents,inputevents);\n\t\t\n\t\t// show logger\n/*\t\tif (logger_str.length > maxsize) {\n//\t\t\tlogger_str = logger_str.substr(logger_str.length-maxsize,maxsize);\n\t\t} */\n\t\t//eoutlogger.outerHTML = \"Howdy!\";\n\t\t//eoutlogger.firstChild.nodeValue = logger_str;\n\t\tif (logmode)\n\t\t\tprintareadraw(eoutlogger,logger_str);\n\t\telse {\n\t\t\tprintareadraw(eoutlogger,\"logger disabled\");\n\t\t\tlogger_str = \"\";\n\t\t}\n\t}\n\t\n\t// show image cache\n/*\tvar str = \"\";\n\tfor (var nam in imagecacher) {\n\t\tstr += \"C[\" + nam + \"] = \" + imagecacher[nam].size+ \",\";\t\n\t} */\n}", "function internal_ui_resize_common()\r\n{\r\n\tgl.canvas.width = gl.canvas.clientWidth * window.devicePixelRatio / ewgl_desktop.subsample;\r\n\tgl.canvas.height = gl.canvas.clientHeight * window.devicePixelRatio / ewgl_desktop.subsample;\r\n\tgl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\r\n}", "function updateMetrics() {\n\n\t\tisVwDirty = false;\n\t\tDPR = window.devicePixelRatio;\n\t\tcssCache = {};\n\t\tsizeLengthCache = {};\n\n\t\tpf.DPR = DPR || 1;\n\n\t\tunits.width = Math.max(window.innerWidth || 0, docElem.clientWidth);\n\t\tunits.height = Math.max(window.innerHeight || 0, docElem.clientHeight);\n\n\t\tunits.vw = units.width / 100;\n\t\tunits.vh = units.height / 100;\n\n\t\tevalId = [ units.height, units.width, DPR ].join(\"-\");\n\n\t\tunits.em = pf.getEmValue();\n\t\tunits.rem = units.em;\n\t}", "function _layout(size, scrollOffset, nested) {\n\t\n\t // Track the number of times the layout-function was executed\n\t this._debug.layoutCount++;\n\t //_log.call(this, 'Layout, scrollOffset: ', scrollOffset, ', particle: ', this._scroll.particle.getPosition1D());\n\t\n\t // Determine start & end\n\t var scrollStart = 0 - Math.max(this.options.extraBoundsSpace[0], 1);\n\t var scrollEnd = size[this._direction] + Math.max(this.options.extraBoundsSpace[1], 1);\n\t if (this.options.paginationMode === PaginationMode.PAGE) {\n\t scrollStart = scrollOffset - this.options.extraBoundsSpace[0];\n\t scrollEnd = scrollOffset + size[this._direction] + this.options.extraBoundsSpace[1];\n\t if ((scrollOffset + size[this._direction]) < 0) {\n\t scrollStart += size[this._direction];\n\t scrollEnd += size[this._direction];\n\t }\n\t else if ((scrollOffset - size[this._direction]) > 0) {\n\t scrollStart -= size[this._direction];\n\t scrollEnd -= size[this._direction];\n\t }\n\t }\n\t if (this.options.layoutAll) {\n\t scrollStart = -1000000;\n\t scrollEnd = 1000000;\n\t }\n\t\n\t // Prepare for layout\n\t var layoutContext = this._nodes.prepareForLayout(\n\t this._viewSequence, // first node to layout\n\t this._nodesById, { // so we can do fast id lookups\n\t size: size,\n\t direction: this._direction,\n\t reverse: this.options.alignment ? true : false,\n\t scrollOffset: this.options.alignment ? (scrollOffset + size[this._direction]) : scrollOffset,\n\t scrollStart: scrollStart,\n\t scrollEnd: scrollEnd\n\t }\n\t );\n\t\n\t // Layout objects\n\t if (this._layout._function) {\n\t this._layout._function(\n\t layoutContext, // context which the layout-function can use\n\t this._layout.options // additional layout-options\n\t );\n\t }\n\t this._scroll.unnormalizedScrollOffset = scrollOffset;\n\t\n\t // Call post-layout function\n\t if (this._postLayout) {\n\t this._postLayout(size, scrollOffset);\n\t }\n\t\n\t // Mark non-invalidated nodes for removal\n\t this._nodes.removeNonInvalidatedNodes(this.options.flowOptions.removeSpec);\n\t\n\t // Check whether the bounds have been reached\n\t //var oldBoundsReached = this._scroll.boundsReached;\n\t _calcBounds.call(this, size, scrollOffset);\n\t //if (oldBoundsReached !== this._scroll.boundsReached) {\n\t // _log.call(this, 'bounds reached changed (', oldBoundsReached, ' != ', this._scroll.boundsReached, ')');\n\t //}\n\t\n\t // Update scroll-to spring\n\t _calcScrollToOffset.call(this, size, scrollOffset);\n\t\n\t // When pagination is enabled, snap to page\n\t _snapToPage.call(this);\n\t\n\t // If the bounds have changed, and the scroll-offset would be different\n\t // than before, then re-layout entirely using the new offset.\n\t var newScrollOffset = _calcScrollOffset.call(this, true);\n\t if (!nested && (newScrollOffset !== scrollOffset)) {\n\t //_log.call(this, 'offset changed, re-layouting... (', scrollOffset, ' != ', newScrollOffset, ')');\n\t return _layout.call(this, size, newScrollOffset, true);\n\t }\n\t\n\t // Normalize scroll offset so that the current viewsequence node is as close to the\n\t // top as possible and the layout function will need to process the least amount\n\t // of renderables.\n\t scrollOffset = _normalizeViewSequence.call(this, size, scrollOffset);\n\t\n\t // Update spring\n\t _updateSpring.call(this);\n\t\n\t // Cleanup any nodes in case of a VirtualViewSequence\n\t this._nodes.removeVirtualViewSequenceNodes();\n\t\n\t // Calculate scroll-length and use that as the true-size (height)\n\t if (this.options.size && (this.options.size[this._direction] === true)) {\n\t var scrollLength = 0;\n\t var node = this._nodes.getStartEnumNode();\n\t while (node) {\n\t if (node._invalidated && node.scrollLength) {\n\t scrollLength += node.scrollLength;\n\t }\n\t node = node._next;\n\t }\n\t this._size = this._size || [0, 0];\n\t this._size[0] = this.options.size[0];\n\t this._size[1] = this.options.size[1];\n\t this._size[this._direction] = scrollLength;\n\t }\n\t\n\t return scrollOffset;\n\t }", "function resizeView() {\n\n navWidth = document.getElementById('vis').clientWidth;\n navHeight = document.getElementById('vis').clientHeight;\n\n}", "update() {\n\n\t\tconst depth = (this.octree !== null) ? this.octree.getDepth() : -1;\n\n\t\tlet level = 0;\n\t\tlet result;\n\n\t\t// Remove existing geometry.\n\t\tthis.dispose();\n\n\t\twhile(level <= depth) {\n\n\t\t\tresult = this.octree.findNodesByLevel(level);\n\n\t\t\tthis.createLineSegments(\n\t\t\t\tresult[Symbol.iterator](),\n\t\t\t\t(typeof result.size === \"number\") ? result.size : result.length\n\t\t\t);\n\n\t\t\t++level;\n\n\t\t}\n\n\t}", "function draw()\n{\n\tvar page = story.getCurrentPage();\n\n\tif(!page.isCorrectSize())\n\t{\n\t\twindowResized();\n\t}\n\n\tpage.draw();\n}", "function runRedraw()\n{\n document.body.style.display='none';\n var h = document.body.offsetHeight;\n document.body.style.display='block';\n}", "function reshapeAndResize(i) {\n try {\n // iterate through the text frames in the page\n for (var s = 0; s < textFrameCount; s++) {\n var page = pages.item(i + 1)\n\n // isolate the value of the current page bounds\n var origionalBounds = pages.item(i + 1).textFrames[s].geometricBounds\n // reset the geometric bounds of the text frame to those of the page bounds\n page.textFrames[s].geometricBounds = page.bounds \n\n // Now that the target characters are availiable to target, reset the relavent attributes, pointSize and fillColor\n // page.textFrames.everyItem().paragraphs.everyItem().characters.everyItem().pointSize = 5\n page.textFrames.everyItem().paragraphs.everyItem().fillColor = myColor \n\n // After the relavent attributes have been changed, reset the geometric bounds of the text frame to \n // the origional bounds\n page.textFrames[s].geometricBounds = origionalBounds\n }\n } catch (err) {\n $.writeln('err: ' + err)\n }\n}", "render () {\n\t\tthis.renderBoard();\n\t\tthis.renderPieces();\n\t\t$writeInnerHTML( this.view.$maxVal, this.model.maxTimes );\n\t\t$writeInnerHTML( this.view.$minVal, this.model.minTimes );\n\t\tthis.view.alocatePieces( this.model.finalPositionsArr, this.model.baseNumber, this.model.getPieceSize(), this.model.gutterSize );\n\t\tthis.toggleBoardLock();\n\t}", "function _layout(size, scrollOffset, nested) {\n\n\t // Track the number of times the layout-function was executed\n\t this._debug.layoutCount++;\n\t //_log.call(this, 'Layout, scrollOffset: ', scrollOffset, ', particle: ', this._scroll.particle.getPosition1D());\n\n\t // Determine start & end\n\t var scrollStart = 0 - Math.max(this.options.extraBoundsSpace[0], 1);\n\t var scrollEnd = size[this._direction] + Math.max(this.options.extraBoundsSpace[1], 1);\n\t if (this.options.layoutAll) {\n\t scrollStart = -1000000;\n\t scrollEnd = 1000000;\n\t }\n\n\t // Prepare for layout\n\t var layoutContext = this._nodes.prepareForLayout(\n\t this._viewSequence, // first node to layout\n\t this._nodesById, { // so we can do fast id lookups\n\t size: size,\n\t direction: this._direction,\n\t reverse: this.options.alignment ? true : false,\n\t scrollOffset: this.options.alignment ? (scrollOffset + size[this._direction]) : scrollOffset,\n\t scrollStart: scrollStart,\n\t scrollEnd: scrollEnd\n\t }\n\t );\n\n\t // Layout objects\n\t if (this._layout._function) {\n\t this._layout._function(\n\t layoutContext, // context which the layout-function can use\n\t this._layout.options // additional layout-options\n\t );\n\t }\n\n\t // Call post-layout function\n\t if (this._postLayout) {\n\t this._postLayout(size, scrollOffset);\n\t }\n\n\t // Mark non-invalidated nodes for removal\n\t this._nodes.removeNonInvalidatedNodes(this.options.removeSpec);\n\n\t // Check whether the bounds have been reached\n\t _calcBounds.call(this, size, scrollOffset);\n\n\t // Update scroll-to spring\n\t _calcScrollToOffset.call(this, size, scrollOffset);\n\n\t // When pagination is enabled, snap to page\n\t _snapToPage.call(this, size, scrollOffset);\n\n\t // If the bounds have changed, and the scroll-offset would be different\n\t // than before, then re-layout entirely using the new offset.\n\t var newScrollOffset = _calcScrollOffset.call(this, true);\n\t if (!nested && (newScrollOffset !== scrollOffset)) {\n\t //_log.call(this, 'offset changed, re-layouting... (', scrollOffset, ' != ', newScrollOffset, ')');\n\t return _layout.call(this, size, newScrollOffset, true);\n\t }\n\n\t // Normalize scroll offset so that the current viewsequence node is as close to the\n\t // top as possible and the layout function will need to process the least amount\n\t // of renderables.\n\t this._scroll.unnormalizedScrollOffset = scrollOffset;\n\t scrollOffset = _normalizeViewSequence.call(this, size, scrollOffset);\n\n\t // Update spring\n\t _updateSpring.call(this);\n\n\t return scrollOffset;\n\t }", "draw({time, deltaTime}) {\n if (this._sketch) {\n this._sketch.draw({time, deltaTime});\n //update smooth scroll\n if (this._expanderEl) {\n this._scrollTo +=\n (this._destScrollTo - this._scrollTo) * 0.1;\n this._sketch.scrollRatio = (this._scrollTo) / (this._expanderHeight - window.innerHeight);\n }\n }\n }", "function draw(){\r\n //Check if visualization is actually shown to screen.\r\n if (document.getElementById(\"vis\").childNodes.length > 2 && data_avail){\r\n var x, nodeX, nodeY;\r\n \r\n //Cycle through existing nodes to see if user is mousing over.\r\n inside = false;\r\n for (x = 0; x < vis_count; x++){\r\n nodeX = node_locations[x][0] + center_adjust;\r\n nodeY = node_locations[x][1];\r\n if(mouseX > nodeX - 25 && mouseX < nodeX + 25 && mouseY < nodeY + 40 && mouseY > nodeY - 25){\r\n enlarge_box(nodeX, nodeY, x);\r\n inside = true;\r\n }\r\n }\r\n if (expanded && !inside){\r\n new_vis();\r\n expanded = false;\r\n }\r\n }\r\n}", "function main() {\n $('.box').css('left', originX - rbx);\n $('.box').css('top', originY + lty);\n $('.box').css('width', rbx - ltx);\n $('.box').css('height', rby - lty);\n\n html2canvas(document.body, {\n allowTaint: true,\n logging: true,\n width: 1484,\n height: 1119,\n onrendered: function(canvas) {\n $('.bg').css('display', 'none');\n $('.box').css('display', 'none');\n var img = new Image();\n img.setAttribute('crossOrigin', 'anonymous');\n img.src = canvas.toDataURL();\n document.body.appendChild(img);\n }\n });\n}", "_updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n let view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }", "function displaypathdata() {\n $('#datasize').empty()\n var svg_data = size($('#canvas').html())\n $('#datasize').append(svg_data + \"Byte\")\n}", "drawSubviews() {}", "prepareDocument(document) {\n let imgElemsQuery = \".//*[@src | @srcset]\";\n const ORDERED_NODE_SNAPSHOT_TYPE = 7;\n let imgElemsResult = document.evaluate(imgElemsQuery, document, null, ORDERED_NODE_SNAPSHOT_TYPE);\n for (let i = 0, elem; i < imgElemsResult.snapshotLength; ++i) {\n elem = imgElemsResult.snapshotItem(i);\n this.prepareElement(elem)\n }\n }" ]
[ "0.5897899", "0.5844595", "0.5798863", "0.5757059", "0.5727924", "0.57139504", "0.5674671", "0.56110436", "0.56022155", "0.5595393", "0.55837214", "0.5493654", "0.54848546", "0.54633313", "0.5460914", "0.5417372", "0.5413575", "0.53778297", "0.5369406", "0.5366451", "0.5362956", "0.5362303", "0.535451", "0.5351134", "0.5349263", "0.5334994", "0.5330372", "0.5326278", "0.5316972", "0.53086704", "0.53033453", "0.5300076", "0.52947", "0.52893305", "0.52866745", "0.5286244", "0.52846235", "0.5281503", "0.5279429", "0.5270519", "0.52655417", "0.5261032", "0.5258157", "0.5250617", "0.52470577", "0.5240561", "0.5240082", "0.52400535", "0.52372617", "0.5218474", "0.5206438", "0.5189615", "0.51848376", "0.51842225", "0.5175777", "0.5168112", "0.51669496", "0.51635957", "0.5160835", "0.5153178", "0.51503897", "0.5148583", "0.5145401", "0.51389444", "0.5132938", "0.51291263", "0.5128888", "0.51275784", "0.5116279", "0.51158655", "0.51156354", "0.5106275", "0.5104222", "0.5104105", "0.5095764", "0.50932425", "0.5091097", "0.5078914", "0.5073974", "0.507008", "0.50644094", "0.506137", "0.5058259", "0.50574106", "0.50552267", "0.5052706", "0.5051558", "0.50449187", "0.5042713", "0.50423294", "0.5038902", "0.50354934", "0.5035181", "0.50346273", "0.50311506", "0.50292194", "0.5025885", "0.5024692", "0.50237256", "0.50237155", "0.5018736" ]
0.0
-1
Computes display.scroller.scrollLeft + display.gutters.offsetWidth, but using getBoundingClientRect to get a subpixelaccurate result.
function compensateForHScroll(display) { return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get getBoundingClientRects() {\n if (!this._boundingClientRects) {\n const innerBox = this._innerBoxHelper.nativeElement.getBoundingClientRect();\n const clientRect = this.element.getBoundingClientRect();\n this._boundingClientRects = {\n clientRect,\n innerWidth: innerBox.width,\n innerHeight: innerBox.height,\n scrollBarWidth: clientRect.width - innerBox.width,\n scrollBarHeight: clientRect.height - innerBox.height,\n };\n const resetCurrentBox = () => this._boundingClientRects = undefined;\n if (this._isScrolling) {\n this.scrolling.pipe(filter(scrolling => scrolling === 0), take(1)).subscribe(resetCurrentBox);\n }\n else {\n requestAnimationFrame(resetCurrentBox);\n }\n }\n return this._boundingClientRects;\n }", "function getWidth(self) {\r\n return (\r\n parseInt(self.clientWidth) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-left\")) -\r\n parseInt(window.getComputedStyle(self).getPropertyValue(\"padding-right\"))\r\n );\r\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n}", "calculateWithDif() {\n return (this._$window.innerWidth - this.interactiveDomWidth) / 2;\n }", "function compensateForHScroll(display) {\r\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\r\n}", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n }", "function compensateForHScroll(display) {\n\t\t return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n\t\t }", "function compensateForHScroll(display) {\n\t\t return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n\t\t }", "function compensateForHScroll(display) {\r\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\r\n }", "_getWidth() {\n const measurer = this._document.createElement('div');\n measurer.className = 'modal-scrollbar-measure';\n const body = this._document.body;\n body.appendChild(measurer);\n const width = measurer.getBoundingClientRect().width - measurer.clientWidth;\n body.removeChild(measurer);\n return width;\n }", "function compensateForHScroll(display) {\n\t return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n\t }", "function compensateForHScroll(display) {\n\t return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n\t }", "function compensateForHScroll(display) {\n\t return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;\n\t }", "function getDimensions(cm) {\n var d = cm.display,\n left = {},\n width = {};\n var gutterLeft = d.gutters.clientLeft;\n\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n\n return {\n fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth\n };\n } // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,", "function xa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft;\n width[cm.options.gutters[i]] = n.offsetWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft;\n width[cm.options.gutters[i]] = n.offsetWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft;\n width[cm.options.gutters[i]] = n.offsetWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}", "function getDimensions(cm) {\r\n var d = cm.display, left = {}, width = {};\r\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\r\n left[cm.options.gutters[i]] = n.offsetLeft;\r\n width[cm.options.gutters[i]] = n.offsetWidth;\r\n }\r\n return {fixedPos: compensateForHScroll(d),\r\n gutterTotalWidth: d.gutters.offsetWidth,\r\n gutterLeft: left,\r\n gutterWidth: width,\r\n wrapperWidth: d.wrapper.clientWidth};\r\n }", "function getScrollbarWidth() {\n return window.innerWidth - document.documentElement.clientWidth;\n}", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth};\n }", "function calcDragBarPosFromCss() {\n if (dragBar.css('left') === '') return null;\n var percent = /(\\d*(?:\\.\\d+)?)\\%/.exec(dragBar.css('left'))[1];\n percent = parseFloat(percent) / 100;\n return outerWidth * percent;\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "getRects() {\n if (!this.moving) { return this.clientRects; }\n else { return this.DOMcontainer.getBoundingClientRect(); }\n }", "function calcScrollPosition() {\n const positionBracket = calcPositionBracket();\n const scrollY = window.scrollY;\n const r = ((scrollY - positionBracket.copy.prev) / (positionBracket.copy.next - positionBracket.copy.prev));\n\n const visualsScrollTarget = Math.round(positionBracket.visual.prev + ((positionBracket.visual.next - positionBracket.visual.prev) * r));\n\n return visualsScrollTarget;\n}", "function getDimensions(cm) {\n\t var d = cm.display, left = {}, width = {};\n\t var gutterLeft = d.gutters.clientLeft;\n\t for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n\t left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n\t width[cm.options.gutters[i]] = n.clientWidth;\n\t }\n\t return {fixedPos: compensateForHScroll(d),\n\t gutterTotalWidth: d.gutters.offsetWidth,\n\t gutterLeft: left,\n\t gutterWidth: width,\n\t wrapperWidth: d.wrapper.clientWidth};\n\t }", "function getDimensions(cm) {\n\t var d = cm.display, left = {}, width = {};\n\t var gutterLeft = d.gutters.clientLeft;\n\t for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n\t left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n\t width[cm.options.gutters[i]] = n.clientWidth;\n\t }\n\t return {fixedPos: compensateForHScroll(d),\n\t gutterTotalWidth: d.gutters.offsetWidth,\n\t gutterLeft: left,\n\t gutterWidth: width,\n\t wrapperWidth: d.wrapper.clientWidth};\n\t }", "function getDimensions(cm) {\n\t var d = cm.display, left = {}, width = {};\n\t var gutterLeft = d.gutters.clientLeft;\n\t for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n\t left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n\t width[cm.options.gutters[i]] = n.clientWidth;\n\t }\n\t return {fixedPos: compensateForHScroll(d),\n\t gutterTotalWidth: d.gutters.offsetWidth,\n\t gutterLeft: left,\n\t gutterWidth: width,\n\t wrapperWidth: d.wrapper.clientWidth};\n\t }", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "function getDimensions(cm) {\n\t\t var d = cm.display, left = {}, width = {};\n\t\t var gutterLeft = d.gutters.clientLeft;\n\t\t for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n\t\t left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n\t\t width[cm.options.gutters[i]] = n.clientWidth;\n\t\t }\n\t\t return {fixedPos: compensateForHScroll(d),\n\t\t gutterTotalWidth: d.gutters.offsetWidth,\n\t\t gutterLeft: left,\n\t\t gutterWidth: width,\n\t\t wrapperWidth: d.wrapper.clientWidth};\n\t\t }", "function returnScrollbarWidth() {\n let scrollbarWidth = innerWindowWidth() - document.querySelector('html').clientWidth;\n \n return scrollbarWidth;\n}", "function getDimensions(cm) {\r\n var d = cm.display, left = {}, width = {};\r\n var gutterLeft = d.gutters.clientLeft;\r\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\r\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\r\n width[cm.options.gutters[i]] = n.clientWidth;\r\n }\r\n return {fixedPos: compensateForHScroll(d),\r\n gutterTotalWidth: d.gutters.offsetWidth,\r\n gutterLeft: left,\r\n gutterWidth: width,\r\n wrapperWidth: d.wrapper.clientWidth}\r\n}", "function getClientRect(el,origin){var offset=el.offset();var scrollbarWidths=getScrollbarWidths(el);var left=offset.left+getCssFloat(el,'border-left-width')+scrollbarWidths.left-(origin?origin.left:0);var top=offset.top+getCssFloat(el,'border-top-width')+scrollbarWidths.top-(origin?origin.top:0);return{left:left,right:left+el[0].clientWidth,top:top,bottom:top+el[0].clientHeight// clientHeight includes padding but NOT scrollbars\n};}", "function returnScrollbarWidth() {\n let scrollbarWidth = innerWindowWidth() - doc.querySelector('html').clientWidth;\n\n return scrollbarWidth;\n}", "function X(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||c[e]:t.height||c[e]}", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}", "function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n}" ]
[ "0.6243216", "0.6220974", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6219117", "0.6184225", "0.6179456", "0.6166653", "0.6166653", "0.6166653", "0.6166653", "0.6166653", "0.6166653", "0.6166653", "0.6166653", "0.6133881", "0.611915", "0.61042863", "0.60982007", "0.606743", "0.606743", "0.606743", "0.6050127", "0.6011351", "0.5974033", "0.5974033", "0.5974033", "0.5974033", "0.5974033", "0.5974033", "0.5942669", "0.5942669", "0.5942669", "0.59425336", "0.5913559", "0.59104794", "0.59091425", "0.59091425", "0.59091425", "0.59091425", "0.59091425", "0.59044963", "0.58865935", "0.58865935", "0.58865935", "0.58865935", "0.586319", "0.5849408", "0.5823719", "0.5823719", "0.5823719", "0.5822157", "0.58181536", "0.58174443", "0.5810053", "0.58049166", "0.57976025", "0.57952935", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.57729745", "0.5764008", "0.5764008", "0.5764008" ]
0.62709266
14
Returns a function that estimates the height of a line, to use as first approximation until the line becomes visible (and is thus properly measurable).
function estimateHeight(cm) { var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); return function (line) { if (lineIsHidden(cm.doc, line)) { return 0 } var widgetsHeight = 0; if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } } } if (wrapping) { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } else { return widgetsHeight + th } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) { break }\r\n else { h += line.height; }\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\r\n var cur = p.children[i$1];\r\n if (cur == chunk) { break }\r\n else { h += cur.height; }\r\n }\r\n }\r\n return h\r\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj)\n\n var h = 0, chunk = lineObj.parent\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i]\n if (line == lineObj) { break }\n else { h += line.height }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1]\n if (cur == chunk) { break }\n else { h += cur.height }\n }\n }\n return h\n}", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function(line) {\r\n if (lineIsHidden(cm.doc, line)) return 0;\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\r\n }\r\n\r\n if (wrapping)\r\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\r\n else\r\n return widgetsHeight + th;\r\n };\r\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function(line) {\n if (lineIsHidden(cm.doc, line)) return 0;\n\n var widgetsHeight = 0;\n if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n }\n\n if (wrapping)\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n else\n return widgetsHeight + th;\n };\n }", "function estimateHeight(cm) {\n\t\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t\t return function (line) {\n\t\t if (lineIsHidden(cm.doc, line)) { return 0 }\n\n\t\t var widgetsHeight = 0;\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n\t\t if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n\t\t } }\n\n\t\t if (wrapping)\n\t\t { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n\t\t else\n\t\t { return widgetsHeight + th }\n\t\t }\n\t\t }", "function estimateHeight(cm) {\n var th = textHeight(cm.display),\n wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) {\n return 0;\n }\n\n var widgetsHeight = 0;\n\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) {\n widgetsHeight += line.widgets[i].height;\n }\n }\n }\n\n if (wrapping) {\n return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n } else {\n return widgetsHeight + th;\n }\n };\n }", "function estimateHeight(cm) {\n\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t return function(line) {\n\t if (lineIsHidden(cm.doc, line)) return 0;\n\t\n\t var widgetsHeight = 0;\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t }\n\t\n\t if (wrapping)\n\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t else\n\t return widgetsHeight + th;\n\t };\n\t }", "function estimateHeight(cm) {\n\t\t var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n\t\t var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n\t\t return function(line) {\n\t\t if (lineIsHidden(cm.doc, line)) return 0;\n\t\t\n\t\t var widgetsHeight = 0;\n\t\t if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {\n\t\t if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;\n\t\t }\n\t\t\n\t\t if (wrapping)\n\t\t return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;\n\t\t else\n\t\t return widgetsHeight + th;\n\t\t };\n\t\t }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size'), 10) * 1.2;\n }\n return parseInt(lh, 10);\n }", "function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }", "function estimateHeight(cm) {\r\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\r\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\r\n return function (line) {\r\n if (lineIsHidden(cm.doc, line)) { return 0 }\r\n\r\n var widgetsHeight = 0;\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\r\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\r\n } }\r\n\r\n if (wrapping)\r\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\r\n else\r\n { return widgetsHeight + th }\r\n }\r\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight / lineHeight), 0);\n }", "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "getYForLine(line) {\n const options = this.options;\n const spacing = options.spacing_between_lines_px;\n const headroom = options.space_above_staff_ln;\n\n const y = this.y + (line * spacing) + (headroom * spacing);\n\n return y;\n }", "lineBlockAtHeight(height) {\n this.readMeasured();\n return this.viewState.lineBlockAtHeight(height);\n }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight/lineHeight), 0);\n }" ]
[ "0.7596268", "0.7594079", "0.75180316", "0.75075346", "0.75075346", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7444702", "0.7420281", "0.7420281", "0.7420281", "0.7420281", "0.7420281", "0.7420281", "0.7420281", "0.7410362", "0.73879707", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.73740244", "0.7344824", "0.7344824", "0.71730185", "0.71730185", "0.71656024", "0.71403074", "0.71403074", "0.71403074", "0.71403074", "0.71403074", "0.71403074", "0.71403074", "0.71403074", "0.7139551", "0.71368784", "0.7099924", "0.70988935", "0.70792514", "0.7059831", "0.7051718", "0.70444036", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.69913244", "0.6964752", "0.6964752", "0.6711538", "0.65840995", "0.65740305", "0.64585304", "0.6446393", "0.6386829", "0.63833356", "0.6381911" ]
0.71244687
68
Given a mouse event, find the corresponding position. If liberal is false, it checks whether a gutter or scrollbar was clicked, and returns null if it was. forRect is used by rectangular selections, and tries to estimate a character position even for coordinates beyond the right of the text.
function posFromMouse(cm, e, liberal, forRect) { var display = cm.display; if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } var x, y, space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly. try { x = e.clientX - space.left; y = e.clientY - space.top; } catch (e) { return null } var coords = coordsChar(cm, x, y), line; if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); } return coords }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal) {\n var target = e_target(e);\n if (target == display.scrollbarH || target == display.scrollbarV ||\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\n }\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\r\n var display = cm.display;\r\n if (!liberal) {\r\n var target = e_target(e);\r\n if (target == display.scrollbarH || target == display.scrollbarV ||\r\n target == display.scrollbarFiller || target == display.gutterFiller) return null;\r\n }\r\n var x, y, space = display.lineSpace.getBoundingClientRect();\r\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\r\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\r\n catch (e) { return null; }\r\n var coords = coordsChar(cm, x, y), line;\r\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\r\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\r\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\r\n }\r\n return coords;\r\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null; }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords;\n }", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n\t var display = cm.display;\n\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\t\n\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t catch (e) { return null; }\n\t var coords = coordsChar(cm, x, y), line;\n\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t }\n\t return coords;\n\t }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }", "function posFromMouse(cm, e, liberal, forRect) {\r\n var display = cm.display;\r\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\r\n\r\n var x, y, space = display.lineSpace.getBoundingClientRect();\r\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\r\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\r\n catch (e) { return null }\r\n var coords = coordsChar(cm, x, y), line;\r\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\r\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\r\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\r\n }\r\n return coords\r\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect()\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))\n }\n return coords\n}", "function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") {\n return null;\n }\n\n var x,\n y,\n space = display.lineSpace.getBoundingClientRect(); // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\n try {\n x = e.clientX - space.left;\n y = e.clientY - space.top;\n } catch (e) {\n return null;\n }\n\n var coords = _coordsChar(cm, x, y),\n line;\n\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n\n return coords;\n } // Find the view element corresponding to a given line. Return null", "function posFromMouse(cm, e, liberal, forRect) {\n\t\t var display = cm.display;\n\t\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") return null;\n\t\t\n\t\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t\t catch (e) { return null; }\n\t\t var coords = coordsChar(cm, x, y), line;\n\t\t if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t\t }\n\t\t return coords;\n\t\t }", "function posFromMouse(cm, e, liberal, forRect) {\n\t\t var display = cm.display;\n\t\t if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n\t\t var x, y, space = display.lineSpace.getBoundingClientRect();\n\t\t // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n\t\t try { x = e.clientX - space.left; y = e.clientY - space.top; }\n\t\t catch (e$1) { return null }\n\t\t var coords = coordsChar(cm, x, y), line;\n\t\t if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n\t\t var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n\t\t coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n\t\t }\n\t\t return coords\n\t\t }", "function bufferPositionFromMouseEvent(editor, event) {\n const sp = atom.views.getView(editor).component.screenPositionForMouseEvent(event);\n if (isNaN(sp.row) || isNaN(sp.column)) {\n return;\n }\n return editor.bufferPositionForScreenPosition(sp);\n}", "_positionFromMouseEvent(event, element, mouseService) {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }", "function getCursorPos( event ) {\n var rect = this.getBoundingClientRect();\n var x = Math.floor( ( event.clientX - rect.left ) / grid / s), \n y = Math.floor( ( event.clientY - rect.top ) / grid / s);\n if( maze[x][y] ) return;\n if( start.x == -1 ) {\n start = { x: x, y: y };\n maze[start.x][start.y] = 8;\n drawBlock(start.x,start.y,8);\n } else {\n end = { x: x, y: y };\n maze[end.x][end.y] = 8;\n drawBlock(end.x,end.y,8);\n // console.log('start search');\n startSolve();\n }\n}", "getPosition(gid, eid, findAlt){\n let container = document.querySelector(`${this.eCfg.selector} > svg`).getBoundingClientRect();\n let e = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}`).getBoundingClientRect();\n if (findAlt){\n let eAlt = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}-alt`)\n if (eAlt) eAlt = eAlt.getBoundingClientRect();\n if (eAlt) e = eAlt;\n }\n return {left:(e.left-container.left)+(e.width/2), top:(e.top-container.top)+(e.height/2)};\n }", "getLocalCoords(elem, ev) {\n let ox = 0, oy = 0;\n let first;\n let pageX, pageY;\n\n // Walk back up the tree to calculate the total page offset of the\n // currentTarget element. I can't tell you how happy this makes me.\n // Really.\n while (elem !== null) {\n ox += elem.offsetLeft;\n oy += elem.offsetTop;\n elem = elem.offsetParent;\n }\n\n if ('changedTouches' in ev) {\n first = ev.changedTouches[0];\n pageX = first.pageX;\n pageY = first.pageY;\n } else {\n pageX = ev.pageX;\n pageY = ev.pageY;\n }\n\n return { 'x': pageX - ox, 'y': pageY - oy };\n }", "function onSelected() {\n let selection = window.getSelection();\n if (selection.toString().trim()) {\n // console.log(selection);\n selectedNode = selection.anchorNode;\n selectedRect = selection.getRangeAt(0).getBoundingClientRect();\n } \n}", "function getCursorPosition(event) {\r\n\tvar x;\r\n\tvar y;\r\n\tif (event.pageX || event.pageY) {\r\n\t x = event.pageX;\r\n\t y = event.pageY;\r\n\t} else {\r\n\t x = event.clientX\r\n\t\t+ document.body.scrollLeft\r\n\t\t+ document.documentElement.scrollLeft;\r\n\t y = event.clientY\r\n\t\t+ document.body.scrollTop\r\n\t\t+ document.documentElement.scrollTop;\r\n\t}\r\n\r\n if(canvas != null) {\r\n x -= canvas.offsetLeft;\r\n y -= canvas.offsetTop;\r\n }\r\n\r\n\tvar point = [Math.floor((x - 2) / CELL_SIZE), Math.floor((y - 4) / CELL_SIZE)];\r\n\treturn point;\r\n }", "function getCoords(element,e)\r\n{\r\n\tvar functionContinue = false;\r\n\r\n\tvar theElement = document.getElementById(element);\r\n\t\r\n\t// let's check to see if we already have gotten the position of this element\r\n\tvar posObj = posObjArray[element];\r\n\t\r\n\t// if we haven't gotten it yet then let's do get it....\r\n\tif(posObj==null)\r\n\t{\r\n\t\tposObj = SEDHTMLMenu_GetElementPosition(theElement);\r\n\t\tposObjArray[element]=posObj;\r\n\t}\r\n\t\r\n\tvar topXDIV = posObj.left;\r\n\tvar topYDIV = posObj.top;\r\n\t\r\n\tvar bottomXDIV = posObj.left + posObj.width;\r\n\tvar bottomYDIV = posObj.top + posObj.height;\r\n\t\r\n\tif ( browser.toUpperCase() == \"IE\" ) {\r\n\t\tvar mouseX = e.clientX + document.body.scrollLeft;\r\n\t\tvar mouseY = e.clientY;\r\n\t}\r\n\telse if ( browser.toUpperCase() == \"MZ\" ) {\r\n\t\tvar mouseX = e.clientX + window.scrollX;\r\n\t\tvar mouseY = e.clientY;\r\n\t}\r\n\t\r\n\t// now we check to see if the mouse is inside of the element because we don't want to continue with the calling function if so\r\n\tif( (mouseX >= topXDIV) && (mouseX <= bottomXDIV) && (mouseY >= topYDIV) && (mouseY <= bottomYDIV) ) {\r\n\t\tfunctionContinue = false;\r\n\t} else {\r\n\t\tfunctionContinue = true;\r\n\t}\r\n\t\r\n\treturn functionContinue;\r\n}", "function getVisibleSelectionRect(global){var selection=global.getSelection();if(!selection.rangeCount){return null;}var range=selection.getRangeAt(0);var boundingRect=getRangeBoundingClientRect(range);var top=boundingRect.top;var right=boundingRect.right;var bottom=boundingRect.bottom;var left=boundingRect.left;// When a re-render leads to a node being removed, the DOM selection will\r\n\t// temporarily be placed on an ancestor node, which leads to an invalid\r\n\t// bounding rect. Discard this state.\r\n\tif(top===0&&right===0&&bottom===0&&left===0){return null;}return boundingRect;}", "function FindMousePos(e)\r\n{ \r\n \r\n //get the mouse coordinates \r\n // Detect if the browser is IE or not.\r\n // If it is not IE, we assume that the browser is NS.\r\n if(!e)e = window.event;\r\n if (e.clientX) { // grab the x-y pos.s if browser is IE\r\n tempX = e.clientX + (document.documentElement.scrollLeft ?\r\n document.documentElement.scrollLeft :\r\n document.body.scrollLeft);\r\n \r\n tempY = e.clientY + (document.documentElement.scrollTop ?\r\n document.documentElement.scrollTop :\r\n document.body.scrollTop);\r\n } else if (e.pageX) { // grab the x-y pos.s if browser is NS\r\n tempX = e.pageX;\r\n tempY = e.pageY;\r\n } \r\n \r\n // catch possible negative values in NS4\r\n if (tempX < 0){tempX = 0}\r\n if (tempY < 0){tempY = 0} \r\n \r\n _varGlbMouseX = tempX;\r\n _varGlbMouseY = tempY;\r\n \r\n}", "function mouseCoordsToElem(div,mouseEvent){//y coords not verified \n //var div=document.getElementById(divId);\n var documentCoords=findDocumentCoords(mouseEvent);\n var div0 = div.getBoundingClientRect();\n var x=documentCoords.x- div0.left - window.pageXOffset;\n //var x=documentCoords.x-(div0.left+document.body.scrollLeft);\n var y=documentCoords.y- div0.top - window.pageYOffset;\n return{\n x:x,\n y:y//y coords not verified \n };\n}", "function findMousePosition(event){\n var rect = canvas.getBoundingClientRect();\n var root = document.documentElement;\n var mouseX = event.clientX - rect.left - root.scrollLeft;\n var mouseY = event.clientY - rect.top - root.scrollTop;\n return {\n x:mouseX,\n y:mouseY\n };\n}", "function getCursorPosition(canvas, event) {\n if (down) {\n const rect = canvas.getBoundingClientRect();\n mouseX = event.clientX - rect.left;\n mouseY = event.clientY - rect.top;\n context.fillRect(mouseX, mouseY, 1, 1);\n }\n}", "function getRelativePosition (evt) {\n var mouseX, mouseY;\n var e = evt.originalEvent || evt,\n canvas = evt.currentTarget || evt.srcElement,\n boundingRect = canvas.getBoundingClientRect();\n\n if (e.touches) {\n mouseX = e.touches[0].clientX - boundingRect.left;\n mouseY = e.touches[0].clientY - boundingRect.top;\n }\n else {\n mouseX = e.clientX - boundingRect.left;\n mouseY = e.clientY - boundingRect.top;\n }\n\n return {\n x: mouseX,\n y: mouseY\n };\n\n}", "function getSelectionForEvent(event, editorState) {\n\t var node = null;\n\t var offset = null;\n\n\t if (typeof document.caretRangeFromPoint === 'function') {\n\t var dropRange = document.caretRangeFromPoint(event.x, event.y);\n\t node = dropRange.startContainer;\n\t offset = dropRange.startOffset;\n\t } else if (event.rangeParent) {\n\t node = event.rangeParent;\n\t offset = event.rangeOffset;\n\t } else {\n\t return null;\n\t }\n\n\t node = nullthrows(node);\n\t offset = nullthrows(offset);\n\t var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n\t return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n\t}", "function getCursorPosition(canvas, event) {\n\t var rect = canvas.getBoundingClientRect();\n\t var x = event.clientX - rect.left;\n\t var y = event.clientY - rect.top;\n\t return [x,y];\n\t}", "function getCursorPos(event) \r\n {\r\n var x = 0;\r\n let y = 0;\r\n event = event || window.event;\r\n\r\n x = event.offsetX;\r\n y = event.offsetY;\r\n\r\n return {x : x, y : y};\r\n }", "function getCoordinate(event) {\n let ne = rectangle.getBounds().getNorthEast();\n let sw = rectangle.getBounds().getSouthWest();\n\n rightUpLat = ne.lat();\n rightUpLng = ne.lng();\n leftDownLat = sw.lat();\n leftDownLng = sw.lng();\n\n let rectangleLength = rightUpLng - leftDownLng;\n let rectangleWidth = rightUpLat - leftDownLat;\n let check = false;\n\n if (rectangleWidth > maxWidth) {\n\n let newBounds = {\n north: rightUpLat,\n south: rightUpLat - maxWidth + 0.02,\n east: rightUpLng,\n west: leftDownLng\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n if (rectangleLength > maxLength) {\n\n let newBounds = {\n north: rightUpLat,\n south: leftDownLat,\n east: rightUpLng,\n west: rightUpLng - maxLength + 0.02\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n\n if (check) {\n alert('Превышен максимальный размер области');\n }\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getSelectionForEvent(event, editorState) {\n var node = null;\n var offset = null;\n\n if (typeof document.caretRangeFromPoint === 'function') {\n var dropRange = document.caretRangeFromPoint(event.x, event.y);\n node = dropRange.startContainer;\n offset = dropRange.startOffset;\n } else if (event.rangeParent) {\n node = event.rangeParent;\n offset = event.rangeOffset;\n } else {\n return null;\n }\n\n node = nullthrows(node);\n offset = nullthrows(offset);\n var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}", "function getPosition(e) {\n var rect = e.target.getBoundingClientRect();\n var x = e.clientX - rect.left;\n var y = e.clientY - rect.top;\n console.log(x, y);\n return {\n x,\n y,\n };\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top;\n var right = boundingRect.right;\n var bottom = boundingRect.bottom;\n var left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top;\n var right = boundingRect.right;\n var bottom = boundingRect.bottom;\n var left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top;\n var right = boundingRect.right;\n var bottom = boundingRect.bottom;\n var left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getPositionMouse(canvas, event) {\n var area = canvas.getBoundingClientRect();\n return {\n x: event.clientX - area.left,\n y: event.clientY - area.top\n };\n}", "function deriveCursorForDocument(paramMouseX, paramMouseY, paramDocument) {\r\n\r\n\t// Calculate line and column number based on mouse position\r\n\tvar currow = Math.floor((mouseY - PADDING_TOP)/FONT_HEIGHT);\r\n\tvar curcol = Math.floor((mouseX - PADDING_LEFT)/FONT_WIDTH);\r\n\t\r\n\t// Perform sanity check on calculated values:\r\n\t// If the calculated line is below the last line, then set cursor at last character in document\r\n\tif (currow > paramDocument.getDocumentLength()-1) {\r\n\t\tcurrow = paramDocument.getDocumentLength()-1;\r\n\t\tcurcol = paramDocument.getLineLength( paramDocument.getDocumentLength() );\r\n\t}\r\n\t// If the calculated cursor is beyond the first or last character in a line, \r\n\t// then set the cursor to the first or last character, respectively\r\n\telse {\t\t\r\n\t\tif ( curcol < 0 ) curcol = 0;\r\n\t\tif ( curcol > paramDocument.getLineLength(currow) ) curcol = paramDocument.getLineLength(currow);\r\n\t}\r\n\t\r\n\t// Before we move the cursor there, make sure that the line isn't locked\r\n\tif( paramDocument.getLineLockingUser( currow ) != null ){\r\n\t\talert(\"Another user is currently on line \"+currow+\", and it is locked.\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// Store the calculated values\r\n\tsetCursor(currow,curcol);\r\n}", "function getSelectionCoords(win) {\n\n win = win || window;\n var doc = win.document;\n var sel = doc.selection, range, rects, rect;\n var left = 0, top = 0, bottom = 0, right = 0;\n\n if (sel) {\n if (sel.type != \"Control\") {\n range = sel.createRange();\n range.collapse(true);\n left = range.boundingLeft;\n top = range.boundingTop;\n bottom = range.boundingBottom;\n right = range.boundingRight;\n }\n } else if (win.getSelection) {\n sel = win.getSelection();\n if (sel.rangeCount) {\n range = sel.getRangeAt(0).cloneRange();\n if (range.getClientRects) {\n range.collapse(true);\n rects = range.getClientRects();\n if (rects.length > 0) {\n rect = rects[0];\n }\n left = rect.left;\n top = rect.top;\n bottom = rect.bottom;\n right = rect.right;\n\n }\n // Fall back to inserting a temporary element\n if (left == 0 && top == 0 && bottom == 0 && right ==0) {\n var span = doc.createElement(\"span\");\n if (span.getClientRects) {\n // Ensure span has dimensions and position by\n // adding a zero-width space character\n span.appendChild( doc.createTextNode(\"\\u200b\") );\n range.insertNode(span);\n rect = span.getClientRects()[0];\n left = rect.left;\n top = rect.top;\n bottom = rect.bottom;\n right = rect.right;\n\n var spanParent = span.parentNode;\n spanParent.removeChild(span);\n\n // Glue any broken text nodes back together\n spanParent.normalize();\n }\n }\n }\n }\n\n return { left: left, top: top, bottom: bottom, right: right };\n}", "function kwmousePosition(event, element)\n{\n var offset = jQuery(element).offset();\n return {left: event.pageX - offset.left, top: event.pageY - offset.top};\n}", "function getCoords(event, element, colCount, rowCount, hasValidCharSize, actualCellWidth, actualCellHeight, isSelection) {\n // Coordinates cannot be measured if there are no valid\n if (!hasValidCharSize) {\n return undefined;\n }\n const coords = getCoordsRelativeToElement(event, element);\n if (!coords) {\n return undefined;\n }\n coords[0] = Math.ceil((coords[0] + (isSelection ? actualCellWidth / 2 : 0)) / actualCellWidth);\n coords[1] = Math.ceil(coords[1] / actualCellHeight);\n // Ensure coordinates are within the terminal viewport. Note that selections\n // need an addition point of precision to cover the end point (as characters\n // cover half of one char and half of the next).\n coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));\n coords[1] = Math.min(Math.max(coords[1], 1), rowCount);\n return coords;\n}", "function getCursorPosition(e) {\n\tvar x, y;\n\tif ( event.offsetX == null ) {\t// Firefox\n\t x = event.originalEvent.layerX;\n\t y = event.originalEvent.layerY;\n\t}\n\telse {\t// Other browsers\n\t x = event.offsetX;\n\t y = event.offsetY;\n\t}\n\treturn [x, y];\n}", "function getMousePos(canvasDom, mouseEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx: mouseEvent.clientX - rect.left,\n\t\t\ty: mouseEvent.clientY - rect.top\n\t\t};\n\t}", "function getMousePos(canvasDom, mouseEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx: mouseEvent.clientX - rect.left,\n\t\t\ty: mouseEvent.clientY - rect.top\n\t\t};\n\t}", "function getMousePos(canvasDom, mouseEvent) {\r\n var rect = canvasDom.getBoundingClientRect();\r\n return {\r\n x: mouseEvent.pageX - rect.left,\r\n y: mouseEvent.pageY - rect.top\r\n };\r\n }", "function getEventPosition(evt) {\n\t\tif (evt.offsetX !== undefined) {\n\t\t\treturn { x: evt.offsetX, y: evt.offsetY };\n\t\t}\n\n\t\tvar el = evt.target,\n\t\t\toffset = { x: 0, y: 0 };\n\n\t\twhile (el.offsetParent) {\n\t\t\toffset.x += el.offsetLeft;\n\t\t\toffset.y += el.offsetTop;\n\t\t\tel = el.offsetParent;\n\t\t}\n\n\t\toffset.x = evt.pageX - offset.x;\n\t\toffset.y = evt.pageY - offset.y;\n\n\t\treturn offset;\n\t}", "function getMousePos(evt) {\n \tvar rect = canvas.getBoundingClientRect();\n \t\n \treturn {\n \t\tx: Math.floor(evt.clientX - rect.left),\n \t\ty: Math.floor(evt.clientY - rect.top)\n \t};\n }", "function getMousePos(evt) {\n \tvar rect = canvas.getBoundingClientRect();\n \t\n \treturn {\n \t\tx: Math.floor(evt.clientX - rect.left),\n \t\ty: Math.floor(evt.clientY - rect.top)\n \t};\n }", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getVisibleSelectionRect(global) {\n var selection = global.getSelection();\n if (!selection.rangeCount) {\n return null;\n }\n\n var range = selection.getRangeAt(0);\n var boundingRect = getRangeBoundingClientRect(range);\n var top = boundingRect.top,\n right = boundingRect.right,\n bottom = boundingRect.bottom,\n left = boundingRect.left;\n\n // When a re-render leads to a node being removed, the DOM selection will\n // temporarily be placed on an ancestor node, which leads to an invalid\n // bounding rect. Discard this state.\n\n if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n return null;\n }\n\n return boundingRect;\n}", "function getMousePos(canvasDom, mouseEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx : mouseEvent.clientX - rect.left,\n\t\t\ty : mouseEvent.clientY - rect.top\n\t\t};\n\t}", "function getMousePos(canvasDom, mouseEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx : mouseEvent.clientX - rect.left,\n\t\t\ty : mouseEvent.clientY - rect.top\n\t\t};\n\t}", "function getMousePos(canvasDom, mouseEvent) {\n\t\tvar rect = canvasDom.getBoundingClientRect();\n\t\treturn {\n\t\t\tx : mouseEvent.clientX - rect.left,\n\t\t\ty : mouseEvent.clientY - rect.top\n\t\t};\n\t}", "function getVisibleSelectionRect(global) {\n\t var selection = global.getSelection();\n\t if (!selection.rangeCount) {\n\t return null;\n\t }\n\n\t var range = selection.getRangeAt(0);\n\t var boundingRect = getRangeBoundingClientRect(range);\n\t var top = boundingRect.top;\n\t var right = boundingRect.right;\n\t var bottom = boundingRect.bottom;\n\t var left = boundingRect.left;\n\n\t // When a re-render leads to a node being removed, the DOM selection will\n\t // temporarily be placed on an ancestor node, which leads to an invalid\n\t // bounding rect. Discard this state.\n\n\t if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n\t return null;\n\t }\n\n\t return boundingRect;\n\t}", "function calculateMousePos(evt) {\n\tvar rect = canvas.getBoundingClientRect();\n\tvar root = document.documentElement;\n\tvar mouseX = evt.clientX - rect.left - root.scrollLeft;\n\tvar mouseY = evt.clientY - rect.top - root.scrollTop;\n\treturn {\n\t\tx: mouseX,\n\t\ty: mouseY\n\t};\n}", "function offsetMousePos(parent, evt) {\n var p = topLeftCorner(parent.getClientRects()[0]);\n return { x: evt.clientX - p.x, y: evt.clientY - p.y };\n}" ]
[ "0.77062094", "0.77062094", "0.77062094", "0.77062094", "0.76363605", "0.7512373", "0.7512373", "0.7470907", "0.7470907", "0.7455225", "0.7455225", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.74524885", "0.7441735", "0.74345076", "0.74345076", "0.743283", "0.743283", "0.743283", "0.743283", "0.743283", "0.743283", "0.743283", "0.7430314", "0.7419819", "0.7419819", "0.7395487", "0.73790246", "0.7345209", "0.60163695", "0.59712166", "0.5895264", "0.58918023", "0.58509636", "0.5780457", "0.5771094", "0.57523847", "0.5717454", "0.56693316", "0.5668122", "0.56634766", "0.5661117", "0.565638", "0.5649947", "0.56474864", "0.56417835", "0.564076", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5638457", "0.5636879", "0.5630625", "0.5630625", "0.5630625", "0.56274176", "0.5622165", "0.56119794", "0.5608072", "0.56044453", "0.55987537", "0.5598517", "0.5598517", "0.559685", "0.55935216", "0.55913335", "0.55913335", "0.5586642", "0.5586642", "0.5586642", "0.5586642", "0.5586642", "0.5586642", "0.55854255", "0.55854255", "0.55854255", "0.55770004", "0.55754745", "0.5574572" ]
0.7454629
16
Find the view element corresponding to a given line. Return null when the line isn't visible.
function findViewIndex(cm, n) { if (n >= cm.display.viewTo) { return null } n -= cm.display.viewFrom; if (n < 0) { return null } var view = cm.display.view; for (var i = 0; i < view.length; i++) { n -= view[i].size; if (n < 0) { return i } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n return cm.display.view[findViewIndex(cm, lineN)];\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n return ext;\n }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t return cm.display.view[findViewIndex(cm, lineN)];\n\t var ext = cm.display.externalMeasured;\n\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t return ext;\n\t }", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n}", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t return cm.display.view[findViewIndex(cm, lineN)];\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t return ext;\n\t\t }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n return cm.display.view[findViewIndex(cm, lineN)];\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n return ext;\r\n }", "function findViewForLine(cm, lineN) {\n\t\t if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n\t\t { return cm.display.view[findViewIndex(cm, lineN)] }\n\t\t var ext = cm.display.externalMeasured;\n\t\t if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n\t\t { return ext }\n\t\t }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)]; }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext; }\r\n }", "function findViewForLine(cm, lineN) {\r\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\r\n { return cm.display.view[findViewIndex(cm, lineN)] }\r\n var ext = cm.display.externalMeasured;\r\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\r\n { return ext }\r\n}", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t line = merged.find(-1, true).line;\n\t\t return line;\n\t\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t var merged;\n\t while (merged = collapsedSpanAtStart(line))\n\t line = merged.find(-1, true).line;\n\t return line;\n\t }", "function visualLine(line) {\n\t\t var merged;\n\t\t while (merged = collapsedSpanAtStart(line))\n\t\t { line = merged.find(-1, true).line; }\n\t\t return line\n\t\t }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n line = merged.find(-1, true).line;\r\n return line;\r\n }", "function visualLine(line) {\n var merged;\n\n while (merged = collapsedSpanAtStart(line)) {\n line = merged.find(-1, true).line;\n }\n\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n line = merged.find(-1, true).line;\n return line;\n }", "function visualLine(line) {\r\n var merged;\r\n while (merged = collapsedSpanAtStart(line))\r\n { line = merged.find(-1, true).line; }\r\n return line\r\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }", "getPositionFromDOMInfo(spanNode, offset) {\n const viewLineDomNode = this._getViewLineDomNode(spanNode);\n if (viewLineDomNode === null) {\n // Couldn't find view line node\n return null;\n }\n const lineNumber = this._getLineNumberFor(viewLineDomNode);\n if (lineNumber === -1) {\n // Couldn't find view line node\n return null;\n }\n if (lineNumber < 1 || lineNumber > this._context.model.getLineCount()) {\n // lineNumber is outside range\n return null;\n }\n if (this._context.model.getLineMaxColumn(lineNumber) === 1) {\n // Line is empty\n return new position_1.Position(lineNumber, 1);\n }\n const rendStartLineNumber = this._visibleLines.getStartLineNumber();\n const rendEndLineNumber = this._visibleLines.getEndLineNumber();\n if (lineNumber < rendStartLineNumber || lineNumber > rendEndLineNumber) {\n // Couldn't find line\n return null;\n }\n let column = this._visibleLines.getVisibleLine(lineNumber).getColumnOfNodeOffset(lineNumber, spanNode, offset);\n const minColumn = this._context.model.getLineMinColumn(lineNumber);\n if (column < minColumn) {\n column = minColumn;\n }\n return new position_1.Position(lineNumber, column);\n }", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLine(line) {\n var merged\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line }\n return line\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line)\n if (line == vis) { return lineN }\n return lineNo(vis)\n}", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }", "function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }" ]
[ "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.7010356", "0.69926566", "0.69926566", "0.69926566", "0.69926566", "0.69926566", "0.69926566", "0.69926566", "0.69926566", "0.6974529", "0.6974529", "0.6974529", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.6941676", "0.69365245", "0.69365245", "0.69097495", "0.6897595", "0.6895506", "0.6875943", "0.68721074", "0.6134467", "0.61292833", "0.61292833", "0.61292833", "0.6097236", "0.6020444", "0.6005285", "0.60039383", "0.60039383", "0.60039383", "0.60039383", "0.60039383", "0.60039383", "0.60039383", "0.5978633", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5968762", "0.5886158", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58739245", "0.58411276", "0.58411276", "0.5835817", "0.5835817", "0.5794205", "0.5794205", "0.5794205", "0.5794205", "0.5794205", "0.5794205", "0.5794205" ]
0.0
-1
Draws a cursor for the given range
function drawSelectionCursor(cm, head, output) { var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); cursor.style.left = pos.left + "px"; cursor.style.top = pos.top + "px"; cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; if (pos.other) { // Secondary cursor, shown when on a 'jump' in bi-directional text var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); otherCursor.style.display = ""; otherCursor.style.left = pos.other.left + "px"; otherCursor.style.top = pos.other.top + "px"; otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\r\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\r\n\r\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\r\n cursor.style.left = pos.left + \"px\";\r\n cursor.style.top = pos.top + \"px\";\r\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\r\n\r\n if (pos.other) {\r\n // Secondary cursor, shown when on a 'jump' in bi-directional text\r\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\r\n otherCursor.style.display = \"\";\r\n otherCursor.style.left = pos.other.left + \"px\";\r\n otherCursor.style.top = pos.other.top + \"px\";\r\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\r\n }\r\n }", "function drawSelectionRange(cm, range, output) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t var fragment = document.createDocumentFragment();\n\t\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\t\n\t\t function add(left, top, width, bottom) {\n\t\t if (top < 0) top = 0;\n\t\t top = Math.round(top);\n\t\t bottom = Math.round(bottom);\n\t\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t\t \"px; height: \" + (bottom - top) + \"px\"));\n\t\t }\n\t\t\n\t\t function drawForLine(line, fromArg, toArg) {\n\t\t var lineObj = getLine(doc, line);\n\t\t var lineLen = lineObj.text.length;\n\t\t var start, end;\n\t\t function coords(ch, bias) {\n\t\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t\t }\n\t\t\n\t\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t\t if (from == to) {\n\t\t rightPos = leftPos;\n\t\t left = right = leftPos.left;\n\t\t } else {\n\t\t rightPos = coords(to - 1, \"right\");\n\t\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t\t left = leftPos.left;\n\t\t right = rightPos.right;\n\t\t }\n\t\t if (fromArg == null && from == 0) left = leftSide;\n\t\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t\t add(left, leftPos.top, null, leftPos.bottom);\n\t\t left = leftSide;\n\t\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t\t }\n\t\t if (toArg == null && to == lineLen) right = rightSide;\n\t\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t\t start = leftPos;\n\t\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t\t end = rightPos;\n\t\t if (left < leftSide + 1) left = leftSide;\n\t\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t\t });\n\t\t return {start: start, end: end};\n\t\t }\n\t\t\n\t\t var sFrom = range.from(), sTo = range.to();\n\t\t if (sFrom.line == sTo.line) {\n\t\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t\t } else {\n\t\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t\t if (singleVLine) {\n\t\t if (leftEnd.top < rightStart.top - 2) {\n\t\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t\t } else {\n\t\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t\t }\n\t\t }\n\t\t if (leftEnd.bottom < rightStart.top)\n\t\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t\t }\n\t\t\n\t\t output.appendChild(fragment);\n\t\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}", "function drawSelectionRange(cm, range, output) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t var fragment = document.createDocumentFragment();\n\t\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\t var docLTR = doc.direction == \"ltr\";\n\n\t\t function add(left, top, width, bottom) {\n\t\t if (top < 0) { top = 0; }\n\t\t top = Math.round(top);\n\t\t bottom = Math.round(bottom);\n\t\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n\t\t }\n\n\t\t function drawForLine(line, fromArg, toArg) {\n\t\t var lineObj = getLine(doc, line);\n\t\t var lineLen = lineObj.text.length;\n\t\t var start, end;\n\t\t function coords(ch, bias) {\n\t\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n\t\t }\n\n\t\t function wrapX(pos, dir, side) {\n\t\t var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n\t\t var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n\t\t var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n\t\t return coords(ch, prop)[prop]\n\t\t }\n\n\t\t var order = getOrder(lineObj, doc.direction);\n\t\t iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n\t\t var ltr = dir == \"ltr\";\n\t\t var fromPos = coords(from, ltr ? \"left\" : \"right\");\n\t\t var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n\t\t var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n\t\t var first = i == 0, last = !order || i == order.length - 1;\n\t\t if (toPos.top - fromPos.top <= 3) { // Single line\n\t\t var openLeft = (docLTR ? openStart : openEnd) && first;\n\t\t var openRight = (docLTR ? openEnd : openStart) && last;\n\t\t var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n\t\t var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n\t\t add(left, fromPos.top, right - left, fromPos.bottom);\n\t\t } else { // Multiple lines\n\t\t var topLeft, topRight, botLeft, botRight;\n\t\t if (ltr) {\n\t\t topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n\t\t topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n\t\t botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n\t\t botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n\t\t } else {\n\t\t topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n\t\t topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n\t\t botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n\t\t botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n\t\t }\n\t\t add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n\t\t if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n\t\t add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n\t\t }\n\n\t\t if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n\t\t if (cmpCoords(toPos, start) < 0) { start = toPos; }\n\t\t if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n\t\t if (cmpCoords(toPos, end) < 0) { end = toPos; }\n\t\t });\n\t\t return {start: start, end: end}\n\t\t }\n\n\t\t var sFrom = range.from(), sTo = range.to();\n\t\t if (sFrom.line == sTo.line) {\n\t\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t\t } else {\n\t\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t\t if (singleVLine) {\n\t\t if (leftEnd.top < rightStart.top - 2) {\n\t\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t\t } else {\n\t\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t\t }\n\t\t }\n\t\t if (leftEnd.bottom < rightStart.top)\n\t\t { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n\t\t }\n\n\t\t output.appendChild(fragment);\n\t\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\t\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\t\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\t\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\t\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\r\n var display = cm.display, doc = cm.doc;\r\n var fragment = document.createDocumentFragment();\r\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\r\n\r\n function add(left, top, width, bottom) {\r\n if (top < 0) top = 0;\r\n top = Math.round(top);\r\n bottom = Math.round(bottom);\r\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\r\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\r\n \"px; height: \" + (bottom - top) + \"px\"));\r\n }\r\n\r\n function drawForLine(line, fromArg, toArg) {\r\n var lineObj = getLine(doc, line);\r\n var lineLen = lineObj.text.length;\r\n var start, end;\r\n function coords(ch, bias) {\r\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\r\n }\r\n\r\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\r\n var leftPos = coords(from, \"left\"), rightPos, left, right;\r\n if (from == to) {\r\n rightPos = leftPos;\r\n left = right = leftPos.left;\r\n } else {\r\n rightPos = coords(to - 1, \"right\");\r\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\r\n left = leftPos.left;\r\n right = rightPos.right;\r\n }\r\n if (fromArg == null && from == 0) left = leftSide;\r\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\r\n add(left, leftPos.top, null, leftPos.bottom);\r\n left = leftSide;\r\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\r\n }\r\n if (toArg == null && to == lineLen) right = rightSide;\r\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\r\n start = leftPos;\r\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\r\n end = rightPos;\r\n if (left < leftSide + 1) left = leftSide;\r\n add(left, rightPos.top, right - left, rightPos.bottom);\r\n });\r\n return {start: start, end: end};\r\n }\r\n\r\n var sFrom = range.from(), sTo = range.to();\r\n if (sFrom.line == sTo.line) {\r\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\r\n } else {\r\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\r\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\r\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\r\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\r\n if (singleVLine) {\r\n if (leftEnd.top < rightStart.top - 2) {\r\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\r\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\r\n } else {\r\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\r\n }\r\n }\r\n if (leftEnd.bottom < rightStart.top)\r\n add(leftSide, leftEnd.bottom, null, rightStart.top);\r\n }\r\n\r\n output.appendChild(fragment);\r\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\r\n var display = cm.display, doc = cm.doc;\r\n var fragment = document.createDocumentFragment();\r\n var padding = paddingH(cm.display), leftSide = padding.left;\r\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\r\n var docLTR = doc.direction == \"ltr\";\r\n\r\n function add(left, top, width, bottom) {\r\n if (top < 0) { top = 0; }\r\n top = Math.round(top);\r\n bottom = Math.round(bottom);\r\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\r\n }\r\n\r\n function drawForLine(line, fromArg, toArg) {\r\n var lineObj = getLine(doc, line);\r\n var lineLen = lineObj.text.length;\r\n var start, end;\r\n function coords(ch, bias) {\r\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\r\n }\r\n\r\n function wrapX(pos, dir, side) {\r\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\r\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\r\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\r\n return coords(ch, prop)[prop]\r\n }\r\n\r\n var order = getOrder(lineObj, doc.direction);\r\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\r\n var ltr = dir == \"ltr\";\r\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\r\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\r\n\r\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\r\n var first = i == 0, last = !order || i == order.length - 1;\r\n if (toPos.top - fromPos.top <= 3) { // Single line\r\n var openLeft = (docLTR ? openStart : openEnd) && first;\r\n var openRight = (docLTR ? openEnd : openStart) && last;\r\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\r\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\r\n add(left, fromPos.top, right - left, fromPos.bottom);\r\n } else { // Multiple lines\r\n var topLeft, topRight, botLeft, botRight;\r\n if (ltr) {\r\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\r\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\r\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\r\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\r\n } else {\r\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\r\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\r\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\r\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\r\n }\r\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\r\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\r\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\r\n }\r\n\r\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\r\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\r\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\r\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\r\n });\r\n return {start: start, end: end}\r\n }\r\n\r\n var sFrom = range$$1.from(), sTo = range$$1.to();\r\n if (sFrom.line == sTo.line) {\r\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\r\n } else {\r\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\r\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\r\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\r\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\r\n if (singleVLine) {\r\n if (leftEnd.top < rightStart.top - 2) {\r\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\r\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\r\n } else {\r\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\r\n }\r\n }\r\n if (leftEnd.bottom < rightStart.top)\r\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\r\n }\r\n\r\n output.appendChild(fragment);\r\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var fromPos = coords(from, dir == \"ltr\" ? \"left\" : \"right\");\n var toPos = coords(to - 1, dir == \"ltr\" ? \"right\" : \"left\");\n if (dir == \"ltr\") {\n var fromLeft = fromArg == null && from == 0 ? leftSide : fromPos.left;\n var toRight = toArg == null && to == lineLen ? rightSide : toPos.right;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(fromLeft, toPos.top, toRight - fromLeft, toPos.bottom);\n } else { // Multiple lines\n add(fromLeft, fromPos.top, null, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(leftSide, toPos.top, toPos.right, toPos.bottom);\n }\n } else if (from < to) { // RTL\n var fromRight = fromArg == null && from == 0 ? rightSide : fromPos.right;\n var toLeft = toArg == null && to == lineLen ? leftSide : toPos.left;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(toLeft, toPos.top, fromRight - toLeft, toPos.bottom);\n } else { // Multiple lines\n var topLeft = leftSide;\n if (i) {\n var topEnd = wrappedLineExtentChar(cm, lineObj, null, from).end;\n // The coordinates returned for an RTL wrapped space tend to\n // be complete bogus, so try to skip that here.\n topLeft = coords(topEnd - (/\\s/.test(lineObj.text.charAt(topEnd - 1)) ? 2 : 1), \"left\").left;\n }\n add(topLeft, fromPos.top, fromRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n var botWidth = null;\n if (i < order.length - 1 || true) {\n var botStart = wrappedLineExtentChar(cm, lineObj, null, to).begin;\n botWidth = coords(botStart, \"right\").right - toLeft;\n }\n add(toLeft, toPos.top, botWidth, toPos.bottom);\n }\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "showCursor() {\n this.canvas.style.cursor = CURRENT_CURSOR;\n }", "function Cursor (position, selectionEnd) {\n this.position = position;\n this.selectionEnd = selectionEnd;\n }", "function Cursor (position, selectionEnd) {\n this.position = position;\n this.selectionEnd = selectionEnd;\n }", "function drawCursor() {\n cursorContext.clearRect(0, 0, cursorCanvas.width, cursorCanvas.height);\n\n cursorContext.beginPath();\n cursorContext.arc(mouseX, mouseY, mouseWidth, 0, 2 * Math.PI, true);\n cursorContext.fillStyle = '#FF6A6A'\n cursorContext.fill();\n cursorContext.lineWidth = 1;\n cursorContext.strokeStyle = \"black\"\n cursorContext.stroke();\n }", "function drawCursor(x,y,w,h){\n\tvar canvas = document.getElementById(\"myCanvas\");\n\tif (canvas.getContext) {\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tctx.strokeStyle = \"red\";\n\t\tctx.lineWidth = 1;\n\t\tctx.strokeRect(x,y,w,h);\n\t}\n}", "function updateCursor() {\n var start, end, x, y, i, el, cls;\n\n if (typeof cursor === 'undefined') {\n return;\n }\n\n if (cursor.getAttribute('id') !== 'cursor') {\n return;\n }\n\n start = input.selectionStart;\n end = input.selectionEnd;\n if (start > end) {\n end = input.selectionStart;\n start = input.selectionEnd;\n }\n\n if (editor.childNodes.length <= start) {\n return;\n }\n\n el = editor.childNodes[start];\n if (el) {\n x = el.offsetLeft;\n y = el.offsetTop;\n cursor.style.left = x + 'px';\n cursor.style.top = y + 'px';\n cursor.style.opacity = 1;\n }\n\n // If there is a selection, add the CSS class 'selected'\n // to all nodes inside the selection range.\n cursor.style.opacity = (start === end) ? 1 : 0;\n for (i = 0; i < editor.childNodes.length; i += 1) {\n el = editor.childNodes[i];\n cls = el.getAttribute('class');\n if (cls !== null) {\n cls = cls.replace(' selected', '');\n if (i >= start && i < end) {\n cls += ' selected';\n }\n el.setAttribute('class', cls);\n }\n }\n }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function drawSelectionCursor(cm, head, output) {\n\t\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\t\n\t\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t\t cursor.style.left = pos.left + \"px\";\n\t\t cursor.style.top = pos.top + \"px\";\n\t\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\t\n\t\t if (pos.other) {\n\t\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t\t otherCursor.style.display = \"\";\n\t\t otherCursor.style.left = pos.other.left + \"px\";\n\t\t otherCursor.style.top = pos.other.top + \"px\";\n\t\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t\t }\n\t\t }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function changeCursor(newCursor) {\n canvas.style.cursor = newCursor\n}", "function drawSelectionCursor(cm, head, output) {\n\t\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t\t cursor.style.left = pos.left + \"px\";\n\t\t cursor.style.top = pos.top + \"px\";\n\t\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t\t if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n\t\t var charPos = charCoords(cm, head, \"div\", null, null);\n\t\t var width = charPos.right - charPos.left;\n\t\t cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n\t\t }\n\n\t\t if (pos.other) {\n\t\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t\t otherCursor.style.display = \"\";\n\t\t otherCursor.style.left = pos.other.left + \"px\";\n\t\t otherCursor.style.top = pos.other.top + \"px\";\n\t\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t\t }\n\t\t }", "function putCursor (color) {\r\n return \"<font color='\" + color + \"'>\" + this.cursor + \"</font>\";\r\n}", "cursorTo() {}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "startDraw() {\n\t\tif (this.cursorVisible != false) {\n\t\t\tthis.write(\"\\x1B[?25l\");\n\t\t\tthis.cursorVisible = false;\n\t\t}\n\t\tthis.write(\"\\x1B7\"); //save cursor pos\n\t}", "function drawSelectionCursor(cm, head, output) {\r\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\r\n\r\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\r\n cursor.style.left = pos.left + \"px\";\r\n cursor.style.top = pos.top + \"px\";\r\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\r\n\r\n if (pos.other) {\r\n // Secondary cursor, shown when on a 'jump' in bi-directional text\r\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\r\n otherCursor.style.display = \"\";\r\n otherCursor.style.left = pos.other.left + \"px\";\r\n otherCursor.style.top = pos.other.top + \"px\";\r\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\r\n }\r\n}", "function addAlongLine(startX, startY, range, xstep, ystep){\n for (let i = 0; i <= range; i++){\n mouseAddAt(startX + int(i * xstep), startY + int(i * ystep));\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}" ]
[ "0.69801736", "0.69801736", "0.69801736", "0.69801736", "0.69801736", "0.69801736", "0.69801736", "0.6950206", "0.68451244", "0.6837227", "0.6837227", "0.6837227", "0.6837227", "0.6835953", "0.6835953", "0.6835953", "0.6835953", "0.68251777", "0.68251777", "0.6819444", "0.68056154", "0.6804944", "0.6797155", "0.6787714", "0.6781747", "0.6753853", "0.6753853", "0.6753853", "0.6753853", "0.6753853", "0.6753853", "0.6753853", "0.6753853", "0.67530084", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6729603", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6727764", "0.6692844", "0.66042197", "0.6592314", "0.6592314", "0.63183033", "0.6267487", "0.62303406", "0.62059176", "0.62059176", "0.6200272", "0.61887014", "0.6167166", "0.614072", "0.61360097", "0.6110773", "0.6097496", "0.6097496", "0.6091285", "0.6091285", "0.6080175", "0.6078235", "0.60752225", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428", "0.6073428" ]
0.6168477
78
Draws the given range as a highlighted selection
function drawSelectionRange(cm, range$$1, output) { var display = cm.display, doc = cm.doc; var fragment = document.createDocumentFragment(); var padding = paddingH(cm.display), leftSide = padding.left; var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; var docLTR = doc.direction == "ltr"; function add(left, top, width, bottom) { if (top < 0) { top = 0; } top = Math.round(top); bottom = Math.round(bottom); fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); } function drawForLine(line, fromArg, toArg) { var lineObj = getLine(doc, line); var lineLen = lineObj.text.length; var start, end; function coords(ch, bias) { return charCoords(cm, Pos(line, ch), "div", lineObj, bias) } function wrapX(pos, dir, side) { var extent = wrappedLineExtentChar(cm, lineObj, null, pos); var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); return coords(ch, prop)[prop] } var order = getOrder(lineObj, doc.direction); iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { var ltr = dir == "ltr"; var fromPos = coords(from, ltr ? "left" : "right"); var toPos = coords(to - 1, ltr ? "right" : "left"); var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; var first = i == 0, last = !order || i == order.length - 1; if (toPos.top - fromPos.top <= 3) { // Single line var openLeft = (docLTR ? openStart : openEnd) && first; var openRight = (docLTR ? openEnd : openStart) && last; var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; add(left, fromPos.top, right - left, fromPos.bottom); } else { // Multiple lines var topLeft, topRight, botLeft, botRight; if (ltr) { topLeft = docLTR && openStart && first ? leftSide : fromPos.left; topRight = docLTR ? rightSide : wrapX(from, dir, "before"); botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); botRight = docLTR && openEnd && last ? rightSide : toPos.right; } else { topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); topRight = !docLTR && openStart && first ? rightSide : fromPos.right; botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); } add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); } if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } if (cmpCoords(toPos, start) < 0) { start = toPos; } if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } if (cmpCoords(toPos, end) < 0) { end = toPos; } }); return {start: start, end: end} } var sFrom = range$$1.from(), sTo = range$$1.to(); if (sFrom.line == sTo.line) { drawForLine(sFrom.line, sFrom.ch, sTo.ch); } else { var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); var singleVLine = visualLine(fromLine) == visualLine(toLine); var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; if (singleVLine) { if (leftEnd.top < rightStart.top - 2) { add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); } else { add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); } } if (leftEnd.bottom < rightStart.top) { add(leftSide, leftEnd.bottom, null, rightStart.top); } } output.appendChild(fragment); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSelectionRange(cm, range, output) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t var fragment = document.createDocumentFragment();\n\t\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\t var docLTR = doc.direction == \"ltr\";\n\n\t\t function add(left, top, width, bottom) {\n\t\t if (top < 0) { top = 0; }\n\t\t top = Math.round(top);\n\t\t bottom = Math.round(bottom);\n\t\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n\t\t }\n\n\t\t function drawForLine(line, fromArg, toArg) {\n\t\t var lineObj = getLine(doc, line);\n\t\t var lineLen = lineObj.text.length;\n\t\t var start, end;\n\t\t function coords(ch, bias) {\n\t\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n\t\t }\n\n\t\t function wrapX(pos, dir, side) {\n\t\t var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n\t\t var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n\t\t var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n\t\t return coords(ch, prop)[prop]\n\t\t }\n\n\t\t var order = getOrder(lineObj, doc.direction);\n\t\t iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n\t\t var ltr = dir == \"ltr\";\n\t\t var fromPos = coords(from, ltr ? \"left\" : \"right\");\n\t\t var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n\t\t var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n\t\t var first = i == 0, last = !order || i == order.length - 1;\n\t\t if (toPos.top - fromPos.top <= 3) { // Single line\n\t\t var openLeft = (docLTR ? openStart : openEnd) && first;\n\t\t var openRight = (docLTR ? openEnd : openStart) && last;\n\t\t var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n\t\t var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n\t\t add(left, fromPos.top, right - left, fromPos.bottom);\n\t\t } else { // Multiple lines\n\t\t var topLeft, topRight, botLeft, botRight;\n\t\t if (ltr) {\n\t\t topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n\t\t topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n\t\t botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n\t\t botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n\t\t } else {\n\t\t topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n\t\t topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n\t\t botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n\t\t botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n\t\t }\n\t\t add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n\t\t if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n\t\t add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n\t\t }\n\n\t\t if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n\t\t if (cmpCoords(toPos, start) < 0) { start = toPos; }\n\t\t if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n\t\t if (cmpCoords(toPos, end) < 0) { end = toPos; }\n\t\t });\n\t\t return {start: start, end: end}\n\t\t }\n\n\t\t var sFrom = range.from(), sTo = range.to();\n\t\t if (sFrom.line == sTo.line) {\n\t\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t\t } else {\n\t\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t\t if (singleVLine) {\n\t\t if (leftEnd.top < rightStart.top - 2) {\n\t\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t\t } else {\n\t\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t\t }\n\t\t }\n\t\t if (leftEnd.bottom < rightStart.top)\n\t\t { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n\t\t }\n\n\t\t output.appendChild(fragment);\n\t\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t var fragment = document.createDocumentFragment();\n\t\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\t\n\t\t function add(left, top, width, bottom) {\n\t\t if (top < 0) top = 0;\n\t\t top = Math.round(top);\n\t\t bottom = Math.round(bottom);\n\t\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t\t \"px; height: \" + (bottom - top) + \"px\"));\n\t\t }\n\t\t\n\t\t function drawForLine(line, fromArg, toArg) {\n\t\t var lineObj = getLine(doc, line);\n\t\t var lineLen = lineObj.text.length;\n\t\t var start, end;\n\t\t function coords(ch, bias) {\n\t\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t\t }\n\t\t\n\t\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t\t if (from == to) {\n\t\t rightPos = leftPos;\n\t\t left = right = leftPos.left;\n\t\t } else {\n\t\t rightPos = coords(to - 1, \"right\");\n\t\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t\t left = leftPos.left;\n\t\t right = rightPos.right;\n\t\t }\n\t\t if (fromArg == null && from == 0) left = leftSide;\n\t\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t\t add(left, leftPos.top, null, leftPos.bottom);\n\t\t left = leftSide;\n\t\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t\t }\n\t\t if (toArg == null && to == lineLen) right = rightSide;\n\t\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t\t start = leftPos;\n\t\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t\t end = rightPos;\n\t\t if (left < leftSide + 1) left = leftSide;\n\t\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t\t });\n\t\t return {start: start, end: end};\n\t\t }\n\t\t\n\t\t var sFrom = range.from(), sTo = range.to();\n\t\t if (sFrom.line == sTo.line) {\n\t\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t\t } else {\n\t\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t\t if (singleVLine) {\n\t\t if (leftEnd.top < rightStart.top - 2) {\n\t\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t\t } else {\n\t\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t\t }\n\t\t }\n\t\t if (leftEnd.bottom < rightStart.top)\n\t\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t\t }\n\t\t\n\t\t output.appendChild(fragment);\n\t\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) top = 0;\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n \"px; height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) left = leftSide;\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n }\n if (toArg == null && to == lineLen) right = rightSide;\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n start = leftPos;\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n end = rightPos;\n if (left < leftSide + 1) left = leftSide;\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end};\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\r\n var display = cm.display, doc = cm.doc;\r\n var fragment = document.createDocumentFragment();\r\n var padding = paddingH(cm.display), leftSide = padding.left;\r\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\r\n var docLTR = doc.direction == \"ltr\";\r\n\r\n function add(left, top, width, bottom) {\r\n if (top < 0) { top = 0; }\r\n top = Math.round(top);\r\n bottom = Math.round(bottom);\r\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\r\n }\r\n\r\n function drawForLine(line, fromArg, toArg) {\r\n var lineObj = getLine(doc, line);\r\n var lineLen = lineObj.text.length;\r\n var start, end;\r\n function coords(ch, bias) {\r\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\r\n }\r\n\r\n function wrapX(pos, dir, side) {\r\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\r\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\r\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\r\n return coords(ch, prop)[prop]\r\n }\r\n\r\n var order = getOrder(lineObj, doc.direction);\r\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\r\n var ltr = dir == \"ltr\";\r\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\r\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\r\n\r\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\r\n var first = i == 0, last = !order || i == order.length - 1;\r\n if (toPos.top - fromPos.top <= 3) { // Single line\r\n var openLeft = (docLTR ? openStart : openEnd) && first;\r\n var openRight = (docLTR ? openEnd : openStart) && last;\r\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\r\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\r\n add(left, fromPos.top, right - left, fromPos.bottom);\r\n } else { // Multiple lines\r\n var topLeft, topRight, botLeft, botRight;\r\n if (ltr) {\r\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\r\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\r\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\r\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\r\n } else {\r\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\r\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\r\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\r\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\r\n }\r\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\r\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\r\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\r\n }\r\n\r\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\r\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\r\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\r\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\r\n });\r\n return {start: start, end: end}\r\n }\r\n\r\n var sFrom = range$$1.from(), sTo = range$$1.to();\r\n if (sFrom.line == sTo.line) {\r\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\r\n } else {\r\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\r\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\r\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\r\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\r\n if (singleVLine) {\r\n if (leftEnd.top < rightStart.top - 2) {\r\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\r\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\r\n } else {\r\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\r\n }\r\n }\r\n if (leftEnd.bottom < rightStart.top)\r\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\r\n }\r\n\r\n output.appendChild(fragment);\r\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range, output) {\r\n var display = cm.display, doc = cm.doc;\r\n var fragment = document.createDocumentFragment();\r\n var padding = paddingH(cm.display), leftSide = padding.left, rightSide = display.lineSpace.offsetWidth - padding.right;\r\n\r\n function add(left, top, width, bottom) {\r\n if (top < 0) top = 0;\r\n top = Math.round(top);\r\n bottom = Math.round(bottom);\r\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\r\n \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\r\n \"px; height: \" + (bottom - top) + \"px\"));\r\n }\r\n\r\n function drawForLine(line, fromArg, toArg) {\r\n var lineObj = getLine(doc, line);\r\n var lineLen = lineObj.text.length;\r\n var start, end;\r\n function coords(ch, bias) {\r\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\r\n }\r\n\r\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\r\n var leftPos = coords(from, \"left\"), rightPos, left, right;\r\n if (from == to) {\r\n rightPos = leftPos;\r\n left = right = leftPos.left;\r\n } else {\r\n rightPos = coords(to - 1, \"right\");\r\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\r\n left = leftPos.left;\r\n right = rightPos.right;\r\n }\r\n if (fromArg == null && from == 0) left = leftSide;\r\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\r\n add(left, leftPos.top, null, leftPos.bottom);\r\n left = leftSide;\r\n if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\r\n }\r\n if (toArg == null && to == lineLen) right = rightSide;\r\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\r\n start = leftPos;\r\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\r\n end = rightPos;\r\n if (left < leftSide + 1) left = leftSide;\r\n add(left, rightPos.top, right - left, rightPos.bottom);\r\n });\r\n return {start: start, end: end};\r\n }\r\n\r\n var sFrom = range.from(), sTo = range.to();\r\n if (sFrom.line == sTo.line) {\r\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\r\n } else {\r\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\r\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\r\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\r\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\r\n if (singleVLine) {\r\n if (leftEnd.top < rightStart.top - 2) {\r\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\r\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\r\n } else {\r\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\r\n }\r\n }\r\n if (leftEnd.bottom < rightStart.top)\r\n add(leftSide, leftEnd.bottom, null, rightStart.top);\r\n }\r\n\r\n output.appendChild(fragment);\r\n }", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}", "function drawSelectionRange(cm, range, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\n\t function add(left, top, width, bottom) {\n\t if (top < 0) top = 0;\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left +\n\t \"px; top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) +\n\t \"px; height: \" + (bottom - top) + \"px\"));\n\t }\n\t\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n\t }\n\t\n\t iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) left = leftSide;\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);\n\t }\n\t if (toArg == null && to == lineLen) right = rightSide;\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t start = leftPos;\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t end = rightPos;\n\t if (left < leftSide + 1) left = leftSide;\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end};\n\t }\n\t\n\t var sFrom = range.from(), sTo = range.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t add(leftSide, leftEnd.bottom, null, rightStart.top);\n\t }\n\t\n\t output.appendChild(fragment);\n\t }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc\n var fragment = document.createDocumentFragment()\n var padding = paddingH(cm.display), leftSide = padding.left\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0 }\n top = Math.round(top)\n bottom = Math.round(bottom)\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")))\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line)\n var lineLen = lineObj.text.length\n var start, end\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right\n if (from == to) {\n rightPos = leftPos\n left = right = leftPos.left\n } else {\n rightPos = coords(to - 1, \"right\")\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }\n left = leftPos.left\n right = rightPos.right\n }\n if (fromArg == null && from == 0) { left = leftSide }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom)\n left = leftSide\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }\n }\n if (toArg == null && to == lineLen) { right = rightSide }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos }\n if (left < leftSide + 1) { left = leftSide }\n add(left, rightPos.top, right - left, rightPos.bottom)\n })\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to()\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch)\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)\n var singleVLine = visualLine(fromLine) == visualLine(toLine)\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top) }\n }\n\n output.appendChild(fragment)\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var fromPos = coords(from, dir == \"ltr\" ? \"left\" : \"right\");\n var toPos = coords(to - 1, dir == \"ltr\" ? \"right\" : \"left\");\n if (dir == \"ltr\") {\n var fromLeft = fromArg == null && from == 0 ? leftSide : fromPos.left;\n var toRight = toArg == null && to == lineLen ? rightSide : toPos.right;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(fromLeft, toPos.top, toRight - fromLeft, toPos.bottom);\n } else { // Multiple lines\n add(fromLeft, fromPos.top, null, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(leftSide, toPos.top, toPos.right, toPos.bottom);\n }\n } else if (from < to) { // RTL\n var fromRight = fromArg == null && from == 0 ? rightSide : fromPos.right;\n var toLeft = toArg == null && to == lineLen ? leftSide : toPos.left;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(toLeft, toPos.top, fromRight - toLeft, toPos.bottom);\n } else { // Multiple lines\n var topLeft = leftSide;\n if (i) {\n var topEnd = wrappedLineExtentChar(cm, lineObj, null, from).end;\n // The coordinates returned for an RTL wrapped space tend to\n // be complete bogus, so try to skip that here.\n topLeft = coords(topEnd - (/\\s/.test(lineObj.text.charAt(topEnd - 1)) ? 2 : 1), \"left\").left;\n }\n add(topLeft, fromPos.top, fromRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n var botWidth = null;\n if (i < order.length - 1 || true) {\n var botStart = wrappedLineExtentChar(cm, lineObj, null, to).begin;\n botWidth = coords(botStart, \"right\").right - toLeft;\n }\n add(toLeft, toPos.top, botWidth, toPos.bottom);\n }\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "highlightRange(range) {\n let span = document.createElement('span');\n span.classList.add(SELECTED_CLS);\n let spans = [span];\n\n // If the selection starts and ends in different containers\n if (range.startContainer !== range.endContainer) {\n let startRange = new Range();\n let startSpan = span.cloneNode();\n startRange.setStart(range.startContainer, range.startOffset);\n startRange.setEnd(range.startContainer, range.startContainer.length);\n startRange.surroundContents(startSpan);\n spans.push(startSpan);\n\n let endRange = new Range();\n let endSpan = span.cloneNode();\n endRange.setStart(range.endContainer, 0);\n endRange.setEnd(range.endContainer, range.endOffset);\n endRange.surroundContents(endSpan);\n spans.push(endSpan);\n\n // Get nodes between the start and end containers\n let betweenNodes = getBetweenNodes(startSpan, endSpan, range.commonAncestorContainer);\n betweenNodes.forEach((n) => {\n let range = new Range();\n if (n instanceof Text) {\n let s = span.cloneNode();\n range.setStart(n, 0);\n range.setEnd(n, n.length);\n range.surroundContents(s);\n spans.push(s);\n } else {\n // Just re-use existing span\n n.classList.add(SELECTED_CLS);\n [...n.querySelectorAll('span')].forEach((s) => {\n s.classList.add(SELECTED_CLS);\n });\n }\n });\n } else {\n range.surroundContents(span);\n }\n return spans;\n }", "function highlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n var range = selection.getRangeAt(0).cloneRange();\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n range.surroundContents(highlightNode);\n selection.removeAllRanges();\n }\n }\n}", "function selectRange(range, window) {\n var selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n }", "function drawSelections() {\n\t\thideSelectionRect();\n\t}", "highlight_correct() {\n\t\t\tthis.selection_board.get_shape(this.shape).set_highlight('green');\n\t\t\tthis.selection_board.draw();\n\t\t}", "function applySelection(data){\n\n if(data.user != username){\n\n var editorSession = editor.getSession();\n var start = data.range.start;\n var end = data.range.end;\n var r = new Range(start.row, start.column, end.row, end.column);\n var lineStyle = isDriver ? \"navigator\" : \"driver\";\n\n for(var i in editorSession.getMarkers(false)){\n editorSession.removeMarker(i);\n }\n\n editorSession.addMarker(r, \"line-style-\" + lineStyle, \"text\", false);\n }\n}", "function drawSelection() {\n\t\t\tif(prevSelection != null &&\n\t\t\t\tselection.first.x == prevSelection.first.x &&\n\t\t\t\tselection.first.y == prevSelection.first.y && \n\t\t\t\tselection.second.x == prevSelection.second.x &&\n\t\t\t\tselection.second.y == prevSelection.second.y)\n\t\t\t\treturn;\n\t\t\t\n\t\t\toctx.strokeStyle = parseColor(options.selection.color).scale(null, null, null, 0.8).toString();\n\t\t\toctx.lineWidth = 1;\n\t\t\tctx.lineJoin = 'round';\n\t\t\toctx.fillStyle = parseColor(options.selection.color).scale(null, null, null, 0.4).toString();\n\n\t\t\tprevSelection = { first: { x: selection.first.x,\n\t\t\t\t\t\t\t\t\t\ty: selection.first.y },\n\t\t\t\t\t\t\t second: { x: selection.second.x,\n\t\t\t\t\t\t\t\t\t\ty: selection.second.y } };\n\n\t\t\tvar x = Math.min(selection.first.x, selection.second.x),\n\t\t\t\ty = Math.min(selection.first.y, selection.second.y),\n\t\t\t\tw = Math.abs(selection.second.x - selection.first.x),\n\t\t\t\th = Math.abs(selection.second.y - selection.first.y);\n\t\t\t\n\t\t\toctx.fillRect(x + plotOffset.left, y + plotOffset.top, w, h);\n\t\t\toctx.strokeRect(x + plotOffset.left, y + plotOffset.top, w, h);\n\t\t}", "function updateDrawSelectionRectangle(x, y, w, h) {\r\n d3.selectAll(\".selection\")\r\n .attr(\"x\", x)\r\n .attr(\"y\", y)\r\n .attr(\"width\", w)\r\n .attr(\"height\", h);\r\n return;\r\n}", "function render_range(selection, i, max, opacity) {\n\t\tvar j=0;\n\t\tvar k=null;\n\t\t\n\t\tangular.forEach(selection.slice(i,max),function(d) {\n\t\t var o = {}; \n\t\t for(key in d){\n\t\t\t\t o[key]=d[key];\n\t\t\t break;\n\t\t }\n\t\t for(k in o){\n\t\t\t path(d, foreground, color(o[k],opacity));\n\t\t }\n\t\t j++;\n\t });\n\t}", "function SelectionRegion() {}", "function SelectionRegion() {}", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function selectionChange(e) {\n var pointRng;\n\n // Check if the button is down or not\n if (e.button) {\n // Create range from mouse position\n pointRng = rngFromPoint(e.pageX, e.pageY);\n\n if (pointRng) {\n // Check if pointRange is before/after selection then change the endPoint\n if (pointRng.compareEndPoints('StartToStart', startRng) > 0)\n pointRng.setEndPoint('StartToStart', startRng);\n else\n pointRng.setEndPoint('EndToEnd', startRng);\n\n pointRng.select();\n }\n } else {\n endSelection();\n }\n }", "function drawSelectionCursor(cm, range, output) {\r\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\r\n\r\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\r\n cursor.style.left = pos.left + \"px\";\r\n cursor.style.top = pos.top + \"px\";\r\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\r\n\r\n if (pos.other) {\r\n // Secondary cursor, shown when on a 'jump' in bi-directional text\r\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\r\n otherCursor.style.display = \"\";\r\n otherCursor.style.left = pos.other.left + \"px\";\r\n otherCursor.style.top = pos.other.top + \"px\";\r\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\r\n }\r\n }", "function render_range(selection, i, max, opacity) {\n selection.slice(i,max).forEach(function(d) {\n path(d, foreground, color(d.group,opacity));\n });\n}", "function updateRangeSelection() {\n\td3.selectAll('#details div.range').style('display', function() {\n\t\treturn (d3.select(this).classed(sn.runtime.powerIOAreaParameters.aggregate.toLowerCase()) ? 'block' : 'none');\n\t});\n}", "function highlight(target){\n var opts = $.data(target, 'timespinner').options;\n var start = 0, end = 0;\n if (opts.highlight == 0){\n start = 0;\n end = 2;\n } else if (opts.highlight == 1){\n start = 3;\n end = 5;\n } else if (opts.highlight == 2){\n start = 6;\n end = 8;\n }\n if (target.selectionStart != null){\n target.setSelectionRange(start, end);\n } else if (target.createTextRange){\n var range = target.createTextRange();\n range.collapse();\n range.moveEnd('character', end);\n range.moveStart('character', start);\n range.select();\n }\n $(target).focus();\n }", "setSelectionRange(range) {\n this.editor.selection = new vscode.Selection(range.start.row, range.start.column, range.end.row, range.end.column);\n }", "function updateRangeSelection() {\n\td3.selectAll('#details div.range').style('display', function() {\n\t\treturn (d3.select(this).classed(sn.runtime.energyBarOverlapParameters.aggregate.toLowerCase()) ? 'block' : 'none');\n\t});\n}", "function highlight() {\n d3.select(this).classed('selected', true)\n }", "function unHighlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n\n var range = selection.getRangeAt(0).cloneRange();\n var node = $(range.commonAncestorContainer);\n\n var previousRange = document.createRange();\n previousRange.setStart(range.startContainer, 0);\n previousRange.setEnd(range.startContainer, range.startOffset);\n\n var nextRange = document.createRange();\n nextRange.setStart(range.endContainer, range.endOffset);\n nextRange.setEnd(range.endContainer, 0);\n\n node.unwrap();\n previousRange.surroundContents(highlightNode);\n nextRange.surroundContents(highlightNode);\n\n selection.removeAllRanges();\n selection.addRange(previousRange);\n selection.addRange(nextRange);\n }\n }\n}", "function drawSelectionSquare() {\n // Draw directly on the main graphics\n graphics2D.lineStyle(2, 0x00FF00, 1);\n graphics2D.drawRect(rendererGeneralState.eventState.lastDownPoint.x, rendererGeneralState.eventState.lastDownPoint.y, (rendererGeneralState.eventState.currentPoint.x - rendererGeneralState.eventState.lastDownPoint.x), (rendererGeneralState.eventState.currentPoint.y - rendererGeneralState.eventState.lastDownPoint.y));\n }", "function notifyRangeCoords() {\n var coords = getSelectionCoords();\n window.TextSelection.jsLog(\"logRangeCoords \" + coords.left + \"-\" + coords.top + \"-\" + coords.bottom + \"-\" + coords.right);\n\n var sel = getSelectionColorAndFontSize();\n var fontSize = 0;\n if (sel) {\n fontSize = sel.fontSize;\n window.TextSelection.jsLog(\"logRangeCoords font \" + fontSize);\n }\n\n window.TextSelection.notifyRangeCoords(parseInt(coords.left, 10),\n parseInt(coords.top, 10),\n parseInt(coords.bottom, 10),\n parseInt(coords.right, 10),\n parseInt(fontSize, 10));\n}", "function highlightAnnotation(range, role){\n var s = range.start;\n var e = range.end;\n var r = new Range(s.row, s.column, e.row, e.column);\n currentHighlight = editor.getSession().addMarker(r,\"line-style-\" + role, \"text\");\n}", "function restoreSelection(range) {\n if (range) {\n if (window.getSelection) {\n sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n } else if (document.selection && range.select) {\n range.select();\n }\n }\n }", "highlightSelection(isSelectionChanged) {\n if (this.owner.enableImageResizerMode) {\n this.owner.imageResizerModule.hideImageResizer();\n }\n if (this.isEmpty) {\n if (this.isHideSelection(this.start.paragraph)) {\n this.hideCaret();\n return;\n }\n this.updateCaretPosition();\n }\n else {\n if (this.isForward) {\n this.highlightSelectedContent(this.start, this.end);\n }\n else {\n this.highlightSelectedContent(this.end, this.start);\n }\n if (this.viewer.isComposingIME) {\n this.updateCaretPosition();\n }\n }\n this.viewer.updateTouchMarkPosition();\n if (isSelectionChanged) {\n this.viewer.scrollToPosition(this.start, this.end);\n }\n }", "function selectionChange(e) {\n\t\t\t\tvar pointRng;\n\n\t\t\t\t// Check if the button is down or not\n\t\t\t\tif (e.button) {\n\t\t\t\t\t// Create range from mouse position\n\t\t\t\t\tpointRng = rngFromPoint(e.x, e.y);\n\n\t\t\t\t\tif (pointRng) {\n\t\t\t\t\t\t// Check if pointRange is before/after selection then change the endPoint\n\t\t\t\t\t\tif (pointRng.compareEndPoints('StartToStart', startRng) > 0) {\n\t\t\t\t\t\t\tpointRng.setEndPoint('StartToStart', startRng);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpointRng.setEndPoint('EndToEnd', startRng);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpointRng.select();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tendSelection();\n\t\t\t\t}\n\t\t\t}", "function selectionChange(e) {\n\t\t\t\tvar pointRng;\n\n\t\t\t\t// Check if the button is down or not\n\t\t\t\tif (e.button) {\n\t\t\t\t\t// Create range from mouse position\n\t\t\t\t\tpointRng = rngFromPoint(e.x, e.y);\n\n\t\t\t\t\tif (pointRng) {\n\t\t\t\t\t\t// Check if pointRange is before/after selection then change the endPoint\n\t\t\t\t\t\tif (pointRng.compareEndPoints('StartToStart', startRng) > 0) {\n\t\t\t\t\t\t\tpointRng.setEndPoint('StartToStart', startRng);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpointRng.setEndPoint('EndToEnd', startRng);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpointRng.select();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tendSelection();\n\t\t\t\t}\n\t\t\t}", "function selectionChange(e) {\n\t\t\t\tvar pointRng;\n\n\t\t\t\t// Check if the button is down or not\n\t\t\t\tif (e.button) {\n\t\t\t\t\t// Create range from mouse position\n\t\t\t\t\tpointRng = rngFromPoint(e.x, e.y);\n\n\t\t\t\t\tif (pointRng) {\n\t\t\t\t\t\t// Check if pointRange is before/after selection then change the endPoint\n\t\t\t\t\t\tif (pointRng.compareEndPoints('StartToStart', startRng) > 0) {\n\t\t\t\t\t\t\tpointRng.setEndPoint('StartToStart', startRng);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpointRng.setEndPoint('EndToEnd', startRng);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpointRng.select();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tendSelection();\n\t\t\t\t}\n\t\t\t}", "function TStylingRange() {}", "function TStylingRange() {}", "selectRange(startPosition, endPosition) {\n this.start.setPositionInternal(startPosition);\n this.end.setPositionInternal(endPosition);\n this.upDownSelectionLength = this.end.location.x;\n this.fireSelectionChanged(true);\n }", "function TStylingRange() { }", "function highlight_period(x_start, x_end, color) {\n var width = x_end - x_start;\n canvas.fillStyle = color;\n canvas.fillRect(x_start, area.y, width, area.h);\n }", "function createHighlight() {\n\n let highlightElement = document.createElement(\"div\");\n highlightElement.style.zIndex = 0;\n\n let boundingClientRect = window.getSelection().getRangeAt(0).getBoundingClientRect();\n\n highlightElement.style.position = \"absolute\";\n highlightElement.style.left = `${boundingClientRect.left}px`;\n highlightElement.style.top = `${boundingClientRect.top}px`;\n highlightElement.style.width = `${boundingClientRect.width}px`;\n highlightElement.style.height = `${boundingClientRect.height}px`;\n\n highlightElement.style.backgroundColor = 'yellow';\n highlightElement.style.opacity=\"0.3\";\n\n // FIXME: insert this into the page element.. to the parent div... there is a\n // get common parent method that I should probably use.\n\n document.body.appendChild(highlightElement);\n\n // FIXME: now clear the selection once this is done.\n\n // FIXME: the highlight should/could be BELOW the text and probably should\n // be until it's deleted I think.\n\n}", "function setSelectionRange( rangeStart, rangeEnd )\n {\n // Check which way we need to define the text range.\n if( this.createTextRange )\n {\n var range = this.createTextRange();\n range.collapse( true );\n range.moveStart( 'character',\trangeStart );\n range.moveEnd( 'character',\t\trangeEnd-rangeStart );\n range.select();\n }\n\n // Alternate setSelectionRange method for supporting browsers.\n else if( this.setSelectionRange )\n {\n this.focus();\n this.setSelectionRange( rangeStart, rangeEnd );\n }\n }", "function highlightMultiple(start, end, passage, id) {\n // ignore margins between elements\n $(passage).find('#selection').contents().unwrap();\n if(start.is(end)) { // single element\n $(start).wrapAll(\"<span class='term event\" + id + \"term' id='selection'/>\");\n } else { // if range of elements\n if($(passage).find('span').index(start) > $(passage).find('span').index(end)) { // swap if end is before start\n var temp = end;\n end = start;\n start = temp;\n }\n \n \n if(!start.parent().not($('#selection')).is(end.parent().not($('#selection')))) {\n // common parent element\n var common = end.parents().not($('#selection')).has(start).first();\n \n if(start.parent('.term').not(common).length) { // if word has a parent term\n start = $(common).children().has(start);\n // $(start).parent('.term');\n }\n \n if(end.parent('.term').not(common).length) {\n end = $(common).children().has(end);\n //end = $(end).parent('.term');\n }\n }\n // highlight range\n $(start).nextUntil(end.next()).andSelf().wrapAll(\"<span class='term event\" + id + \"term' id='selection' />\");\n }\n }", "highlight(on) { }", "function drawHighlights() {\n for (let i = 0; i < currentScenario.sceneObjects.length; i++) {\n let object = currentScenario.sceneObjects[i];\n if (object.isSelected(mousePosX, mousePosY)) {\n context.beginPath();\n context.strokeStyle = 'red';\n context.strokeRect(object.x, object.y, object.width, object.height);\n context.closePath();\n return;\n }\n }\n}", "function selectRange() {\n var frstSelect = selectedEles[0];\n var lstSelect = selectedEles[selectedEles.length - 1];\n if (cols) {\n var flipStart = flipFlipIdx(Math.min(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n var flipEnd = flipFlipIdx(Math.max(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n selectElemsDownRows(Math.min(flipStart, flipEnd), Math.max(flipStart, flipEnd));\n } else {\n var start = Math.min(selectionMinPivot, frstSelect);\n var end = Math.max(selectionMaxPivot, lstSelect);\n selectElemRange(start, end);\n }\n }", "function rangeMouseOver(color) {\n $(\"#rangeMouseOver\").html(makeSwatch(color, principal, principal));\n}", "function createSelectionRect() {\r\n selectionRect = that.surface.createRect({\r\n x: that.width, y: that.height, \r\n width: 1, height: 1}).\r\n setFill(\"yellow\");\r\n }", "function highlight_rects() {\n var all = qt.query(null, null);\n var mouse = stage.getMousePosition();\n // specifically ask for no filtering\n var ids = qt.query({x:mouse.x, y:mouse.y, w:1, h:1}, null, true);\n\n // recolor everything\n for (var i = 0; i < all.length; i++) {\n var obj = qt.obj_ids[all[i]];\n obj.rect.clear();\n obj.rect.beginFill(0x0077AA);\n obj.rect.drawRect(obj.x, obj.y, obj.w, obj.h);\n }\n // 'highlight' moused-over nodes\n for (var i = 0; i < ids.length; i++) {\n var obj = qt.obj_ids[ids[i]];\n obj.rect.clear();\n obj.rect.beginFill(0xFF0000);\n obj.rect.drawRect(obj.x, obj.y, obj.w, obj.h);\n }\n}", "function setSelectionRange(input, selectionStart, selectionEnd) {\n if (input.setSelectionRange) {\n input.focus();\n //input.setSelectionRange(selectionStart, selectionEnd);\n input.selectionStart=selectionStart;\n input.selectionEnd=selectionEnd;\n }\n else if (input.createTextRange) {\n var range = input.createTextRange();\n range.collapse(true);\n range.moveEnd('character', selectionEnd);\n range.moveStart('character', selectionStart);\n range.select();\n }\n}", "function Selection (ranges) {\n this.ranges = ranges || [];\n }", "function reselect(myWindow, startOffset, endOffset, startIndex, endIndex) {\n //scroll to the position\n //myWindow.document.getElementById(\"document\").scrollTo(0, yPosition);\n\n //reselect the selection using startIndex and endIndex\n let documentNode = myWindow.document.getElementById(\"document\");\n let node = documentNode.firstElementChild;\n let i = 0;\n let startNode;\n let endNode;\n\n while (node) {\n if (i == startIndex) {\n startNode = node;\n }\n if (i == endIndex) {\n endNode = node;\n }\n i++;\n node = node.nextElementSibling || node.nextSibling;\n }\n console.log(startNode);\n console.log(endNode);\n\n //re-create the selection using offset\n const newRange = new Range();\n console.log(startNode.firstChild.firstChild);\n\n if (startNode.firstChild.nodeName == \"STRONG\") {\n console.log(\"start strong\");\n newRange.setStart(startNode.firstChild.firstChild, startOffset);\n } else {\n newRange.setStart(startNode.firstChild, startOffset);\n }\n\n if (endNode.firstChild.nodeName == \"STRONG\") {\n console.log(\"end strong\");\n newRange.setEnd(endNode.firstChild.firstChild, endOffset);\n } else {\n console.log(endNode.firstChild);\n newRange.setEnd(endNode.firstChild, endOffset);\n }\n\n let selection = myWindow.window.getSelection();\n selection.removeAllRanges();\n selection.addRange(newRange);\n}", "function highlightSelection(e) \n{\n selection = window.getSelection();\n \n //Skip this section if mouse event is undefined\n if (e != undefined)\n {\n \n //Ignore right clicks; avoids odd behavior with CTRL key\n if (e.button == 2)\n {\n return;\n }\n\n //Exit if CTRL key is held while auto highlight is checked on\n if(imedBool && e.ctrlKey)\n {\n return;\n }\n \n //Exit if CTRL key not held and auto highlight is checked off\n if(!imedBool && !e.ctrlKey)\n {\n return;\n }\n }\n \n var selectionTagName;\n //Avoid inputs like the plague..\n try {\n selectionTagName = selection.anchorNode.childNodes[0].tagName.toLowerCase();\n } catch (err) {\n //fail silently :-D\n }\n if (selectionTagName == \"input\") {\n return;\n }\n \n // Clear all highlights if requested\n if (clearBetweenSelections && highlightedPage == true)\n {\n clearHighlightsOnPage();\n }\n \n var selectedText = window.getSelection().toString().replace(/^\\s+|\\s+$/g, \"\");\n var testText = selectedText.toLowerCase();\n \n //Exit if selection is whitespace or what was previously selected\n if (selectedText == '' || lastText == testText)\n {\n return;\n }\n \n if (selection.toString() != '') {\n var mySpan = document.createElement(\"span\");\n var prevSpan = document.getElementById(\"mySelectedSpan\");\n if (prevSpan != null) {\n prevSpan.removeAttribute(\"id\");\n }\n mySpan.id = \"mySelectedSpan\";\n var range = selection.getRangeAt(0).cloneRange();\n mySpan.appendChild(range.extractContents());\n range.insertNode(mySpan);\n }\n \n //Perform highlighting\n localSearchHighlight(selectedText, singleSearch);\n highlightedPage = true;\n \n //Store processed selection for next time this method is called\n lastText = testText;\n if (selection.toString() != '') {\n if (!triggeredOnce) {\n triggeredOnce = !triggeredOnce;\n }\n }\n}", "function highlight(target, index){\n\t\tvar opts = $.data(target, 'timespinner').options;\n\t\tif (index != undefined){\n\t\t\topts.highlight = index;\n\t\t}\n\t\tvar range = opts.selections[opts.highlight];\n\t\tif (range){\n\t\t\tvar tb = $(target).timespinner('textbox');\n\t\t\t$(target).timespinner('setSelectionRange', {start:range[0],end:range[1]});\n\t\t\ttb.focus();\n\t\t}\n\t}", "function displaySelections(){\r\n //defaults\r\n Session.set('breaksOption','origOption');\r\n Session.set('highlightElement','line');\r\n Session.set('boldElement','boldLine');\r\n Session.set('syllablesVisible','true');\r\n Session.set('stressVisible', 'true');\r\n \r\n var selectionsCursor = Selections.find({poem_id:Session.get('currentPoem')});\r\n selectionsCursor.observe({\r\n //when something is added to the Selections Collection\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n //used to catch errors\r\n if (style.length > 0){\r\n var layerNodeID = style[0].layer_id;\r\n var layerID = Layers.findOne({poem_id: Session.get('currentPoem'), id: layerNodeID})._id;\r\n //if selection is from highlighting style/layer\r\n if ((style[0].background_color !== null)&&(typeof style[0].background_color !== \"undefined\")) {\r\n var rgba = style[0].background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n var curRGBA = substring+' ';\r\n var op = Layers.findOne(layerID).opacity;\r\n var newRGBA = curRGBA+op+\")\";\r\n console.log(newRGBA);\r\n $(\".\"+location).css(\r\n {\r\n \"background\": newRGBA\r\n });\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n var substring = style[0].font_color;\r\n $(\".\"+location).css(\r\n {\r\n \"color\": substring\r\n }\r\n );\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n var substring = style[0].bold;\r\n if (substring){\r\n $(\".\"+location).css(\r\n {\r\n \"font-weight\": \"bold\"\r\n }\r\n );\r\n $(\".\"+location).addClass(\"bold\"+style[0].font_color);\r\n }\r\n }\r\n //if selection is from stressing style/layer\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n if (Session.get('stressVisible')==\"true\"){\r\n $('.'+location).css('vertical-align','super');\r\n }\r\n $('.'+location).addClass('stressStyle');\r\n }\r\n }\r\n },\r\n //when something is removed from the Selections Collection\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var curLayerNodeID = selection.layerNode_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n console.log(style);\r\n //used to catch errors\r\n if (style.length > 0){\r\n //if removed is highlighting\r\n if ((style[0].background_color !== undefined)) {\r\n //must go through all selections that may have colored line/word/character to check and\r\n //see if after one background-color is turned off, there is another (from another layer)\r\n //still coloring that line/word/character\r\n var curRGBA = \"transparent\";\r\n var allSelections = Selections.find({poem_id: Session.get('currentPoem'), location: location}).fetch();\r\n console.log(allSelections);\r\n _.each(allSelections, function(sel){\r\n var piece = sel.style_id; \r\n var otherStyle = Styles.findOne({_id: piece});\r\n if ((otherStyle !== undefined)){\r\n if ((otherStyle.background_color !== undefined)){\r\n op = Layers.findOne({id:otherStyle.layer_id}).opacity;\r\n var rgba = otherStyle.background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n curRGBA = substring;\r\n var newRGBA = curRGBA+op+\")\";\r\n if (otherStyle.layer_id != curLayerNodeID){\r\n curRGBA = newRGBA;\r\n console.log(curRGBA);\r\n }\r\n }\r\n }\r\n });\r\n $(\".\"+location).css(\r\n {\r\n \"background-color\": curRGBA\r\n }\r\n );\r\n\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n $(\".\"+location).css(\r\n {\r\n \"color\": \"black\"\r\n }\r\n );\r\n $(\".\"+location).removeClass(\"bold\"+style[0].font_color);\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n //so that word can be bolded if line is bolded\r\n $(\".\"+location).css(\"font-weight\",\"\");\r\n $(\".\"+location).css(\"color\",\"\");\r\n }\r\n //if removed selection is stressing\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n $('.'+location).css('vertical-align','baseline');\r\n $('.'+location).removeClass('stressStyle');\r\n }\r\n }\r\n }\r\n });\r\n //handles additions/removals from SyllableMarkers Collection\r\n var syllablesCursor = SyllableMarkers.find({poem_id:Session.get('currentPoem')});\r\n syllablesCursor.observe({\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n if (Session.get('syllablesVisible')==\"true\"){\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"2px solid black\"\r\n });\r\n }\r\n $(\".\"+location).addClass('syllableStyle');\r\n //updates natural syllables\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"none\"\r\n });\r\n $(\".\"+location).removeClass('syllableStyle');\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n console.log($(this).css(\"border-left\"));\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n });\r\n //handles changes from Layers Collection\r\n var layersCursor = Layers.find({poem_id:Session.get('currentPoem')});\r\n layersCursor.observe({ \r\n added: function (selection, beforeIndex) {\r\n var sessionObj = Session.get(\"layersArray\");\r\n //if layer just created, user probably wants to use it, so default \"visible\"\r\n sessionObj[selection._id] = \"visible\";\r\n Session.set(\"layersArray\", sessionObj);\r\n },\r\n });\r\n\r\n}", "function showRange() {\n\n for (var i = 0; i < N; i += 1) {\n\n var state = algo.render.kS_GRAY;\n\n if (i >= LEFT && i <= RIGHT) {\n state = algo.render.kS_BLUE;\n }\n if (i === LEFT || i === RIGHT) {\n state = algo.render.kS_RED;\n }\n if (i === M1 || i === M2) {\n state = algo.render.kS_GREEN;\n }\n A[i].element.set({\n state: state\n });\n }\n }" ]
[ "0.7518527", "0.7518195", "0.7518195", "0.7518195", "0.7518195", "0.75134164", "0.7491995", "0.7491995", "0.7491995", "0.7491995", "0.7467499", "0.74550974", "0.7454464", "0.7444052", "0.7444052", "0.7439307", "0.74364483", "0.7432532", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74276966", "0.74211615", "0.74211615", "0.74211615", "0.74211615", "0.74211615", "0.74211615", "0.74211615", "0.74211615", "0.7399893", "0.7220966", "0.69731057", "0.6611705", "0.6550389", "0.6509004", "0.64764386", "0.6396994", "0.6377514", "0.63603127", "0.63515097", "0.63515097", "0.6298624", "0.6298624", "0.6298624", "0.6298624", "0.6298624", "0.6298624", "0.6298624", "0.6284064", "0.6275827", "0.6267782", "0.6247514", "0.62109953", "0.6193513", "0.6181452", "0.61717", "0.61457163", "0.61163634", "0.6108931", "0.6044872", "0.59990233", "0.5993293", "0.59930426", "0.59930426", "0.59930426", "0.5986359", "0.5986359", "0.59694904", "0.59634596", "0.5958208", "0.59575385", "0.5935651", "0.59234035", "0.5922045", "0.59215724", "0.5916706", "0.5908725", "0.59085524", "0.5902917", "0.5897534", "0.58766294", "0.58682513", "0.58360463", "0.5832381", "0.5829067", "0.5821051" ]
0.7443068
20
Read the actual heights of the rendered lines, and update their stored heights to match.
function updateHeightsInViewport(cm) { var display = cm.display; var prevBottom = display.lineDiv.offsetTop; for (var i = 0; i < display.view.length; i++) { var cur = display.view[i], height = (void 0); if (cur.hidden) { continue } if (ie && ie_version < 8) { var bot = cur.node.offsetTop + cur.node.offsetHeight; height = bot - prevBottom; prevBottom = bot; } else { var box = cur.node.getBoundingClientRect(); height = box.bottom - box.top; } var diff = cur.line.height - height; if (height < 2) { height = textHeight(display); } if (diff > .005 || diff < -.005) { updateLineHeight(cur.line, height); updateWidgetHeight(cur.line); if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) { updateWidgetHeight(cur.rest[j]); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineHeight(){\n\t\thistoryLine.each(function(index, element){\n\t\t\tif(index == $('.line').length - 1){\n\t\t\t\treturn false;\n\t\t\t} else{\n\t\t\t\tvar thisBlock = $(this).closest('.history-item').height()/2;\n\t\t\t\tvar nextBlock = $(this).closest('.history-item').next().height()/2;\n\t\t\t\tvar h = thisBlock+nextBlock;\n\t\t\t\t$(this).height(h);\n\t\t\t}\n\t\t\t\n\t\t})\n\t}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t\t }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\r\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\r\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i],\n wrapping = cm.options.lineWrapping;\n var height = void 0,\n width = 0;\n\n if (cur.hidden) {\n continue;\n }\n\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top; // Check that lines don't extend past the right of the current\n // editor width\n\n if (!wrapping && cur.text.firstChild) {\n width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1;\n }\n }\n\n var diff = cur.line.height - height;\n\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n\n if (cur.rest) {\n for (var j = 0; j < cur.rest.length; j++) {\n updateWidgetHeight(cur.rest[j]);\n }\n }\n }\n\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n } // Read and store the height of line widgets associated with the", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t\t var w = line.widgets[i], parent = w.node.parentNode;\n\t\t if (parent) { w.height = parent.offsetHeight; }\n\t\t } }\n\t\t }", "function updateWidgetHeight(line) {\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\r\n var w = line.widgets[i], parent = w.node.parentNode;\r\n if (parent) { w.height = parent.offsetHeight; }\r\n } }\r\n}", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }\n}", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\r\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }" ]
[ "0.6847615", "0.6575622", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6532162", "0.6520374", "0.6517116", "0.6517116", "0.6511045", "0.6511045", "0.6511045", "0.6507662", "0.64917886", "0.64917886", "0.64917886", "0.6491407", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64767325", "0.64587665", "0.64527076", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.6448829", "0.64340377", "0.64340377", "0.64340377", "0.64340377", "0.64340377", "0.64340377", "0.64340377", "0.6429388", "0.6425526", "0.6420173", "0.64099437", "0.64099437", "0.64099437", "0.64099437", "0.64099437", "0.64099437", "0.64099437", "0.64099437", "0.63924086", "0.6377747", "0.6377747", "0.6377747", "0.62933725", "0.62933725", "0.62825704", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.62638444", "0.6262654", "0.6262654", "0.6262654", "0.6262654", "0.6262654", "0.6262654", "0.6262654" ]
0.62943816
79
Read and store the height of line widgets associated with the given line.
function updateWidgetHeight(line) { if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { var w = line.widgets[i], parent = w.node.parentNode; if (parent) { w.height = parent.offsetHeight; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\n }", "function updateWidgetHeight(line) {\r\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\r\n line.widgets[i].height = line.widgets[i].node.offsetHeight;\r\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n }", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)\n { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n}", "function updateWidgetHeight(line) {\r\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\r\n var w = line.widgets[i], parent = w.node.parentNode;\r\n if (parent) { w.height = parent.offsetHeight; }\r\n } }\r\n}", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t }", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)\n\t\t line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight;\n\t\t }", "function updateWidgetHeight(line) {\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n\t\t var w = line.widgets[i], parent = w.node.parentNode;\n\t\t if (parent) { w.height = parent.offsetHeight; }\n\t\t } }\n\t\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\t\t\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) break;\n\t\t else h += line.height;\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i = 0; i < p.children.length; ++i) {\n\t\t var cur = p.children[i];\n\t\t if (cur == chunk) break;\n\t\t else h += cur.height;\n\t\t }\n\t\t }\n\t\t return h;\n\t\t }", "function heightAtLine(lineObj) {\n\t\t lineObj = visualLine(lineObj);\n\n\t\t var h = 0, chunk = lineObj.parent;\n\t\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t\t var line = chunk.lines[i];\n\t\t if (line == lineObj) { break }\n\t\t else { h += line.height; }\n\t\t }\n\t\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t\t for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n\t\t var cur = p.children[i$1];\n\t\t if (cur == chunk) { break }\n\t\t else { h += cur.height; }\n\t\t }\n\t\t }\n\t\t return h\n\t\t }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n\n if (diff) {\n for (var n = line; n; n = n.parent) {\n n.height += diff;\n }\n }\n } // Given a line object, find its line number by walking up through", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\n\t lineObj = visualLine(lineObj);\n\t\n\t var h = 0, chunk = lineObj.parent;\n\t for (var i = 0; i < chunk.lines.length; ++i) {\n\t var line = chunk.lines[i];\n\t if (line == lineObj) break;\n\t else h += line.height;\n\t }\n\t for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n\t for (var i = 0; i < p.children.length; ++i) {\n\t var cur = p.children[i];\n\t if (cur == chunk) break;\n\t else h += cur.height;\n\t }\n\t }\n\t return h;\n\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) break;\r\n else h += line.height;\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i = 0; i < p.children.length; ++i) {\r\n var cur = p.children[i];\r\n if (cur == chunk) break;\r\n else h += cur.height;\r\n }\r\n }\r\n return h;\r\n }", "function updateLineHeight(line, height) {\r\n var diff = height - line.height;\r\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\r\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t\t }", "function updateLineHeight(line, height) {\n\t\t var diff = height - line.height;\n\t\t if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n\t\t }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) break;\n else h += line.height;\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i = 0; i < p.children.length; ++i) {\n var cur = p.children[i];\n if (cur == chunk) break;\n else h += cur.height;\n }\n }\n return h;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function updateLineHeight(line, height) {\n\t var diff = height - line.height;\n\t if (diff) for (var n = line; n; n = n.parent) n.height += diff;\n\t }", "function heightAtLine(lineObj) {\r\n lineObj = visualLine(lineObj);\r\n\r\n var h = 0, chunk = lineObj.parent;\r\n for (var i = 0; i < chunk.lines.length; ++i) {\r\n var line = chunk.lines[i];\r\n if (line == lineObj) { break }\r\n else { h += line.height; }\r\n }\r\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\r\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\r\n var cur = p.children[i$1];\r\n if (cur == chunk) { break }\r\n else { h += cur.height; }\r\n }\r\n }\r\n return h\r\n}", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }", "function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }" ]
[ "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.7959993", "0.79586625", "0.79324657", "0.79324657", "0.79289424", "0.7914109", "0.7914109", "0.7914109", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7900077", "0.7866175", "0.7859086", "0.7859086", "0.7859086", "0.78334785", "0.777902", "0.71254086", "0.7125148", "0.71088016", "0.7071791", "0.7071791", "0.70712084", "0.70541394", "0.70533603", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7051498", "0.7042471", "0.7040672", "0.70383674", "0.70383674", "0.70383674", "0.70383674", "0.70383674", "0.70383674", "0.70383674", "0.70377064", "0.70377064", "0.70377064", "0.70377064", "0.70377064", "0.70377064", "0.70377064", "0.70190096", "0.70190096", "0.70190096", "0.7003399", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907", "0.70019907" ]
0.786585
37
Compute the lines that are visible in a given viewport (defaults the the current scroll position). viewport may contain top, height, and ensure (see op.scrollToPos) properties.
function visibleLines(display, doc, viewport) { var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; top = Math.floor(top - paddingTop(display)); var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and // forces those lines into the viewport (if possible). if (viewport && viewport.ensure) { var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; if (ensureFrom < from) { from = ensureFrom; to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); } else if (Math.min(ensureTo, doc.lastLine()) >= to) { from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); to = ensureTo; } } return {from: from, to: Math.max(to, from + 1)} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = _lineAtHeight(doc, top),\n to = _lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n\n\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line,\n ensureTo = viewport.ensure.to.line;\n\n if (ensureFrom < from) {\n from = ensureFrom;\n to = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n\n return {\n from: from,\n to: Math.max(to, from + 1)\n };\n } // SCROLLING THINGS INTO VIEW", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\t\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)};\n\t\t }", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)}\n\t\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from) {\r\n from = ensureFrom;\r\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\r\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\r\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\r\n to = ensureTo;\r\n }\r\n }\r\n return {from: from, to: Math.max(to, from + 1)}\r\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from)\r\n return {from: ensureFrom,\r\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\r\n if (Math.min(ensureTo, doc.lastLine()) >= to)\r\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\r\n to: ensureTo};\r\n }\r\n return {from: from, to: Math.max(to, from + 1)};\r\n }", "function visibleLines(display, doc, viewPort) {\n var top = viewPort && viewPort.top != null ? Math.max(0, viewPort.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewPort && viewPort.bottom != null ? viewPort.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewPort && viewPort.ensure) {\n var ensureFrom = viewPort.ensure.from.line, ensureTo = viewPort.ensure.to.line;\n if (ensureFrom < from)\n return {from: ensureFrom,\n to: lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)};\n if (Math.min(ensureTo, doc.lastLine()) >= to)\n return {from: lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight),\n to: ensureTo};\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "_calcVisibleLines() {\n this._lines.qtMaxVisible = Math.floor(this._matrixHeight / this._cell.heightMin);\n if (this._lines.qtMaxVisible > 3)\n this._lines.qtMinVisible = 3;\n else\n this._lines.qtMinVisible = 1;\n if (this._lines.qtMaxVisible > this._lines.qtTotal)\n this._lines.qtMaxVisible = this._lines.qtTotal;\n if (this._lines.qtMaxVisible < this._lines.qtVisible && this._lines.qtMaxVisible != 0)\n this._lines.qtVisible = this._lines.qtMaxVisible;\n }", "get viewportLineBlocks() {\n return this.viewState.viewportLines;\n }", "function getNumLinesOnScreen() {\n\t\treturn camera.topAtZZero * 2. / getWorldLineHeight()\n\t}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() { }", "function ViewportScrollPosition() { }", "function linesOnScroll() {\n $('.line-container').each(function () {\n w_h = $(window).height();\n winTop = $(window).scrollTop();\n elOffTop = $(this).offset().top;\n line = $(this).find('.vertical-line');\n elOffTop < winTop + w_h - 300 ? ($(this).addClass('active'), line.css({height: line.attr('data-height') + 'px'})) : ($(this).removeClass('active'), line.css({height: 0 + 'px'}));\n });\n}", "buildScrollMap() {\n if (!this.totalLineCount) {\n return null;\n }\n const scrollMap = [];\n const nonEmptyList = [];\n for (let i = 0; i < this.totalLineCount; i++) {\n scrollMap.push(-1);\n }\n nonEmptyList.push(0);\n scrollMap[0] = 0;\n // write down the offsetTop of element that has 'data-line' property to scrollMap\n const lineElements = this.previewElement.getElementsByClassName(\"sync-line\");\n for (let i = 0; i < lineElements.length; i++) {\n let el = lineElements[i];\n let t = el.getAttribute(\"data-line\");\n if (!t) {\n continue;\n }\n t = parseInt(t, 10);\n if (!t) {\n continue;\n }\n // this is for ignoring footnote scroll match\n if (t < nonEmptyList[nonEmptyList.length - 1]) {\n el.removeAttribute(\"data-line\");\n }\n else {\n nonEmptyList.push(t);\n let offsetTop = 0;\n while (el && el !== this.previewElement) {\n offsetTop += el.offsetTop;\n el = el.offsetParent;\n }\n scrollMap[t] = Math.round(offsetTop);\n }\n }\n nonEmptyList.push(this.totalLineCount);\n scrollMap.push(this.previewElement.scrollHeight);\n let pos = 0;\n for (let i = 0; i < this.totalLineCount; i++) {\n if (scrollMap[i] !== -1) {\n pos++;\n continue;\n }\n const a = nonEmptyList[pos - 1];\n const b = nonEmptyList[pos];\n scrollMap[i] = Math.round((scrollMap[b] * (i - a) + scrollMap[a] * (b - i)) / (b - a));\n }\n return scrollMap; // scrollMap's length == screenLineCount (vscode can't get screenLineCount... sad)\n }", "viewportIsAppropriate({ from, to }, bias = 0) {\n if (!this.inView)\n return true;\n let { top } = this.heightMap.lineAt(from, QueryType.ByPos, this.heightOracle, 0, 0);\n let { bottom } = this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0);\n let { visibleTop, visibleBottom } = this;\n return (from == 0 || top <= visibleTop - Math.max(10 /* MinCoverMargin */, Math.min(-bias, 250 /* MaxCoverMargin */))) &&\n (to == this.state.doc.length ||\n bottom >= visibleBottom + Math.max(10 /* MinCoverMargin */, Math.min(bias, 250 /* MaxCoverMargin */))) &&\n (top > visibleTop - 2 * 1000 /* Margin */ && bottom < visibleBottom + 2 * 1000 /* Margin */);\n }", "_getNarrowedViewportRect() {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement.clientWidth;\n const height = this._document.documentElement.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - (2 * this._viewportMargin),\n height: height - (2 * this._viewportMargin),\n };\n }", "function getViewPort() {\n var\n scrollTop = body_container[0].scrollTop,\n bodyHeight = body_container[0].offsetHeight,\n // calculate the start index\n from = parseInt(scrollTop / (options.rowHeight + options.borderHeight), 10),\n // calculate the end index\n to = from + parseInt((body_container[0].offsetHeight / (options.rowHeight + options.borderHeight)) * 1.5, 10);\n return {\n from: Math.max(from - options.threshold, 0),\n to: to + options.threshold,\n height: from + to\n };\n }", "function viewport_line(e){\n\tsettings.colors.line=e.srcElement.value;\n\tvp.line=settings.colors.line;\t\n}", "async isIntersectingViewport() {\n return await this.evaluate(async (element) => {\n const visibleRatio = await new Promise((resolve) => {\n const observer = new IntersectionObserver((entries) => {\n resolve(entries[0].intersectionRatio);\n observer.disconnect();\n });\n observer.observe(element);\n });\n return visibleRatio > 0;\n });\n }", "async isIntersectingViewport() {\n return await this.evaluate(async (element) => {\n const visibleRatio = await new Promise((resolve) => {\n const observer = new IntersectionObserver((entries) => {\n resolve(entries[0].intersectionRatio);\n observer.disconnect();\n });\n observer.observe(element);\n });\n return visibleRatio > 0;\n });\n }", "async isIntersectingViewport() {\n return await this.evaluate(async (element) => {\n const visibleRatio = await new Promise((resolve) => {\n const observer = new IntersectionObserver((entries) => {\n resolve(entries[0].intersectionRatio);\n observer.disconnect();\n });\n observer.observe(element);\n });\n return visibleRatio > 0;\n });\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line; // Continuing lines, if any\n\n this.rest = visualLineContinued(line); // Number of logical lines in this visual line\n\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n } // Create a range of LineView objects for the given lines.", "scrollSyncToLine(line, topRatio = 0.372) {\n if (!this.scrollMap) {\n this.scrollMap = this.buildScrollMap();\n }\n if (!this.scrollMap || line >= this.scrollMap.length) {\n return;\n }\n if (line + 1 === this.totalLineCount) {\n // last line\n this.scrollToPos(this.previewElement.scrollHeight);\n }\n else {\n /**\n * Since I am not able to access the viewport of the editor\n * I used `golden section` (0.372) here for scrollTop.\n */\n this.scrollToPos(Math.max(this.scrollMap[line] - this.previewElement.offsetHeight * topRatio, 0));\n }\n }", "getLinesScrolled(ev) {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0) {\n return 0;\n }\n // Fallback to WheelEvent.DOM_DELTA_LINE\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n amount /= this._currentRowHeight + 0.0; // Prevent integer division\n this._wheelPartialScroll += amount;\n amount = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1);\n this._wheelPartialScroll %= 1;\n }\n else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._bufferService.rows;\n }\n return amount;\n }", "_onScroll(ev) {\n // Record current scroll top position\n this._lastScrollTop = this._viewportElement.scrollTop;\n // Don't attempt to scroll if the element is not visible, otherwise scrollTop will be corrupt\n // which causes the terminal to scroll the buffer to the top\n if (!this._viewportElement.offsetParent) {\n return;\n }\n // Ignore the event if it was flagged to ignore (when the source of the event is from Viewport)\n if (this._ignoreNextScrollEvent) {\n this._ignoreNextScrollEvent = false;\n return;\n }\n const newRow = Math.round(this._lastScrollTop / this._currentRowHeight);\n const diff = newRow - this._bufferService.buffer.ydisp;\n this._scrollLines(diff, true);\n }", "function calcViewport() {\n var scrollTop = $window.scrollTop(),\n scrollLeft = window.pageXOffset || 0,\n edgeX = options.edgeX,\n edgeY = options.edgeY;\n\n viewportTop = scrollTop - edgeY;\n viewportBottom = scrollTop + (window.innerHeight || $window.height()) + edgeY;\n viewportLeft = scrollLeft - edgeX;\n viewportRight = scrollLeft + (window.innerWidth || $window.width()) + edgeX;\n }", "function viewportSize(){\n\tvar size = document.querySelectorAll( \"section\" );\n\n\tsize.style.cssText = \"position: fixed;top: 0;left: 0;bottom: 0;right: 0;\";\n\tdocument.documentElement.insertBefore( size, document.documentElement.firstChild );\n\t\n\tvar dims = { width: size.offsetWidth, height: size.offsetHeight };\n\tdocument.documentElement.removeChild( size );\n\tlet coords = dims.height;\n return coords;\n}", "get viewport() {\n\t\treturn this._viewport;\n\t}", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }", "function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line\n // Continuing lines, if any\n this.rest = visualLineContinued(line)\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1\n this.node = this.text = null\n this.hidden = lineIsHidden(doc, line)\n}", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "get viewport() { return this.viewState.viewport; }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n\n const renderedRange = this._viewport.getRenderedRange();\n\n const newRange = {\n start: renderedRange.start,\n end: renderedRange.end\n };\n\n const viewportSize = this._viewport.getViewportSize();\n\n const dataLength = this._viewport.getDataLength();\n\n let scrollOffset = this._viewport.measureScrollOffset(); // Prevent NaN as result when dividing by zero.\n\n\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; // If user scrolls to the bottom of the list and data changes to a smaller list\n\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n\n this._viewport.setRenderedRange(newRange);\n\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "function updateHeightsInViewport(cm) {\n\t\t var display = cm.display;\n\t\t var prevBottom = display.lineDiv.offsetTop;\n\t\t var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n\t\t var oldHeight = display.lineDiv.getBoundingClientRect().top;\n\t\t var mustScroll = 0;\n\t\t for (var i = 0; i < display.view.length; i++) {\n\t\t var cur = display.view[i], wrapping = cm.options.lineWrapping;\n\t\t var height = (void 0), width = 0;\n\t\t if (cur.hidden) { continue }\n\t\t oldHeight += cur.line.height;\n\t\t if (ie && ie_version < 8) {\n\t\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t\t height = bot - prevBottom;\n\t\t prevBottom = bot;\n\t\t } else {\n\t\t var box = cur.node.getBoundingClientRect();\n\t\t height = box.bottom - box.top;\n\t\t // Check that lines don't extend past the right of the current\n\t\t // editor width\n\t\t if (!wrapping && cur.text.firstChild)\n\t\t { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n\t\t }\n\t\t var diff = cur.line.height - height;\n\t\t if (diff > .005 || diff < -.005) {\n\t\t if (oldHeight < viewTop) { mustScroll -= diff; }\n\t\t updateLineHeight(cur.line, height);\n\t\t updateWidgetHeight(cur.line);\n\t\t if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n\t\t { updateWidgetHeight(cur.rest[j]); } }\n\t\t }\n\t\t if (width > cm.display.sizerWidth) {\n\t\t var chWidth = Math.ceil(width / charWidth(cm.display));\n\t\t if (chWidth > cm.display.maxLineLength) {\n\t\t cm.display.maxLineLength = chWidth;\n\t\t cm.display.maxLine = cur.line;\n\t\t cm.display.maxLineChanged = true;\n\t\t }\n\t\t }\n\t\t }\n\t\t if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n\t\t }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n}", "function isClippedInViewport(domElement) {\n var rect = domElement.getBoundingClientRect();\n return rect.top < 0 || rect.bottom > document.documentElement.clientHeight || rect.left < 0 || rect.right > document.documentElement.clientWidth;\n } // don't need to check for \"both items null/empty\", and don't need to null-check item, since item required to be length-1 JQ object", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n let firstVisibleIndex = scrollOffset / this._itemSize;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "getLines({ start, end, strictIndexing } = { start: 0, end: -1, strictIndexing: true }) {\n const indexing = typeof strictIndexing === 'undefined' ? true : strictIndexing;\n return this.request(`${this.prefix}get_lines`, [\n start,\n end,\n indexing,\n ]);\n }", "function clientViewportRect() {\n var elem = document.documentElement;\n var x = window.pageXOffset;\n var y = window.pageYOffset;\n var width = elem.clientWidth;\n var height = elem.clientHeight;\n return { x: x, y: y, width: width, height: height };\n}", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array\n\t\t }", "function buildViewArray(cm, from, to) {\n\t\t var array = [], nextPos;\n\t\t for (var pos = from; pos < to; pos = nextPos) {\n\t\t var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n\t\t nextPos = pos + view.size;\n\t\t array.push(view);\n\t\t }\n\t\t return array;\n\t\t }", "function isInViewport($item, returnRect) {\n var rect = $item[0].getBoundingClientRect();\n var result = 1;\n\n if (rect.right <= 0 || rect.left >= wndW) {\n result = 0;\n } else if (rect.bottom < 0 && rect.top <= wndH) {\n result = 0;\n } else {\n var beforeTopEnd = Math.max(0, rect.height + rect.top);\n var beforeBottomEnd = Math.max(0, rect.height - (rect.top + rect.height - wndH));\n var afterTop = Math.max(0, -rect.top);\n var beforeBottom = Math.max(0, rect.top + rect.height - wndH);\n if (rect.height < wndH) {\n result = 1 - (afterTop || beforeBottom) / rect.height;\n } else if (beforeTopEnd <= wndH) {\n result = beforeTopEnd / wndH;\n } else if (beforeBottomEnd <= wndH) {\n result = beforeBottomEnd / wndH;\n }\n result = result < 0 ? 0 : result;\n }\n if (returnRect) {\n return [result, rect];\n }\n return result;\n}", "function LineView(doc, line, lineN) {\r\n // The starting line\r\n this.line = line;\r\n // Continuing lines, if any\r\n this.rest = visualLineContinued(line);\r\n // Number of logical lines in this visual line\r\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\r\n this.node = this.text = null;\r\n this.hidden = lineIsHidden(doc, line);\r\n}", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }", "function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }" ]
[ "0.74272996", "0.74230975", "0.74230975", "0.7401155", "0.73803174", "0.7377409", "0.7353546", "0.7353546", "0.7353546", "0.7353546", "0.731544", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.7312608", "0.73074466", "0.73074466", "0.72325194", "0.72325194", "0.72325194", "0.72283643", "0.66864634", "0.6269517", "0.6227224", "0.5838048", "0.5820093", "0.5820093", "0.5820093", "0.5820093", "0.56670934", "0.56670934", "0.56439143", "0.56287605", "0.5578122", "0.53491396", "0.53332543", "0.5328284", "0.5327419", "0.5327419", "0.5327419", "0.52968323", "0.5291474", "0.5227583", "0.5189816", "0.50862455", "0.50796735", "0.50795007", "0.504371", "0.504371", "0.50432974", "0.50432974", "0.50400716", "0.5033165", "0.50268966", "0.5005263", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49923337", "0.49920517", "0.49912357", "0.49803105", "0.49720174", "0.49715084", "0.49614987", "0.49602333", "0.49531442", "0.49521503", "0.49521503", "0.49521503" ]
0.7355309
18
Realign line numbers and gutter marks to compensate for horizontal scrolling.
function alignHorizontally(cm) { var display = cm.display, view = display.view; if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; var gutterW = display.gutters.offsetWidth, left = comp + "px"; for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { if (cm.options.fixedGutter) { if (view[i].gutter) { view[i].gutter.style.left = left; } if (view[i].gutterBackground) { view[i].gutterBackground.style.left = left; } } var align = view[i].alignable; if (align) { for (var j = 0; j < align.length; j++) { align[j].style.left = left; } } } } if (cm.options.fixedGutter) { display.gutters.style.left = (comp + gutterW) + "px"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ensureLineGaps(current, mayMeasure) {\n let wrapping = this.heightOracle.lineWrapping;\n let margin = wrapping ? 10000 /* MarginWrap */ : 2000 /* Margin */, halfMargin = margin >> 1, doubleMargin = margin << 1;\n // The non-wrapping logic won't work at all in predominantly right-to-left text.\n if (this.defaultTextDirection != exports.Direction.LTR && !wrapping)\n return [];\n let gaps = [];\n let addGap = (from, to, line, structure) => {\n if (to - from < halfMargin)\n return;\n let sel = this.state.selection.main, avoid = [sel.from];\n if (!sel.empty)\n avoid.push(sel.to);\n for (let pos of avoid) {\n if (pos > from && pos < to) {\n addGap(from, pos - 10 /* SelectionMargin */, line, structure);\n addGap(pos + 10 /* SelectionMargin */, to, line, structure);\n return;\n }\n }\n let gap = find(current, gap => gap.from >= line.from && gap.to <= line.to &&\n Math.abs(gap.from - from) < halfMargin && Math.abs(gap.to - to) < halfMargin &&\n !avoid.some(pos => gap.from < pos && gap.to > pos));\n if (!gap) {\n // When scrolling down, snap gap ends to line starts to avoid shifts in wrapping\n if (to < line.to && mayMeasure && wrapping &&\n mayMeasure.visibleRanges.some(r => r.from <= to && r.to >= to)) {\n let lineStart = mayMeasure.moveToLineBoundary(state.EditorSelection.cursor(to), false, true).head;\n if (lineStart > from)\n to = lineStart;\n }\n gap = new LineGap(from, to, this.gapSize(line, from, to, structure));\n }\n gaps.push(gap);\n };\n for (let line of this.viewportLines) {\n if (line.length < doubleMargin)\n continue;\n let structure = lineStructure(line.from, line.to, this.stateDeco);\n if (structure.total < doubleMargin)\n continue;\n let target = this.scrollTarget ? this.scrollTarget.range.head : null;\n let viewFrom, viewTo;\n if (wrapping) {\n let marginHeight = (margin / this.heightOracle.lineLength) * this.heightOracle.lineHeight;\n let top, bot;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line.height;\n top = targetFrac - spaceFrac;\n bot = targetFrac + spaceFrac;\n }\n else {\n top = (this.visibleTop - line.top - marginHeight) / line.height;\n bot = (this.visibleBottom - line.top + marginHeight) / line.height;\n }\n viewFrom = findPosition(structure, top);\n viewTo = findPosition(structure, bot);\n }\n else {\n let totalWidth = structure.total * this.heightOracle.charWidth;\n let marginWidth = margin * this.heightOracle.charWidth;\n let left, right;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;\n left = targetFrac - spaceFrac;\n right = targetFrac + spaceFrac;\n }\n else {\n left = (this.pixelViewport.left - marginWidth) / totalWidth;\n right = (this.pixelViewport.right + marginWidth) / totalWidth;\n }\n viewFrom = findPosition(structure, left);\n viewTo = findPosition(structure, right);\n }\n if (viewFrom > line.from)\n addGap(line.from, viewFrom, line, structure);\n if (viewTo < line.to)\n addGap(viewTo, line.to, line, structure);\n }\n return gaps;\n }", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) return false;\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm);\n\t\t return true;\n\t\t }\n\t\t return false;\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) { return false }\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm.display);\n\t\t return true\n\t\t }\n\t\t return false\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) return false;\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true;\r\n }\r\n return false;\r\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t { view[i].gutter.style.left = left; }\n\t\t if (view[i].gutterBackground)\n\t\t { view[i].gutterBackground.style.left = left; }\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) { for (var j = 0; j < align.length; j++)\n\t\t { align[j].style.left = left; } }\n\t\t } }\n\t\t if (cm.options.fixedGutter)\n\t\t { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n view[i].gutter.style.left = left;\n if (view[i].gutterBackground)\n view[i].gutterBackground.style.left = left;\n }\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t view[i].gutter.style.left = left;\n\t\t if (view[i].gutterBackground)\n\t\t view[i].gutterBackground.style.left = left;\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) for (var j = 0; j < align.length; j++)\n\t\t align[j].style.left = left;\n\t\t }\n\t\t if (cm.options.fixedGutter)\n\t\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t\t }", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\r\n if (cm.options.fixedGutter) {\r\n if (view[i].gutter)\r\n { view[i].gutter.style.left = left; }\r\n if (view[i].gutterBackground)\r\n { view[i].gutterBackground.style.left = left; }\r\n }\r\n var align = view[i].alignable;\r\n if (align) { for (var j = 0; j < align.length; j++)\r\n { align[j].style.left = left; } }\r\n } }\r\n if (cm.options.fixedGutter)\r\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\r\n}", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) { return false }\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true\r\n }\r\n return false\r\n}", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\r\n if (cm.options.fixedGutter && view[i].gutter)\r\n view[i].gutter.style.left = left;\r\n var align = view[i].alignable;\r\n if (align) for (var j = 0; j < align.length; j++)\r\n align[j].style.left = left;\r\n }\r\n if (cm.options.fixedGutter)\r\n display.gutters.style.left = (comp + gutterW) + \"px\";\r\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) {\n return false;\n }\n\n var doc = cm.doc,\n last = lineNumberFor(cm.options, doc.first + doc.size - 1),\n display = cm.display;\n\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)], \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth,\n padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true;\n }\n\n return false;\n }", "_justify() {\n let hIx = 0;\n let left = 0;\n let minx = 0;\n let maxx = 0;\n let lvl = 0;\n let maxwidth = 0;\n let runningWidth = 0;\n let runningHeight = 0;\n if (!this.inlineBlocks.length) {\n return;\n }\n minx = this.inlineBlocks[0].text.startX;\n // We justify relative to first block x/y.\n const initialX = this.inlineBlocks[0].text.startX;\n const initialY = this.inlineBlocks[0].text.startY;\n const vert = {};\n this.inlineBlocks.forEach((inlineBlock) => {\n const block = inlineBlock.text;\n const blockBox = block.getLogicalBox();\n // If this is a horizontal positioning, reset to first blokc position\n //\n if (hIx > 0) {\n block.startX = initialX;\n block.startY = initialY;\n }\n minx = block.startX < minx ? block.startX : minx;\n maxx = (block.startX + blockBox.width) > maxx ? block.startX + blockBox.width : maxx;\n\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.ABOVE ? lvl + 1 : lvl;\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.BELOW ? lvl - 1 : lvl;\n if (inlineBlock.position === SmoTextGroup.relativePositions.RIGHT) {\n block.startX += runningWidth;\n if (hIx > 0) {\n block.startX += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.LEFT) {\n if (hIx > 0) {\n block.startX = minx - blockBox.width;\n minx = block.startX;\n block.startX -= this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.BELOW) {\n block.startY += runningHeight;\n if (hIx > 0) {\n block.startY += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.ABOVE) {\n block.startY -= runningHeight;\n if (hIx > 0) {\n block.startY -= this.spacing;\n }\n }\n if (!vert[lvl]) {\n vert[lvl] = {};\n vert[lvl].blocks = [block];\n vert[lvl].minx = block.startX;\n vert[lvl].maxx = block.startX + blockBox.width;\n maxwidth = vert[lvl].width = blockBox.width;\n } else {\n vert[lvl].blocks.push(block);\n vert[lvl].minx = vert[lvl].minx < block.startX ? vert[lvl].minx : block.startX;\n vert[lvl].maxx = vert[lvl].maxx > (block.startX + blockBox.width) ?\n vert[lvl].maxx : (block.startX + blockBox.width);\n vert[lvl].width += blockBox.width;\n maxwidth = maxwidth > vert[lvl].width ? maxwidth : vert[lvl].width;\n }\n runningWidth += blockBox.width;\n runningHeight += blockBox.height;\n hIx += 1;\n block.updatedMetrics = false;\n });\n\n const levels = Object.keys(vert);\n\n // Horizontal justify the vertical blocks\n levels.forEach((level) => {\n const vobj = vert[level];\n if (this.justification === SmoTextGroup.justifications.LEFT) {\n left = minx - vobj.minx;\n } else if (this.justification === SmoTextGroup.justifications.RIGHT) {\n left = maxx - vobj.maxx;\n } else {\n left = (maxwidth / 2) - (vobj.width / 2);\n left += minx - vobj.minx;\n }\n vobj.blocks.forEach((block) => {\n block.offsetStartX(left);\n });\n });\n }", "function leftAlign(){\n\tvar baseX = 999999;\n\tfor(var i=0; i<currentShapes.length; i++){\n\t\tif(baseX>currentShapes[i].getX()){\n\t\t\tbaseX = currentShapes[i].getX();\n\t\t}\n\t}\n\tfor(var k=0; k<currentShapes.length; k++){\n\t\tcurrentShapes[k].setX(baseX);\n\t}\n\tlayer.draw();\n\thatioGroupRevised();\n}", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter) {\n\t if (view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t if (view[i].gutterBackground)\n\t view[i].gutterBackground.style.left = left;\n\t }\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter && view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter && view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "realignInkBar() {\n if (this._tabHeader) {\n this._tabHeader._alignInkBarToSelectedTab();\n }\n }", "SameLine(offset_from_start_x=0, spacing_w=-1)\n {\n let win = this.getCurrentWindow();\n if (win.SkipItems)\n return;\n\n let g = this.guictx;\n if (offset_from_start_x != 0)\n {\n if (spacing_w < 0.) spacing_w = 0.;\n win.DC.CursorPos.x = win.Pos.x - win.Scroll.x + offset_from_start_x +\n spacing_w + win.DC.GroupOffset.x + win.DC.ColumnsOffset.x;\n win.DC.CursorPos.y = win.DC.CursorPosPrevLine.y;\n }\n else\n {\n if (spacing_w < 0) spacing_w = g.Style.ItemSpacing.x;\n win.DC.CursorPos.x = win.DC.CursorPosPrevLine.x + spacing_w;\n win.DC.CursorPos.y = win.DC.CursorPosPrevLine.y;\n }\n win.DC.CurrentLineHeight = win.DC.PrevLineHeight;\n win.DC.CurrentLineHeightMax = win.DC.PrevLineHeightMax;\n win.DC.CurrentLineTextBaseOffset = win.DC.PrevLineTextBaseOffset;\n }", "async _indentMagikLines(\n lines,\n firstRow,\n lastRow,\n updateRangeOnly,\n checkOnly\n ) {\n const editor = vscode.window.activeTextEditor;\n const doc = editor.document;\n\n const lineIndents = [];\n const assignIndentKeywords = [];\n const arrowAssignRows = [];\n const outdentWords = [];\n let indent = 0;\n let tempIndent = false;\n\n const edit = new vscode.WorkspaceEdit();\n\n for (let row = 0; row < lines.length; row++) {\n const text = lines[row];\n const textLength = text.length;\n let testString = text.trim();\n let start = text.search(/\\S/);\n let matches;\n\n if (start === -1) start = textLength;\n\n // Don't reduce indent when chaining method calls when line starts with ').'\n if (testString[0] !== '#' && !/^\\)\\.\\s*(#|$)/.test(testString)) {\n const decWordsLength = MagikUtils.INDENT_DEC_WORDS.length;\n for (let i = 0; i < decWordsLength; i++) {\n if (testString.startsWith(MagikUtils.INDENT_DEC_WORDS[i])) {\n indent--;\n break;\n }\n }\n }\n\n const indentText = '\\t'.repeat(Math.max(indent, 0));\n\n lineIndents.push(indent);\n\n if (\n !checkOnly &&\n indentText !== text.slice(0, start) &&\n (!lastRow ||\n (!updateRangeOnly && firstRow + row === lastRow) ||\n (updateRangeOnly && firstRow + row <= lastRow))\n ) {\n const range = new vscode.Range(\n firstRow + row,\n 0,\n firstRow + row,\n start\n );\n edit.replace(doc.uri, range, indentText);\n }\n\n\n if (firstRow + row === lastRow) break;\n\n if (NO_CODE.test(testString)) {\n if (arrowAssignRows.length > 0) {\n // Defer checking for a statement as the line is empty\n arrowAssignRows[arrowAssignRows.length - 1]++;\n }\n } else {\n testString = MagikUtils.stringBeforeComment(testString).trim();\n\n if (arrowAssignRows.length > 0) {\n if (row === arrowAssignRows.slice(-1)[0] + 1) {\n const startAssignWordsLength = MagikUtils.START_ASSIGN_WORDS.length;\n let assignIndentKeyword;\n for (let i = 0; i < startAssignWordsLength; i++) {\n if (testString.startsWith(MagikUtils.START_ASSIGN_WORDS[i])) {\n assignIndentKeyword = MagikUtils.START_ASSIGN_WORDS[i];\n assignIndentKeywords.push(assignIndentKeyword);\n break;\n }\n }\n if (!assignIndentKeyword) {\n if (this._incompleteInvocationTest(testString)) {\n // Defer checking for a statement as the line is incomplete\n arrowAssignRows[arrowAssignRows.length - 1]++;\n } else {\n indent--;\n arrowAssignRows.pop();\n }\n }\n }\n if (\n arrowAssignRows.length > 0 &&\n this._cancelAssignIndent(\n testString,\n assignIndentKeywords.slice(-1)[0]\n )\n ) {\n indent--;\n arrowAssignRows.pop();\n assignIndentKeywords.pop();\n }\n } else if (assignIndentKeywords.length > 0) {\n if (\n this._cancelAssignIndent(\n testString,\n assignIndentKeywords.slice(-1)[0]\n )\n ) {\n indent--;\n assignIndentKeywords.pop();\n }\n }\n\n if (tempIndent && !/[,(]$/.test(testString)) {\n indent--;\n tempIndent = false;\n }\n\n if (/^\\)\\.$/.test(testString)) {\n // Don't increase indent when chaining method calls\n } else if (this._methodStartTest(testString)) {\n indent++;\n outdentWords[indent] = '_endmethod';\n } else {\n const statementAssignKeyword = this._statementAssignTest(testString);\n if (statementAssignKeyword) {\n indent++;\n assignIndentKeywords.push(statementAssignKeyword);\n if (INDENT_INC_STATEMENT_WORDS.includes(statementAssignKeyword)) {\n indent++;\n }\n outdentWords[indent] = INDENT_PAIRS[statementAssignKeyword];\n } else if (/^[)}]/.test(testString)) {\n // Starts with bracket - explicitly handled here as not included in INDENT_INC_WORDS test below\n indent++;\n } else if (/\\s+_then(\\s+|$)/.test(testString)) {\n indent++;\n if (/(\\s+|;)_endif$/.test(testString)) {\n indent--;\n }\n } else {\n const incWordsLength = MagikUtils.INDENT_INC_WORDS.length;\n for (let i = 0; i < incWordsLength; i++) {\n const iWord = MagikUtils.INDENT_INC_WORDS[i];\n if (testString === iWord || testString.startsWith(`${iWord} `)) {\n indent++;\n outdentWords[indent] = INDENT_PAIRS[iWord];\n break;\n }\n }\n if (this._startProcTest(testString)) {\n indent++;\n outdentWords[indent] = '_endproc';\n }\n if (this._endStatementTest(testString)) {\n indent--;\n }\n }\n }\n\n if (this._arrowAssignTest(testString)) {\n indent++;\n arrowAssignRows.push(row);\n } else {\n const endWordsLength = MagikUtils.END_WORDS.length;\n for (let i = 0; i < endWordsLength; i++) {\n if (testString.endsWith(MagikUtils.END_WORDS[i])) {\n indent++;\n tempIndent = true;\n break;\n }\n }\n }\n\n // Remove strings before counting brackets\n const noStrings = MagikUtils.removeStrings(testString);\n\n matches = noStrings.match(MagikUtils.INC_BRACKETS);\n if (matches) {\n indent += matches.length;\n }\n matches = noStrings.match(MagikUtils.DEC_BRACKETS);\n if (matches) {\n indent -= matches.length;\n }\n }\n }\n\n if (edit.size > 0) {\n await vscode.workspace.applyEdit(edit);\n }\n\n this.magikVSCode.outdentWord = outdentWords[indent];\n\n return lineIndents;\n }", "function adjustMargins() {\n detectSpacesIn(body);\n} //Initiate recursion:", "_alignCell(cell, dimensions, number, offset = 0, lineWeight = 1) {\n\t\t\td3.select(cell)\n\t\t\t\t// + number: Space 1 px between cells\n\t\t\t\t.attr('transform', `translate(${ offset + number * dimensions + number * lineWeight },0)`);\n\t\t}", "_createLineNumbers(editor) {\n const {\n changes,\n newStart: initialOffset\n } = this.props.hunk;\n const changeCount = changes.length;\n const maxDisplayLineNumber = initialOffset + changeCount - 1; // The maximum required gutter width for this hunk, in characters:\n\n const gutterWidth = String(maxDisplayLineNumber).length;\n let deletedLinesInSection = 0;\n let deletedLines = 0; // use a generator to avoid having to precalculate and store an array of\n // line numbers\n\n function* lineNumberGenerator() {\n for (let line = 0; line < changeCount; line++) {\n if (changes[line].type === 'del') {\n deletedLinesInSection++;\n } else {\n deletedLines += deletedLinesInSection;\n deletedLinesInSection = 0;\n }\n\n yield line + initialOffset - deletedLines;\n }\n }\n\n const gutter = createCustomLineNumberGutter(editor, lineNumberGenerator(), gutterWidth, {\n onClick: this.props.onClickLine\n });\n\n this._disposables.add(() => {\n gutter.destroy();\n });\n }" ]
[ "0.63226783", "0.6284006", "0.625558", "0.6180552", "0.6180552", "0.6180552", "0.6165085", "0.61348224", "0.61348224", "0.61348224", "0.61348224", "0.6134229", "0.6134229", "0.6134229", "0.6134229", "0.6134229", "0.6134229", "0.6125308", "0.6125308", "0.6116254", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6109484", "0.6100977", "0.60872024", "0.6085849", "0.60817075", "0.60817075", "0.60817075", "0.60817075", "0.60817075", "0.60817075", "0.60817075", "0.6080586", "0.607821", "0.6076882", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.6063494", "0.60461354", "0.60461354", "0.6041835", "0.6041835", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037647", "0.6037417", "0.6024754", "0.60163873", "0.6001819", "0.59993625", "0.59993625", "0.59141517", "0.58860445", "0.5797976", "0.5784064", "0.57733184", "0.5765648" ]
0.61332417
33
Used to ensure that the line number gutter is still the right size for the current document size. Returns true when an update is needed.
function maybeUpdateLineNumberWidth(cm) { if (!cm.options.lineNumbers) { return false } var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; if (last.length != display.lineNumChars) { var test = display.measure.appendChild(elt("div", [elt("div", last)], "CodeMirror-linenumber CodeMirror-gutter-elt")); var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; display.lineGutter.style.width = ""; display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; display.lineNumWidth = display.lineNumInnerWidth + padding; display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; display.lineGutter.style.width = display.lineNumWidth + "px"; updateGutterSpace(cm); return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) {\n return false;\n }\n\n var doc = cm.doc,\n last = lineNumberFor(cm.options, doc.first + doc.size - 1),\n display = cm.display;\n\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)], \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth,\n padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true;\n }\n\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) return false;\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true;\r\n }\r\n return false;\r\n }", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) { return false }\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true\r\n }\r\n return false\r\n}", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) return false;\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm);\n\t\t return true;\n\t\t }\n\t\t return false;\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) { return false }\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm.display);\n\t\t return true\n\t\t }\n\t\t return false\n\t\t }", "_shouldUpdateWidth() {\n const domWidth = this._getDOMDimensions().width;\n return this.state.width !== domWidth;\n }", "function isChanged() {\n var x = currentCircle.attr(\"cx\");\n var xBackup = currentCircle.attr(\"cx-backup\");\n return Math.round(parseFloat(x) / minSpace) != Math.round(parseFloat(xBackup) / minSpace);\n}", "function checkSize() {\n var truncate = function truncate() {\n if (line < 1) lineData = [that._ellipsis(\"\", line)];else lineData[line - 1] = that._ellipsis(lineData[line - 1], line);\n }; // Constraint the font size\n\n\n fS = max([fS, fMin]);\n fS = min([fS, fMax]);\n\n if (resize) {\n lH = fS * lHRatio;\n wrapper.fontSize(fS).lineHeight(lH);\n style[\"font-size\"] = fS;\n style[\"line-height\"] = lH;\n }\n\n wrapResults = wrapper(t);\n lineData = wrapResults.lines.filter(function (l) {\n return l !== \"\";\n });\n line = lineData.length;\n\n if (wrapResults.truncated) {\n if (resize) {\n fS--;\n\n if (fS < fMin) {\n fS = fMin;\n truncate();\n return;\n } else checkSize();\n } else truncate();\n }\n }", "updatePanelSize ()\n {\n this.viewerState.viewport.invalidate();\n\n // FIXME(wabain): This should really only be called after initial load\n if (this.viewerState.renderer)\n {\n this.updateOffsets();\n this.viewerState.renderer.goto(this.settings.currentPageIndex, this.viewerState.verticalOffset, this.viewerState.horizontalOffset);\n }\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt()\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt()\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\r\n var display = cm.display, doc = cm.doc;\r\n if (update.editorIsHidden) {\r\n resetView(cm);\r\n return false;\r\n }\r\n\r\n // Bail out if the visible area is already rendered and nothing changed.\r\n if (!update.force &&\r\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\r\n countDirtyView(cm) == 0)\r\n return false;\r\n\r\n if (maybeUpdateLineNumberWidth(cm)) {\r\n resetView(cm);\r\n update.dims = getDimensions(cm);\r\n }\r\n\r\n // Compute a suitable new viewport (from & to)\r\n var end = doc.first + doc.size;\r\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\r\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\r\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\r\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\r\n if (sawCollapsedSpans) {\r\n from = visualLineNo(cm.doc, from);\r\n to = visualLineEndNo(cm.doc, to);\r\n }\r\n\r\n var different = from != display.viewFrom || to != display.viewTo ||\r\n display.lastSizeC != update.wrapperHeight;\r\n adjustView(cm, from, to);\r\n\r\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\r\n // Position the mover div to align with the current scroll position\r\n cm.display.mover.style.top = display.viewOffset + \"px\";\r\n\r\n var toUpdate = countDirtyView(cm);\r\n if (!different && toUpdate == 0 && !update.force &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\r\n return false;\r\n\r\n // For big changes, we hide the enclosing element during the\r\n // update, since that speeds up the operations on most browsers.\r\n var focused = activeElt();\r\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\r\n patchDisplay(cm, display.updateLineNumbers, update.dims);\r\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\r\n // There might have been a widget with a focused element that got\r\n // hidden or updated, if so re-focus it.\r\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\r\n\r\n // Prevent selection and cursors from interfering with the scroll\r\n // width.\r\n removeChildren(display.cursorDiv);\r\n removeChildren(display.selectionDiv);\r\n\r\n if (different) {\r\n display.lastSizeC = update.wrapperHeight;\r\n startWorker(cm, 400);\r\n }\r\n\r\n display.updateLineNumbers = null;\r\n\r\n return true;\r\n }", "function updateDisplayIfNeeded(cm, update) {\r\n var display = cm.display, doc = cm.doc;\r\n\r\n if (update.editorIsHidden) {\r\n resetView(cm);\r\n return false\r\n }\r\n\r\n // Bail out if the visible area is already rendered and nothing changed.\r\n if (!update.force &&\r\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\r\n display.renderedView == display.view && countDirtyView(cm) == 0)\r\n { return false }\r\n\r\n if (maybeUpdateLineNumberWidth(cm)) {\r\n resetView(cm);\r\n update.dims = getDimensions(cm);\r\n }\r\n\r\n // Compute a suitable new viewport (from & to)\r\n var end = doc.first + doc.size;\r\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\r\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\r\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\r\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\r\n if (sawCollapsedSpans) {\r\n from = visualLineNo(cm.doc, from);\r\n to = visualLineEndNo(cm.doc, to);\r\n }\r\n\r\n var different = from != display.viewFrom || to != display.viewTo ||\r\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\r\n adjustView(cm, from, to);\r\n\r\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\r\n // Position the mover div to align with the current scroll position\r\n cm.display.mover.style.top = display.viewOffset + \"px\";\r\n\r\n var toUpdate = countDirtyView(cm);\r\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\r\n { return false }\r\n\r\n // For big changes, we hide the enclosing element during the\r\n // update, since that speeds up the operations on most browsers.\r\n var selSnapshot = selectionSnapshot(cm);\r\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\r\n patchDisplay(cm, display.updateLineNumbers, update.dims);\r\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\r\n display.renderedView = display.view;\r\n // There might have been a widget with a focused element that got\r\n // hidden or updated, if so re-focus it.\r\n restoreSelection(selSnapshot);\r\n\r\n // Prevent selection and cursors from interfering with the scroll\r\n // width and height.\r\n removeChildren(display.cursorDiv);\r\n removeChildren(display.selectionDiv);\r\n display.gutters.style.height = display.sizer.style.minHeight = 0;\r\n\r\n if (different) {\r\n display.lastWrapHeight = update.wrapperHeight;\r\n display.lastWrapWidth = update.wrapperWidth;\r\n startWorker(cm, 400);\r\n }\r\n\r\n display.updateLineNumbers = null;\r\n\r\n return true\r\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "get geometryChanged() {\n return this.docChanged || (this.flags & (8 /* Geometry */ | 2 /* Height */)) > 0;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display,\n doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n } // Bail out if the visible area is already rendered and nothing changed.\n\n\n if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) {\n return false;\n }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n } // Compute a suitable new viewport (from & to)\n\n\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\n if (display.viewFrom < from && from - display.viewFrom < 20) {\n from = Math.max(doc.first, display.viewFrom);\n }\n\n if (display.viewTo > to && display.viewTo - to < 20) {\n to = Math.min(end, display.viewTo);\n }\n\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n display.viewOffset = _heightAtLine(getLine(cm.doc, display.viewFrom)); // Position the mover div to align with the current scroll position\n\n cm.display.mover.style.top = display.viewOffset + \"px\";\n var toUpdate = countDirtyView(cm);\n\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) {\n return false;\n } // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n\n\n var selSnapshot = selectionSnapshot(cm);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"none\";\n }\n\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"\";\n }\n\n display.renderedView = display.view; // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n\n restoreSelection(selSnapshot); // Prevent selection and cursors from interfering with the scroll\n // width and height.\n\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n return true;\n }", "function updateSize() {\n var mb_in_bytes = 1024 * 1024;\n var file = document.getElementById(\"data-file\").files[0],\n type_file = file.name.split('.').pop();\n if (file.size < mb_in_bytes * 5 && type_file === \"docx\") {\n return true;\n }\n return false;\n}", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function checkDrawSize(){\n\t\tvar current = svgCanvas.getSvgString();\n\t\tvar compressed = lz77.compress(current);\n\t\t//alert(current.length*2 + ' ' + compressed.length * 2);\n\t\t// if compressed svg string is larger than 20k (or 10k if maxSnaps > 10), alert user and undo latest change\n\t\tif(compressed.length * 2 > svgEditor.maxDrawSize){\n\t\t\t$('#tool_undo').click();\n\t\t\t$('#drawlimit_dialog').dialog('open');\n\t\t}\n\t}", "get _isResized() {\n // Compare ratios. Very different includes IHM space.\n var heightRatio = _Global.document.documentElement.clientHeight / _Global.innerHeight,\n widthRatio = _Global.document.documentElement.clientWidth / _Global.innerWidth;\n\n // If they're nearly identical, then the view hasn't been resized for the IHM\n // Only check one bound because we know the IHM will make it shorter, not skinnier.\n return (widthRatio / heightRatio < 0.99);\n\n }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false\n\t\t }\n\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t { return false }\n\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n\t\t if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t { return false }\n\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var selSnapshot = selectionSnapshot(cm);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t restoreSelection(selSnapshot);\n\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\n\t\t display.updateLineNumbers = null;\n\n\t\t return true\n\t\t }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t return false;\n\t\t\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\t\t\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\t\t\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\t\t\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\t\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t return false;\n\t\t\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var focused = activeElt();\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\t\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\t\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\t\t\n\t\t display.updateLineNumbers = null;\n\t\t\n\t\t return true;\n\t\t }", "function fastCheck() {\n for (var i = watchArray.length - 1; i >= 0; i--) {\n if (!watchArray[i].inited) continue;\n\n var deltaTop = Math.abs(getDocOffsetTop(watchArray[i].clone) - watchArray[i].docOffsetTop),\n deltaHeight = Math.abs(watchArray[i].parent.node.offsetHeight - watchArray[i].parent.height);\n\n if (deltaTop >= 2 || deltaHeight >= 2) return false;\n }\n return true;\n }", "function fastCheck() {\n for (var i = watchArray.length - 1; i >= 0; i--) {\n if (!watchArray[i].inited) continue;\n\n var deltaTop = Math.abs(getDocOffsetTop(watchArray[i].clone) - watchArray[i].docOffsetTop),\n deltaHeight = Math.abs(watchArray[i].parent.node.offsetHeight - watchArray[i].parent.height);\n\n if (deltaTop >= 2 || deltaHeight >= 2) return false;\n }\n return true;\n }", "gridCellSizeLockChangeHandler () {\n if (!this.gridCellSizeLock) {\n this.store.dispatch(setGridCellSizeLockAndGridSize({\n gridCellSizeLock: !this.gridCellSizeLock,\n gridSize: fgmState.cellSize\n }));\n } else {\n this.store.dispatch(setGridCellSizeLock(!this.gridCellSizeLock));\n }\n\n return true;\n }" ]
[ "0.6706616", "0.6706616", "0.6706616", "0.6706616", "0.6706616", "0.6706616", "0.6696778", "0.6696778", "0.66581243", "0.66581243", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66474265", "0.66334224", "0.66334224", "0.66334224", "0.6623874", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.6621087", "0.66143346", "0.65753245", "0.6566693", "0.6489531", "0.6251447", "0.6032688", "0.59193724", "0.58379525", "0.58253485", "0.58253485", "0.5813326", "0.58020455", "0.58020455", "0.58020455", "0.58020455", "0.57979536", "0.5786727", "0.5786515", "0.5786515", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5778329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.5768329", "0.57416666", "0.57228893", "0.57155746", "0.57003367", "0.57003367", "0.5692011", "0.5679943", "0.5673621", "0.5664968", "0.5655627", "0.5655627", "0.55739886" ]
0.6679237
10
SCROLLING THINGS INTO VIEW If an editor sits on the top or bottom of the window, partially scrolled out of view, this ensures that the cursor is visible.
function maybeScrollWindow(cm, rect) { if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; if (rect.top + box.top < 0) { doScroll = true; } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; } if (doScroll != null && !phantom) { var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); cm.display.lineSpace.appendChild(scrollNode); scrollNode.scrollIntoView(doScroll); cm.display.lineSpace.removeChild(scrollNode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateView(selection, editor) {\n let path = editor.getPath();\n let i = 0;\n // We check that the selection is actually a point\n // We use selection because for the moment we think it's better not to update the view when the user selects a large part of text\n if (\n selection.newScreenRange.start.row == selection.newScreenRange.end.row &&\n selection.newScreenRange.start.column ==\n selection.newScreenRange.end.column\n ) {\n // we create some alias to clean the code\n let row = selection.newScreenRange.start.row;\n let column = selection.newScreenRange.start.column;\n let none_objective = 0; // if no FocusView is associated with the cursor position\n\n for (i = 0; i < this.FocusView.length; i++) {\n // we find the focusView associated with the cursor position\n if (\n this.rangewithin(\n this.FocusView[i].path,\n this.FocusView[i].range.start.line,\n this.FocusView[i].range.end.line,\n this.FocusView[i].range.start.character,\n this.FocusView[i].range.end.character,\n path,\n row,\n column\n )\n ) {\n // we display the information contained in the focusView.\n this.setCurrentObjectif(this.FocusView[i].goal);\n this.setHypothesis(this.FocusView[i].hypothesis);\n this.setGoals(this.FocusView[i].goals);\n this.markGoal(this.FocusView[i]); // we want to provide some visual information to the user.\n none_objective = 1; // We can now consider that we found a data within our tab that correspond to the situation\n }\n }\n if (none_objective === 0) {\n //If no FocusView is associated with the cursor position\n this.setCurrentObjectif(\"\"); // The currentObjective is set to null.\n this.cleanHypothesis(); //We clean every hypothesis.\n this.cleanGoals(); //We clean every goals.\n }\n }\n }", "function ensureVisible()\r\n{\r\n var selectedTop = selected.position().top;\r\n var selectedBottom = selectedTop + selected.outerHeight();\r\n\r\n var $wnd = $(wnd);\r\n var wndTop = $wnd.scrollTop();\r\n var wndBottom = wndTop + $wnd.height();\r\n\r\n if(selectedBottom > wndBottom)\r\n {\r\n $wnd.scrollTop(wndTop + (selectedBottom-wndBottom));\r\n }\r\n else if(selectedTop < wndTop)\r\n {\r\n $wnd.scrollTop(selectedTop);\r\n }\r\n}", "function updateRangePosition() {\n // Using setTimeout to avoid flicker.\n // setTimeout() causes at least 4ms delay, which seems to skip flickering.\n window.setTimeout(function() {\n var selection = window.getSelection();\n var range = selection.getRangeAt(0);\n var boundingRect;\n var cloneRange = range.cloneRange();\n cloneRange.setStart(selection.focusNode, selection.focusOffset);\n cloneRange.setEnd(selection.focusNode, selection.focusOffset);\n var rects = cloneRange.getClientRects();\n // rects.length is 0 when focusNode is an element node.\n if (rects.length == 0) {\n // Find the closest element node that we can get the\n // boundingClientRect from.\n boundingRect = findElementNodeFrom(selection.focusNode)\n .getBoundingClientRect();\n // But it is not good enough, the div could be the whole body.\n // A too big scroll rectangle would not allow scrolling.\n // Now, find if there is bounding rect at the focusOffset of\n // focusNode.\n if (selection.focusNode.nodeType == Node.ELEMENT_NODE) {\n var node =\n selection.focusNode.childNodes[selection.focusOffset];\n if (node && node.nodeType == Node.ELEMENT_NODE\n && node.getClientRects().length > 0) {\n boundingRect = node.getBoundingClientRect();\n }\n }\n } else if (rects.length == 1) {\n // This is needed instead of using getBoundingClientRect().\n // See b/33416019\n boundingRect = rects[0];\n } else {\n boundingRect = cloneRange.getBoundingClientRect();\n }\n\n EditWebView.updateRangePosition(\n boundingRect.left, boundingRect.top,\n boundingRect.right, boundingRect.bottom);\n });\n}", "checkForCursorVisibility() {\n this.showCaret();\n }", "function ensureCursorVisible(cm) {\n\t\t resolveScrollToPos(cm);\n\t\t var cur = cm.getCursor();\n\t\t cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n\t\t }", "get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }", "function ensureCursorVisible(cm) {\n\t\t resolveScrollToPos(cm);\n\t\t var cur = cm.getCursor(), from = cur, to = cur;\n\t\t if (!cm.options.lineWrapping) {\n\t\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t\t to = Pos(cur.line, cur.ch + 1);\n\t\t }\n\t\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "_dragScroll() {\n if (!this._model.selectionEnd || !this._model.selectionStart) {\n return;\n }\n if (this._dragScrollAmount) {\n this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });\n // Re-evaluate selection\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n const buffer = this._bufferService.buffer;\n if (this._dragScrollAmount > 0) {\n if (this._activeSelectionMode !== 3 /* COLUMN */) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n this._model.selectionEnd[1] = Math.min(buffer.ydisp + this._bufferService.rows, buffer.lines.length - 1);\n }\n else {\n if (this._activeSelectionMode !== 3 /* COLUMN */) {\n this._model.selectionEnd[0] = 0;\n }\n this._model.selectionEnd[1] = buffer.ydisp;\n }\n this.refresh();\n }\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function maybeScrollWindow(cm, rect) {\n\t\t if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n\t\t var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n\t\t var doc = display.wrapper.ownerDocument;\n\t\t if (rect.top + box.top < 0) { doScroll = true; }\n\t\t else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n\t\t if (doScroll != null && !phantom) {\n\t\t var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n\t\t cm.display.lineSpace.appendChild(scrollNode);\n\t\t scrollNode.scrollIntoView(doScroll);\n\t\t cm.display.lineSpace.removeChild(scrollNode);\n\t\t }\n\t\t }", "function ensureCursorVisible(cm) {\r\n resolveScrollToPos(cm);\r\n var cur = cm.getCursor();\r\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\r\n}", "function ensureCursorVisible(cm) {\r\n resolveScrollToPos(cm);\r\n var cur = cm.getCursor(), from = cur, to = cur;\r\n if (!cm.options.lineWrapping) {\r\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\r\n to = Pos(cur.line, cur.ch + 1);\r\n }\r\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\r\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }", "function containScroll() {\n\n var targetX = startX + deltaX;\n var targetY = startY + deltaY;\n\n if (targetY < 0)\n deltaY += -targetY;\n else {\n var containerVisibleHeight = focus ? focus.clientHeight : root.innerHeight;\n var containerRealHeight = focus ? focus.scrollHeight : document.body.scrollHeight;\n if (targetY + containerVisibleHeight > containerRealHeight)\n deltaY -= targetY + containerVisibleHeight - containerRealHeight;\n }\n\n if (targetX < 0)\n deltaX += -targetX;\n else {\n var containerVisibleWidth = focus ? focus.clientWidth : root.innerWidth;\n var containerRealWidth = focus ? focus.scrollWidth : document.body.scrollWidth;\n if (targetX + containerVisibleWidth > containerRealWidth)\n deltaX -= targetX + containerVisibleWidth - containerRealWidth;\n }\n\n }", "_checkScrollPosition() {\n\n var isVisible = this._isVisible;\n var isAtBottom = this._isAtBottom;\n var scrollTop = typeof window.scrollY !== 'undefined' ? window.scrollY : window.pageYOffset;\n var bottomThreshold = scrollTop + this._windowHeight;\n\n this._isVisible = scrollTop + this._windowHeight >= this._visibleThreshold ? true : false;\n this._isAtBottom = this._containerBottom <= bottomThreshold ? true : false;\n\n if (this._isAtBottom !== isAtBottom || this._isVisible !== isVisible) {\n this._updateBindings();\n }\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor(), from = cur, to = cur\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur\n to = Pos(cur.line, cur.ch + 1)\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin}\n}", "_handleScrolledClassOnEditor() {\n __querySelectorLive(`.${this.utils.cls('_editor-wrapper')}`, ($wrapper) => {\n $wrapper.addEventListener('scroll', (e) => {\n if (Math.abs($wrapper.scrollTop) >= 100) {\n this._$editor.classList.add('scrolled');\n }\n else {\n this._$editor.classList.remove('scrolled');\n }\n });\n });\n }", "scrollIntoView() {\n this.updated |= UPDATED_SCROLL;\n return this;\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm)\n var cur = cm.getCursor(), from = cur, to = cur\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur\n to = Pos(cur.line, cur.ch + 1)\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}\n}", "function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) {\n return;\n }\n\n var display = cm.display,\n box = display.sizer.getBoundingClientRect(),\n doScroll = null;\n\n if (rect.top + box.top < 0) {\n doScroll = true;\n } else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) {\n doScroll = false;\n }\n\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200B\", null, \"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + rect.left + \"px; width: \" + Math.max(2, rect.right - rect.left) + \"px;\");\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n } // Scroll a given position into view (immediately), verifying that", "function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }", "function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }", "function Va(e){Qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\t//setFocus();\n\t\t}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n\t\t if (margin == null) { margin = 0; }\n\t\t var rect;\n\t\t if (!cm.options.lineWrapping && pos == end) {\n\t\t // Set pos and end to the cursor positions around the character pos sticks to\n\t\t // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n\t\t // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n\t\t end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n\t\t pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n\t\t }\n\t\t for (var limit = 0; limit < 5; limit++) {\n\t\t var changed = false;\n\t\t var coords = cursorCoords(cm, pos);\n\t\t var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n\t\t rect = {left: Math.min(coords.left, endCoords.left),\n\t\t top: Math.min(coords.top, endCoords.top) - margin,\n\t\t right: Math.max(coords.left, endCoords.left),\n\t\t bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n\t\t var scrollPos = calculateScrollPos(cm, rect);\n\t\t var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n\t\t if (scrollPos.scrollTop != null) {\n\t\t updateScrollTop(cm, scrollPos.scrollTop);\n\t\t if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n\t\t }\n\t\t if (scrollPos.scrollLeft != null) {\n\t\t setScrollLeft(cm, scrollPos.scrollLeft);\n\t\t if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n\t\t }\n\t\t if (!changed) { break }\n\t\t }\n\t\t return rect\n\t\t }", "function Mn(e,a){var n=e.display,r=e.doc;if(a.editorIsHidden)return vn(e),!1;\n // Bail out if the visible area is already rendered and nothing changed.\n if(!a.force&&a.visible.from>=n.viewFrom&&a.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==En(e))return!1;za(e)&&(vn(e),a.dims=wa(e));\n // Compute a suitable new viewport (from & to)\n var f=r.first+r.size,o=Math.max(a.visible.from-e.options.viewportMargin,r.first),i=Math.min(f,a.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>i&&n.viewTo-i<20&&(i=Math.min(f,n.viewTo)),Jo&&(o=pe(e.doc,o),i=ge(e.doc,i));var s=o!=n.viewFrom||i!=n.viewTo||n.lastWrapHeight!=a.wrapperHeight||n.lastWrapWidth!=a.wrapperWidth;xn(e,o,i),n.viewOffset=ye(T(e.doc,n.viewFrom)),\n // Position the mover div to align with the current scroll position\n e.display.mover.style.top=n.viewOffset+\"px\";var c=En(e);if(!s&&0==c&&!a.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var u=Tn(e);\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n return c>4&&(n.lineDiv.style.display=\"none\"),An(e,n.updateLineNumbers,a.dims),c>4&&(n.lineDiv.style.display=\"\"),n.renderedView=n.view,Nn(u),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=a.wrapperHeight,n.lastWrapWidth=a.wrapperWidth,Sn(e,400)),n.updateLineNumbers=null,!0}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}" ]
[ "0.6381544", "0.62946326", "0.61377126", "0.6136688", "0.60811096", "0.6075753", "0.6057329", "0.601064", "0.601064", "0.601064", "0.6005282", "0.5908861", "0.5908861", "0.5908861", "0.5908861", "0.5908861", "0.5908861", "0.5908861", "0.5906888", "0.58924943", "0.58923125", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5883875", "0.5879922", "0.58454883", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.5826507", "0.582005", "0.58135754", "0.5806061", "0.57984835", "0.5796033", "0.5779673", "0.5779673", "0.577912", "0.5775156", "0.57747626", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57707816", "0.57686913", "0.57686913", "0.57686913", "0.5765142", "0.57567346", "0.57535005", "0.57535005", "0.57535005", "0.57535005", "0.57535005", "0.57535005" ]
0.5791855
66
Scroll a given position into view (immediately), verifying that it actually became visible (as line heights are accurately measured, the position of something may 'drift' during drawing).
function scrollPosIntoView(cm, pos, end, margin) { if (margin == null) { margin = 0; } var rect; if (!cm.options.lineWrapping && pos == end) { // Set pos and end to the cursor positions around the character pos sticks to // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch // If pos == Pos(_, 0, "before"), pos and end are unchanged pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; } for (var limit = 0; limit < 5; limit++) { var changed = false; var coords = cursorCoords(cm, pos); var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); rect = {left: Math.min(coords.left, endCoords.left), top: Math.min(coords.top, endCoords.top) - margin, right: Math.max(coords.left, endCoords.left), bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; var scrollPos = calculateScrollPos(cm, rect); var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } } if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } } if (!changed) { break } } return rect }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ifVisible(pos) {\n var bottomLine = html.clientHeight + html.scrollTop;\n\n if (pos < bottomLine) {\n return true;\n }\n }", "_checkScrollPosition() {\n\n var isVisible = this._isVisible;\n var isAtBottom = this._isAtBottom;\n var scrollTop = typeof window.scrollY !== 'undefined' ? window.scrollY : window.pageYOffset;\n var bottomThreshold = scrollTop + this._windowHeight;\n\n this._isVisible = scrollTop + this._windowHeight >= this._visibleThreshold ? true : false;\n this._isAtBottom = this._containerBottom <= bottomThreshold ? true : false;\n\n if (this._isAtBottom !== isAtBottom || this._isVisible !== isVisible) {\n this._updateBindings();\n }\n }", "_scrollSpy() {\n const currentScrollPosition = scrollPosition();\n if (currentScrollPosition.top > this.props.scrollStart) {\n if (!this.state.isVisible) {\n this.setState({ isVisible: true });\n }\n } else {\n if (this.state.isVisible) {\n this.setState({ isVisible: false });\n }\n }\n }", "function ensureVisible()\r\n{\r\n var selectedTop = selected.position().top;\r\n var selectedBottom = selectedTop + selected.outerHeight();\r\n\r\n var $wnd = $(wnd);\r\n var wndTop = $wnd.scrollTop();\r\n var wndBottom = wndTop + $wnd.height();\r\n\r\n if(selectedBottom > wndBottom)\r\n {\r\n $wnd.scrollTop(wndTop + (selectedBottom-wndBottom));\r\n }\r\n else if(selectedTop < wndTop)\r\n {\r\n $wnd.scrollTop(selectedTop);\r\n }\r\n}", "function checkPosition() {\n const offset = reposition(prevFocused);\n if (offset.top !== prevOffset.top || offset.left !== prevOffset.left || offset.width !== prevOffset.width || offset.height !== prevOffset.height) {\n // console.log(\"Changed focus position\", offset, prevFocused);\n prevOffset = offset;\n staticCounter = 0;\n } else {\n staticCounter++;\n }\n if (staticCounter < 3) {\n // at the beginning and as long as we see position changes\n // we will check the position/bounds more often\n positionTimeout = setTimeout(checkPosition, 100);\n } else {\n // we want to measure at least every 2 seconds\n positionTimeout = setTimeout(checkPosition, 1000);\n }\n }", "function checkScrollPosition() {\n clearTimeout(scrollPosCheck);\n scrollPosCheck = setTimeout(function () {\n if ($(window).scrollTop() >= scrollIndicatorThreshold) {\n if (animating) {\n animating = 0;\n $('.scroll-indicator-shadow').css({ \"display\": \"none\" });\n }\n setTimeout(() => {\n $('.scroll-indicator').addClass(\"scroll-indicator-up\");\n }, 1);\n\n } else {\n $('.scroll-indicator').removeClass(\"scroll-indicator-up\");\n }\n }, 100);\n }", "function checkPosition () {\n if (!$el.is(':visible')) return;\n \n var height = $el.height(),\n // offset = options.offset\n scrollHeight = Math.max($(document).height(), $(document.body).height()),\n\n // position y of target compared to our scroll position\n\n scrollTop = $el.scrollTop(),\n position = $el.offset(),\n targetHeight = $el.height();\n\n console.log($el, height, scrollTop, position, targetHeight);\n\n $el.removeClass('affix-top affix-bottom affix');\n if (scrollTop <= offsetTop) {\n // top position\n $el.addClass('affix-top');\n } else if (position.top + height >= scrollHeight - offsetBottom) {\n // bottom position\n $el.addClass('affix-bottom');\n } else {\n // centered affixed position\n $el.addClass('affix');\n }\n\n }", "function checkVisible(elm) {\n var rect = elm.getBoundingClientRect();\n var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);\n return !(rect.bottom < 0 || rect.top + 20 - viewHeight >= 0);\n}", "function inViewport(position) {\n if(position.x > viewport.x && position.y > viewport.y &&\n position.x < viewport.x + 1 && position.y < viewport.y + 1) {\n return true; \n } else { return false; }\n }", "function ScrollPosition() {}", "function ensureVisible(e)\n{\n\tvar posTop = findPosY(e);\n\tvar posBot = posTop + e.offsetHeight;\n\tvar winTop = findScrollY();\n\tvar winHeight = findWindowHeight();\n\tvar winBot = winTop + winHeight;\n\tif(posTop < winTop)\n\t\treturn(posTop);\n\telse if(posBot > winBot)\n\t\t{\n\t\tif(e.offsetHeight < winHeight)\n\t\t\treturn(posTop - (winHeight - e.offsetHeight));\n\t\telse\n\t\t\treturn(posTop);\n\t\t}\n\telse\n\t\treturn(winTop);\n}", "function isElementVisible(elementToBeChecked)\n{\n var TopView = $(window).scrollTop();\n var BotView = TopView + $(window).height();\n var TopElement = $(elementToBeChecked).offset().top;\n var BotElement = TopElement + $(elementToBeChecked).height()-150;\n return ((BotElement <= BotView) && (TopElement >= TopView));\n}", "function checkScrollHeight() {\n let pos = window.scrollY\n let button = document.querySelector('.goto')\n\n if (pos > 50) {\n button.style.display = \"block\"\n } else {\n button.style.display = \"none\"\n }\n}", "function isScrolledIntoView(elem){\n\t// New & Improved Check\n\tvar docViewTop = $(window).scrollTop(),\n\tdocViewBottom = docViewTop + $(window).height(),\n\telemTop = $(elem).offset().top,\n\telemBottom = elemTop + $(elem).height();\n\t\n\t// Is more than half of the element visible\n\treturn ((elemTop + ((elemBottom - elemTop)/2)) >= docViewTop && ((elemTop + ((elemBottom - elemTop)/2)) <= docViewBottom));\n}", "function checkIfVisible(elem, offset) {\n var docViewBottom = $(window).scrollTop() + $(window).height();\n var elemTop = $(elem).offset().top;\n var offset = offset | 0;\n return( (elemTop + offset) <= docViewBottom );\n}", "function checkView(e) {\n\n const scroll = window.scrollY || window.pageYOffset,\n boundsTop = e.getBoundingClientRect().top + scroll;\n\n\n const viewport = {\n top: scroll,\n bottom: scroll + window.innerHeight,\n }\n\n const bounds = {\n top: boundsTop,\n bottom: boundsTop + e.clientHeight,\n }\n\n\n return (bounds.top + 300) < viewport.top;\n\n }", "_listenToScroll() {\n this.setState({\n visible: window.pageYOffset > 0\n });\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = _lineAtHeight(doc, top),\n to = _lineAtHeight(doc, bottom); // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n\n\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line,\n ensureTo = viewport.ensure.to.line;\n\n if (ensureFrom < from) {\n from = ensureFrom;\n to = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = _lineAtHeight(doc, _heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n\n return {\n from: from,\n to: Math.max(to, from + 1)\n };\n } // SCROLLING THINGS INTO VIEW", "function makeVisible(element) {\n /* Find the location of element relative to document top. */\n var posY = element.offsetTop;\n var parent = element.offsetParent;\n while (parent) {\n posY += parent.offsetTop;\n parent = parent.offsetParent;\n }\n /* Define the range of values that we want to be onscreen (you can add\n * margins here). */\n var margin = 8;\n var top = posY - margin;\n var bottom = posY + element.offsetHeight + margin;\n /* Determine the range of values that currently are onscreen\n * (Note: might fail to deduce the height of a horizontal scrollbar)\n */\n var visible_top = window.scrollY;\n var visible_bottom = window.scrollY + window.innerHeight;\n var tc = $('#touch-controls');\n if (tc.is(\":visible\")) {\n visible_bottom -= tc[0].offsetHeight;\n }\n /* Calculate the amount to scroll */\n var amount = 0;\n if (visible_top > top) {\n /* Top of our desired range is obscured. */\n amount = top - visible_top;\n } else if (bottom > visible_bottom) {\n /* Bottom of our desired range is obscured. */\n amount = bottom - visible_bottom;\n if (visible_top + amount > top) {\n /* The element doesn't fit on screen, make the topmost part of it\n * visible */\n amount = top - visible_top;\n }\n }\n if (amount) window.scrollBy(0, amount);\n}", "function checkScrollPosition() {\n if ($(window).scrollTop() + $(window).height() == $(document).height()) {\n $.ajax({\n url: replaceURLName(nextURL),\n success: function (data) {\n var results = extractInfoFromData(data);\n renderResultsWithHandlebarTemplate(results.items);\n nextURL = results.next;\n if (nextURL) {\n setTimeout(checkScrollPosition, 500);\n }\n },\n });\n } else {\n setTimeout(checkScrollPosition, 500);\n }\n}", "function scrolledVisibleView(elem) {\n var docViewTop = $(window).scrollTop(); //top of browser window\n var docViewBottom = docViewTop + $(window).height(); //bottom of browser window\n var elemTop = $(elem).offset().top; //top of element\n var elemBottom = elemTop + $(elem).height(); //bottom of element\n return ((elemBottom <= docViewBottom) || (elemTop >= docViewTop)); //return the value when element is outside browser window\n }", "function scrolledVisibleView(elem) {\n var docViewTop = $(window).scrollTop(); //top of browser window\n var docViewBottom = docViewTop + $(window).height(); //bottom of browser window\n var elemTop = $(elem).offset().top; //top of element\n var elemBottom = elemTop + $(elem).height(); //bottom of element\n return ((elemBottom <= docViewBottom) || (elemTop >= docViewTop)); //return the value when element is outside browser window\n }", "function show() {\r\n showThis.forEach(function(e) {\r\n if (isElementInViewport(e)) {\r\n e.classList.add(\"showing\");\r\n } else {\r\n e.classList.remove(\"showing\");\r\n }\r\n });\r\n scroll(show); //request point and apply/remove classes\r\n}", "function appearsOnScroll() {\n $('.row').on('inview', function(event, visible) {\n if (visible === true) {\n $(this).addClass('visible');\n };\n });\n // $(window).scrollTop(1); //move scroll to fires inview events\n}", "function positionCheck(clientRect) {\n return event.originalEvent.clientY <= clientRect.top + 10;\n }", "function move(pos) {\n if (element) {\n var x = element.scrollLeft\n var y = element.scrollTop\n try {\n scrolling = true\n element.scrollLeft = scrollOrigin[0] + pos[0] * scrollMultiplier[0];\n element.scrollTop = scrollOrigin[1] + pos[1] * scrollMultiplier[1];\n } finally {\n scrolling = false\n }\n return element.scrollLeft != x || element.scrollTop != y\n }\n }", "function checkVisibility(message)\n{\n\t// Scroll the view down a certain amount\n\t$chatlogs.stop().animate({scrollTop: $chatlogs[0].scrollHeight});\n}", "function checkVisible(){\n\t\tif (firedAnimation){\n\t\t\t// animation has already fired, detach the event listeners\n\t\t\tdocument.removeEventListener(\"scroll\", checkVisible, false);\n\t\t\twindow.removeEventListener(\"resize\", checkVisible, false);\n\t\t\treturn;\n\t\t}\n\t\tvar rect = chart.getBoundingClientRect();\n\t\tvar top = window.pageYOffset || document.documentElement.scrollTop;\n\t\tvar left = window.pageXOffset || document.documentElement.scrollLeft;\n\n\t\tif ((rect.top>=0)&&(rect.top <window.innerHeight) && \n\t\t\t(rect.left>=0)&&(rect.left <window.innerWidth)){\n\t\t\t// this means that we partly see the chart\n\t\t\t// fire the animation (only once)\n\t\t\tfiredAnimation = true;\n\t\t\tsetAnimate(startValue, endValue, (500/animationSpeed));\t\t\t\t\t\n\t\t}\n\t}", "function checkVisibility(message) {\n\n\t// Scroll the view down a certain amount\n\t$chatlogs.stop().animate({scrollTop: $chatlogs[0].scrollHeight});\n}", "function checkPosition(elemsToShow, callback) {\n // if (!elemsToShow.length === undefined) {\n // elemsToShow.forEach(function (elem) {\n // if (isElementInViewport(elem)) {\n // callback();\n // }\n // });\n // onScroll(checkPosition);\n // } else {\n if (isElementInViewport(elemsToShow)) {\n callback();\n return;\n }\n onScroll(() => checkPosition(elemsToShow, callback));\n // }\n}", "function ensureCursorVisible(cm) {\n\t\t resolveScrollToPos(cm);\n\t\t var cur = cm.getCursor(), from = cur, to = cur;\n\t\t if (!cm.options.lineWrapping) {\n\t\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t\t to = Pos(cur.line, cur.ch + 1);\n\t\t }\n\t\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t\t }", "function isVisible(topFoldOffset, bottomFoldOffset) {\n\n // If the element is not visible because it\n // is hidden, don't bother testing it.\n if (! element.is(\":visible\")) {\n\n return (false );\n\n }\n\n // If the height has not yet been calculated,\n // the cache it for the duration of the page.\n if (height === null) {\n\n height = element.height() || 215;\n\n }\n // Update the dimensions of the element.\n var top = element.offset().top;\n var bottom = (top + height );\n // Return true if the element is:\n // 1. The top offset is in view.\n // 2. The bottom offset is in view.\n // 3. The element is overlapping the viewport.\n return (((top <= bottomFoldOffset ) && (top >= topFoldOffset )\n ) || ((bottom <= bottomFoldOffset ) && (bottom >= topFoldOffset )\n ) || ((top <= topFoldOffset ) && (bottom >= bottomFoldOffset )\n )\n );\n }", "function viewVisible(element){\n var windowHeight = $(window).height();\n var windowTop = $(window).scrollTop() + (windowHeight * .10);\n var windowBottom = (windowHeight - windowTop) - (windowHeight * .10);\n var targetElement = element.offset().top;\n var coffee = daysFromGenerator(2, \"3/15/16\");\n var coding = daysFromGenerator(12, \"3/15/16\");\n\n if(targetElement < windowBottom && targetElement > windowTop && set === false){\n timeAdd($('.coffee-drink'), coffee - 100, coffee);\n timeAdd($('.hours-code'), coding - 100, coding);\n set = true;\n }\n}", "function scrollToView($el) {\n\t\t\t// get the current position\n\t\t\tvar p = position($el, true);\n\t\t\t// get the screen dimensions\n\t\t\tvar sd = getScreenDimensions();\n\n\t\t\t// if we're hidden off the bottom of the page, move up\n\t\t\tif (p.bottom > sd.y) {\n\t\t\t\t$(\"html,body\").animate({\n\t\t\t\t\t\"scrollTop\"\t: \"+=\"\n\t\t\t\t\t\t\t+ ((p.bottom - sd.y) + settings.screenPadding)\n\t\t\t\t\t\t\t+ \"px\"\n\t\t\t\t})\n\t\t\t}\n\t\t}", "get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "checkScrollPos() {\n let fromTop = window.scrollY;\n this.links.forEach(link => {\n let section = document.querySelector(`#${link.el.dataset.section}`);\n if (section.offsetTop <= fromTop && section.offsetTop + section.offsetHeight > fromTop) {\n link.setCurrent();\n } else {\n link.setCurrent(false);\n }\n })\n }", "function checkForParallaxInView(parallaxItem) {\n var isVisible = false;\n var yScrollPosition = window.scrollY;\n var header = document.querySelector('header');\n var headerHeight = header.offsetHeight; \n var startScrollFn = parallaxItem.offsetTop - parallaxItem.offsetHeight + headerHeight;\n var endScrollFn = parallaxItem.offsetTop + parallaxItem.offsetHeight + headerHeight;\n // console.log('--------------------------');\n // console.log(`ypos is ${yScrollPosition}`);\n // console.log(`start is ${startScrollFn}`);\n // console.log(`end is ${endScrollFn}`);\n // console.log('--------------------------');\n\n if(yScrollPosition > startScrollFn && yScrollPosition < endScrollFn) {\n return isVisible = true;\n } else {\n return isVisible = false\n }\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)};\n }", "isVisible() {\n\t\tlet y = this.getY();\n\t\treturn y >= -100 && y <= dh + 100;\n\t}", "function isScrolledIntoView(el) {\n var elemTop = el.getBoundingClientRect().top;\n var elemBottom = el.getBoundingClientRect().bottom;\n var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);\n return isVisible;\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }", "handleScroll() {\n const { scrollPos } = this.state;\n this.setState({\n scrollPos: document.body.getBoundingClientRect().top,\n show: document.body.getBoundingClientRect().top > scrollPos\n });\n }", "function isScrolledIntoView(element) {\n\tvar $element = $(element);\n\tif( $element.is(\":visible\") ) {\n\t\tvar scrollTop = $window.scrollTop();\n\t\tvar bottomView = scrollTop + $window.height();\n\t\tvar elementOffsetTop = $element.offset().top;\n\t\tvar elementBottomView = elementOffsetTop + $element.height();\n\t\treturn((( elementOffsetTop >= scrollTop) && (elementOffsetTop <= bottomView)) || ((elementBottomView >= scrollTop) && (elementBottomView <= bottomView)));\n\t}\n}", "function inView() {\n // get window height\n var windowHeight = window.innerHeight;\n // get number of pixels that the document is scrolled\n var scrollY = window.scrollY || window.pageYOffset;\n\n // get current scroll position (distance from the top of the page to the bottom of the current viewport)\n var scrollPosition = scrollY + windowHeight;\n // get element position (distance from the top of the page to the bottom of the element)\n var elementPosition =\n element.getBoundingClientRect().top + scrollY + elementHeight;\n\n // is scroll position greater than element position? (is element in view?)\n if (scrollPosition > elementPosition) {\n return true;\n }\n\n return false;\n}", "function isVisible(topFoldOffset, bottomFoldOffset) {\n\n\t\t\t// If the element is not visible because it\n\t\t\t// is hidden, don't bother testing it.\n\t\t\tif (! element.is(\":visible\")) {\n\n\t\t\t\t//return (false );\n\n\t\t\t}\n\n\t\t\t// If the height has not yet been calculated,\n\t\t\t// the cache it for the duration of the page.\n\t\t\tif (height === null) {\n\n\t\t\t\theight = element.height();\n\n\t\t\t}\n\t\t\t// Update the dimensions of the element.\n\t\t\tvar top = element.offset().top;\n\t\t\tvar bottom = (top + height );\n\t\t\t// Return true if the element is:\n\t\t\t// 1. The top offset is in view.\n\t\t\t// 2. The bottom offset is in view.\n\t\t\t// 3. The element is overlapping the viewport.\n\t\t\treturn (((top <= bottomFoldOffset ) && (top >= topFoldOffset )\n\t\t\t) || ((bottom <= bottomFoldOffset ) && (bottom >= topFoldOffset )\n\t\t\t) || ((top <= topFoldOffset ) && (bottom >= bottomFoldOffset )\n\t\t\t)\n\t\t\t);\n\n\t\t}", "scrollBehavior (to, from, savedPosition) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n if (savedPosition) {\n resolve(savedPosition);\n } else {\n resolve({ x: 0, y: 0 })\n }\n }, 500);\n })\n }", "function isVisible(elem){var coords=elem.getBoundingClientRect();var windowHeight=document.documentElement.clientHeight;var extendedTop=-windowHeight;var extendedBottom=2*windowHeight;// верхняя граница elem в пределах видимости ИЛИ нижняя граница видима\nvar topVisible=coords.top>extendedTop&&coords.top<extendedBottom;var bottomVisible=coords.bottom<extendedBottom&&coords.bottom>extendedTop;return topVisible||bottomVisible;}", "function containScroll() {\n\n var targetX = startX + deltaX;\n var targetY = startY + deltaY;\n\n if (targetY < 0)\n deltaY += -targetY;\n else {\n var containerVisibleHeight = focus ? focus.clientHeight : root.innerHeight;\n var containerRealHeight = focus ? focus.scrollHeight : document.body.scrollHeight;\n if (targetY + containerVisibleHeight > containerRealHeight)\n deltaY -= targetY + containerVisibleHeight - containerRealHeight;\n }\n\n if (targetX < 0)\n deltaX += -targetX;\n else {\n var containerVisibleWidth = focus ? focus.clientWidth : root.innerWidth;\n var containerRealWidth = focus ? focus.scrollWidth : document.body.scrollWidth;\n if (targetX + containerVisibleWidth > containerRealWidth)\n deltaX -= targetX + containerVisibleWidth - containerRealWidth;\n }\n\n }", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\t\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)};\n\t\t }", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) {\n margin = 0;\n }\n\n var rect;\n\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n\n var coords = _cursorCoords(cm, pos);\n\n var endCoords = !end || end == pos ? coords : _cursorCoords(cm, end);\n rect = {\n left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin\n };\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop,\n startLeft = cm.doc.scrollLeft;\n\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) {\n changed = true;\n }\n }\n\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) {\n changed = true;\n }\n }\n\n if (!changed) {\n break;\n }\n }\n\n return rect;\n } // Scroll a given set of coordinates into view (immediately).", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop\n top = Math.floor(top - paddingTop(display))\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line\n if (ensureFrom < from) {\n from = ensureFrom\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)\n to = ensureTo\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n}", "function visibleLines(display, doc, viewport) {\n\t\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t\t top = Math.floor(top - paddingTop(display));\n\t\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t\t // forces those lines into the viewport (if possible).\n\t\t if (viewport && viewport.ensure) {\n\t\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t\t if (ensureFrom < from) {\n\t\t from = ensureFrom;\n\t\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t\t to = ensureTo;\n\t\t }\n\t\t }\n\t\t return {from: from, to: Math.max(to, from + 1)}\n\t\t }", "function checkPosition() {\n for (let i = 0; i < elements.length; i++) {\n // getBoundingClientRect returns the size of the element and its position relative to the viewport\n // so basically, look how far the element is from the top of the viewport, if it gets close in view \n // add the fade in animation\n let positionFromTop = elements[i].getBoundingClientRect().top;\n if (positionFromTop - windowHeight <= 0) {\n elements[i].className = elements[i].className.replace(\n 'hidden',\n 'fade-in-element'\n );\n }\n }\n }", "function IsScrolledIntoView(elem, bottom_buffer) {\n var docViewTop = $(window).scrollTop();\n var docViewBottom = docViewTop + $(window).height();\n var elemTop = $(elem).offset().top;\n var elemBottom = elemTop + $(elem).height();\n if (bottom_buffer) docViewBottom -= bottom_buffer;\n return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom));\n}", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\t\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "setScrollPosition(position) {\n // Set the new scrollTop/scrollLeft to all scrollViews elements\n return this.pageScrollOptions.scrollViews.reduce((oneAlreadyWorked, scrollingView) => {\n const startScrollPropertyValue = this.getScrollPropertyValue(scrollingView);\n\n if (scrollingView && startScrollPropertyValue !== undefined && startScrollPropertyValue !== null) {\n const scrollDistance = Math.abs(startScrollPropertyValue - position); // The movement we need to perform is less than 2px\n // This we consider a small movement which some browser may not perform when\n // changing the scrollTop/scrollLeft property\n // Thus in this cases we do not stop the scroll animation, although setting the\n // scrollTop/scrollLeft value \"fails\"\n\n const isSmallMovement = scrollDistance < this.pageScrollOptions._minScrollDistance;\n\n if (!this.pageScrollOptions.verticalScrolling) {\n scrollingView.scrollLeft = position;\n } else {\n scrollingView.scrollTop = position;\n } // Return true if setting the new scrollTop/scrollLeft value worked\n // We consider that it worked if the new scrollTop/scrollLeft value is closer to the\n // desired scrollTop/scrollLeft than before (it might not be exactly the value we\n // set due to dpi or rounding irregularities)\n\n\n if (isSmallMovement || scrollDistance > Math.abs(this.getScrollPropertyValue(scrollingView) - position)) {\n return true;\n }\n }\n\n return oneAlreadyWorked;\n }, false);\n }", "function visibleLines(display, doc, viewport) {\r\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\r\n top = Math.floor(top - paddingTop(display));\r\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\r\n\r\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\r\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\r\n // forces those lines into the viewport (if possible).\r\n if (viewport && viewport.ensure) {\r\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\r\n if (ensureFrom < from) {\r\n from = ensureFrom;\r\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\r\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\r\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\r\n to = ensureTo;\r\n }\r\n }\r\n return {from: from, to: Math.max(to, from + 1)}\r\n}", "function loop(){\n DisplayedEl.forEach(function(elem){\n if(IsElementInViewport(elem)){\n elem.classList.add(\"visible\");\n }else{\n elem.classList.remove(\"visible\");\n }\n });\n scroll(loop);\n}", "function check(e) {\n var pos = getPos(e), posAbs = { x: e.clientX, y: e.clientY }; // div is fixed, so use clientX/Y\n if (!visible &&\n pos.x >= region.x && pos.x < region.x + region.w &&\n pos.y >= region.y && pos.y < region.y + region.h) {\n me.show(posAbs); // show tool-tip at this pos\n }\n else\n setDivPos(posAbs); // otherwise, update position\n }", "function checkScrollState() {\r\n\tif (yPos2 > yPos) {\r\n\t\tscrolling.state = true; // this will make it stop\r\n\t}\r\n\tif (scrolling.state) {\r\n\t\tstopScroll();\r\n\t} else if (!scrolling.state) {\r\n\t\tstartScroll();\r\n\t}\r\n}", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function visibleLines(display, doc, viewport) {\n\t var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n\t top = Math.floor(top - paddingTop(display));\n\t var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n\t var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n\t // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n\t // forces those lines into the viewport (if possible).\n\t if (viewport && viewport.ensure) {\n\t var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n\t if (ensureFrom < from) {\n\t from = ensureFrom;\n\t to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n\t } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n\t from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n\t to = ensureTo;\n\t }\n\t }\n\t return {from: from, to: Math.max(to, from + 1)};\n\t }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }" ]
[ "0.69423", "0.6568037", "0.6292333", "0.6179102", "0.6121385", "0.6019687", "0.59949857", "0.5969167", "0.59429836", "0.5869381", "0.5855563", "0.5851159", "0.5847824", "0.58293194", "0.58235383", "0.5810686", "0.5810506", "0.5798683", "0.5796673", "0.57808304", "0.57767045", "0.57767045", "0.575953", "0.5755784", "0.57554704", "0.5744903", "0.57400656", "0.5730798", "0.57243395", "0.5723089", "0.5708277", "0.57037055", "0.5700537", "0.56933045", "0.5692027", "0.5675459", "0.5675459", "0.5675459", "0.56753093", "0.56710577", "0.5664031", "0.5664031", "0.5664031", "0.5664031", "0.5659601", "0.56500065", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5644927", "0.5638321", "0.56334436", "0.56310993", "0.5626172", "0.5619178", "0.5619009", "0.56186515", "0.5616794", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.56106985", "0.5604616", "0.56005484", "0.56005484", "0.5598685", "0.5590075", "0.55875087", "0.55799556", "0.5579564", "0.55779153", "0.55697024", "0.55616206", "0.55537605", "0.5547293", "0.5547293", "0.5534022", "0.5534022", "0.5534022", "0.5534022", "0.5534022" ]
0.0
-1
Scroll a given set of coordinates into view (immediately).
function scrollIntoView(cm, rect) { var scrollPos = calculateScrollPos(cm, rect); if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollIntoView(cm, x1, y1, x2, y2) {\n\t\t var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n\t\t if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n\t\t if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n\t\t }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n\t var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n\t if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n\t if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n\t }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n\t var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n\t if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n\t if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n\t }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n\t var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n\t if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n\t if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n\t }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\r\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);\r\n if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);\r\n if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);\r\n }", "function scrollIntoView(cm, x1, y1, x2, y2) {\n var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)\n if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) break;\n }\n return coords;\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) break;\n }\n return coords;\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) break;\n }\n return coords;\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) break;\n }\n return coords;\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (var limit = 0; limit < 5; limit++) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) return coords;\n }\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n\t\t if (margin == null) margin = 0;\n\t\t for (var limit = 0; limit < 5; limit++) {\n\t\t var changed = false, coords = cursorCoords(cm, pos);\n\t\t var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n\t\t var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n\t\t Math.min(coords.top, endCoords.top) - margin,\n\t\t Math.max(coords.left, endCoords.left),\n\t\t Math.max(coords.bottom, endCoords.bottom) + margin);\n\t\t var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n\t\t if (scrollPos.scrollTop != null) {\n\t\t setScrollTop(cm, scrollPos.scrollTop);\n\t\t if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n\t\t }\n\t\t if (scrollPos.scrollLeft != null) {\n\t\t setScrollLeft(cm, scrollPos.scrollLeft);\n\t\t if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n\t\t }\n\t\t if (!changed) break;\n\t\t }\n\t\t return coords;\n\t\t }", "function scrollPosIntoView(cm, pos, end, margin) {\n\t if (margin == null) margin = 0;\n\t for (var limit = 0; limit < 5; limit++) {\n\t var changed = false, coords = cursorCoords(cm, pos);\n\t var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n\t var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n\t Math.min(coords.top, endCoords.top) - margin,\n\t Math.max(coords.left, endCoords.left),\n\t Math.max(coords.bottom, endCoords.bottom) + margin);\n\t var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n\t if (scrollPos.scrollTop != null) {\n\t setScrollTop(cm, scrollPos.scrollTop);\n\t if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n\t }\n\t if (scrollPos.scrollLeft != null) {\n\t setScrollLeft(cm, scrollPos.scrollLeft);\n\t if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n\t }\n\t if (!changed) break;\n\t }\n\t return coords;\n\t }", "function scrollPosIntoView(cm, pos, end, margin) {\n\t if (margin == null) margin = 0;\n\t for (var limit = 0; limit < 5; limit++) {\n\t var changed = false, coords = cursorCoords(cm, pos);\n\t var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n\t var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n\t Math.min(coords.top, endCoords.top) - margin,\n\t Math.max(coords.left, endCoords.left),\n\t Math.max(coords.bottom, endCoords.bottom) + margin);\n\t var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n\t if (scrollPos.scrollTop != null) {\n\t setScrollTop(cm, scrollPos.scrollTop);\n\t if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n\t }\n\t if (scrollPos.scrollLeft != null) {\n\t setScrollLeft(cm, scrollPos.scrollLeft);\n\t if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n\t }\n\t if (!changed) break;\n\t }\n\t return coords;\n\t }", "function scrollPosIntoView(cm, pos, end, margin) {\n\t if (margin == null) margin = 0;\n\t for (var limit = 0; limit < 5; limit++) {\n\t var changed = false, coords = cursorCoords(cm, pos);\n\t var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n\t var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n\t Math.min(coords.top, endCoords.top) - margin,\n\t Math.max(coords.left, endCoords.left),\n\t Math.max(coords.bottom, endCoords.bottom) + margin);\n\t var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n\t if (scrollPos.scrollTop != null) {\n\t setScrollTop(cm, scrollPos.scrollTop);\n\t if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n\t }\n\t if (scrollPos.scrollLeft != null) {\n\t setScrollLeft(cm, scrollPos.scrollLeft);\n\t if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n\t }\n\t if (!changed) break;\n\t }\n\t return coords;\n\t }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var coords\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return coords\n}", "function scrollIntoView(cm, rect) {\n\t\t var scrollPos = calculateScrollPos(cm, rect);\n\t\t if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n\t\t if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n\t\t }", "async scrollIntoView() {\n await this.assertConnectedElement();\n await this.evaluate(async (element) => {\n element.scrollIntoView({\n block: 'center',\n inline: 'center',\n behavior: 'instant',\n });\n });\n }", "function move(sel) {\ndocument.querySelector(sel).scrollIntoView({ \n behavior: 'smooth' \n});\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) {\n margin = 0;\n }\n\n var rect;\n\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n\n var coords = _cursorCoords(cm, pos);\n\n var endCoords = !end || end == pos ? coords : _cursorCoords(cm, end);\n rect = {\n left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin\n };\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop,\n startLeft = cm.doc.scrollLeft;\n\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) {\n changed = true;\n }\n }\n\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) {\n changed = true;\n }\n }\n\n if (!changed) {\n break;\n }\n }\n\n return rect;\n } // Scroll a given set of coordinates into view (immediately).", "function scrollPosIntoView(cm, pos, end, margin) {\r\n if (margin == null) margin = 0;\r\n for (;;) {\r\n var changed = false, coords = cursorCoords(cm, pos);\r\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\r\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\r\n Math.min(coords.top, endCoords.top) - margin,\r\n Math.max(coords.left, endCoords.left),\r\n Math.max(coords.bottom, endCoords.bottom) + margin);\r\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\r\n if (scrollPos.scrollTop != null) {\r\n setScrollTop(cm, scrollPos.scrollTop);\r\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\r\n }\r\n if (scrollPos.scrollLeft != null) {\r\n setScrollLeft(cm, scrollPos.scrollLeft);\r\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\r\n }\r\n if (!changed) return coords;\r\n }\r\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (;;) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) return coords;\n }\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) margin = 0;\n for (;;) {\n var changed = false, coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),\n Math.min(coords.top, endCoords.top) - margin,\n Math.max(coords.left, endCoords.left),\n Math.max(coords.bottom, endCoords.bottom) + margin);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;\n }\n if (!changed) return coords;\n }\n }", "function jumpto(coordinates, zoom){\n let position = fromLonLat(coordinates)\n if (zoom)\n view.animate({zoom: zoom, center: position});\n else\n view.animate({center: position});\n}", "function scroll() {\n\t\telement.scrollIntoView({behavior: \"smooth\"});\n\t\t\n\t}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0 }\n var rect\n for (var limit = 0; limit < 5; limit++) {\n var changed = false\n var coords = cursorCoords(cm, pos)\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin}\n var scrollPos = calculateScrollPos(cm, rect)\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft\n if (scrollPos.scrollTop != null) {\n setScrollTop(cm, scrollPos.scrollTop)\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft)\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect)\n if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }\n}", "function scrollIntoView(cm, rect) {\r\n var scrollPos = calculateScrollPos(cm, rect);\r\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\r\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\r\n}", "function scrollMapTo(x, y) {\n\t\tvar scl = eval(x) / this.minimap.xRate;\n\t\tvar sct = eval(y) / this.minimap.yRate;\n\t\tdocument.getElementById(MAP).scrollLeft = scl;\n\t\tdocument.getElementById(MAP).scrollTop = sct;\n\t}", "function ScrollAll(_X,_Y,_ms){\n\t\t\t//Scroll both appropriately within the same animation\n\t\t\tanimateScroll(_X);\n\t\t}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\t//setFocus();\n\t\t}", "function scroll(els) {\n sections = els;\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n d3.select(window)\n .on('scroll.scroller', position)\n .on('resize.scroller', resize);\n\n // manually call resize\n // initially to setup\n // scroller.\n resize();\n\n // hack to get position\n // to be called once for\n // the scroll position on\n // load.\n // @v4 timer no longer stops if you\n // return true at the end of the callback\n // function - so here we stop it explicitly.\n var timer = d3.timer(function () {\n position();\n timer.stop();\n });\n }", "function scrollTo(e,d){if(d>=0){var h=document.documentElement;if(h.scrollTop===0){var t=h.scrollTop;++h.scrollTop;h=t+1===h.scrollTop--?h:document.body}typeof e===\"object\"&&(e=e.offsetTop);scrollToX(h,h.scrollTop,e,0,1/d,20)}}", "function scrolldiv() {\n window.scroll(0, findPosition(matches[i]));\n }", "function ScrollPosition() {}", "setScrollPosition() {\n var step = this.state.step;\n var isVertical = this.props.vertical;\n var left = !isVertical ? step * this.state.width : 0;\n var top = isVertical ? step * this.state.height : 0;\n\n this.scroller.setPosition(left, top);\n this.scroller.scrollTo(left, top, false);\n }", "function scrollPosIntoView(cm, pos, end, margin) {\r\n if (margin == null) { margin = 0; }\r\n var rect;\r\n if (!cm.options.lineWrapping && pos == end) {\r\n // Set pos and end to the cursor positions around the character pos sticks to\r\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\r\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\r\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\r\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\r\n }\r\n for (var limit = 0; limit < 5; limit++) {\r\n var changed = false;\r\n var coords = cursorCoords(cm, pos);\r\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\r\n rect = {left: Math.min(coords.left, endCoords.left),\r\n top: Math.min(coords.top, endCoords.top) - margin,\r\n right: Math.max(coords.left, endCoords.left),\r\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\r\n var scrollPos = calculateScrollPos(cm, rect);\r\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\r\n if (scrollPos.scrollTop != null) {\r\n updateScrollTop(cm, scrollPos.scrollTop);\r\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\r\n }\r\n if (scrollPos.scrollLeft != null) {\r\n setScrollLeft(cm, scrollPos.scrollLeft);\r\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\r\n }\r\n if (!changed) { break }\r\n }\r\n return rect\r\n}", "function scrollToPoint(x, y) {\n Reporter_1.Reporter.debug(`Scrolling to point: (${x},${y})`);\n tryBlock(() => browser.scroll(x, y), `Failed scroll to point (${x},${y})`);\n }", "function scrollIntoView(element) {\n var scrollerBounds = scroller.getBoundingClientRect();\n var elementBounds = element.getBoundingClientRect();\n var extra = 7;\n var scrollX = Math.min(0, elementBounds.left - scrollerBounds.left - extra) || Math.max(0, elementBounds.right - scrollerBounds.right + extra + (scroller.offsetWidth - scroller.clientWidth));\n var scrollY = Math.min(0, elementBounds.top - scrollerBounds.top - extra) || Math.max(0, elementBounds.bottom - scrollerBounds.bottom + extra + (scroller.offsetHeight - scroller.clientHeight));\n scroller.scrollLeft += scrollX;\n scroller.scrollTop += scrollY;\n }", "function resolveScrollToPos(cm) {\n\t\t var range = cm.curOp.scrollToPos;\n\t\t if (range) {\n\t\t cm.curOp.scrollToPos = null;\n\t\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t\t scrollToCoordsRange(cm, from, to, range.margin);\n\t\t }\n\t\t }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n}", "function scroll (element) {\r\n element.scrollIntoView({behavior: \"smooth\", block: \"start\", inline: \"nearest\"});\r\n}", "function scrollTo(el, d, n) { // element, diff(-/+), number\n if (d !== undefined) { // If offset is provided\n if (d === \"pos\") {\n $('html, body').animate({\n scrollTop: $(el).offset().top + n\n }, 800)\n } else {\n $('html, body').animate({\n scrollTop: $(el).offset().top - n\n }, 800)\n }\n } else { // If no offset is defined\n $('html, body').animate({\n scrollTop: $(el).offset().top\n }, 800)\n }\n }", "function updateScroll(event) {\n moveElements();\n}", "function scroll(els) {\n sections = els;\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n\n d3.select(ReactDOM.findDOMNode(this))\n .on('scroll.scroller', position)\n .on('resize.scroller', resize);\n\n // manually call resize\n // initially to setup\n // scroller.\n resize();\n\n // hack to get position\n // to be called once for\n // the scroll position on\n // load.\n // @v4 timer no longer stops if you\n // return true at the end of the callback\n // function - so here we stop it explicitly.\n var timer = d3.timer(function () {\n position();\n timer.stop();\n });\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }", "function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }" ]
[ "0.6669891", "0.66223603", "0.66223603", "0.66223603", "0.65623295", "0.65623295", "0.65623295", "0.65623295", "0.65623295", "0.65623295", "0.65623295", "0.6510215", "0.64825606", "0.6190785", "0.6190785", "0.6190785", "0.6190785", "0.61849487", "0.61735487", "0.61570007", "0.61570007", "0.61570007", "0.61564255", "0.6028487", "0.5997315", "0.59425974", "0.5940152", "0.5866813", "0.584695", "0.584695", "0.5839418", "0.5835233", "0.5823333", "0.58215165", "0.5816454", "0.5812893", "0.5802991", "0.57596827", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.5755303", "0.57365483", "0.570819", "0.56767625", "0.5675236", "0.5664833", "0.5653596", "0.5616224", "0.56040907", "0.5586162", "0.5574529", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55724055", "0.55576104", "0.55555797", "0.554673", "0.55448335", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733", "0.55324733" ]
0.5908495
38
Calculate a new scroll position needed to scroll the given rectangle into view. Returns an object with scrollTop and scrollLeft properties. When these are undefined, the vertical/horizontal position does not need to be adjusted.
function calculateScrollPos(cm, rect) { var display = cm.display, snapMargin = textHeight(cm.display); if (rect.top < 0) { rect.top = 0; } var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; var screen = displayHeight(cm), result = {}; if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } var docBottom = cm.doc.height + paddingVert(display); var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; if (rect.top < screentop) { result.scrollTop = atTop ? 0 : rect.top; } else if (rect.bottom > screentop + screen) { var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); if (newTop != screentop) { result.scrollTop = newTop; } } var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); var tooWide = rect.right - rect.left > screenw; if (tooWide) { rect.right = rect.left + screenw; } if (rect.left < 10) { result.scrollLeft = 0; } else if (rect.left < screenleft) { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); } else if (rect.right > screenw + screenleft - 3) { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } return result }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPosition(rect) {\r\n return {\r\n \"top\" : window.scrollY + Math.round(rect.top),\r\n \"right\" : Math.round(rect.left + rect.width),\r\n \"bottom\" : window.scrollY + Math.round(rect.top + rect.height),\r\n \"left\" : Math.round(rect.left),\r\n \"leftCenter\" : Math.round(rect.left + rect.width/2)\r\n };\r\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }", "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._getDocument();\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top, left };\n }", "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top, left };\n }", "function calculateScrollPos(cm, rect) {\n var display = cm.display,\n snapMargin = textHeight(cm.display);\n\n if (rect.top < 0) {\n rect.top = 0;\n }\n\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm),\n result = {};\n\n if (rect.bottom - rect.top > screen) {\n rect.bottom = rect.top + screen;\n }\n\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin,\n atBottom = rect.bottom > docBottom - snapMargin;\n\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n\n if (newTop != screentop) {\n result.scrollTop = newTop;\n }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n\n if (tooWide) {\n rect.right = rect.left + screenw;\n }\n\n if (rect.left < 10) {\n result.scrollLeft = 0;\n } else if (rect.left < screenleft) {\n result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10));\n } else if (rect.right > screenw + screenleft - 3) {\n result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw;\n }\n\n return result;\n } // Store a relative adjustment to the scroll position in the current", "function calculateScrollPos(cm, rect) {\r\n var display = cm.display, snapMargin = textHeight(cm.display);\r\n if (rect.top < 0) { rect.top = 0; }\r\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\r\n var screen = displayHeight(cm), result = {};\r\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\r\n var docBottom = cm.doc.height + paddingVert(display);\r\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\r\n if (rect.top < screentop) {\r\n result.scrollTop = atTop ? 0 : rect.top;\r\n } else if (rect.bottom > screentop + screen) {\r\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\r\n if (newTop != screentop) { result.scrollTop = newTop; }\r\n }\r\n\r\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\r\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\r\n var tooWide = rect.right - rect.left > screenw;\r\n if (tooWide) { rect.right = rect.left + screenw; }\r\n if (rect.left < 10)\r\n { result.scrollLeft = 0; }\r\n else if (rect.left < screenleft)\r\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\r\n else if (rect.right > screenw + screenleft - 3)\r\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\r\n return result\r\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n}", "function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (rect.top < 0) { rect.top = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = rect.right - rect.left > screenw\n if (tooWide) { rect.right = rect.left + screenw }\n if (rect.left < 10)\n { result.scrollLeft = 0 }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }\n return result\n}", "function calculateScrollPos(cm, rect) {\n\t\t var display = cm.display, snapMargin = textHeight(cm.display);\n\t\t if (rect.top < 0) { rect.top = 0; }\n\t\t var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n\t\t var screen = displayHeight(cm), result = {};\n\t\t if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n\t\t var docBottom = cm.doc.height + paddingVert(display);\n\t\t var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n\t\t if (rect.top < screentop) {\n\t\t result.scrollTop = atTop ? 0 : rect.top;\n\t\t } else if (rect.bottom > screentop + screen) {\n\t\t var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n\t\t if (newTop != screentop) { result.scrollTop = newTop; }\n\t\t }\n\n\t\t var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n\t\t var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n\t\t var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n\t\t var tooWide = rect.right - rect.left > screenw;\n\t\t if (tooWide) { rect.right = rect.left + screenw; }\n\t\t if (rect.left < 10)\n\t\t { result.scrollLeft = 0; }\n\t\t else if (rect.left < screenleft)\n\t\t { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n\t\t else if (rect.right > screenw + screenleft - 3)\n\t\t { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n\t\t return result\n\t\t }", "getScroll() {\n if (!(this.frame instanceof HTMLElement)) {\n return {\n x: undefined,\n y: undefined\n };\n }\n return {\n x: this.frame.contentWindow.scrollX,\n y: this.frame.contentWindow.scrollY\n };\n }", "function getScrollToShow(doc, boundingBox) {\n const scroll = getScroll(doc);\n const win = getWindow(doc);\n // vertical\n // if(scroll.y > boundingBox.top - SCROLL_ZONE_SIZE) {\n if (scroll.y > boundingBox.top) {\n scroll.y = boundingBox.top - exports.SCROLL_ZONE_SIZE;\n }\n // else if(scroll.y < boundingBox.bottom + SCROLL_ZONE_SIZE - win.innerHeight) {\n else if (scroll.y < boundingBox.bottom - win.innerHeight) {\n scroll.y = boundingBox.bottom + exports.SCROLL_ZONE_SIZE - win.innerHeight;\n }\n // horizontal\n // if(scroll.x > boundingBox.left - SCROLL_ZONE_SIZE) {\n if (scroll.x > boundingBox.left) {\n scroll.x = boundingBox.left - exports.SCROLL_ZONE_SIZE;\n }\n // else if(scroll.x < boundingBox.right + SCROLL_ZONE_SIZE - win.innerWidth) {\n else if (scroll.x < boundingBox.right - win.innerWidth) {\n scroll.x = boundingBox.right + exports.SCROLL_ZONE_SIZE - win.innerWidth;\n }\n return {\n x: Math.max(0, scroll.x),\n y: Math.max(0, scroll.y),\n };\n }", "function calcScrollPosition() {\n const positionBracket = calcPositionBracket();\n const scrollY = window.scrollY;\n const r = ((scrollY - positionBracket.copy.prev) / (positionBracket.copy.next - positionBracket.copy.prev));\n\n const visualsScrollTarget = Math.round(positionBracket.visual.prev + ((positionBracket.visual.next - positionBracket.visual.prev) * r));\n\n return visualsScrollTarget;\n}", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = display.scroller.clientHeight - scrollerCutOff, result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = display.scroller.clientWidth - scrollerCutOff - display.gutters.offsetWidth;\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\n return result;\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = display.scroller.clientHeight - scrollerCutOff, result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = display.scroller.clientWidth - scrollerCutOff - display.gutters.offsetWidth;\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = y1 + screen;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\n return result;\n }", "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return {\n top: 0,\n left: 0\n };\n } // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n\n\n const document = this._document;\n\n const window = this._getWindow();\n\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX || documentElement.scrollLeft || 0;\n return {\n top,\n left\n };\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\r\n var display = cm.display, snapMargin = textHeight(cm.display);\r\n if (y1 < 0) y1 = 0;\r\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\r\n var screen = display.scroller.clientHeight - scrollerCutOff, result = {};\r\n if (y2 - y1 > screen) y2 = y1 + screen;\r\n var docBottom = cm.doc.height + paddingVert(display);\r\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\r\n if (y1 < screentop) {\r\n result.scrollTop = atTop ? 0 : y1;\r\n } else if (y2 > screentop + screen) {\r\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\r\n if (newTop != screentop) result.scrollTop = newTop;\r\n }\r\n\r\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\r\n var screenw = display.scroller.clientWidth - scrollerCutOff - display.gutters.offsetWidth;\r\n var tooWide = x2 - x1 > screenw;\r\n if (tooWide) x2 = y1 + screen;\r\n if (x1 < 10)\r\n result.scrollLeft = 0;\r\n else if (x1 < screenleft)\r\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\r\n else if (x2 > screenw + screenleft - 3)\r\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\r\n\r\n return result;\r\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "function getScrollPosition(win) {\n var x = 0, y = 0;\n if (typeof win.pageXOffset == NUMBER && typeof win.pageYOffset == NUMBER) {\n x = win.pageXOffset;\n y = win.pageYOffset;\n } else {\n var doc = win.document;\n var docEl = doc.documentElement;\n var compatMode = doc.compatMode;\n var scrollEl = (typeof compatMode == \"string\" && compatMode.indexOf(\"CSS\") >= 0 && docEl)\n ? docEl : dom.getBody(doc);\n\n if (scrollEl && typeof scrollEl.scrollLeft == NUMBER && typeof scrollEl.scrollTop == NUMBER) {\n try {\n x = scrollEl.scrollLeft;\n y = scrollEl.scrollTop;\n } catch (ex) {}\n }\n }\n return { x: x, y: y };\n }", "function getScrollPosition(win) {\n var x = 0, y = 0;\n if (typeof win.pageXOffset == NUMBER && typeof win.pageYOffset == NUMBER) {\n x = win.pageXOffset;\n y = win.pageYOffset;\n } else {\n var doc = win.document;\n var docEl = doc.documentElement;\n var compatMode = doc.compatMode;\n var scrollEl = (typeof compatMode == \"string\" && compatMode.indexOf(\"CSS\") >= 0 && docEl)\n ? docEl : dom.getBody(doc);\n\n if (scrollEl && typeof scrollEl.scrollLeft == NUMBER && typeof scrollEl.scrollTop == NUMBER) {\n try {\n x = scrollEl.scrollLeft;\n y = scrollEl.scrollTop;\n } catch (ex) {}\n }\n }\n return { x: x, y: y };\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = display.scroller.clientHeight - scrollerCutOff, result = {};\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = display.scroller.clientWidth - scrollerCutOff;\n x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;\n var gutterw = display.gutters.offsetWidth;\n var atLeft = x1 < gutterw + 10;\n if (x1 < screenleft + gutterw || atLeft) {\n if (atLeft) x1 = 0;\n result.scrollLeft = Math.max(0, x1 - 10 - gutterw);\n } else if (x2 > screenw + screenleft - 3) {\n result.scrollLeft = x2 + 10 - screenw;\n }\n return result;\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n return result;\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n return result;\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n return result;\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (y1 < 0) y1 = 0;\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (y2 - y1 > screen) y2 = y1 + screen;\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1;\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n if (newTop != screentop) result.scrollTop = newTop;\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = x2 - x1 > screenw;\n if (tooWide) x2 = x1 + screenw;\n if (x1 < 10)\n result.scrollLeft = 0;\n else if (x1 < screenleft)\n result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n else if (x2 > screenw + screenleft - 3)\n result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n return result;\n }", "extractScrollTargetPosition() {\n const scrollTargetElement = this.getScrollTargetElement();\n\n if (scrollTargetElement === null || scrollTargetElement === undefined) {\n // Scroll target not found\n return {\n top: NaN,\n left: NaN\n };\n }\n\n if (this.isInlineScrolling) {\n return PageScrollInstance.getInlineScrollingTargetPosition(this.pageScrollOptions, scrollTargetElement);\n }\n\n return PageScrollInstance.getScrollingTargetPosition(this.pageScrollOptions, scrollTargetElement);\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n\t var display = cm.display, snapMargin = textHeight(cm.display);\n\t if (y1 < 0) y1 = 0;\n\t var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n\t var screen = displayHeight(cm), result = {};\n\t if (y2 - y1 > screen) y2 = y1 + screen;\n\t var docBottom = cm.doc.height + paddingVert(display);\n\t var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n\t if (y1 < screentop) {\n\t result.scrollTop = atTop ? 0 : y1;\n\t } else if (y2 > screentop + screen) {\n\t var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n\t if (newTop != screentop) result.scrollTop = newTop;\n\t }\n\t\n\t var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n\t var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n\t var tooWide = x2 - x1 > screenw;\n\t if (tooWide) x2 = x1 + screenw;\n\t if (x1 < 10)\n\t result.scrollLeft = 0;\n\t else if (x1 < screenleft)\n\t result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n\t else if (x2 > screenw + screenleft - 3)\n\t result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\t return result;\n\t }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n\t\t var display = cm.display, snapMargin = textHeight(cm.display);\n\t\t if (y1 < 0) y1 = 0;\n\t\t var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n\t\t var screen = displayHeight(cm), result = {};\n\t\t if (y2 - y1 > screen) y2 = y1 + screen;\n\t\t var docBottom = cm.doc.height + paddingVert(display);\n\t\t var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n\t\t if (y1 < screentop) {\n\t\t result.scrollTop = atTop ? 0 : y1;\n\t\t } else if (y2 > screentop + screen) {\n\t\t var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n\t\t if (newTop != screentop) result.scrollTop = newTop;\n\t\t }\n\t\t\n\t\t var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n\t\t var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n\t\t var tooWide = x2 - x1 > screenw;\n\t\t if (tooWide) x2 = x1 + screenw;\n\t\t if (x1 < 10)\n\t\t result.scrollLeft = 0;\n\t\t else if (x1 < screenleft)\n\t\t result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n\t\t else if (x2 > screenw + screenleft - 3)\n\t\t result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\t\t return result;\n\t\t }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n\t var display = cm.display, snapMargin = textHeight(cm.display);\n\t if (y1 < 0) y1 = 0;\n\t var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n\t var screen = displayHeight(cm), result = {};\n\t if (y2 - y1 > screen) y2 = y1 + screen;\n\t var docBottom = cm.doc.height + paddingVert(display);\n\t var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n\t if (y1 < screentop) {\n\t result.scrollTop = atTop ? 0 : y1;\n\t } else if (y2 > screentop + screen) {\n\t var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n\t if (newTop != screentop) result.scrollTop = newTop;\n\t }\n\n\t var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n\t var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n\t var tooWide = x2 - x1 > screenw;\n\t if (tooWide) x2 = x1 + screenw;\n\t if (x1 < 10)\n\t result.scrollLeft = 0;\n\t else if (x1 < screenleft)\n\t result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n\t else if (x2 > screenw + screenleft - 3)\n\t result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\t return result;\n\t }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n\t var display = cm.display, snapMargin = textHeight(cm.display);\n\t if (y1 < 0) y1 = 0;\n\t var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n\t var screen = displayHeight(cm), result = {};\n\t if (y2 - y1 > screen) y2 = y1 + screen;\n\t var docBottom = cm.doc.height + paddingVert(display);\n\t var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;\n\t if (y1 < screentop) {\n\t result.scrollTop = atTop ? 0 : y1;\n\t } else if (y2 > screentop + screen) {\n\t var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);\n\t if (newTop != screentop) result.scrollTop = newTop;\n\t }\n\n\t var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n\t var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n\t var tooWide = x2 - x1 > screenw;\n\t if (tooWide) x2 = x1 + screenw;\n\t if (x1 < 10)\n\t result.scrollLeft = 0;\n\t else if (x1 < screenleft)\n\t result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10));\n\t else if (x2 > screenw + screenleft - 3)\n\t result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw;\n\t return result;\n\t }", "_getNarrowedViewportRect() {\n // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,\n // because we want to use the `clientWidth` and `clientHeight` as the base. The difference\n // being that the client properties don't include the scrollbar, as opposed to `innerWidth`\n // and `innerHeight` that do. This is necessary, because the overlay container uses\n // 100% `width` and `height` which don't include the scrollbar either.\n const width = this._document.documentElement.clientWidth;\n const height = this._document.documentElement.clientHeight;\n const scrollPosition = this._viewportRuler.getViewportScrollPosition();\n return {\n top: scrollPosition.top + this._viewportMargin,\n left: scrollPosition.left + this._viewportMargin,\n right: scrollPosition.left + width - this._viewportMargin,\n bottom: scrollPosition.top + height - this._viewportMargin,\n width: width - (2 * this._viewportMargin),\n height: height - (2 * this._viewportMargin),\n };\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) return savedPosition;\n else return { left: 0, top: 0 };\n }", "static adjustScroll(box,scroll) {\n // WIP...\n if (typeof(box) == 'undefined' || typeof(scroll) == 'undefined') {\n console.log('bad values to scroll thing');\n return;\n }\n return svgHelpers.boxPoints(box.x - scroll.x,box.y-scroll.y,box.width,box.height);\n // return box;\n }", "function calculateScrollPos(cm, x1, y1, x2, y2) {\n var display = cm.display, snapMargin = textHeight(cm.display)\n if (y1 < 0) { y1 = 0 }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop\n var screen = displayHeight(cm), result = {}\n if (y2 - y1 > screen) { y2 = y1 + screen }\n var docBottom = cm.doc.height + paddingVert(display)\n var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin\n if (y1 < screentop) {\n result.scrollTop = atTop ? 0 : y1\n } else if (y2 > screentop + screen) {\n var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)\n if (newTop != screentop) { result.scrollTop = newTop }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)\n var tooWide = x2 - x1 > screenw\n if (tooWide) { x2 = x1 + screenw }\n if (x1 < 10)\n { result.scrollLeft = 0 }\n else if (x1 < screenleft)\n { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }\n else if (x2 > screenw + screenleft - 3)\n { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }\n return result\n}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function ViewportScrollPosition() {}", "function getScrollOffsets(w) {\n // Use the specified window or the current window if no argument\n w = w || window;\n\n // This works for all browsers except IE versions 8 and before\n if (w.pageXOffset != null)\n return {x: w.pageXOffset, y:w.pageYOffset};\n\n // For IE (or any browser) in Standards mode\n var d = w.document;\n if (document.compatMode == \"CSS1Compat\")\n return {x:d.documentElement.scrollLeft, y:d.documentElement.scrollTop};\n\n // For browsers in Quirks mode\n return { x: d.body.scrollLeft, y: d.body.scrollTop };\n}", "scrollBehavior (to, from, savedPosition) {\n return { x: 0, y: 0 }\n }", "scrollBehavior(_, _2, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n }\n return { top: 0, left: 0 };\n }", "function ScrollPosition() {}", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "function scrollIntoView(cm, rect) {\n\t\t var scrollPos = calculateScrollPos(cm, rect);\n\t\t if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n\t\t if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n\t\t }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "scrollBehavior(to, from, savedPosition) {\n return {x: 0, y: 0};\n }", "scrollBehavior(to, from, savedPosition) {\n return { x: 0, y: 0 };\n }", "function getScrollingPosition()\r\n\t\t{\r\n\t\t\tvar position = [0, 0];\r\n\t\t\t\tif (typeof window.pageYOffset != 'undefined')\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition = [\r\n\t\t\t\t\twindow.pageXOffset,\r\n\t\t\t\t\twindow.pageYOffset\r\n\t\t\t\t\t];\r\n\t\t\t\t\t}\r\n\t\t\t\telse if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition = [\r\n\t\t\t\t\tdocument.documentElement.scrollLeft,\r\n\t\t\t\t\tdocument.documentElement.scrollTop\r\n\t\t\t\t\t];\r\n\t\t\t\t}\r\n\t\t\t\telse if (typeof document.body.scrollTop != 'undefined')\r\n\t\t\t\t{\r\n\t\t\t\t\tposition = [\r\n\t\t\t\t\tdocument.body.scrollLeft,\r\n\t\t\t\t\tdocument.body.scrollTop\r\n\t\t\t\t\t];\r\n\t\t\t\t}\r\n\t\t\treturn position;\r\n\t\t}", "function Cr(e){var t=e.container;return[t.scrollLeft,t.scrollTop]}", "scrollBehavior (to, from, savedPosition) {\r\n if (savedPosition) {\r\n return savedPosition\r\n } else {\r\n return { x: 0, y: 0 }\r\n }\r\n }", "scrollBehavior(to, from, savedPosition) {\n return { x: 0, y: 0 };\n }", "scrollBehavior (to, from, savedPosition) {\n\t\treturn { x: 0, y: 0 }\n\t}", "function ViewportScrollPosition() { }", "function ViewportScrollPosition() { }", "getViewportRect() {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition();\n const {\n width,\n height\n } = this.getViewportSize();\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width\n };\n }", "function getPosition(el) {\n while (el) {\n if (el.tagName == \"ball\") {\n // deal with browser quirks with body/window/document and page scroll\n var xScroll = el.scrollLeft || document.documentElement.scrollLeft;\n var yScroll = el.scrollTop || document.documentElement.scrollTop;\n\n xPos += el.offsetLeft - xScroll + el.clientLeft;\n current.left = xPos;\n yPos += el.offsetTop - yScroll + el.clientTop;\n current.top = yPos;\n } else {\n // for all other non-BODY elements\n xPos += el.offsetLeft - el.scrollLeft + el.clientLeft;\n current.left = xPos;\n yPos += el.offsetTop - el.scrollTop + el.clientTop;\n current.top = yPos;\n }\n\n el = el.offsetParent;\n }\n\n return {\n x: xPos,\n y: yPos,\n };\n}", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {x: 0, y: 0}\n }\n }", "function getScrollXY() {\n var scrOfX = 0, scrOfY = 0;\n if(window.pageYOffset) {\n //Netscape compliant\n scrOfY = window.pageYOffset;\n scrOfX = window.pageXOffset;\n }else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){\n //DOM compliant\n scrOfY = document.body.scrollTop;\n scrOfX = document.body.scrollLeft;\n }else if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop)){\n //IE6 standards compliant mode\n scrOfY = document.documentElement.scrollTop;\n scrOfX = document.documentElement.scrollLeft;\n }\n return new Point(scrOfX,scrOfY);\n}", "function get_scroll_xy() {\n var scroll_offset = {x:0, y:0};\n var body = document.body;\n var root = document.documentElement;\n if(typeof(window.pageYOffset) == 'number') {\n // Netscape compliant\n scroll_offset.y = window.pageYOffset;\n scroll_offset.x = window.pageXOffset;\n }\n else if(body && (body.scrollLeft || body.scrollTop)) {\n // DOM compliant\n scroll_offset.y = body.scrollTop;\n scroll_offset.x = body.scrollLeft;\n }\n else if(root && (root.scrollLeft || root.scrollTop)) {\n // IE6 standards compliant mode\n scroll_offset.y = root.scrollTop;\n scroll_offset.x = root.scrollLeft;\n }\n return scroll_offset;\n}", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }", "function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }" ]
[ "0.65935665", "0.64901495", "0.64901495", "0.64901495", "0.64901495", "0.64901495", "0.64901495", "0.64879495", "0.6468168", "0.64599055", "0.64464575", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.64172757", "0.6382589", "0.63437766", "0.6326947", "0.6282048", "0.6281226", "0.6256509", "0.6253693", "0.6232737", "0.6228465", "0.6216034", "0.619988", "0.619988", "0.61833036", "0.61817163", "0.61817163", "0.61817163", "0.61817163", "0.61817163", "0.615447", "0.615447", "0.615447", "0.615447", "0.61290705", "0.61015564", "0.60990846", "0.60908103", "0.60908103", "0.6071152", "0.6053516", "0.6049856", "0.60275877", "0.6013387", "0.6013387", "0.6013387", "0.6013387", "0.59816444", "0.59767085", "0.5962597", "0.5925189", "0.5914306", "0.58908415", "0.5883771", "0.5877651", "0.58593", "0.5858035", "0.5851291", "0.58509284", "0.58393914", "0.5836755", "0.58366257", "0.58366257", "0.58300304", "0.57979316", "0.57924753", "0.57915115", "0.5781683", "0.57761765", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095", "0.5765095" ]
0.6590364
9
Store a relative adjustment to the scroll position in the current operation (to be applied when the operation finishes).
function addToScrollTop(cm, top) { if (top == null) { return } resolveScrollToPos(cm); cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveScrollPosition({ commit }, value) {\n commit('setScrollPosition', value)\n }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t\t if (left != null || top != null) resolveScrollToPos(cm);\n\t\t if (left != null)\n\t\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t\t if (top != null)\n\t\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t\t }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "function addToScrollPos(cm, left, top) {\r\n if (left != null || top != null) resolveScrollToPos(cm);\r\n if (left != null)\r\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\r\n if (top != null)\r\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\r\n }", "function ScrollPosition() {}", "function onScroll() {\n if (savePositionHandle !== null) {\n return;\n }\n\n // It's possible that this scroll operation was triggered by what will be\n // a `POP` transition. Instead of updating the saved location\n // immediately, we have to enqueue the update, then potentially cancel it\n // if we observe a location update.\n savePositionHandle = _domHelpersUtilRequestAnimationFrame2['default'](function () {\n savePositionHandle = null;\n\n var state = _historyLibDOMStateStorage.readState(currentKey);\n var scrollPosition = [_domHelpersQueryScrollLeft2['default'](window), _domHelpersQueryScrollTop2['default'](window)];\n\n // We have to directly update `DOMStateStorage`, because actually\n // updating the location could cause e.g. React Router to re-render the\n // entire page, which would lead to observably bad scroll performance.\n _historyLibDOMStateStorage.saveState(currentKey, _extends({}, state, { scrollPosition: scrollPosition }));\n });\n }", "function scroll_add(delta) {\n\tif (scroll_min != null) {\n\t\tscroll = Math.max(\n\t\t\tscroll_min/0.6 - innerHeight + 40,\n\t\t\tMath.min(scroll + delta, scroll_max/0.6 + scroll_offset - 35)\n\t\t);\n\t\tdiv.screen.style.top = scroll_offset - scroll;\n\t}\n}", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) { resolveScrollToPos(cm) }\n if (left != null)\n { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }\n if (top != null)\n { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }\n}", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) { resolveScrollToPos(cm) }\n if (left != null)\n { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }\n if (top != null)\n { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }\n}", "_adjustScrollingTop() {\n return this.el.scrollTop = this.g.zoomer.get(\"_alignmentScrollTop\");\n }", "function adjustOffset(e) {\n e.data._prvt.elemOffset = e.data.element.offsetLeft + e.data._prvt.sliderBarBack[0].offsetLeft;\n }", "scrollBehavior(_, _2, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n }\n return { top: 0, left: 0 };\n }", "function createScrollActionPosition() {\n let header = document.getElementsByClassName(\"header\")[0];\n let headerHeight = header.offsetHeight;\n let pointofChange = headerHeight + 50;\n return pointofChange;\n}", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) return savedPosition;\n else return { left: 0, top: 0 };\n }", "update() {\n\t\tthis.scroll.update();\n\t}", "moveScroll( val )\r\n {\r\n let current = this.contentScroll.offsetLeft;\r\n let newPos = current + val;\r\n\r\n this.contentScroll.style.left = newPos+'px';\r\n\r\n this.handleButtons( newPos );\r\n }", "scrollBehavior (to, from, savedPosition) {\r\n if (savedPosition) {\r\n return savedPosition\r\n } else {\r\n return { x: 0, y: 0 }\r\n }\r\n }", "function _calcScrollOffset(normalize, refreshParticle) {\n\t\n\t // When moving using touch-gestures, make the offset stick to the\n\t // finger. When the bounds is exceeded, decrease the scroll distance\n\t // by two.\n\t if (refreshParticle || (this._scroll.particleValue === undefined)) {\n\t this._scroll.particleValue = this._scroll.particle.getPosition1D();\n\t this._scroll.particleValue = Math.round(this._scroll.particleValue * 1000) / 1000;\n\t }\n\t\n\t // do stuff\n\t var scrollOffset = this._scroll.particleValue;\n\t if (this._scroll.scrollDelta || this._scroll.normalizedScrollDelta) {\n\t scrollOffset += this._scroll.scrollDelta + this._scroll.normalizedScrollDelta;\n\t if (((this._scroll.boundsReached & Bounds.PREV) && (scrollOffset > this._scroll.springPosition)) ||\n\t ((this._scroll.boundsReached & Bounds.NEXT) && (scrollOffset < this._scroll.springPosition)) ||\n\t (this._scroll.boundsReached === Bounds.BOTH)) {\n\t scrollOffset = this._scroll.springPosition;\n\t }\n\t if (normalize) {\n\t if (!this._scroll.scrollDelta) {\n\t this._scroll.normalizedScrollDelta = 0;\n\t _setParticle.call(this, scrollOffset, undefined, '_calcScrollOffset');\n\t }\n\t this._scroll.normalizedScrollDelta += this._scroll.scrollDelta;\n\t this._scroll.scrollDelta = 0;\n\t }\n\t }\n\t\n\t if (this._scroll.scrollForceCount && this._scroll.scrollForce) {\n\t if (this._scroll.springPosition !== undefined) {\n\t scrollOffset = (scrollOffset + this._scroll.scrollForce + this._scroll.springPosition) / 2.0;\n\t }\n\t else {\n\t scrollOffset += this._scroll.scrollForce;\n\t }\n\t }\n\t\n\t // Prevent the scroll position from exceeding the bounds when overscroll is disabled\n\t if (!this.options.overscroll) {\n\t if ((this._scroll.boundsReached === Bounds.BOTH) ||\n\t ((this._scroll.boundsReached === Bounds.PREV) && (scrollOffset > this._scroll.springPosition)) ||\n\t ((this._scroll.boundsReached === Bounds.NEXT) && (scrollOffset < this._scroll.springPosition))) {\n\t scrollOffset = this._scroll.springPosition;\n\t }\n\t }\n\t\n\t //_log.call(this, 'scrollOffset: ', scrollOffset, ', particle:', this._scroll.particle.getPosition1D(), ', moveToPosition: ', this._scroll.moveToPosition, ', springPosition: ', this._scroll.springPosition);\n\t return scrollOffset;\n\t }", "updateScrollPosition(lastXDelta, lastYDelta) {\n // actually update the plane position only if last X delta or last Y delta is not equal to 0\n if(lastXDelta || lastYDelta) {\n // set new positions based on our delta without triggering reflow\n this._boundingRect.document.top += lastYDelta * this.renderer.pixelRatio;\n this._boundingRect.document.left += lastXDelta * this.renderer.pixelRatio;\n\n // apply them\n this._applyWorldPositions();\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {\n x: 0,\n y: 0,\n }\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "function _calcScrollOffset(normalize, refreshParticle) {\n\n\t // When moving using touch-gestures, make the offset stick to the\n\t // finger. When the bounds is exceeded, decrease the scroll distance\n\t // by two.\n\t if (refreshParticle || (this._scroll.particleValue === undefined)) {\n\t this._scroll.particleValue = this._scroll.particle.getPosition1D();\n\t this._scroll.particleValue = Math.round(this._scroll.particleValue * 1000) / 1000;\n\t }\n\n\t // do stuff\n\t var scrollOffset = this._scroll.particleValue;\n\t if (this._scroll.scrollDelta || this._scroll.normalizedScrollDelta) {\n\t scrollOffset += this._scroll.scrollDelta + this._scroll.normalizedScrollDelta;\n\t if (((this._scroll.boundsReached & Bounds.PREV) && (scrollOffset > this._scroll.springPosition)) ||\n\t ((this._scroll.boundsReached & Bounds.NEXT) && (scrollOffset < this._scroll.springPosition)) ||\n\t (this._scroll.boundsReached === Bounds.BOTH)) {\n\t scrollOffset = this._scroll.springPosition;\n\t }\n\t if (normalize) {\n\t if (!this._scroll.scrollDelta) {\n\t this._scroll.normalizedScrollDelta = 0;\n\t _setParticle.call(this, scrollOffset, undefined, '_calcScrollOffset');\n\t }\n\t this._scroll.normalizedScrollDelta += this._scroll.scrollDelta;\n\t this._scroll.scrollDelta = 0;\n\t }\n\t }\n\n\t if (this._scroll.scrollForceCount && this._scroll.scrollForce) {\n\t if (this._scroll.springPosition !== undefined) {\n\t scrollOffset = (scrollOffset + this._scroll.scrollForce + this._scroll.springPosition) / 2.0;\n\t }\n\t else {\n\t scrollOffset += this._scroll.scrollForce;\n\t }\n\t }\n\n\t //_log.call(this, 'scrollOffset: ', scrollOffset, ', particle:', this._scroll.particle.getPosition1D(), ', moveToPosition: ', this._scroll.moveToPosition, ', springPosition: ', this._scroll.springPosition);\n\t return scrollOffset;\n\t }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {\n x: 0,\n y: 0\n }\n }\n }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n console.log(\"后退\")\n return savedPosition\n } else {\n console.log(\"前进\")\n return {x: 0, y: 0}\n }\n }", "_updatePosition() {\n var width = this.$element.outerWidth();\n var outerWidth = $(window).width();\n var height = this.$element.outerHeight();\n var outerHeight = $(window).height();\n var left, top;\n if (this.options.hOffset === 'auto') {\n left = parseInt((outerWidth - width) / 2, 10);\n } else {\n left = parseInt(this.options.hOffset, 10);\n }\n if (this.options.vOffset === 'auto') {\n if (height > outerHeight) {\n top = parseInt(Math.min(100, outerHeight / 10), 10);\n } else {\n top = parseInt((outerHeight - height) / 4, 10);\n }\n } else {\n top = parseInt(this.options.vOffset, 10);\n }\n this.$element.css({top: top + 'px'});\n // only worry about left if we don't have an overlay or we havea horizontal offset,\n // otherwise we're perfectly in the middle\n if(!this.$overlay || (this.options.hOffset !== 'auto')) {\n this.$element.css({left: left + 'px'});\n this.$element.css({margin: '0px'});\n }\n\n }", "scrollBehavior (to, from, savedPosition) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n if (savedPosition) {\n resolve(savedPosition);\n } else {\n resolve({ x: 0, y: 0 })\n }\n }, 500);\n })\n }", "function updateScroll(){\n var treshold = 5;\n ux.scroll.offsetPrevious = ux.scroll.offset;\n ux.scroll.offset = $(window).scrollTop();\n \n // We compare distance traveled with a defined treshold and report scroll direction\n if( ux.scroll.offset - ux.scroll.offsetPrevious > treshold ){\n ux.scroll.direction = 'down';\n } else if( ux.scroll.offsetPrevious - ux.scroll.offset > treshold ){\n ux.scroll.direction = 'up';\n }\n \n ux.viewport.visibleTop = ux.scroll.offset\n ux.viewport.visibleBottom = ux.viewport.height + ux.scroll.offset;\n}", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n } else {\n return { x: 0, y: 0 };\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {x: 0, y: 0}\n }\n }", "_scroll(scrollCoefficient) {\n const that = this;\n\n that.$.scrollViewer.scrollTop = that.$.scrollViewer.scrollTop + scrollCoefficient * 10;\n that._updateScrollButtonVisibility();\n that.focus();\n }", "setScrollPosition(position) {\n // Set the new scrollTop/scrollLeft to all scrollViews elements\n return this.pageScrollOptions.scrollViews.reduce((oneAlreadyWorked, scrollingView) => {\n const startScrollPropertyValue = this.getScrollPropertyValue(scrollingView);\n\n if (scrollingView && startScrollPropertyValue !== undefined && startScrollPropertyValue !== null) {\n const scrollDistance = Math.abs(startScrollPropertyValue - position); // The movement we need to perform is less than 2px\n // This we consider a small movement which some browser may not perform when\n // changing the scrollTop/scrollLeft property\n // Thus in this cases we do not stop the scroll animation, although setting the\n // scrollTop/scrollLeft value \"fails\"\n\n const isSmallMovement = scrollDistance < this.pageScrollOptions._minScrollDistance;\n\n if (!this.pageScrollOptions.verticalScrolling) {\n scrollingView.scrollLeft = position;\n } else {\n scrollingView.scrollTop = position;\n } // Return true if setting the new scrollTop/scrollLeft value worked\n // We consider that it worked if the new scrollTop/scrollLeft value is closer to the\n // desired scrollTop/scrollLeft than before (it might not be exactly the value we\n // set due to dpi or rounding irregularities)\n\n\n if (isSmallMovement || scrollDistance > Math.abs(this.getScrollPropertyValue(scrollingView) - position)) {\n return true;\n }\n }\n\n return oneAlreadyWorked;\n }, false);\n }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "getCurrentScrollPosition() {\n return this._state;\n }", "function updateScroll(event) {\n moveElements();\n}", "function calcScrollPosition() {\n const positionBracket = calcPositionBracket();\n const scrollY = window.scrollY;\n const r = ((scrollY - positionBracket.copy.prev) / (positionBracket.copy.next - positionBracket.copy.prev));\n\n const visualsScrollTarget = Math.round(positionBracket.visual.prev + ((positionBracket.visual.next - positionBracket.visual.prev) * r));\n\n return visualsScrollTarget;\n}", "function updateCalculations(win, rootElement, targetElement, setName, hasScrolled) {\n\t\tvar inView = isInViewport(win, targetElement);\n\t\tquery('.' + setName, rootElement)[0].value = inView ? 1 : 0;\n\t\tquery('.hasScrolled', rootElement)[0].value = hasScrolled ? 1 : 0;\n\t}", "beforeUpdate() {\n const {\n delta, remain, bench, changeProp, getZone,\n setScrollTop, offset, variable, getVarOffset, size,\n } = this;\n const calcstart = changeProp === 'start' ? this.start : delta.start;\n const zone = getZone(calcstart);\n delta.keeps = remain + (bench || remain);\n // if start, size or offset change, update scroll position.\n if (changeProp && ['start', 'size', 'offset'].includes(changeProp)) {\n let scrollTop = 0;\n if (changeProp === 'offset') {\n scrollTop = offset; // 更新了偏移,直接将偏移设置为滚动距离\n } else {\n const { isLast, start } = zone;\n const { total } = delta;\n if (variable) { // 可变高度,则通过函数来计算距离\n scrollTop = getVarOffset(isLast ? total : start);\n } else if (isLast && (total - calcstart <= remain)) { // 已经滚动到最底\n scrollTop = total * size;\n } else {\n scrollTop = calcstart * size;\n }\n }\n this.$nextTick(setScrollTop.bind(this, scrollTop));\n }\n\n // if points out difference, force update once again.\n if (changeProp || delta.end !== zone.end || calcstart !== zone.start) {\n this.changeProp = '';\n delta.end = zone.end;\n delta.start = zone.start;\n this.forceRender();\n }\n }", "function headerOffsetAdjust() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('body.compose-mode').length > 0) {\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$headerScrollTop = nectarDOMInfo.scrollTop;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (lastPosition == $headerScrollTop) {\r\n\t\t\t\t\t\t\trequestAnimationFrame(headerOffsetAdjust);\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlastPosition = $headerScrollTop;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\theaderOffsetAdjustCalc();\r\n\t\t\t\t\t\trequestAnimationFrame(headerOffsetAdjust);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "setScrollPosition() {\n var step = this.state.step;\n var isVertical = this.props.vertical;\n var left = !isVertical ? step * this.state.width : 0;\n var top = isVertical ? step * this.state.height : 0;\n\n this.scroller.setPosition(left, top);\n this.scroller.scrollTo(left, top, false);\n }", "_setWrapperPosition() {\n this.wrapper.style.left = this.percentPosition.x + '%';\n this.wrapper.style.top = this.percentPosition.y + '%';\n }", "scrollToPosition(startPosition, endPosition, skipCursorUpdate) {\n if (this.skipScrollToPosition) {\n this.skipScrollToPosition = false;\n return;\n }\n if (this.owner.enableImageResizerMode && this.owner.imageResizerModule.isImageResizing\n || this.isMouseDownInFooterRegion || this.isRowOrCellResizing) {\n return;\n }\n let lineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, true);\n if (isNullOrUndefined(lineWidget)) {\n return;\n }\n let top = this.selection.getTop(lineWidget);\n if (this.isMouseDown) {\n let prevLineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, false);\n let prevTop = this.selection.getTop(prevLineWidget);\n if (prevLineWidget !== lineWidget && endPosition.location.y >= prevTop) {\n lineWidget = prevLineWidget;\n }\n }\n let height = lineWidget.height;\n //Gets current page.\n let endPage = this.selection.getPage(lineWidget.paragraph);\n this.currentPage = endPage;\n let x = 0;\n let y = 0;\n let viewer = this;\n let isPageLayout = viewer instanceof PageLayoutViewer;\n if (isPageLayout) {\n if (isNullOrUndefined(endPage)) {\n return;\n }\n let pageWidth = endPage.boundingRectangle.width;\n x = (this.visibleBounds.width - pageWidth * this.zoomFactor) / 2;\n if (x < 30) {\n x = 30;\n }\n // tslint:disable-next-line:max-line-length\n y = endPage.boundingRectangle.y * this.zoomFactor + (this.pages.indexOf(endPage) + 1) * viewer.pageGap * (1 - this.zoomFactor);\n }\n let scrollTop = this.containerTop;\n let scrollLeft = this.containerLeft;\n let pageHeight = this.visibleBounds.height;\n let caretInfo = this.selection.updateCaretSize(this.owner.selection.end, true);\n let topMargin = caretInfo.topMargin;\n let caretHeight = caretInfo.height;\n x += (endPosition.location.x) * this.zoomFactor;\n y += (endPosition.location.y + topMargin) * this.zoomFactor;\n //vertical scroll bar update\n if ((scrollTop + 20) > y) {\n this.viewerContainer.scrollTop = (y - 10);\n }\n else if (scrollTop + pageHeight < y + caretHeight) {\n this.viewerContainer.scrollTop = y + caretHeight - pageHeight + 10;\n }\n if (!skipCursorUpdate) {\n this.selection.updateCaretToPage(startPosition, endPage);\n }\n let scrollBarWidth = this.viewerContainer.offsetWidth - this.viewerContainer.clientWidth;\n if (scrollLeft > x) {\n this.viewerContainer.scrollLeft = x - (viewer.pageContainer.offsetWidth / 100) * 20;\n }\n else if (scrollLeft + this.visibleBounds.width < x + scrollBarWidth) {\n this.viewerContainer.scrollLeft = scrollLeft + (viewer.pageContainer.offsetWidth / 100) * 15 + scrollBarWidth;\n }\n }", "updateRelativePos_() {\n const {headerPosition_: header, footerPosition_: footer} = this;\n const {INSIDE, TOP, BOTTOM} = RelativePositions;\n\n devAssert(\n header || footer,\n 'next-page scroll triggered without a header or footer position'\n );\n\n if (header === INSIDE && footer === INSIDE) {\n // Both the header and footer are within the viewport bounds\n // meaning that the document is short enough to be\n // contained inside the viewport\n this.relativePos_ = PageRelativePos.INSIDE_VIEWPORT;\n } else if ((!header || header === TOP) && (!footer || footer === BOTTOM)) {\n // The head of the document is above the viewport and the\n // footer of the document is below it, meaning that the viewport\n // is looking at a section of the document\n this.relativePos_ = PageRelativePos.CONTAINS_VIEWPORT;\n } else if (\n ((!header || header === TOP) && footer === TOP) ||\n (header === BOTTOM && (!footer || footer === BOTTOM))\n ) {\n // Both the header and the footer of the document are either\n // above or below the document meaning that the viewport hasn't\n // reached the document yet or has passed it\n this.relativePos_ = PageRelativePos.OUTSIDE_VIEWPORT;\n } else {\n // The remaining case is the case where the document is halfway\n // through being scrolling into/out of the viewport in which case\n // we don't need to update the visibility\n this.relativePos_ = PageRelativePos.LEAVING_VIEWPORT;\n return;\n }\n\n this.manager_.updateVisibility();\n }", "updatePage(){\n let curPage = this.options.paging.offset,\n idxs = this.getFirstLastIndexes();\n\n if (this.options.internal.oldScrollPosition === undefined){\n this.options.internal.oldScrollPosition = 0;\n }\n\n let oldScrollPosition = this.options.internal.oldScrollPosition,\n newPage = idxs.first / this.options.paging.size;\n\n this.options.internal.oldScrollPosition = newPage;\n\n if (newPage < oldScrollPosition) {\n // scrolling up\n newPage = Math.floor(newPage);\n } else if (newPage > oldScrollPosition){\n // scrolling down\n newPage = Math.ceil(newPage);\n } else {\n // equal, just stay on the current page\n newPage = curPage;\n }\n\n if(!isNaN(newPage)){\n this.options.paging.offset = newPage;\n }\n }", "function Va(e){Qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}", "getCurrentOffset() {\n return this.pageScrollOptions.scrollOffset;\n }", "reapplyLastPosition() {\n if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {\n this._originRect = this._getOriginRect();\n this._overlayRect = this._pane.getBoundingClientRect();\n this._viewportRect = this._getNarrowedViewportRect();\n const lastPosition = this._lastPosition || this._preferredPositions[0];\n const originPoint = this._getOriginPoint(this._originRect, lastPosition);\n this._applyPosition(lastPosition, originPoint);\n }\n }", "function addToScrollTop(cm, top) {\n if (top == null) {\n return;\n }\n\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n } // Make sure that at the end of the operation the current cursor is", "adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.prefferedOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.prefferedOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }", "adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.prefferedOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.prefferedOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }", "adjustPosition () {\n if (typeof window === 'undefined') return\n\n const spaceAbove = this.$el.getBoundingClientRect().top\n const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom\n const hasEnoughSpaceBelow = spaceBelow > this.maxHeight\n\n if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') {\n this.prefferedOpenDirection = 'below'\n this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight)\n } else {\n this.prefferedOpenDirection = 'above'\n this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight)\n }\n }", "function reposition() {\n var amountOfIframeScroll = initialScroll - $editorDoc.scrollTop();\n var heightAboveToolbar = $toolbar.offset().top - $contentWrap.offset().top; // e.g. merge conflict resolution\n var heightOfPrecursor = $editorPrecursor.outerHeight();\n var heightOfToolbar = $toolbar.outerHeight();\n\n $editorPrecursor.css('top', (heightAboveToolbar + heightOfToolbar + amountOfIframeScroll + precursorTopPadding) + 'px');\n $editorBody.css('padding-top', (heightOfPrecursor + bodyTopPadding) + 'px');\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "_updateTabScrollPosition() {\n if (this.disablePagination) {\n return;\n }\n const scrollDistance = this.scrollDistance;\n const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;\n // Don't use `translate3d` here because we don't want to create a new layer. A new layer\n // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar\n // and ripples will exceed the boundaries of the visible tab bar.\n // See: https://github.com/angular/components/issues/10276\n // We round the `transform` here, because transforms with sub-pixel precision cause some\n // browsers to blur the content of the element.\n this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;\n // Setting the `transform` on IE will change the scroll offset of the parent, causing the\n // position to be thrown off in some cases. We have to reset it ourselves to ensure that\n // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing\n // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).\n if (this._platform.TRIDENT || this._platform.EDGE) {\n this._tabListContainer.nativeElement.scrollLeft = 0;\n }\n }", "scrollBehavior(to, from, savedPosition) {\n return { x: 0, y: 0 };\n }", "stepScrollAnimation_() {\n if (!this.scrollTarget) {\n return;\n }\n\n const currentScrollPos = -this.workspace_.scrollY;\n const diff = this.scrollTarget - currentScrollPos;\n if (Math.abs(diff) < 1) {\n this.workspace_.scrollbar.setY(this.scrollTarget);\n this.scrollTarget = null;\n return;\n }\n this.workspace_.scrollbar.setY(\n currentScrollPos + diff * this.scrollAnimationFraction);\n\n requestAnimationFrame(this.stepScrollAnimation_.bind(this));\n }", "scrollBehavior (to, from, savedPosition) {\n return { x: 0, y: 0 }\n }", "updatePosition() {\n console.log('update position');\n const xValue = this.IMAGE_WIDTH_ * this.currentIndex_;\n this.imageContainer_.style.left = -xValue;\n }", "scrollBehavior(to, from, savedPosition) {\n return {x: 0, y: 0};\n }", "function l(e){\n // Only if the scroll is not what it was last time we did this.\n e!=k&&(\n // Move the target element horizontally relative to its original\n // horizontal position.\n x.css(\"left\",S-e),\n // Hold the last horizontal position set.\n k=e)}", "updatePosition() {\n if (this._positionStrategy) {\n this._positionStrategy.apply();\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } if (to.hash) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve({ selector: to.hash, behavior: 'smooth', offset: { y: 60 } })\n }, 0)\n })\n } else {\n return { x: 0, y: 0 }\n }\n }", "setOffsets() {\n const startPt = this.startPt.minusPt(this.head);\n const endPt = this.endPt.minusPt(this.head);\n const controlPt = this.controlPt.minusPt(this.head);\n this.stateOffset = { startPt, endPt, controlPt };\n }", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the\n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n item.right = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if (current.offsetParent) {\n // Compute offsetRight\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft;\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n\n var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\n }", "_refreshScrollerPosition() {\n this.__carouselScrollerWidth = qx.bom.element.Dimension.getWidth(\n this.__carouselScroller.getContentElement()\n );\n\n this._scrollToPage(this.getCurrentIndex());\n }", "function ViewportScrollPosition() { }", "function ViewportScrollPosition() { }", "function defineOffset() {\n if(STATE.CURRENT_SLIDE > 1) {\n STATE.OFFSET = -STATE.RESIZE_OFFSET;\n } else {\n STATE.OFFSET = STATE.OFFSET;\n }\n }", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n item.clone.css('margin-left', item.left + 'px');\n if ($mdUtil.floatingScrollbars()) {\n item.clone.css('margin-right', '0');\n }\n }", "_updatePositions() {\n let direction = this.options.direction;\n let largestHeight = 0;\n if(this.lastIndex === -1)\n return;\n\n if(this.options.onPosition && typeof this.options.onPosition === 'function')\n this.options.onPosition.call();\n\n this.rows.forEach(row => {\n row.forEach(rowItem => {\n let itemBottom = rowItem.position.top + rowItem.item.offsetHeight;\n rowItem.item.style.top = rowItem.position.top + 'px';\n rowItem.item.style[direction] = rowItem.position[direction] + 'px';\n if(largestHeight < itemBottom)\n largestHeight = itemBottom;\n });\n });\n\n this.element.style.height = largestHeight + 'px';\n\n if(this.options.onPositioned && typeof this.options.onPositioned === 'function')\n this.options.onPositioned.call();\n }", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n item.right = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if ( current.offsetParent ){\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n\n var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\n }" ]
[ "0.64346343", "0.63160354", "0.63160354", "0.63160354", "0.6271868", "0.6246505", "0.6246505", "0.6246505", "0.6246505", "0.6246505", "0.6246505", "0.6246505", "0.6216615", "0.6205321", "0.6168856", "0.6106831", "0.6085435", "0.60719085", "0.60719085", "0.60719085", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6065365", "0.6045317", "0.6045317", "0.600157", "0.5972573", "0.5954194", "0.59493095", "0.5936962", "0.5933091", "0.58633226", "0.584766", "0.584484", "0.58348405", "0.58282506", "0.5827701", "0.58259606", "0.5822522", "0.58193344", "0.58157", "0.5806874", "0.5769116", "0.5748695", "0.5739604", "0.57358557", "0.5731933", "0.57318854", "0.57031757", "0.56991816", "0.5697042", "0.5690831", "0.56895006", "0.5687078", "0.56852686", "0.5684346", "0.56706387", "0.5668573", "0.5666034", "0.5653768", "0.56522405", "0.5641957", "0.56408286", "0.560764", "0.5607225", "0.5607225", "0.5607225", "0.5591333", "0.55792654", "0.55617183", "0.55540967", "0.55479896", "0.5545882", "0.55431056", "0.5542435", "0.553505", "0.5518584", "0.55085576", "0.550707", "0.5497592", "0.54965", "0.5495607", "0.5495607", "0.5489348", "0.54874486", "0.5478409", "0.547733" ]
0.0
-1
Make sure that at the end of the operation the current cursor is shown.
function ensureCursorVisible(cm) { resolveScrollToPos(cm); var cur = cm.getCursor(); cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EmptyCursor () {}", "_showCursor() {\n if (!this._coreService.isCursorInitialized) {\n this._coreService.isCursorInitialized = true;\n this.refresh(this.buffer.y, this.buffer.y);\n }\n }", "checkForCursorVisibility() {\n this.showCaret();\n }", "endDraw() {\n\t\tif (this.cursorEnabled) {\n\t\t\tthis.write(\"\\x1B[?25h\");\n\t\t\tthis.cursorVisible = true;\n\t\t}\n\t\tthis.write(\"\\x1B8\"); //load cursor pos\n\t}", "outputCR() {\n this.cursor.x = 0;\n }", "static SetCursor() {}", "function showCursor(cur)\n {\n if (cur != undefined) selectCursor(cur);\n container.style.cursor = currentCursor;\n\t}", "_resetCursors() {\n this._taskCursor = '';\n this._eventsCursor = '';\n }", "navigateLineEnd() {\n this.selection.moveCursorLineEnd();\n this.clearSelection();\n }", "function endOperation(cm) {\n var op = cm.curOp, doc = cm.doc, display = cm.display;\n cm.curOp = null;\n\n if (op.updateMaxLine) findMaxLine(cm);\n\n // If it looks like an update might be needed, call updateDisplay\n if (op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping) {\n var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;\n }\n // If no update was run, but the selection changed, redraw that.\n if (!updated && op.selectionChanged) updateSelection(cm);\n if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm);\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n display.wheelStartX = display.wheelStartY = null;\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) {\n var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));\n display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;\n }\n if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) {\n var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));\n display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;\n alignHorizontally(cm);\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),\n clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);\n if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);\n }\n\n if (op.selectionChanged) restartBlink(cm);\n\n if (cm.state.focused && op.updateInput)\n resetInput(cm, op.typing);\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) for (var i = 0; i < hidden.length; ++i)\n if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\n if (unhidden) for (var i = 0; i < unhidden.length; ++i)\n if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\n\n var delayed;\n if (!--delayedCallbackDepth) {\n delayed = delayedCallbacks;\n delayedCallbacks = null;\n }\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n signal(cm, \"changes\", cm, op.changeObjs);\n if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();\n if (op.cursorActivityHandlers)\n for (var i = 0; i < op.cursorActivityHandlers.length; i++)\n op.cursorActivityHandlers[i](cm);\n }", "updateCursorTotal () {\n\n }", "function setCursorToEnd(input){\n input.selectionStart = input.selectionEnd = 10000;\n}", "function cursorWait() {\n document.body.style.cursor = 'wait';\n }", "function updateCursor(cursor){\r\n\tif(typeof hatsForm.notRefreshSafe != \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\thatsForm.CURSORPOSITION.value = cursor;\r\n\tresetCursor();\r\n}", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function waitingCursor() {\n\t\t\t\tvar texts = ['/', '-', '\\\\', '|'],\n\t\t\t\t $c = me.$body.find('.cursor.waiting');\n\t\t\t\tif ($c.length > 0) {\n\t\t\t\t\t$c.each(function() {\n\t\t\t\t\t\tvar $this = $(this),\n\t\t\t\t\t\t text = $this.text(),\n\t\t\t\t\t\t index = texts.indexOf(text) + 1;\n\t\t\t\t\t\tif (index === texts.length) {\n\t\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.text(texts[index]);\n\t\t\t\t\t});\n\t\t\t\t\tview.waitingCursorTimeoutId = window.setTimeout(waitingCursor, 100);\n\t\t\t\t} else {\n\t\t\t\t\tdelete view.waitingCursorTimeoutId;\n\t\t\t\t}\n\t\t\t}", "getCursor() {\n return this.after;\n }", "function setCursorToEnd() {\n let p = document.getElementById(\"content\");\n let s = window.getSelection();\n let r = document.createRange();\n r.setStart(p.lastChild, 1);\n r.setEnd(p.lastChild, 1);\n s.removeAllRanges();\n s.addRange(r);\n}", "function updateCursorPosition() {\r\n var position = editor.getCursorPosition();\r\n // indicate cursor postion elements\r\n document.getElementById(\"cur-row\").innerText = position.row + 1;\r\n document.getElementById(\"cur-col\").innerText = position.column + 1;\r\n document.getElementById(\"all-lines\").innerText = editor.getSession().getLength();\r\n}", "navigateFileEnd() {\n this.selection.moveCursorFileEnd();\n this.clearSelection();\n }", "outputLF() {\n this.cursor.y += 1;\n if (this.cursor.y == this.scrollMax + 1) {\n this.outputScrollUp(1);\n this.cursor.y = this.scrollMax;\n }\n else if (this.cursor.y >= this.termRows) {\n this.cursor.y = this.termRows - 1;\n }\n }", "function ensureCursorVisible(cm) {\n\t\t resolveScrollToPos(cm);\n\t\t var cur = cm.getCursor();\n\t\t cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n\t\t }", "function handleClick(event)\n {\n if($(_consoleSelector)[0].selectionStart <= _eraseLimit || $(_consoleSelector)[0].selectionEnd <= _eraseLimit)\n {\n $(_consoleSelector)[0].selectionStart = _eraseLimit;\n $(_consoleSelector)[0].selectionEnd = _eraseLimit;\n }\t\n }", "writeAfterUpdate() {\n\t\tthis.setFocus();\n\t}", "writeAfterUpdate() {\n\t\tthis.setFocus();\n\t}", "function cursorClear() {\n document.body.style.cursor = 'default';\n }", "startDraw() {\n\t\tif (this.cursorVisible != false) {\n\t\t\tthis.write(\"\\x1B[?25l\");\n\t\t\tthis.cursorVisible = false;\n\t\t}\n\t\tthis.write(\"\\x1B7\"); //save cursor pos\n\t}", "outputRLF() {\n this.cursor.y -= 1;\n if (this.cursor.y == this.scrollMin - 1) {\n this.outputScrollDown(1);\n this.cursor.y = this.scrollMin;\n }\n else if (this.cursor.y < 0) {\n this.cursor.y = 0;\n }\n }", "function cursorInvisible() {\r\n\r\n\t\tcursorTime = cursorTime-1; //decrease time by 1\r\n\r\n\t\tif(cursorTime == 0) {\r\n\t\t\t$('body').css(\"cursor\", \"none\");\r\n\t\t\tclearInterval(cursor);\r\n\t\t}; //if time = 0, cursor disappears\r\n\r\n\t}", "handleControlEndKey() {\n let documentEnd = undefined;\n if (!isNullOrUndefined(this.owner.documentEnd)) {\n documentEnd = this.owner.documentEnd;\n }\n if (!isNullOrUndefined(documentEnd)) {\n this.owner.selection.selectContent(documentEnd, true);\n }\n this.checkForCursorVisibility();\n }", "function showCursorLoader(loading) {\n console.log('showCursorLoader running');\n if (loading) {\n $('body').css('cursor', 'progress');\n }\n else {\n $('body').css('cursor', 'default');\n }\n}", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "function ensureCursorVisible(cm) {\r\n resolveScrollToPos(cm);\r\n var cur = cm.getCursor();\r\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\r\n}", "moveSourceCursorToTheNextPosition () {\n\n }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "showCursor() {\n this.canvas.style.cursor = CURRENT_CURSOR;\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor(), from = cur, to = cur;\n if (!cm.options.lineWrapping) {\n from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n to = Pos(cur.line, cur.ch + 1);\n }\n cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n }", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n}", "function CursorTrack() {}", "function finalizeSelection(){\n\n\tvar len = cliptext.value.length\n\tif(len > 5) cliptext.selectionStart = 3\n\telse cliptext.selectionStart = defaultStart\n\tcliptext.selectionEnd = len - 2\n}", "function resetCursor(){\r\n\ttry{ \r\n\t\tif (hatsForm.CURSORPOSITION.value){\r\n\t\t\tinitInputFieldFocus(hatsForm.CURSORPOSITION.value);\r\n\t\t}\r\n\t}catch(e){\r\n\t\treturn;\r\n\t}\r\n\tsetInputFieldFocus();\r\n\t//for mozilla and IE10 only\r\n\tsetInitValuesforHidden();\r\n}", "function waitCursorStart() {\n $(\"*\").css(\"cursor\", \"wait\");\n // $(\"html\").css(\"cursor\", \"wait\");\n }", "function drawSelectionCursor(cm, head, output) {\n\t\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\t\n\t\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t\t cursor.style.left = pos.left + \"px\";\n\t\t cursor.style.top = pos.top + \"px\";\n\t\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\t\n\t\t if (pos.other) {\n\t\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t\t otherCursor.style.display = \"\";\n\t\t otherCursor.style.left = pos.other.left + \"px\";\n\t\t otherCursor.style.top = pos.other.top + \"px\";\n\t\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t\t }\n\t\t }", "function noCursor() {\n _displaycontrol &= ~LCD_CURSORON;\n command(LCD_DISPLAYCONTROL | _displaycontrol);\n}", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t resolveScrollToPos(cm);\n\t var cur = cm.getCursor(), from = cur, to = cur;\n\t if (!cm.options.lineWrapping) {\n\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t to = Pos(cur.line, cur.ch + 1);\n\t }\n\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t }", "function ensureCursorVisible(cm) {\n\t\t resolveScrollToPos(cm);\n\t\t var cur = cm.getCursor(), from = cur, to = cur;\n\t\t if (!cm.options.lineWrapping) {\n\t\t from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;\n\t\t to = Pos(cur.line, cur.ch + 1);\n\t\t }\n\t\t cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true};\n\t\t }", "afterOp() {\n if ( focusedNode && focusedNode.focusable ) {\n focusedNode.focus();\n }\n BrowserEvents.blockFocusCallbacks = false;\n }", "incrCursor() {\n const last = this.getLastHistory().groups;\n if (this.cursorIndex === null) {\n this.cursorIndex = 0;\n return;\n }\n if (this._overwrite) {\n if (this.cursorIndex < last.length) {\n // ?\n this.cursorIndex++;\n } else {\n return;\n }\n }\n if (!this._overwrite) {\n if (this.cursorIndex < last.length - 1) {\n // ?\n this.cursorIndex++;\n } else {\n }\n }\n }", "moveToDocumentEnd() {\n this.handleControlEndKey();\n }", "afterDrawEnd() {\n if (me.draw) {\n me.draw.setActive(false);\n }\n me.drawActive = false;\n HsQueryBaseService.activateQueries();\n }", "function advance_exec_cursor() {\n\t\t\t\twhile (exec_cursor < chain.length) {\n\t\t\t\t\tif (is_func(chain[exec_cursor])) {\n\t\t\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_msg(\"$LAB.wait() executing: \"+chain[exec_cursor]);/*!END_DEBUG*/\n\t\t\t\t\t\ttry { chain[exec_cursor++](); } catch (err) {\n\t\t\t\t\t\t\t/*!START_DEBUG*/if (chain_opts[_Debug]) log_error(\"$LAB.wait() error caught: \",err);/*!END_DEBUG*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!chain[exec_cursor].finished) {\n\t\t\t\t\t\tif (check_chain_group_scripts_ready(chain[exec_cursor])) continue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\texec_cursor++;\n\t\t\t\t}\n\t\t\t\t// we've reached the end of the chain (so far)\n\t\t\t\tif (exec_cursor == chain.length) {\n\t\t\t\t\tscripts_currently_loading = false;\n\t\t\t\t\tgroup = false;\n\t\t\t\t}\n\t\t\t}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }" ]
[ "0.7190308", "0.7081346", "0.7073892", "0.6674232", "0.6522049", "0.6432475", "0.6331778", "0.6274427", "0.62296295", "0.6224343", "0.6167284", "0.6154745", "0.6123359", "0.60431594", "0.6026936", "0.6026936", "0.6026936", "0.6026936", "0.60075444", "0.60075444", "0.60075444", "0.59947395", "0.59299356", "0.5894107", "0.5887412", "0.5875242", "0.58743846", "0.58648986", "0.5846641", "0.580201", "0.580201", "0.58019376", "0.58001494", "0.57626337", "0.57497954", "0.57357126", "0.57336324", "0.5719498", "0.5706887", "0.57019705", "0.568623", "0.568623", "0.5683866", "0.5675494", "0.56698114", "0.56698114", "0.56698114", "0.56698114", "0.56698114", "0.56698114", "0.56698114", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5659003", "0.5656743", "0.5644491", "0.5640793", "0.5638236", "0.56341547", "0.5632539", "0.5626217", "0.5626217", "0.5626217", "0.56220067", "0.5617429", "0.5614671", "0.5611427", "0.5602264", "0.5600185", "0.5598354", "0.5598354", "0.5598354", "0.5598354", "0.5598354", "0.5598354", "0.5598354" ]
0.5801836
43
When an operation has its scrollToPos property set, and another scroll action is applied before the end of the operation, this 'simulates' scrolling that position into view in a cheap way, so that the effect of intermediate scroll commands is not ignored.
function resolveScrollToPos(cm) { var range$$1 = cm.curOp.scrollToPos; if (range$$1) { cm.curOp.scrollToPos = null; var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to); scrollToCoordsRange(cm, from, to, range$$1.margin); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n console.log(\"后退\")\n return savedPosition\n } else {\n console.log(\"前进\")\n return {x: 0, y: 0}\n }\n }", "scrollBehavior (to, from, savedPosition) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n if (savedPosition) {\n resolve(savedPosition);\n } else {\n resolve({ x: 0, y: 0 })\n }\n }, 500);\n })\n }", "function Qa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;Xa(e,ua(e,t.from),ua(e,t.to),t.margin)}}", "setScrollPosition(position) {\n // Set the new scrollTop/scrollLeft to all scrollViews elements\n return this.pageScrollOptions.scrollViews.reduce((oneAlreadyWorked, scrollingView) => {\n const startScrollPropertyValue = this.getScrollPropertyValue(scrollingView);\n\n if (scrollingView && startScrollPropertyValue !== undefined && startScrollPropertyValue !== null) {\n const scrollDistance = Math.abs(startScrollPropertyValue - position); // The movement we need to perform is less than 2px\n // This we consider a small movement which some browser may not perform when\n // changing the scrollTop/scrollLeft property\n // Thus in this cases we do not stop the scroll animation, although setting the\n // scrollTop/scrollLeft value \"fails\"\n\n const isSmallMovement = scrollDistance < this.pageScrollOptions._minScrollDistance;\n\n if (!this.pageScrollOptions.verticalScrolling) {\n scrollingView.scrollLeft = position;\n } else {\n scrollingView.scrollTop = position;\n } // Return true if setting the new scrollTop/scrollLeft value worked\n // We consider that it worked if the new scrollTop/scrollLeft value is closer to the\n // desired scrollTop/scrollLeft than before (it might not be exactly the value we\n // set due to dpi or rounding irregularities)\n\n\n if (isSmallMovement || scrollDistance > Math.abs(this.getScrollPropertyValue(scrollingView) - position)) {\n return true;\n }\n }\n\n return oneAlreadyWorked;\n }, false);\n }", "scrollBehavior(to, from, savedPosition) {\n return {x: 0, y: 0};\n }", "scrollBehavior(to, from, savedPosition) {\n return { x: 0, y: 0 };\n }", "function resolveScrollToPos(cm) {\n\t\t var range = cm.curOp.scrollToPos;\n\t\t if (range) {\n\t\t cm.curOp.scrollToPos = null;\n\t\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t\t scrollToCoordsRange(cm, from, to, range.margin);\n\t\t }\n\t\t }", "scrollBehavior (to, from, savedPosition) {\r\n if (savedPosition) {\r\n return savedPosition\r\n } else {\r\n return { x: 0, y: 0 }\r\n }\r\n }", "function ScrollPosition() {}", "scrollBehavior (to, from, savedPosition) {\n return { x: 0, y: 0 }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n } else {\n return { x: 0, y: 0 };\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "scrollBehavior(to, from, savedPosition) {\n return { x: 0, y: 0 };\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) return savedPosition;\n else return { left: 0, top: 0 };\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {\n x: 0,\n y: 0,\n }\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {\n x: 0,\n y: 0\n }\n }\n }", "scrollToPosition(startPosition, endPosition, skipCursorUpdate) {\n if (this.skipScrollToPosition) {\n this.skipScrollToPosition = false;\n return;\n }\n if (this.owner.enableImageResizerMode && this.owner.imageResizerModule.isImageResizing\n || this.isMouseDownInFooterRegion || this.isRowOrCellResizing) {\n return;\n }\n let lineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, true);\n if (isNullOrUndefined(lineWidget)) {\n return;\n }\n let top = this.selection.getTop(lineWidget);\n if (this.isMouseDown) {\n let prevLineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, false);\n let prevTop = this.selection.getTop(prevLineWidget);\n if (prevLineWidget !== lineWidget && endPosition.location.y >= prevTop) {\n lineWidget = prevLineWidget;\n }\n }\n let height = lineWidget.height;\n //Gets current page.\n let endPage = this.selection.getPage(lineWidget.paragraph);\n this.currentPage = endPage;\n let x = 0;\n let y = 0;\n let viewer = this;\n let isPageLayout = viewer instanceof PageLayoutViewer;\n if (isPageLayout) {\n if (isNullOrUndefined(endPage)) {\n return;\n }\n let pageWidth = endPage.boundingRectangle.width;\n x = (this.visibleBounds.width - pageWidth * this.zoomFactor) / 2;\n if (x < 30) {\n x = 30;\n }\n // tslint:disable-next-line:max-line-length\n y = endPage.boundingRectangle.y * this.zoomFactor + (this.pages.indexOf(endPage) + 1) * viewer.pageGap * (1 - this.zoomFactor);\n }\n let scrollTop = this.containerTop;\n let scrollLeft = this.containerLeft;\n let pageHeight = this.visibleBounds.height;\n let caretInfo = this.selection.updateCaretSize(this.owner.selection.end, true);\n let topMargin = caretInfo.topMargin;\n let caretHeight = caretInfo.height;\n x += (endPosition.location.x) * this.zoomFactor;\n y += (endPosition.location.y + topMargin) * this.zoomFactor;\n //vertical scroll bar update\n if ((scrollTop + 20) > y) {\n this.viewerContainer.scrollTop = (y - 10);\n }\n else if (scrollTop + pageHeight < y + caretHeight) {\n this.viewerContainer.scrollTop = y + caretHeight - pageHeight + 10;\n }\n if (!skipCursorUpdate) {\n this.selection.updateCaretToPage(startPosition, endPage);\n }\n let scrollBarWidth = this.viewerContainer.offsetWidth - this.viewerContainer.clientWidth;\n if (scrollLeft > x) {\n this.viewerContainer.scrollLeft = x - (viewer.pageContainer.offsetWidth / 100) * 20;\n }\n else if (scrollLeft + this.visibleBounds.width < x + scrollBarWidth) {\n this.viewerContainer.scrollLeft = scrollLeft + (viewer.pageContainer.offsetWidth / 100) * 15 + scrollBarWidth;\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return {x: 0, y: 0}\n }\n }", "[scroll]() {\n if (!this.scrollableElement || !this.currentMousePosition) {\n return;\n }\n\n cancelAnimationFrame(this.scrollAnimationFrame);\n\n const { speed, sensitivity } = this.options;\n\n const rect = this.scrollableElement.getBoundingClientRect();\n const bottomCutOff = rect.bottom > window.innerHeight;\n const topCutOff = rect.top < 0;\n const cutOff = topCutOff || bottomCutOff;\n\n const documentScrollingElement = getDocumentScrollingElement();\n const scrollableElement = this.scrollableElement;\n const clientX = this.currentMousePosition.clientX;\n const clientY = this.currentMousePosition.clientY;\n\n if (scrollableElement !== document.body && scrollableElement !== document.documentElement && !cutOff) {\n const { offsetHeight, offsetWidth } = scrollableElement;\n\n if (rect.top + offsetHeight - clientY < sensitivity) {\n scrollableElement.scrollTop += speed;\n } else if (clientY - rect.top < sensitivity) {\n scrollableElement.scrollTop -= speed;\n }\n\n if (rect.left + offsetWidth - clientX < sensitivity) {\n scrollableElement.scrollLeft += speed;\n } else if (clientX - rect.left < sensitivity) {\n scrollableElement.scrollLeft -= speed;\n }\n } else {\n const { innerHeight, innerWidth } = window;\n\n if (clientY < sensitivity) {\n documentScrollingElement.scrollTop -= speed;\n } else if (innerHeight - clientY < sensitivity) {\n documentScrollingElement.scrollTop += speed;\n }\n\n if (clientX < sensitivity) {\n documentScrollingElement.scrollLeft -= speed;\n } else if (innerWidth - clientX < sensitivity) {\n documentScrollingElement.scrollLeft += speed;\n }\n }\n\n this.scrollAnimationFrame = requestAnimationFrame(this[scroll]);\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from),\n to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n }\n if (to.hash) {\n return { selector: to.hash };\n }\n return { x: 0, y: 0 };\n }", "stepScrollAnimation_() {\n if (!this.scrollTarget) {\n return;\n }\n\n const currentScrollPos = -this.workspace_.scrollY;\n const diff = this.scrollTarget - currentScrollPos;\n if (Math.abs(diff) < 1) {\n this.workspace_.scrollbar.setY(this.scrollTarget);\n this.scrollTarget = null;\n return;\n }\n this.workspace_.scrollbar.setY(\n currentScrollPos + diff * this.scrollAnimationFraction);\n\n requestAnimationFrame(this.stepScrollAnimation_.bind(this));\n }", "function _calcScrollToOffset(size, scrollOffset) {\n\t var scrollToRenderNode = this._scroll.scrollToRenderNode || this._scroll.ensureVisibleRenderNode;\n\t if (!scrollToRenderNode) {\n\t return;\n\t }\n\n\t // 1. When boundary is reached, stop scrolling in that direction\n\t if ((this._scroll.boundsReached === Bounds.BOTH) ||\n\t (!this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.PREV)) ||\n\t (this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.NEXT))) {\n\t return;\n\t }\n\n\t // 2. Find the node to scroll to\n\t var foundNode;\n\t var scrollToOffset = 0;\n\t var node = this._nodes.getStartEnumNode(true);\n\t var count = 0;\n\t while (node) {\n\t count++;\n\t if (!node._invalidated || (node.scrollLength === undefined)) {\n\t break;\n\t }\n\t if (this.options.alignment) {\n\t scrollToOffset -= node.scrollLength;\n\t }\n\t if (node.renderNode === scrollToRenderNode) {\n\t foundNode = node;\n\t break;\n\t }\n\t if (!this.options.alignment) {\n\t scrollToOffset -= node.scrollLength;\n\t }\n\t node = node._next;\n\t }\n\t if (!foundNode) {\n\t scrollToOffset = 0;\n\t node = this._nodes.getStartEnumNode(false);\n\t while (node) {\n\t if (!node._invalidated || (node.scrollLength === undefined)) {\n\t break;\n\t }\n\t if (!this.options.alignment) {\n\t scrollToOffset += node.scrollLength;\n\t }\n\t if (node.renderNode === scrollToRenderNode) {\n\t foundNode = node;\n\t break;\n\t }\n\t if (this.options.alignment) {\n\t scrollToOffset += node.scrollLength;\n\t }\n\t node = node._prev;\n\t }\n\t }\n\n\t // 3. Update springs\n\t if (foundNode) {\n\t if (this._scroll.ensureVisibleSequence) {\n\t if (this.options.alignment) {\n\t if ((scrollToOffset - foundNode.scrollLength) < 0) {\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t } else if (scrollToOffset > size[this._direction]) {\n\t this._scroll.springPosition = size[this._direction] - scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else {\n\t this._scroll.ensureVisibleRenderNode = undefined;\n\t }\n\t }\n\t else {\n\t scrollToOffset = -scrollToOffset;\n\t if (scrollToOffset < 0) {\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t } else if ((scrollToOffset + foundNode.scrollLength) > size[this._direction]) {\n\t this._scroll.springPosition = size[this._direction] - (scrollToOffset + foundNode.scrollLength);\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else {\n\t this._scroll.ensureVisibleRenderNode = undefined;\n\t }\n\t }\n\t }\n\t else { // scrollToSequence\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.GOTOSEQUENCE;\n\t }\n\t return;\n\t }\n\n\t // 4. When node not found, keep searching\n\t if (this._scroll.scrollToDirection) {\n\t this._scroll.springPosition = scrollOffset - size[this._direction];\n\t this._scroll.springSource = SpringSource.GOTOPREVDIRECTION;\n\t }\n\t else {\n\t this._scroll.springPosition = scrollOffset + size[this._direction];\n\t this._scroll.springSource = SpringSource.GOTONEXTDIRECTION;\n\t }\n\t }", "scrollBehavior (to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } else {\n return { x: 0, y: 0 }\n }\n }", "function Va(e){Qa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}", "function _calcScrollToOffset(size, scrollOffset) {\n\t var scrollToRenderNode = this._scroll.scrollToRenderNode || this._scroll.ensureVisibleRenderNode;\n\t if (!scrollToRenderNode) {\n\t return;\n\t }\n\t\n\t // 1. When boundary is reached, stop scrolling in that direction\n\t if ((this._scroll.boundsReached === Bounds.BOTH) ||\n\t (!this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.PREV)) ||\n\t (this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.NEXT))) {\n\t return;\n\t }\n\t\n\t // 2. Find the node to scroll to\n\t var foundNode;\n\t var scrollToOffset = 0;\n\t var node = this._nodes.getStartEnumNode(true);\n\t var count = 0;\n\t while (node) {\n\t count++;\n\t if (!node._invalidated || (node.scrollLength === undefined)) {\n\t break;\n\t }\n\t if (this.options.alignment) {\n\t scrollToOffset -= node.scrollLength;\n\t }\n\t if (node.renderNode === scrollToRenderNode) {\n\t foundNode = node;\n\t break;\n\t }\n\t if (!this.options.alignment) {\n\t scrollToOffset -= node.scrollLength;\n\t }\n\t node = node._next;\n\t }\n\t if (!foundNode) {\n\t scrollToOffset = 0;\n\t node = this._nodes.getStartEnumNode(false);\n\t while (node) {\n\t if (!node._invalidated || (node.scrollLength === undefined)) {\n\t break;\n\t }\n\t if (!this.options.alignment) {\n\t scrollToOffset += node.scrollLength;\n\t }\n\t if (node.renderNode === scrollToRenderNode) {\n\t foundNode = node;\n\t break;\n\t }\n\t if (this.options.alignment) {\n\t scrollToOffset += node.scrollLength;\n\t }\n\t node = node._prev;\n\t }\n\t }\n\t\n\t // 3. Update springs\n\t if (foundNode) {\n\t if (this._scroll.ensureVisibleRenderNode) {\n\t if (this.options.alignment) {\n\t if ((scrollToOffset - foundNode.scrollLength) < 0) {\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else if (scrollToOffset > size[this._direction]) {\n\t this._scroll.springPosition = size[this._direction] - scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else {\n\t if (!foundNode.trueSizeRequested) {\n\t this._scroll.ensureVisibleRenderNode = undefined;\n\t }\n\t }\n\t }\n\t else {\n\t scrollToOffset = -scrollToOffset;\n\t if (scrollToOffset < 0) {\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else if ((scrollToOffset + foundNode.scrollLength) > size[this._direction]) {\n\t this._scroll.springPosition = size[this._direction] - (scrollToOffset + foundNode.scrollLength);\n\t this._scroll.springSource = SpringSource.ENSUREVISIBLE;\n\t }\n\t else {\n\t if (!foundNode.trueSizeRequested) {\n\t this._scroll.ensureVisibleRenderNode = undefined;\n\t }\n\t }\n\t }\n\t }\n\t else { // scrollToSequence\n\t this._scroll.springPosition = scrollToOffset;\n\t this._scroll.springSource = SpringSource.GOTOSEQUENCE;\n\t }\n\t return;\n\t }\n\t\n\t // 4. When node not found, keep searching\n\t if (this._scroll.scrollToDirection) {\n\t this._scroll.springPosition = scrollOffset - size[this._direction];\n\t this._scroll.springSource = SpringSource.GOTONEXTDIRECTION;\n\t }\n\t else {\n\t this._scroll.springPosition = scrollOffset + size[this._direction];\n\t this._scroll.springSource = SpringSource.GOTOPREVDIRECTION;\n\t }\n\t\n\t // 5. In case of a VirtualViewSequnce, make sure all the view-sequence nodes are touched, so\n\t // that they are not cleaned up.\n\t if (this._viewSequence.cleanup) {\n\t var viewSequence = this._viewSequence;\n\t while (viewSequence.get() !== scrollToRenderNode) {\n\t viewSequence = this._scroll.scrollToDirection ? viewSequence.getNext(true) : viewSequence.getPrevious(true);\n\t if (!viewSequence) {\n\t break;\n\t }\n\t }\n\t }\n\t }", "function resolveScrollToPos(cm) {\n\t\t var range = cm.curOp.scrollToPos;\n\t\t if (range) {\n\t\t cm.curOp.scrollToPos = null;\n\t\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t\t var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n\t\t Math.min(from.top, to.top) - range.margin,\n\t\t Math.max(from.right, to.right),\n\t\t Math.max(from.bottom, to.bottom) + range.margin);\n\t\t cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n\t\t }\n\t\t }", "_scroll(scrollButton) {\n const that = this,\n mainContainer = that.$.mainContainer,\n scrollCoefficient = scrollButton.classList.contains('jqx-scroll-button-near') ? -1 : 1,\n oldScrollTop = mainContainer.scrollTop;\n\n mainContainer.scrollTop = mainContainer.scrollTop + scrollCoefficient * 10;\n\n if (oldScrollTop !== mainContainer.scrollTop) {\n that._updateScrollButtonVisibility(mainContainer, false, [that.$.scrollButtonNear, that.$.scrollButtonFar]);\n that._fireScrollBottomReachedEvent(oldScrollTop);\n }\n }", "_scrollButtonNearClickHandler() {\n const that = this;\n\n if (that.$.scrollButtonNear.disabled) {\n return;\n }\n\n that._scroll(-1);\n }", "function resolveScrollToPos(cm) {\r\n var range$$1 = cm.curOp.scrollToPos;\r\n if (range$$1) {\r\n cm.curOp.scrollToPos = null;\r\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\r\n scrollToCoordsRange(cm, from, to, range$$1.margin);\r\n }\r\n}", "function endOperation(cm) {\n var op = cm.curOp, doc = cm.doc, display = cm.display;\n cm.curOp = null;\n\n if (op.updateMaxLine) findMaxLine(cm);\n\n // If it looks like an update might be needed, call updateDisplay\n if (op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping) {\n var updated = updateDisplay(cm, {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;\n }\n // If no update was run, but the selection changed, redraw that.\n if (!updated && op.selectionChanged) updateSelection(cm);\n if (!updated && op.startHeight != cm.doc.height) updateScrollbars(cm);\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n display.wheelStartX = display.wheelStartY = null;\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null && display.scroller.scrollTop != op.scrollTop) {\n var top = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop));\n display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = top;\n }\n if (op.scrollLeft != null && display.scroller.scrollLeft != op.scrollLeft) {\n var left = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft));\n display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = left;\n alignHorizontally(cm);\n }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var coords = scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos.from),\n clipPos(cm.doc, op.scrollToPos.to), op.scrollToPos.margin);\n if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords);\n }\n\n if (op.selectionChanged) restartBlink(cm);\n\n if (cm.state.focused && op.updateInput)\n resetInput(cm, op.typing);\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) for (var i = 0; i < hidden.length; ++i)\n if (!hidden[i].lines.length) signal(hidden[i], \"hide\");\n if (unhidden) for (var i = 0; i < unhidden.length; ++i)\n if (unhidden[i].lines.length) signal(unhidden[i], \"unhide\");\n\n var delayed;\n if (!--delayedCallbackDepth) {\n delayed = delayedCallbacks;\n delayedCallbacks = null;\n }\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n signal(cm, \"changes\", cm, op.changeObjs);\n if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();\n if (op.cursorActivityHandlers)\n for (var i = 0; i < op.cursorActivityHandlers.length; i++)\n op.cursorActivityHandlers[i](cm);\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin);\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n }\n }", "function resolveScrollToPos(cm) {\n\t var range = cm.curOp.scrollToPos;\n\t if (range) {\n\t cm.curOp.scrollToPos = null;\n\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n\t Math.min(from.top, to.top) - range.margin,\n\t Math.max(from.right, to.right),\n\t Math.max(from.bottom, to.bottom) + range.margin);\n\t cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n\t }\n\t }", "function resolveScrollToPos(cm) {\n\t var range = cm.curOp.scrollToPos;\n\t if (range) {\n\t cm.curOp.scrollToPos = null;\n\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n\t Math.min(from.top, to.top) - range.margin,\n\t Math.max(from.right, to.right),\n\t Math.max(from.bottom, to.bottom) + range.margin);\n\t cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n\t }\n\t }", "function resolveScrollToPos(cm) {\n\t var range = cm.curOp.scrollToPos;\n\t if (range) {\n\t cm.curOp.scrollToPos = null;\n\t var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n\t var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n\t Math.min(from.top, to.top) - range.margin,\n\t Math.max(from.right, to.right),\n\t Math.max(from.bottom, to.bottom) + range.margin);\n\t cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\n\t }\n\t }", "function resolveScrollToPos(cm) {\r\n var range = cm.curOp.scrollToPos;\r\n if (range) {\r\n cm.curOp.scrollToPos = null;\r\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\r\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\r\n Math.min(from.top, to.top) - range.margin,\r\n Math.max(from.right, to.right),\r\n Math.max(from.bottom, to.bottom) + range.margin);\r\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop);\r\n }\r\n }", "scrollBehavior(to, from, savedPosition) {\n if (savedPosition) {\n return savedPosition\n } if (to.hash) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve({ selector: to.hash, behavior: 'smooth', offset: { y: 60 } })\n }, 0)\n })\n } else {\n return { x: 0, y: 0 }\n }\n }", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n}", "scrollBehavior (to, from, savedPosition) {\n\t\treturn { x: 0, y: 0 }\n\t}", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "get scrolledIntoView() {\n return (this.updated & UPDATED_SCROLL) > 0;\n }", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),\n Math.min(from.top, to.top) - range.margin,\n Math.max(from.right, to.right),\n Math.max(from.bottom, to.bottom) + range.margin)\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n}", "scrollBehavior(to, from, savedPosition) {\n if (to.hash) {\n return { selector: to.hash };\n } else if (savedPosition) {\n return savedPosition;\n } else {\n return { x: 0, y: 0 };\n }\n }", "setRenderedContentOffset(offset, to = 'to-start') {\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; // in appendOnly, we always start from the top\n\n offset = this.appendOnly && to === 'to-start' ? 0 : offset;\n this._renderedContentOffset = offset;\n\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`; // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n\n this._renderedContentOffsetNeedsRewrite = true;\n }\n\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n } else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t if (left != null || top != null) resolveScrollToPos(cm);\n\t if (left != null)\n\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t if (top != null)\n\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t }", "function addToScrollPos(cm, left, top) {\n\t\t if (left != null || top != null) resolveScrollToPos(cm);\n\t\t if (left != null)\n\t\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t\t if (top != null)\n\t\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t\t }", "function Wa(e,t){null!=t&&(Qa(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}", "scrollToPos(scrollTop) {\n if (this.scrollTimeout) {\n clearTimeout(this.scrollTimeout);\n this.scrollTimeout = null;\n }\n if (scrollTop < 0) {\n return;\n }\n const delay = 10;\n const helper = (duration = 0) => {\n this.scrollTimeout = setTimeout(() => {\n if (duration <= 0) {\n this.previewScrollDelay = Date.now() + 500;\n this.previewElement.scrollTop = scrollTop;\n return;\n }\n const difference = scrollTop - this.previewElement.scrollTop;\n const perTick = (difference / duration) * delay;\n // disable preview onscroll\n this.previewScrollDelay = Date.now() + 500;\n this.previewElement.scrollTop += perTick;\n if (this.previewElement.scrollTop === scrollTop) {\n return;\n }\n helper(duration - delay);\n }, delay);\n };\n const scrollDuration = 120;\n helper(scrollDuration);\n }", "function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos\n if (range) {\n cm.curOp.scrollToPos = null\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - range.margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + range.margin\n })\n cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n}", "function scrollStart() {\n // Hide context menu if showing\n component.hideContextMenu();\n // Bind clickout scroll\n //component.layers[\"clickout\"].on(\"scroll\", onChangeLayout);\n }", "function CameraCommand_Scroll_ProcessScrollables()\n{\n\t//assume done\n\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t//reset scrollables\n\tthis.ScrollTarget = this.TargetHTML;\n\tthis.ScrollArea = new Position_Rect(this.TargetArea.left, this.TargetArea.top, this.TargetArea.width, this.TargetArea.height);\n\tthis.ScrollDirection = __CAMERA_CMD_SCROLL_NOSCROLL;\n\tthis.ScrollValue = 0;\n\t//setup new scrollcommand\n\tvar listOfScrollCmds = [];\n\t//loop through scrollables\n\tfor (var i = 0, c = this.Scrollables.length; i < c; i++)\n\t{\n\t\t//transform the area to scrollable\n\t\tvar newArea = this.TransformToParent(this.Scrollables[i]);\n\t\t//check if we need to scroll\n\t\tthis.NeedsToScrollParent(this.Scrollables[i], newArea, listOfScrollCmds);\n\t}\n\t//has scroll direction?\n\tif (this.ScrollDirection != __CAMERA_CMD_SCROLL_NOSCROLL)\n\t{\n\t\t///\n\t\t//we might be stuck on an infinite loop\n\t\t///\n\t\t//check scroll attemps\n\t\tif (this.ScrollAttempts++ > __CAMERA_CMD_SCROLL_MAX_ATTEMPTS)\n\t\t{\n\t\t\t//we have failed, we cannot scroll properly. report\n\t\t\tCommon_Log(\"Camera Cmd Scroll: Failed to scroll, max attempts reached\");\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//attempt to scroll into view\n\t\t\t\tthis.TargetHTML.scrollIntoView();\n\t\t\t}\n\t\t\tcatch (error)\n\t\t\t{\n\t\t\t\t//ignore this\n\t\t\t}\n\t\t\t//now we are finished\n\t\t\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//check last command? do we have at least 2 commands?\n\t\t\tif (this.LastScrollCmd.length > 1)\n\t\t\t{\n\t\t\t\t//get the last command\n\t\t\t\tvar lastCommand = this.LastScrollCmd.pop();\n\t\t\t\t//compare the current command with the last command\n\t\t\t\tif (lastCommand.ScrollTargetId == this.ScrollTarget.id)\n\t\t\t\t{\n\t\t\t\t\t//we are scrolling the same object? are we reversing the scroll?\n\t\t\t\t\tswitch (lastCommand.ScrollDirection + this.ScrollDirection)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 3: //UP == 1 + DOWN == 2 -> 3\n\t\t\t\t\t\tcase 7: //LEFT == 3 + RIGHT == 4 -> 7\n\t\t\t\t\t\t\t///\n\t\t\t\t\t\t\t//command is being reversed, cancel it\n\t\t\t\t\t\t\t///\n\t\t\t\t\t\t\t//retrieve the one before this one\n\t\t\t\t\t\t\tvar newCmd = this.LastScrollCmd[this.LastScrollCmd.length - 1];\n\t\t\t\t\t\t\t//reset data\n\t\t\t\t\t\t\tthis.ScrollTarget = newCmd.ScrollTarget;\n\t\t\t\t\t\t\tthis.ScrollValue = newCmd.ScrollValue;\n\t\t\t\t\t\t\tthis.ScrollDirection = newCmd.ScrollDirection;\n\t\t\t\t\t\t\tthis.ScrollArea = newCmd.ScrollArea;\n\t\t\t\t\t\t\t//now correct the scroll target area\n\t\t\t\t\t\t\tthis.CorrectScrollTargetArea(this.ScrollDirection, newCmd.Parent);\n\t\t\t\t\t\t\t//update list of scroll cmds\n\t\t\t\t\t\t\tlistOfScrollCmds = this.LastScrollCmd;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//update the last command\n\t\t\tthis.LastScrollCmd = listOfScrollCmds;\n\t\t\t//has camera?\n\t\t\tif (this.Camera)\n\t\t\t{\n\t\t\t\t//show the camera\n\t\t\t\tthis.Camera.CameraUI.Show(true);\n\t\t\t}\n\t\t\t//move to target\n\t\t\tthis.State = __CAMERA_CMD_STATE_MOVING;\n\t\t}\n\t}\n}", "scrollIntoView() {\n this.updated |= UPDATED_SCROLL;\n return this;\n }", "scrollBehavior(_, _2, savedPosition) {\n if (savedPosition) {\n return savedPosition;\n }\n return { top: 0, left: 0 };\n }", "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }", "_scroll(scrollCoefficient) {\n const that = this;\n\n that.$.scrollViewer.scrollTop = that.$.scrollViewer.scrollTop + scrollCoefficient * 10;\n that._updateScrollButtonVisibility();\n that.focus();\n }", "function updateScroll(event) {\n moveElements();\n}", "function step () {\n // Check for scroll interference before continuing animation\n if (lastX === container.scrollLeft && lastY === container.scrollTop) {\n const elapsed = Date.now() - startTime\n lastX = container.scrollLeft = position(startX, targetX, elapsed, duration)\n lastY = container.scrollTop = position(startY, targetY, elapsed, duration)\n if (elapsed > duration && typeof options.onArrive === 'function') options.onArrive()\n else window.requestAnimationFrame(step)\n } else {\n typeof options.onInterrupt === 'function' && options.onInterrupt()\n }\n }", "_scrollSpy() {\n const currentScrollPosition = scrollPosition();\n if (currentScrollPosition.top > this.props.scrollStart) {\n if (!this.state.isVisible) {\n this.setState({ isVisible: true });\n }\n } else {\n if (this.state.isVisible) {\n this.setState({ isVisible: false });\n }\n }\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }", "function addToScrollPos(cm, left, top) {\n if (left != null || top != null) resolveScrollToPos(cm);\n if (left != null)\n cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n if (top != null)\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }" ]
[ "0.6445612", "0.64282805", "0.6379907", "0.63762003", "0.6313169", "0.63107616", "0.6299939", "0.62854207", "0.6278228", "0.6262097", "0.6240442", "0.6235206", "0.6234112", "0.622936", "0.61974496", "0.61974496", "0.6193366", "0.617505", "0.617505", "0.617505", "0.617505", "0.617505", "0.617505", "0.617505", "0.617505", "0.61689854", "0.6149713", "0.61469847", "0.6124759", "0.6123352", "0.61186844", "0.6102474", "0.61022496", "0.60978854", "0.6088941", "0.60735726", "0.6033181", "0.60310316", "0.6030293", "0.60285306", "0.6026435", "0.6026435", "0.6026435", "0.6026435", "0.6026435", "0.6026435", "0.6026435", "0.60234547", "0.60234547", "0.60234547", "0.6013804", "0.6007854", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.59954435", "0.5988465", "0.5979102", "0.59676296", "0.5946153", "0.59276587", "0.59093416", "0.5906989", "0.59023356", "0.59023356", "0.59023356", "0.58926857", "0.58767045", "0.5876353", "0.5861591", "0.58483094", "0.58477867", "0.58429885", "0.5826261", "0.58219004", "0.58188945", "0.5801331", "0.5801213", "0.5799461", "0.57988626", "0.57988626", "0.57988626", "0.57988626", "0.57988626", "0.57988626" ]
0.6146728
33
Sync the scrollable area and scrollbars, ensure the viewport covers the visible area.
function updateScrollTop(cm, val) { if (Math.abs(cm.doc.scrollTop - val) < 2) { return } if (!gecko) { updateDisplaySimple(cm, {top: val}); } setScrollTop(cm, val, true); if (gecko) { updateDisplaySimple(cm); } startWorker(cm, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setScrollBars() {\r\n const that = this;\r\n\r\n if (!that._scrollView) {\r\n that._scrollView = new LW.Utilities.Scroll(that.$.timeline, that.$.horizontalScrollBar, that.$.verticalScrollBar);\r\n }\r\n\r\n const vScrollBar = that._scrollView.vScrollBar,\r\n hScrollBar = that._scrollView.hScrollBar;\r\n\r\n hScrollBar.$.addClass('lw-hidden');\r\n vScrollBar.$.addClass('lw-hidden');\r\n\r\n //Cancel Style/Resize observers of the ScrollBars\r\n vScrollBar.hasStyleObserver = false;\r\n hScrollBar.hasStyleObserver = false;\r\n vScrollBar.hasResizeObserver = false;\r\n hScrollBar.hasResizeObserver = false;\r\n\r\n hScrollBar.wait = false;\r\n vScrollBar.wait = false;\r\n\r\n //Refreshes the ScrollBars\r\n that._refresh();\r\n }", "_ensureVisible(scrollTarget) {\n const that = this;\n\n if (that._minimized) {\n return;\n }\n\n const mode = that.mode;\n let parent, scrollButtons;\n\n if (mode !== 'tree' && scrollTarget.parentElement !== that.$.mainContainer) {\n if (scrollTarget.dropDownHeight === null) {\n return;\n }\n\n parent = scrollTarget.parentElement;\n scrollButtons = [parent.container.children[0], parent.container.children[2]];\n }\n else {\n parent = that.$.mainContainer;\n scrollButtons = [that.$.scrollButtonNear, that.$.scrollButtonFar];\n }\n\n if (parent === that.$.mainContainer &&\n (that.dropDownAppendTo === null && that.mode !== 'tree' && !that.$mainContainer.hasClass('simple') ||\n !parent.$.hasClass('scroll-buttons-shown') && that.overflow !== 'hidden')) {\n return;\n }\n\n const parentBoundingRect = parent.getBoundingClientRect(),\n scrollTargetBoundingRect = scrollTarget.getBoundingClientRect();\n\n if (mode === 'tree') {\n that._ensureVisibleTreeMode(scrollTarget, scrollTargetBoundingRect, parent, parentBoundingRect, 0);\n return;\n }\n\n function setTargetScrollValue(scrollValue, scrollDimension, dimension) {\n let targetScrollValue = scrollTarget.firstElementChild[dimension] + scrollValue - parent[dimension];\n\n if (targetScrollValue < 0) {\n targetScrollValue = scrollValue;\n }\n\n parent['scroll' + scrollDimension] = targetScrollValue;\n }\n\n function scrollTo(scrollDimension, dimension) {\n let scrollValue = scrollTarget['offset' + scrollDimension],\n oldParentDimension = parent[dimension];\n\n if (scrollDimension === 'Top' && parent !== that.$.mainContainer && !scrollButtons[0].$.hasClass('jqx-hidden')) {\n scrollValue -= scrollButtons[0][dimension];\n }\n\n setTargetScrollValue(scrollValue, scrollDimension, dimension);\n that._updateScrollButtonVisibility(parent, scrollDimension === 'Left', scrollButtons);\n\n if (oldParentDimension !== parent[dimension]) {\n setTargetScrollValue(scrollValue, scrollDimension, dimension);\n }\n }\n\n if ((parent === that.$.mainContainer && mode === 'horizontal') &&\n (parentBoundingRect.left > scrollTargetBoundingRect.left || parentBoundingRect.right < scrollTargetBoundingRect.right)) {\n scrollTo('Left', 'offsetWidth');\n }\n else if (parentBoundingRect.top > scrollTargetBoundingRect.top || parentBoundingRect.bottom < scrollTargetBoundingRect.bottom) {\n scrollTo('Top', 'offsetHeight');\n }\n }", "updateScrollableContents() {\n if (this.intervalId_ !== null) {\n return;\n } // notifyResize is already in progress.\n\n this.requestUpdateScroll();\n\n const nodeList = this.shadowRoot.querySelectorAll('[scrollable] iron-list');\n if (!nodeList.length) {\n return;\n }\n\n let nodesToResize = Array.from(nodeList).map(node => ({\n node: node,\n lastScrollHeight: 0,\n }));\n // Use setInterval to avoid initial render / sizing issues.\n this.intervalId_ = window.setInterval(() => {\n const checkAgain = [];\n nodesToResize.forEach(({node, lastScrollHeight}) => {\n const scrollHeight = node.parentNode.scrollHeight;\n // A hidden scroll-container has a height of 0. When not hidden, it has\n // a min-height of 1px and the iron-list needs a resize to show the\n // initial items and update the |scrollHeight|. The initial item count\n // is determined by the |scrollHeight|. A scrollHeight of 1px will\n // result in the minimum default item count (currently 3). After the\n // |scrollHeight| is updated to be greater than 1px, another resize is\n // needed to correctly calculate the number of physical iron-list items\n // to render.\n if (scrollHeight !== lastScrollHeight) {\n const ironList = /** @type {!IronListElement} */ (node);\n ironList.notifyResize();\n }\n\n // TODO(crbug.com/1121679): Add UI Test for this behavior.\n if (scrollHeight <= 1 &&\n window.getComputedStyle(node.parentNode).display !== 'none') {\n checkAgain.push({\n node: node,\n lastScrollHeight: scrollHeight,\n });\n }\n });\n if (checkAgain.length === 0) {\n window.clearInterval(this.intervalId_);\n this.intervalId_ = null;\n } else {\n nodesToResize = checkAgain;\n }\n }, 10);\n }", "_handleScrollbarsDisplay(event) {\n const that = this,\n textBox = that.$.input;\n\n setTimeout(function () {\n switch (that.horizontalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('hscroll');\n that.$.horizontalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('hscroll');\n break;\n case 'visible':\n that.$container.addClass('hscroll');\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n that.$.horizontalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollWidth > textBox.clientWidth) {\n that.$container.addClass('hscroll');\n\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollLeft = that._scrollView.scrollLeft;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n }\n }\n else {\n that.$container.removeClass('hscroll');\n }\n that.$.horizontalScrollBar.disabled = false;\n }\n\n switch (that.verticalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('vscroll');\n that.$.verticalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('vscroll');\n break;\n case 'visible':\n that.$container.addClass('vscroll');\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n that._scrollView.scrollTo(that.$.input.scrollTop);\n that.$.verticalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollHeight > textBox.clientHeight) {\n that.$container.addClass('vscroll');\n\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollTop = that._scrollView.scrollTop;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n }\n else {\n that.$container.removeClass('vscroll');\n }\n that.$.verticalScrollBar.disabled = false;\n }\n }, 0);\n\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('smart-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "_syncScrollbar(dimension, value) {\n const that = this;\n let max, scrollbar;\n\n if (dimension === 0 && that._oneDimensionSpecialCase === false) {\n if (!that.showHorizontalScrollbar) {\n return;\n }\n\n max = that._getMaxValuesOfScrollBars('horizontal');\n scrollbar = that.$.horizontalScrollbar;\n }\n else {\n if (!that.showVerticalScrollbar) {\n return;\n }\n\n max = that._getMaxValuesOfScrollBars('vertical');\n scrollbar = that.$.verticalScrollbar;\n }\n\n if (value > max) {\n max = value;\n }\n\n const currentMax = scrollbar.max;\n\n if (currentMax !== max) {\n if (currentMax > max) {\n that._suppressScrollbarEvent = true;\n }\n\n scrollbar.max = max;\n }\n\n if (scrollbar.value !== value) {\n that._suppressScrollbarEvent = true;\n scrollbar.value = value;\n }\n }", "function syncVisualPanelScroll() {\n const visualPanelEl = document.querySelector('.visual-panel');\n const currentScroll = visualPanelEl.scrollTop;\n const targetScroll = calcScrollPosition();\n const difference = targetScroll - visualPanelEl.scrollTop;\n const step = difference * 0.67;\n\n const t = currentScroll + step;\n visualPanelEl.scrollTo({\n top: t\n });\n window.requestAnimationFrame(syncVisualPanelScroll);\n}", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function ensureVisible()\r\n{\r\n var selectedTop = selected.position().top;\r\n var selectedBottom = selectedTop + selected.outerHeight();\r\n\r\n var $wnd = $(wnd);\r\n var wndTop = $wnd.scrollTop();\r\n var wndBottom = wndTop + $wnd.height();\r\n\r\n if(selectedBottom > wndBottom)\r\n {\r\n $wnd.scrollTop(wndTop + (selectedBottom-wndBottom));\r\n }\r\n else if(selectedTop < wndTop)\r\n {\r\n $wnd.scrollTop(selectedTop);\r\n }\r\n}", "updateScroll(){\n \t\tif (this.$.content.scrollHeight > this.$.content.offsetHeight){\n \t\t\tthis.$.content.scrollTop = this.$.content.scrollHeight - this.$.content.offsetHeight;\n \t\t}\n \t}", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('jqx-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "syncScrollArea(immediate = false) {\n // If buffer height changed\n if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) {\n this._lastRecordedBufferLength = this._bufferService.buffer.lines.length;\n this._refresh(immediate);\n return;\n }\n // If viewport height changed\n if (this._lastRecordedViewportHeight !== this._renderService.dimensions.canvasHeight) {\n this._refresh(immediate);\n return;\n }\n // If the buffer position doesn't match last scroll top\n const newScrollTop = this._bufferService.buffer.ydisp * this._currentRowHeight;\n if (this._lastScrollTop !== newScrollTop) {\n this._refresh(immediate);\n return;\n }\n // If element's scroll top changed, this can happen when hiding the element\n if (this._lastScrollTop !== this._viewportElement.scrollTop) {\n this._refresh(immediate);\n return;\n }\n // If row height changed\n if (this._renderService.dimensions.scaledCellHeight / window.devicePixelRatio !== this._currentRowHeight) {\n this._refresh(immediate);\n return;\n }\n }", "_refreshLayout() {\n const that = this;\n const source = that._items;\n\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that._height = null;\n\n if (!that._scrollView) {\n that._scrollView = new JQX.Utilities.Scroll(that, that.$.horizontalScrollBar, that.$.verticalScrollBar);\n }\n\n that.$itemsContainer.removeClass('hscroll');\n that.$itemsContainer.removeClass('vscroll');\n\n if (!source || source === null || source.length === 0) {\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n that.$filterInputContainer.removeClass('vscroll');\n that.$placeholder.removeClass('jqx-hidden');\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n that.$placeholder.addClass('jqx-hidden');\n\n const horizontalOffset = 2 * (parseInt(getComputedStyle(that.$.itemsInnerContainer).getPropertyValue('--jqx-list-item-horizontal-offset')) || 0);\n\n let hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n let vScrollHeight = that._scrollHeight;\n\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n that._refreshVerticalScrollBarVisibility(vScrollHeight);\n\n\n if (that.horizontalScrollBarVisibility === 'hidden') {\n that.$.itemsInnerContainer.style.width = that.$.itemsContainer.offsetWidth - horizontalOffset;\n }\n else {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth) + 'px';\n }\n\n if (that.computedVerticalScrollBarVisibility) {\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - that._scrollView.vScrollBar.offsetWidth;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.horizontalScrollBarVisibility !== 'hidden') {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth - that._scrollView.vScrollBar.offsetWidth) + 'px';\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n if (!(that.horizontalScrollBarVisibility === 'visible' && that.scrollWidth === 0)) {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n else if (that.horizontalScrollBarVisibility === 'visible') {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n\n that.scrollHeight = that.__scrollHeight;\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.computedHorizontalScrollBarVisibility) {\n that.scrollHeight = that._scrollHeight;\n that._refreshVerticalScrollBarVisibility(that.scrollHeight);\n\n //Resize event not thrown after 'bottom-corner' is applied\n if (that._scrollView.vScrollBar.$.hasClass('bottom-corner')) {\n that._scrollView.vScrollBar.refresh();\n }\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n const isIE = /Trident|Edge/.test(navigator.userAgent);\n if (!that.isRefreshing && isIE) {\n setTimeout(function () {\n that.isRefreshing = true;\n that._refreshLayout();\n that.isRefreshing = false;\n }, 50);\n }\n }", "function containScroll() {\n\n var targetX = startX + deltaX;\n var targetY = startY + deltaY;\n\n if (targetY < 0)\n deltaY += -targetY;\n else {\n var containerVisibleHeight = focus ? focus.clientHeight : root.innerHeight;\n var containerRealHeight = focus ? focus.scrollHeight : document.body.scrollHeight;\n if (targetY + containerVisibleHeight > containerRealHeight)\n deltaY -= targetY + containerVisibleHeight - containerRealHeight;\n }\n\n if (targetX < 0)\n deltaX += -targetX;\n else {\n var containerVisibleWidth = focus ? focus.clientWidth : root.innerWidth;\n var containerRealWidth = focus ? focus.scrollWidth : document.body.scrollWidth;\n if (targetX + containerVisibleWidth > containerRealWidth)\n deltaX -= targetX + containerVisibleWidth - containerRealWidth;\n }\n\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "function overlapScrollbars() {\n var tmpSb = document.createElement('div'),\n tmpSbInner = document.createElement('div');\n tmpSb.className = \"CodeMirror-scrollbar\";\n tmpSb.style.cssText = \"position: absolute; left: -9999px; height: 100px;\";\n tmpSbInner.className = \"CodeMirror-scrollbar-inner\";\n tmpSbInner.style.height = \"200px\";\n tmpSb.appendChild(tmpSbInner);\n\n document.body.appendChild(tmpSb);\n var result = (tmpSb.offsetWidth <= 1);\n document.body.removeChild(tmpSb);\n return result;\n }", "updateScroll() {\n // _mustAlwaysScroll works by stopping _mustScroll from being automatically updated, so it stays `true`.\n if (!this._mustAlwaysScroll && this._modalElement) {\n // Semantic UI modal margin and dimmer padding are 1rem, which is relative to the global font size, so for compatibility:\n const fontSize = parseFloat(window.getComputedStyle(document.documentElement).getPropertyValue(\"font-size\"));\n const margin = fontSize * 2;\n const element = this._modalElement.nativeElement;\n // The modal must scroll if the window height is smaller than the modal height + both margins.\n this._mustScroll = window.innerHeight < element.clientHeight + margin * 2;\n }\n }", "_checkScrollPosition() {\n\n var isVisible = this._isVisible;\n var isAtBottom = this._isAtBottom;\n var scrollTop = typeof window.scrollY !== 'undefined' ? window.scrollY : window.pageYOffset;\n var bottomThreshold = scrollTop + this._windowHeight;\n\n this._isVisible = scrollTop + this._windowHeight >= this._visibleThreshold ? true : false;\n this._isAtBottom = this._containerBottom <= bottomThreshold ? true : false;\n\n if (this._isAtBottom !== isAtBottom || this._isVisible !== isVisible) {\n this._updateBindings();\n }\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n let firstVisibleIndex = scrollOffset / this._itemSize;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n\n const renderedRange = this._viewport.getRenderedRange();\n\n const newRange = {\n start: renderedRange.start,\n end: renderedRange.end\n };\n\n const viewportSize = this._viewport.getViewportSize();\n\n const dataLength = this._viewport.getDataLength();\n\n let scrollOffset = this._viewport.measureScrollOffset(); // Prevent NaN as result when dividing by zero.\n\n\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; // If user scrolls to the bottom of the list and data changes to a smaller list\n\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n\n this._viewport.setRenderedRange(newRange);\n\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n\n this._scrollStrategy.onDataLengthChanged();\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function determineScrollbars() {\n var docStyle = inlineStyle(docElem);\n mainBodyRect = bodyGeo.getCurrentBodyInfo();\n\n // -- Clear the scrollbars --\n if (shouldComputeMainBodyScrollbars) {\n defaultOverflowX = defaultOverflowY = 'hidden';\n }\n else {\n defaultOverflowX = docStyle.overflowX;\n defaultOverflowY = docStyle.overflowY;\n }\n\n // -- Set the scrollbars after a delay --\n // If the right side of the visible content is beyond the window width,\n // or the visible content is wider than the window width, show the scrollbars.\n // Doing this after a timeout fixes SC-3722 for some reason -- the toolbar was moving up and down by the height\n // of the horizontal scrollbar. It's as if doing it on a delay gives IE/Edge a chance to\n // deal with zoom first, and then scrollbars separately\n // The delay also allows us to collect several concurrent requests and handle them once.\n clearTimeout(finalizeScrollbarsTimer);\n\n var\n doUseHorizScrollbar = doForceHorizScrollbar || isBodyTooWide(),\n doUseVertScrollbar = doForceVertScrollbar || isBodyTooTall(),\n newOverflowX = doUseHorizScrollbar ? 'scroll' : defaultOverflowX,\n newOverflowY = doUseVertScrollbar ? 'scroll' : defaultOverflowY;\n\n if (newOverflowX !== docStyle.overflowX || newOverflowY !== docStyle.overflowY) {\n if (shouldComputeMainBodyScrollbars) {\n // MS browsers need to reset first, otherwise causes SC-3722\n setOverflow('hidden', 'hidden');\n }\n finalizeScrollbarsTimer = nativeGlobal.setTimeout(function() {\n setOverflow(newOverflowX, newOverflowY);\n }, 0);\n }\n }", "_ensureVisible(scrollTarget) {\n const that = this,\n parent = that.$.mainContainer;\n\n if (!parent.$.hasClass('scroll-buttons-shown') && that.overflow !== 'hidden') {\n return;\n }\n\n const parentBoundingRect = parent.getBoundingClientRect(),\n scrollTargetBoundingRect = scrollTarget.getBoundingClientRect(),\n scrollButtons = [that.$.scrollButtonNear, that.$.scrollButtonFar],\n oldScrollTop = parent.scrollTop;\n\n if (parentBoundingRect.top > scrollTargetBoundingRect.top || parentBoundingRect.bottom < scrollTargetBoundingRect.bottom) {\n parent.scrollTop = scrollTarget.offsetTop;\n that._updateScrollButtonVisibility(parent, false, scrollButtons);\n }\n\n that._fireScrollBottomReachedEvent(oldScrollTop);\n }", "_checkOverflow() {\n const that = this,\n scrollViewer = that.$.scrollViewer,\n overflow = that.overflow;\n\n if (that.scrollMode === 'scrollbar' || overflow === 'hidden') {\n scrollViewer.refresh();\n return;\n }\n\n const oldScrollTop = scrollViewer.scrollTop;\n\n if (overflow === 'auto') {\n scrollViewer.$.removeClass('scroll-buttons-shown');\n scrollViewer.$.removeClass('one-button-shown');\n that.$scrollButtonNear.addClass('jqx-hidden');\n that.$scrollButtonFar.addClass('jqx-hidden');\n }\n\n const overflowing = Math.round(scrollViewer.$.scrollViewerContentContainer.offsetHeight) >\n Math.round(scrollViewer.$.scrollViewerContainer.offsetHeight),\n showNear = Math.round(scrollViewer.scrollTop) > 0,\n showFar = Math.round(scrollViewer.$.scrollViewerContainer.offsetHeight + scrollViewer.scrollTop) <\n Math.round(scrollViewer.$.scrollViewerContentContainer.offsetHeight);\n\n if (overflowing) {\n if (overflow === 'auto') {\n scrollViewer.$.addClass('scroll-buttons-shown');\n\n if (showNear) {\n that.$scrollButtonNear.removeClass('jqx-hidden');\n }\n\n if (showFar) {\n that.$scrollButtonFar.removeClass('jqx-hidden');\n }\n\n if ((showNear && showFar) === false) {\n scrollViewer.$.addClass('one-button-shown');\n }\n\n if (!that.disabled) {\n that.$.scrollButtonNear.disabled = false;\n that.$.scrollButtonFar.disabled = false;\n }\n\n scrollViewer.scrollTop = oldScrollTop;\n }\n else {\n that.$scrollButtonNear.removeClass('jqx-hidden');\n that.$scrollButtonFar.removeClass('jqx-hidden');\n\n if (that.disabled) {\n that.$.scrollButtonNear.disabled = true;\n that.$.scrollButtonFar.disabled = true;\n }\n else {\n that.$.scrollButtonNear.disabled = !showNear;\n that.$.scrollButtonFar.disabled = !showFar;\n }\n }\n }\n else if (overflow === 'scroll') {\n that.$.scrollButtonNear.disabled = true;\n that.$.scrollButtonFar.disabled = true;\n }\n\n scrollViewer.refresh();\n }", "enable() {\n if (this._scrollSubscription) {\n return;\n }\n const stream = this._scrollDispatcher.scrolled(0);\n if (this._config && this._config.threshold && this._config.threshold > 1) {\n this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n this._scrollSubscription = stream.subscribe(() => {\n const scrollPosition = this._viewportRuler.getViewportScrollPosition().top;\n if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) {\n this._detach();\n }\n else {\n this._overlayRef.updatePosition();\n }\n });\n }\n else {\n this._scrollSubscription = stream.subscribe(this._detach);\n }\n }", "_updateViewport () {\n const $scrollElement = this.$(this._scrollClass)\n this.set('_viewport.scrollLeft', $scrollElement[0].scrollLeft)\n this.set('_viewport.width', $scrollElement.width())\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n that.scrollHeight = scrollHeight;\n\n if (that.computedVerticalScrollBarVisibility) {\n that.$itemsContainer.addClass('vscroll');\n that.$filterInputContainer.addClass('vscroll');\n\n }\n else {\n that.$itemsContainer.removeClass('vscroll');\n that.$filterInputContainer.removeClass('vscroll');\n }\n }", "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }", "function updateScroll() {\n\n var _tmStart = BrowserUtils.now();\n var requestedScrollPos = scroll.scrollTop();\n var availableRowCount = $controller.availableRowCount();\n\n\n // adjust the scroll height if necessary\n var newScrollHeight = availableRowCount *\n (layoutMetrics.cellOuterSize + paddingMetrics.spaceY) +\n paddingMetrics.spaceY;\n if (newScrollHeight && scrollSpacer.height() !== newScrollHeight) {\n scrollSpacer.css('height', newScrollHeight + 'px');\n }\n\n\n // fix up the scroll position if trackNewData is enabled\n var trackNewData = $controller.trackNewData();\n var rootHeight = root.height();\n var rows = $controller.rows();\n\n var neededTopIdx = Math.floor(requestedScrollPos / \n (layoutMetrics.cellOuterSize + paddingMetrics.spaceY)) - 1;\n var actualTopIdx = rows.length ? rows[0].id : 0;\n\n var tblTopPx;\n\n if (trackNewData && rows.length > layoutMetrics.rowsPerScreen) {\n requestedScrollPos = newScrollHeight - rootHeight;\n scroll.scrollTop(requestedScrollPos); \n // for tracking, the table always stays at the bottom\n tblTopPx = newScrollHeight - tbl.height();\n } else {\n\n // figure out what rows should now be visible, and request\n // them if they're not visible.\n\n if (neededTopIdx != actualTopIdx) {\n\n $controller.windowPosition(\n neededTopIdx + layoutMetrics.maxRowCount - 1);\n rows = $scope.automatonViewer.rows;\n actualTopIdx = rows.length ? rows[0].id : 0;\n }\n\n // now, put the table where it should be within the scroll\n tblTopPx = actualTopIdx * \n (layoutMetrics.cellOuterSize + paddingMetrics.spaceY) + \n (scroll.scrollTop() - requestedScrollPos);\n } \n\n if (tbl.css('top') !== tblTopPx) {\n tbl.css('top', tblTopPx + 'px');\n }\n\n return;\n }", "_addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }", "onScroll_() {\n const scrollTop = this.scrollTop;\n if (scrollTop > 0 && this.instances_.length !== this.items.length) {\n if (this.fillViewHeight_(scrollTop + this.maxHeight)) {\n this.updateHeight_();\n }\n }\n }", "setupScrollSync() {\n let scrollBar = this.element.querySelector('.et-horizontal-scroll-wrapper');\n\n let bodyScrollContainer = this.element.querySelector('tbody');\n let headerScrollContainer = this.element.querySelector('thead');\n let footerScrollContainer = this.element.querySelector('tfoot');\n\n let scrollElements = [\n bodyScrollContainer,\n headerScrollContainer,\n footerScrollContainer\n ].filter((item) => {\n return item;\n });\n\n let prevClientX, prevClientY;\n\n this._wheelHandler = (event) => {\n if (Math.abs(event.deltaX) < Math.abs(event.deltaY)) {\n return;\n }\n\n event.preventDefault();\n\n scrollBar.scrollLeft += event.deltaX;\n\n for (let scrollElement of scrollElements) {\n scrollElement.scrollLeft = scrollBar.scrollLeft;\n }\n };\n\n this._scrollHandler = () => {\n for (let scrollElement of scrollElements) {\n scrollElement.scrollLeft = scrollBar.scrollLeft;\n }\n };\n\n this._touchstartHandler = (event) => {\n let [{ clientX, clientY }] = event.touches;\n\n prevClientX = clientX;\n prevClientY = clientY;\n };\n\n this._touchmoveHandler = (event) => {\n let [{ clientX, clientY }] = event.touches;\n\n let deltaX = clientX - prevClientX;\n let deltaY = clientY - prevClientY;\n\n if (Math.abs(deltaX) < Math.abs(deltaY)) {\n return;\n }\n\n event.preventDefault();\n\n scrollBar.scrollLeft -= deltaX;\n\n for (let scrollElement of scrollElements) {\n scrollElement.scrollLeft = scrollBar.scrollLeft;\n }\n\n prevClientX = clientX;\n prevClientY = clientY;\n };\n\n this.element.addEventListener('wheel', this._wheelHandler);\n scrollBar.addEventListener('scroll', this._scrollHandler);\n\n bodyScrollContainer.addEventListener('touchstart', this._touchstartHandler);\n bodyScrollContainer.addEventListener('touchmove', this._touchmoveHandler);\n }", "updateMenuScrollArea(){\n \n //$('#sidebar-scroller').perfectScrollbar('update');\n \n }", "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n const me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n } // Auto-widthed padding element at end hides or shows to create matching margin.\n\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n } // Change of scrollbar status means height change\n\n me.onHeightChange();\n }", "update() {\n\t\tthis.scroll.update();\n\t}", "_updateIfNeeded()\n\t{\n\t\tif (!this._needUpdate)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tthis._needUpdate = false;\n\n\t\t// calculate the edges of the form and various other sizes, in various units:\n\t\tthis._leftEdge = this._pos[0] - this._size[0] / 2.0;\n\t\tthis._rightEdge = this._pos[0] + this._size[0] / 2.0;\n\t\tthis._topEdge = this._pos[1] + this._size[1] / 2.0;\n\t\tthis._bottomEdge = this._pos[1] - this._size[1] / 2.0;\n\n\t\t[this._leftEdge_px, this._topEdge_px] = util.to_px(\n\t\t\t[this._leftEdge, this._topEdge],\n\t\t\tthis.units,\n\t\t\tthis.win,\n\t\t\ttrue,\n\t\t);\n\t\t[this._rightEdge_px, this._bottomEdge_px] = util.to_px(\n\t\t\t[this._rightEdge, this._bottomEdge],\n\t\t\tthis.units,\n\t\t\tthis.win,\n\t\t\ttrue,\n\t\t);\n\t\tthis._itemPadding_px = this._getLengthPix(this._itemPadding);\n\t\tthis._scrollbarWidth_px = this._getLengthPix(this._scrollbarWidth, true);\n\t\tthis._size_px = util.to_px(this._size, this.units, this.win, true);\n\n\t\t// update the stimuli clip mask\n\t\t// note: the clip mask is in screen coordinates\n\t\tthis._stimuliClipMask.clear();\n\t\tthis._stimuliClipMask.beginFill(0xFFFFFF);\n\t\tthis._stimuliClipMask.drawRect(\n\t\t\tthis._win._stimsContainer.position.x + this._leftEdge_px + 2,\n\t\t\tthis._win._stimsContainer.position.y + this._bottomEdge_px + 2,\n\t\t\tthis._size_px[0] - 4,\n\t\t\tthis._size_px[1] - 6,\n\t\t);\n\t\tthis._stimuliClipMask.endFill();\n\n\t\t// position the scrollbar and get the scrollbar offset, in form units:\n\t\tthis._scrollbar.setPos([this._rightEdge - this._scrollbarWidth / 2, this._pos[1]], false);\n\t\tthis._scrollbar.setOpacity(0.5);\n\t\tthis._scrollbarOffset = this._prevScrollbarMarkerPos * (this._visual.stimuliTotalHeight + this._size[1]) / (-this._visual.stimuliTotalHeight / this._size[1]);\n\n\t\t// update decorations and stimuli:\n\t\tthis._updateVisibleStimuli();\n\t\tthis._updateDecorations();\n\t}", "function updateScroll(){\n var treshold = 5;\n ux.scroll.offsetPrevious = ux.scroll.offset;\n ux.scroll.offset = $(window).scrollTop();\n \n // We compare distance traveled with a defined treshold and report scroll direction\n if( ux.scroll.offset - ux.scroll.offsetPrevious > treshold ){\n ux.scroll.direction = 'down';\n } else if( ux.scroll.offsetPrevious - ux.scroll.offset > treshold ){\n ux.scroll.direction = 'up';\n }\n \n ux.viewport.visibleTop = ux.scroll.offset\n ux.viewport.visibleBottom = ux.viewport.height + ux.scroll.offset;\n}", "_updateScrollButtonVisibility() {\n const that = this,\n overflow = that.overflow;\n\n if (that.scrollMode === 'scrollbar' || overflow === 'hidden') {\n return;\n }\n\n let showNear = true,\n showFar = true;\n\n if (Math.round(that.$.scrollViewer.scrollTop) === 0) {\n showNear = false;\n }\n\n if (Math.round(that.$.scrollViewer.$.scrollViewerContainer.offsetHeight + that.$.scrollViewer.scrollTop) >=\n Math.round(that.$.scrollViewer.$.scrollViewerContentContainer.offsetHeight)) {\n showFar = false;\n }\n\n if (overflow === 'auto') {\n if (showNear && showFar) {\n that.$scrollButtonNear.removeClass('jqx-hidden');\n that.$scrollButtonFar.removeClass('jqx-hidden');\n that.$scrollViewer.removeClass('one-button-shown');\n that.$.scrollViewer.refresh();\n return;\n }\n\n if (showNear) {\n that.$scrollButtonNear.removeClass('jqx-hidden');\n }\n else {\n that.$scrollButtonNear.addClass('jqx-hidden');\n }\n\n if (showFar) {\n that.$scrollButtonFar.removeClass('jqx-hidden');\n }\n else {\n that.$scrollButtonFar.addClass('jqx-hidden');\n }\n\n that.$scrollViewer.addClass('one-button-shown');\n that.$.scrollViewer.refresh();\n }\n else if (overflow === 'scroll' && !that.disabled) {\n that.$.scrollButtonNear.disabled = !showNear;\n that.$.scrollButtonFar.disabled = !showFar;\n }\n }", "function monitorScroll() {\n //reset vars for new view\n $rootScope.showScrollRight = true;\n $rootScope.showScrollLeft = false;\n //get dom elements\n var view = angular.element($document[0].getElementById(\"navTabsScroller\"))\n var maxScrollLeft = $document[0].getElementById(\"navTabsScroller\").scrollWidth - $document[0].getElementById(\"navTabsScroller\").clientWidth;\n //bind to scroll\n view.bind('scroll', function() {\n // console.log(view.scrollLeft());\n\n if(view.scrollLeft() == 0) {\n $rootScope.$apply(function() {\n $rootScope.showScrollLeft = false\n });\n } else {\n $rootScope.$apply(function() {\n $rootScope.showScrollLeft = true\n });\n }\n\n if(view.scrollLeft() == maxScrollLeft) {\n $rootScope.$apply(function() {\n $rootScope.showScrollRight = false\n });\n } else {\n $rootScope.$apply(function() {\n $rootScope.showScrollRight = true\n });\n }\n\n });\n\n }", "onVerticalScroll() {\n // ResizeMonitor triggers scroll during render, make sure render is done\n if (this.isDrawn) {\n // Do not invalidate on scroll, if height changes it will be invalidated anyway\n this.scheduleDraw(false);\n }\n }", "onVerticalScroll() {\n // ResizeMonitor triggers scroll during render, make sure render is done\n if (this.isDrawn) {\n // Do not invalidate on scroll, if height changes it will be invalidated anyway\n this.scheduleDraw(false);\n }\n }", "pollBoundingRect() {\n if (this.isAutoAlignment() && this.popoverVisible) {\n // eslint-disable-next-line @lwc/lwc/no-async-operation\n setTimeout(() => {\n if (this.isConnected) {\n observePosition(this, 300, this._boundingRect, () => {\n this.close();\n });\n\n this.pollBoundingRect();\n }\n }, 250);\n }\n }", "function setViewportByController() {\r\n setViewportBounds(webController.getLastViewport());\r\n}", "function monitorScroll() {\n SidebarActions.monitorScroll()\n}", "updateScrolling(coords) {\n const {\n left: x,\n top: y,\n width: w,\n height: h,\n } = this.container.getBoundingClientRect();\n const box = { x, y, w, h };\n\n // calculate strength\n this.scaleX = this.props.horizontalStrength(box, coords);\n this.scaleY = this.props.verticalStrength(box, coords);\n\n // start scrolling if we need to\n if (!this.frame && (this.scaleX || this.scaleY)) {\n this.startScrolling();\n }\n }", "onViewportResize() {// TODO: Could do something cheaper\n // Refresh without discarding any available layouts\n // this.scheduler.refresh(); // Seems not needed? Will be updated by horizontal scroll anyway\n }", "onScroll_() {\n if (this.$.container.scrollTop > 0 &&\n this.domRepeat_.items.length !== this.items.length) {\n const aboveScrollTopItemCount =\n Math.round(this.$.container.scrollTop / this.domItemAverageHeight_());\n\n // Ensure we have sufficient items to fill the current scroll position and\n // a full view following our current position.\n if (aboveScrollTopItemCount + this.chunkItemThreshold >\n this.domRepeat_.items.length) {\n this.ensureDomItemsAvailableStartingAt_(aboveScrollTopItemCount);\n }\n }\n }", "function shouldLockDocumentScroll(options) {\n\n //if (supportsOverscrollBehavior) {\n // return false;\n //}\n\n return true;\n }", "function updateScreenshotScroll() {\r\n if (!isMobile) { \r\n $('#screenshots').slimScroll(slimOptionsContent); \r\n }\r\n}", "_dragScroll() {\n if (!this._model.selectionEnd || !this._model.selectionStart) {\n return;\n }\n if (this._dragScrollAmount) {\n this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });\n // Re-evaluate selection\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n const buffer = this._bufferService.buffer;\n if (this._dragScrollAmount > 0) {\n if (this._activeSelectionMode !== 3 /* COLUMN */) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n this._model.selectionEnd[1] = Math.min(buffer.ydisp + this._bufferService.rows, buffer.lines.length - 1);\n }\n else {\n if (this._activeSelectionMode !== 3 /* COLUMN */) {\n this._model.selectionEnd[0] = 0;\n }\n this._model.selectionEnd[1] = buffer.ydisp;\n }\n this.refresh();\n }\n }", "[scroll]() {\n if (!this.scrollableElement || !this.currentMousePosition) {\n return;\n }\n\n cancelAnimationFrame(this.scrollAnimationFrame);\n\n const { speed, sensitivity } = this.options;\n\n const rect = this.scrollableElement.getBoundingClientRect();\n const bottomCutOff = rect.bottom > window.innerHeight;\n const topCutOff = rect.top < 0;\n const cutOff = topCutOff || bottomCutOff;\n\n const documentScrollingElement = getDocumentScrollingElement();\n const scrollableElement = this.scrollableElement;\n const clientX = this.currentMousePosition.clientX;\n const clientY = this.currentMousePosition.clientY;\n\n if (scrollableElement !== document.body && scrollableElement !== document.documentElement && !cutOff) {\n const { offsetHeight, offsetWidth } = scrollableElement;\n\n if (rect.top + offsetHeight - clientY < sensitivity) {\n scrollableElement.scrollTop += speed;\n } else if (clientY - rect.top < sensitivity) {\n scrollableElement.scrollTop -= speed;\n }\n\n if (rect.left + offsetWidth - clientX < sensitivity) {\n scrollableElement.scrollLeft += speed;\n } else if (clientX - rect.left < sensitivity) {\n scrollableElement.scrollLeft -= speed;\n }\n } else {\n const { innerHeight, innerWidth } = window;\n\n if (clientY < sensitivity) {\n documentScrollingElement.scrollTop -= speed;\n } else if (innerHeight - clientY < sensitivity) {\n documentScrollingElement.scrollTop += speed;\n }\n\n if (clientX < sensitivity) {\n documentScrollingElement.scrollLeft -= speed;\n } else if (innerWidth - clientX < sensitivity) {\n documentScrollingElement.scrollLeft += speed;\n }\n }\n\n this.scrollAnimationFrame = requestAnimationFrame(this[scroll]);\n }", "function ListView_UpdateScrollBars(theObject)\n{\n\t//content exits?\n\tif (theObject.Content && theObject.Content.Item_Panel)\n\t{\n\t\t//set scrollbars\n\t\ttheObject.Content.Item_Panel.style.overflowX = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\ttheObject.Content.Item_Panel.style.overflowY = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\t//has vertical scroll position?\n\t\tvar vertical = Get_String(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_POS], null);\n\t\t//and horizontal\n\t\tvar horizontal = Get_String(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_POS], null);\n\t\t//at least one is valid?\n\t\tif (vertical != null || horizontal != null)\n\t\t{\n\t\t\t//vertical?\n\t\t\tif (vertical != null)\n\t\t\t{\n\t\t\t\t//set vertical\n\t\t\t\ttheObject.Content.Item_Panel.scrollTop = vertical * theObject.Content.Item_Height;\n\t\t\t}\n\t\t\t//has horizontal\n\t\t\tif (horizontal != null)\n\t\t\t{\n\t\t\t\t//set horizontal\n\t\t\t\ttheObject.Content.Item_Panel.scrollLeft = horizontal;\n\t\t\t\t//has header panel?\n\t\t\t\tif (theObject.Content.Header_Panel)\n\t\t\t\t{\n\t\t\t\t\t//match scroll pos\n\t\t\t\t\ttheObject.Content.Header_Panel.scrollLeft = theObject.Content.Item_Panel.scrollLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//trigger a repaint\n\t\t\tListView_Paint(theObject);\n\t\t}\n\t}\n}", "function handleWindowScroll() {\n centerElement();\n }", "attached() {\n const that = this;\n\n super.attached();\n\n if (!that._scrollView) {\n that._scrollView = new JQX.Utilities.Scroll(that.$.input, that.$.horizontalScrollBar, that.$.verticalScrollBar);\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function setCustomScrollBars() {\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : BEGIN * * */\n /*http://manos.malihu.gr/jquery-custom-content-scroller/*/\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">$(window).load() event starting.</div>');\n if (Compass.Global.isInternetExplorer === false) {\n $(\"#LoanDatesPanelContent_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n callbacks: {\n onScrollStart: function () {\n Compass.Helm.hideHelpPopOvers();\n }\n },\n scrollInertia: 500\n\n });\n $(\"#LoanContactsListContainer_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n scrollInertia: 500\n\n });\n }\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : END * * */\n }", "function onWindowScroll() {\n checkFlipped();\n }", "function _checkInView() {\n var viewport = {\n top: 0,\n bottom: getViewportHeight()\n };\n var callbacks = [];\n\n watchingItems.forEach(function (item) {\n var bounds = getBoundingClientRect(item.element[0]);\n\n if (bounds.top < viewport.bottom && bounds.bottom >= viewport.top) {\n callbacks.push(item.callback);\n }\n });\n\n callbacks.forEach(function (callback) {\n callback();\n });\n }", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "function update() {\n\n let bounds = element.bounds(container)\n offsetTop = bounds.top\n offsetBot = bounds.top + bounds.height + $(window).height()\n\n offsetTop = offsetTop - $(window).height()\n offsetBot = offsetBot - $(window).height()\n\n if (offsetTop < 0) {\n offsetTop = 0\n }\n }", "function updateScrollbars(cm, measure) {\r\n if (!measure) measure = measureForScrollbars(cm);\r\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\r\n var scrollHeight = measure.docHeight + scrollerCutOff;\r\n var needsH = measure.scrollWidth > measure.clientWidth;\r\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\r\n sWidth > 0 && !measure.hScrollbarTakesSpace)\r\n needsH = false; // (Issue #2562)\r\n var needsV = scrollHeight > measure.clientHeight;\r\n\r\n if (needsV) {\r\n d.scrollbarV.style.display = \"block\";\r\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\r\n // A bug in IE8 can cause this value to be negative, so guard it.\r\n d.scrollbarV.firstChild.style.height =\r\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\r\n } else {\r\n d.scrollbarV.style.display = \"\";\r\n d.scrollbarV.firstChild.style.height = \"0\";\r\n }\r\n if (needsH) {\r\n d.scrollbarH.style.display = \"block\";\r\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\r\n d.scrollbarH.firstChild.style.width =\r\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\r\n } else {\r\n d.scrollbarH.style.display = \"\";\r\n d.scrollbarH.firstChild.style.width = \"0\";\r\n }\r\n if (needsH && needsV) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\r\n } else d.scrollbarFiller.style.display = \"\";\r\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sWidth + \"px\";\r\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\r\n } else d.gutterFiller.style.display = \"\";\r\n\r\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\r\n if (sWidth === 0) {\r\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\r\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\r\n var barMouseDown = function(e) {\r\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\r\n operation(cm, onMouseDown)(e);\r\n };\r\n on(d.scrollbarV, \"mousedown\", barMouseDown);\r\n on(d.scrollbarH, \"mousedown\", barMouseDown);\r\n }\r\n cm.state.checkedOverlayScrollbar = true;\r\n }\r\n }", "function syncSelectionIndicator() {\n _.forEach(_views, function (view) {\n view.$openFilesContainer.triggerHandler(\"scroll\");\n });\n }", "_refreshLayout() {\n const that = this;\n const source = that.rows;\n\n if (that._layoutSuspended) {\n return;\n }\n\n that._visibleRows = null;\n that.__viewRows = null;\n that.__clientSize = null;\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that.__parentCells = null;\n\n that.$.columnFarContainer.classList.remove('vscroll');\n that.$.columnNearContainer.classList.remove('vscroll');\n\n that.$.scrollView.classList.remove('hscroll');\n that.$.scrollView.classList.remove('vscroll');\n\n that._refreshElementsVisibility();\n that._refreshColumnHeights();\n that._refreshContentHeight();\n\n if (!(source && source.url)) {\n if (!source || source === null || source.length === 0 || that.columns.length === 0) {\n that.$.placeholder.classList.remove('smart-hidden');\n\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n\n return;\n }\n }\n\n if (!that.__columnHeaderHeight) {\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\n }\n\n if (!that.__filterFooterOffsetHeight) {\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains('smart-hidden') ? 0 : that.$.filterFooter.offsetHeight;\n }\n\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\n\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\n\n\n if (that.paging.spinner.enabled && that.paging.enabled) {\n if (!that.pageScroll) {\n const pageScroll = document.createElement('smart-scroll-bar');\n\n pageScroll.orientation = 'vertical';\n pageScroll.style.height = '100%';\n pageScroll.style.width = '100%';\n pageScroll.max = Math.ceil(that.dataSource.length / that.paging.pageSize);\n pageScroll.step = that.paging.spinner.step;\n pageScroll.largeStep = that.paging.spinner.step;\n pageScroll.setAttribute('spinner', '');\n pageScroll.setAttribute('smart-id', 'spinner');\n pageScroll.ownerElement = that;\n\n that.addPropertyBinding('[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader);\n\n pageScroll.addEventListener('change', function (event) {\n that.paging.pageIndex = event.detail.value;\n });\n\n that.pageScroll = pageScroll;\n }\n\n that.htmlColumnLastChild.appendChild(that.pageScroll);\n }\n else {\n that.htmlColumnLastChild.innerHTML = '';\n }\n\n that._refreshScrollBars();\n\n }", "function _isInViewport() {\n if (isOpen){\n $items.css('top', ($outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height()) ? -itemsHeight : '');\n setTimeout(_isInViewport, 100);\n }\n }", "_verticalScrollbarHandler(event) {\n const that = this;\n const value = event.detail.value;\n event.stopPropagation();\n\n if (that.isVirtualized) {\n that._recycle();\n }\n else {\n that.$.itemsContainer.scrollTop = value;\n }\n\n that._updateTopVisibleIndex();\n\n if (event.context.max === event.context.value) {\n that.$.fireEvent('scrollBottomReached');\n return;\n }\n\n if (event.context.min === event.context.value) {\n that.$.fireEvent('scrollTopReached');\n }\n }", "setScroll() {\n this.canScroll = true\n }", "function mkdOnWindowScroll() {\n \n }", "function manageScroll () {\n\t\tvar scroller = $('#scroller'),\n\t\t\telementScrolled,\n\t\t\tcurrentScrollTop;\n\n\t\tscroller.scroll(function () {\n\t\t\tcurrentScrollTop = $(this).scrollTop();\n\t\t\tif (currentScrollTop > prevScrollTop) {\n\t\t\t\telementScrolled = Math.floor((currentScrollTop - prevScrollTop) / minContentHeight);\n\t\t\t\t// If a complete block is scrolled up only then call the updateGrid function\n\t\t\t\tif (elementScrolled) {\n\t\t\t\t\tupdateGrid(lastDrawIndex, lastDrawIndex + 3);\n\t\t\t\t\tprevScrollTop = currentScrollTop;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function simpleLock() {\n // save scrolled Y position when locking\n scrolledClientY = document.body.getBoundingClientRect().top;\n // force the Y scrollbar to always appear to prevent jumping issues\n document.body.style.overflow = 'hidden scroll';\n // add scrolled Y position to body top before changing the position property\n document.body.style.top = `${scrolledClientY}px`;\n // limit the vertical height by fixing the position\n document.body.style.position = 'fixed';\n // force body to expand to its whole width\n document.body.style.width = '100%';\n}", "initScroll() {\n const me = this;\n // This method may be called early, before render calls it, so ensure that it's\n // only executed once.\n if (!me.scrollInitialized) {\n let scrollTop,\n onScroll = me.createOnFrame(() => {\n me._scrollTop = scrollTop = me.scrollable.y;\n\n if (!me.scrolling) {\n me.scrolling = true;\n me.eachSubGrid((s) => (s.suspendResizeMonitor = true));\n }\n\n me.rowManager.updateRenderedRows(scrollTop);\n\n /**\n * Grid has scrolled vertically\n * @event scroll\n * @param {Grid.view.Grid} grid\n * @param {Number} scrollTop\n */\n me.trigger('scroll', { scrollTop });\n });\n\n me.scrollInitialized = true;\n\n me.scrollable.on({\n scroll: onScroll,\n scrollend() {\n me.scrolling = false;\n me.eachSubGrid((s) => (s.suspendResizeMonitor = false));\n }\n });\n\n me.callEachSubGrid('initScroll');\n }\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else { d.gutterFiller.style.display = \"\"; }\n\t\t }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\t\t\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\t\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else d.scrollbarFiller.style.display = \"\";\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else d.gutterFiller.style.display = \"\";\n\t\t }" ]
[ "0.6310475", "0.60149384", "0.5974547", "0.5973448", "0.595236", "0.594288", "0.5937404", "0.5917567", "0.5917567", "0.5917567", "0.58974105", "0.5860123", "0.5858213", "0.58399194", "0.5810556", "0.578282", "0.5782065", "0.5772861", "0.57630867", "0.5731742", "0.57251173", "0.57205147", "0.57205147", "0.57205147", "0.5707842", "0.57022554", "0.57012403", "0.56855196", "0.5681351", "0.56535995", "0.56446123", "0.56288826", "0.56246835", "0.56059325", "0.56059325", "0.5594962", "0.55878466", "0.5582771", "0.55826896", "0.55823874", "0.5556209", "0.5537126", "0.55335224", "0.5527967", "0.5524085", "0.54863983", "0.5483261", "0.5483261", "0.5483232", "0.54762304", "0.54756904", "0.54746056", "0.54518884", "0.54482585", "0.544603", "0.54239213", "0.5420337", "0.5391489", "0.53907096", "0.5385385", "0.5384867", "0.5380883", "0.5380883", "0.5380883", "0.5380883", "0.5378052", "0.5377474", "0.5377181", "0.5356268", "0.53561175", "0.53495914", "0.5343916", "0.53385913", "0.5334073", "0.5323724", "0.5321727", "0.5315728", "0.5311047", "0.5305132", "0.52799517", "0.5277257", "0.5274052", "0.5273149", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.5268751", "0.52682894" ]
0.0
-1
Sync scroller and scrollbar, ensure the gutter elements are aligned.
function setScrollLeft(cm, val, isScroller, forceScroll) { val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } cm.doc.scrollLeft = val; alignHorizontally(cm); if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } cm.display.scrollbars.setScrollLeft(val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbars(cm, measure) {\r\n if (!measure) measure = measureForScrollbars(cm);\r\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\r\n var scrollHeight = measure.docHeight + scrollerCutOff;\r\n var needsH = measure.scrollWidth > measure.clientWidth;\r\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\r\n sWidth > 0 && !measure.hScrollbarTakesSpace)\r\n needsH = false; // (Issue #2562)\r\n var needsV = scrollHeight > measure.clientHeight;\r\n\r\n if (needsV) {\r\n d.scrollbarV.style.display = \"block\";\r\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\r\n // A bug in IE8 can cause this value to be negative, so guard it.\r\n d.scrollbarV.firstChild.style.height =\r\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\r\n } else {\r\n d.scrollbarV.style.display = \"\";\r\n d.scrollbarV.firstChild.style.height = \"0\";\r\n }\r\n if (needsH) {\r\n d.scrollbarH.style.display = \"block\";\r\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\r\n d.scrollbarH.firstChild.style.width =\r\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\r\n } else {\r\n d.scrollbarH.style.display = \"\";\r\n d.scrollbarH.firstChild.style.width = \"0\";\r\n }\r\n if (needsH && needsV) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\r\n } else d.scrollbarFiller.style.display = \"\";\r\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sWidth + \"px\";\r\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\r\n } else d.gutterFiller.style.display = \"\";\r\n\r\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\r\n if (sWidth === 0) {\r\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\r\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\r\n var barMouseDown = function(e) {\r\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\r\n operation(cm, onMouseDown)(e);\r\n };\r\n on(d.scrollbarV, \"mousedown\", barMouseDown);\r\n on(d.scrollbarH, \"mousedown\", barMouseDown);\r\n }\r\n cm.state.checkedOverlayScrollbar = true;\r\n }\r\n }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else { d.gutterFiller.style.display = \"\"; }\n\t\t }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\t\t\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\t\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else d.scrollbarFiller.style.display = \"\";\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else d.gutterFiller.style.display = \"\";\n\t\t }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\r\n if (cm.options.fixedGutter) {\r\n if (view[i].gutter)\r\n { view[i].gutter.style.left = left; }\r\n if (view[i].gutterBackground)\r\n { view[i].gutterBackground.style.left = left; }\r\n }\r\n var align = view[i].alignable;\r\n if (align) { for (var j = 0; j < align.length; j++)\r\n { align[j].style.left = left; } }\r\n } }\r\n if (cm.options.fixedGutter)\r\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\r\n}", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\r\n var d = cm.display;\r\n var sizes = d.scrollbars.update(measure);\r\n\r\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\r\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\r\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\r\n\r\n if (sizes.right && sizes.bottom) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\r\n d.scrollbarFiller.style.width = sizes.right + \"px\";\r\n } else { d.scrollbarFiller.style.display = \"\"; }\r\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sizes.bottom + \"px\";\r\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\r\n } else { d.gutterFiller.style.display = \"\"; }\r\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n view[i].gutter.style.left = left;\n if (view[i].gutterBackground)\n view[i].gutterBackground.style.left = left;\n }\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t { view[i].gutter.style.left = left; }\n\t\t if (view[i].gutterBackground)\n\t\t { view[i].gutterBackground.style.left = left; }\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) { for (var j = 0; j < align.length; j++)\n\t\t { align[j].style.left = left; } }\n\t\t } }\n\t\t if (cm.options.fixedGutter)\n\t\t { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n\t\t }", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t };\n\t\t }", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t }\n\t\t }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\r\n if (cm.options.fixedGutter && view[i].gutter)\r\n view[i].gutter.style.left = left;\r\n var align = view[i].alignable;\r\n if (align) for (var j = 0; j < align.length; j++)\r\n align[j].style.left = left;\r\n }\r\n if (cm.options.fixedGutter)\r\n display.gutters.style.left = (comp + gutterW) + \"px\";\r\n }", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t view[i].gutter.style.left = left;\n\t\t if (view[i].gutterBackground)\n\t\t view[i].gutterBackground.style.left = left;\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) for (var j = 0; j < align.length; j++)\n\t\t align[j].style.left = left;\n\t\t }\n\t\t if (cm.options.fixedGutter)\n\t\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t\t }", "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter) {\n\t if (view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t if (view[i].gutterBackground)\n\t view[i].gutterBackground.style.left = left;\n\t }\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function Ga(e){var t=e.display,a=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,f=n+\"px\",o=0;o<a.length;o++)if(!a[o].hidden){e.options.fixedGutter&&(a[o].gutter&&(a[o].gutter.style.left=f),a[o].gutterBackground&&(a[o].gutterBackground.style.left=f));var i=a[o].alignable;if(i)for(var s=0;s<i.length;s++)i[s].style.left=f}e.options.fixedGutter&&(t.gutters.style.left=n+r+\"px\")}}", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }" ]
[ "0.7326835", "0.7249031", "0.7249031", "0.7249031", "0.64672166", "0.64672166", "0.64672166", "0.64092076", "0.63350016", "0.63350016", "0.63350016", "0.63350016", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.63306326", "0.6324951", "0.62958163", "0.62834126", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6279913", "0.6272581", "0.62719285", "0.62719285", "0.62719285", "0.62553567", "0.62553567", "0.6254707", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.6245865", "0.62434727", "0.6230633", "0.62288046", "0.62127674", "0.62127674", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.6210517", "0.61958385", "0.619509", "0.6161837", "0.6147123", "0.61315733", "0.61315733", "0.61315733", "0.61315733", "0.61315733", "0.61315733", "0.61315733", "0.6131035", "0.6103104", "0.6101984", "0.6081595", "0.60493654", "0.60449016", "0.60449016" ]
0.0
-1
SCROLLBARS Prepare DOM reads needed to update the scrollbars. Done in one shot to minimize update/measure roundtrips.
function measureForScrollbars(cm) { var d = cm.display, gutterW = d.gutters.offsetWidth; var docH = Math.round(cm.doc.height + paddingVert(cm.display)); return { clientHeight: d.scroller.clientHeight, viewHeight: d.wrapper.clientHeight, scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, viewWidth: d.wrapper.clientWidth, barLeft: cm.options.fixedGutter ? gutterW : 0, docHeight: docH, scrollHeight: docH + scrollGap(cm) + d.barHeight, nativeBarWidth: d.nativeBarWidth, gutterWidth: gutterW } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createScrollBarForAll(){\n if($('body').hasClass(RESPONSIVE)){\n removeResponsiveScrollOverflows();\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }", "function createScrollBarForAll() {\n if ($('body').hasClass(RESPONSIVE)) {\n removeResponsiveScrollOverflows();\n } else {\n forEachSectionAndSlide(createScrollBar);\n }\n }", "_setScrollBars() {\r\n const that = this;\r\n\r\n if (!that._scrollView) {\r\n that._scrollView = new LW.Utilities.Scroll(that.$.timeline, that.$.horizontalScrollBar, that.$.verticalScrollBar);\r\n }\r\n\r\n const vScrollBar = that._scrollView.vScrollBar,\r\n hScrollBar = that._scrollView.hScrollBar;\r\n\r\n hScrollBar.$.addClass('lw-hidden');\r\n vScrollBar.$.addClass('lw-hidden');\r\n\r\n //Cancel Style/Resize observers of the ScrollBars\r\n vScrollBar.hasStyleObserver = false;\r\n hScrollBar.hasStyleObserver = false;\r\n vScrollBar.hasResizeObserver = false;\r\n hScrollBar.hasResizeObserver = false;\r\n\r\n hScrollBar.wait = false;\r\n vScrollBar.wait = false;\r\n\r\n //Refreshes the ScrollBars\r\n that._refresh();\r\n }", "function setCustomScrollBars() {\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : BEGIN * * */\n /*http://manos.malihu.gr/jquery-custom-content-scroller/*/\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">$(window).load() event starting.</div>');\n if (Compass.Global.isInternetExplorer === false) {\n $(\"#LoanDatesPanelContent_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n callbacks: {\n onScrollStart: function () {\n Compass.Helm.hideHelpPopOvers();\n }\n },\n scrollInertia: 500\n\n });\n $(\"#LoanContactsListContainer_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n scrollInertia: 500\n\n });\n }\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : END * * */\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function determineScrollbars() {\n var docStyle = inlineStyle(docElem);\n mainBodyRect = bodyGeo.getCurrentBodyInfo();\n\n // -- Clear the scrollbars --\n if (shouldComputeMainBodyScrollbars) {\n defaultOverflowX = defaultOverflowY = 'hidden';\n }\n else {\n defaultOverflowX = docStyle.overflowX;\n defaultOverflowY = docStyle.overflowY;\n }\n\n // -- Set the scrollbars after a delay --\n // If the right side of the visible content is beyond the window width,\n // or the visible content is wider than the window width, show the scrollbars.\n // Doing this after a timeout fixes SC-3722 for some reason -- the toolbar was moving up and down by the height\n // of the horizontal scrollbar. It's as if doing it on a delay gives IE/Edge a chance to\n // deal with zoom first, and then scrollbars separately\n // The delay also allows us to collect several concurrent requests and handle them once.\n clearTimeout(finalizeScrollbarsTimer);\n\n var\n doUseHorizScrollbar = doForceHorizScrollbar || isBodyTooWide(),\n doUseVertScrollbar = doForceVertScrollbar || isBodyTooTall(),\n newOverflowX = doUseHorizScrollbar ? 'scroll' : defaultOverflowX,\n newOverflowY = doUseVertScrollbar ? 'scroll' : defaultOverflowY;\n\n if (newOverflowX !== docStyle.overflowX || newOverflowY !== docStyle.overflowY) {\n if (shouldComputeMainBodyScrollbars) {\n // MS browsers need to reset first, otherwise causes SC-3722\n setOverflow('hidden', 'hidden');\n }\n finalizeScrollbarsTimer = nativeGlobal.setTimeout(function() {\n setOverflow(newOverflowX, newOverflowY);\n }, 0);\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n const me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n } // Auto-widthed padding element at end hides or shows to create matching margin.\n\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n } // Change of scrollbar status means height change\n\n me.onHeightChange();\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "_addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\t\t\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\t\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else d.scrollbarFiller.style.display = \"\";\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else d.gutterFiller.style.display = \"\";\n\t\t }", "function updateAllTransientScrollbars() {\n for (var i = 0; i < transientScrollbarEls.length; i++) {\n var el = transientScrollbarEls[i];\n updateTransientScrollbars(el);\n }\n}", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else { d.gutterFiller.style.display = \"\"; }\n\t\t }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "initScrollbar(){\n\t\tconst { fade = true } = this.options.scrollbar;\n\t\tthis.indicators = [];\n\t\tlet indicator;\n\n\t\tif (this.options.scrollX) {\n\t\t\tindicator = {\n\t\t\t\tel: createScrollbar('horizontal'),\n\t\t\t\tdirection: 'horizontal',\n\t\t\t\tfade\n\t\t\t};\n\t\t\tthis.insertScrollBar(indicator.el);\n\n\t\t\tthis.indicators.push(new Indicator(this, indicator));\n\t\t}\n\n\t\tif (this.options.scrollY) {\n\t\t\tindicator = {\n\t\t\t\tel: createScrollbar('vertical'),\n\t\t\t\tdirection: 'vertical',\n\t\t\t\tfade\n\t\t\t};\n\t\t\tthis.insertScrollBar(indicator.el);\n\t\t\tthis.indicators.push(new Indicator(this, indicator));\n\t\t}\n\n\t\tthis.on('refresh', () => {\n\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\tthis.indicators[i].refresh();\n\t\t\t}\n\t\t});\n\n\t\tif (fade) {\n\t\t\tthis.on('scrollEnd', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade(true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', () => {\n\t\t\t\tfor (let i = 0; i < this.indicators.length; i++) {\n\t\t\t\t\tthis.indicators[i].fade(true, true);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function initScroll() {\n this.leftButton.onmousedown = handleScrollClick;\n this.leftButton.onmouseup = handleScrollStop;\n\n this.rightButton.onmousedown = handleScrollClick;\n this.rightButton.onmouseup = handleScrollStop;\n disableNavigation(0,0);\n disableNavigation(0,1);\n var isIEMac = (navigator.appName.indexOf(\"Explorer\") != -1 && navigator.userAgent.indexOf(\"Mac\") != -1);\n if (!isIEMac) {\n document.getElementById(\"theInnerContainer\").style.overflow = \"hidden\";\n }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "_refreshLayout() {\n const that = this;\n const source = that.rows;\n\n if (that._layoutSuspended) {\n return;\n }\n\n that._visibleRows = null;\n that.__viewRows = null;\n that.__clientSize = null;\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that.__parentCells = null;\n\n that.$.columnFarContainer.classList.remove('vscroll');\n that.$.scrollView.classList.remove('hscroll');\n that.$.scrollView.classList.remove('vscroll');\n\n that._refreshElementsVisibility();\n that._refreshColumnHeights();\n that._refreshContentHeight();\n\n if (!(source && source.url)) {\n if (!source || source === null || source.length === 0 || that.columns.length === 0) {\n that.$.placeholder.classList.remove('jqx-hidden');\n\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n\n return;\n }\n }\n\n if (!that.__columnHeaderHeight) {\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\n }\n\n if (!that.__filterFooterOffsetHeight) {\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains('jqx-hidden') ? 0 : that.$.filterFooter.offsetHeight;\n }\n\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\n\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\n\n\n if (that.paging.spinner.enabled && that.paging.enabled) {\n if (!that.pageScroll) {\n const pageScroll = document.createElement('jqx-scroll-bar');\n\n pageScroll.orientation = 'vertical';\n pageScroll.style.height = '100%';\n pageScroll.style.width = '100%';\n pageScroll.max = Math.ceil(that.dataSource.length / that.paging.pageSize);\n pageScroll.step = that.paging.spinner.step;\n pageScroll.largeStep = that.paging.spinner.step;\n pageScroll.setAttribute('spinner', '');\n pageScroll.setAttribute('jqx-id', 'spinner');\n pageScroll.ownerElement = that;\n\n that.addPropertyBinding('[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader);\n\n pageScroll.addEventListener('change', function (event) {\n that.paging.pageIndex = event.detail.value;\n });\n\n that.pageScroll = pageScroll;\n }\n\n that.htmlColumnLastChild.appendChild(that.pageScroll);\n }\n else {\n that.htmlColumnLastChild.innerHTML = '';\n }\n\n that._refreshScrollBars();\n\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "_refreshLayout() {\n const that = this;\n const source = that._items;\n\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that._height = null;\n\n if (!that._scrollView) {\n that._scrollView = new JQX.Utilities.Scroll(that, that.$.horizontalScrollBar, that.$.verticalScrollBar);\n }\n\n that.$itemsContainer.removeClass('hscroll');\n that.$itemsContainer.removeClass('vscroll');\n\n if (!source || source === null || source.length === 0) {\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n that.$filterInputContainer.removeClass('vscroll');\n that.$placeholder.removeClass('jqx-hidden');\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n that.$placeholder.addClass('jqx-hidden');\n\n const horizontalOffset = 2 * (parseInt(getComputedStyle(that.$.itemsInnerContainer).getPropertyValue('--jqx-list-item-horizontal-offset')) || 0);\n\n let hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n let vScrollHeight = that._scrollHeight;\n\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n that._refreshVerticalScrollBarVisibility(vScrollHeight);\n\n\n if (that.horizontalScrollBarVisibility === 'hidden') {\n that.$.itemsInnerContainer.style.width = that.$.itemsContainer.offsetWidth - horizontalOffset;\n }\n else {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth) + 'px';\n }\n\n if (that.computedVerticalScrollBarVisibility) {\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - that._scrollView.vScrollBar.offsetWidth;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.horizontalScrollBarVisibility !== 'hidden') {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth - that._scrollView.vScrollBar.offsetWidth) + 'px';\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n if (!(that.horizontalScrollBarVisibility === 'visible' && that.scrollWidth === 0)) {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n else if (that.horizontalScrollBarVisibility === 'visible') {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n\n that.scrollHeight = that.__scrollHeight;\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.computedHorizontalScrollBarVisibility) {\n that.scrollHeight = that._scrollHeight;\n that._refreshVerticalScrollBarVisibility(that.scrollHeight);\n\n //Resize event not thrown after 'bottom-corner' is applied\n if (that._scrollView.vScrollBar.$.hasClass('bottom-corner')) {\n that._scrollView.vScrollBar.refresh();\n }\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n const isIE = /Trident|Edge/.test(navigator.userAgent);\n if (!that.isRefreshing && isIE) {\n setTimeout(function () {\n that.isRefreshing = true;\n that._refreshLayout();\n that.isRefreshing = false;\n }, 50);\n }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\r\n var d = cm.display;\r\n var sizes = d.scrollbars.update(measure);\r\n\r\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\r\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\r\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\r\n\r\n if (sizes.right && sizes.bottom) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\r\n d.scrollbarFiller.style.width = sizes.right + \"px\";\r\n } else { d.scrollbarFiller.style.display = \"\"; }\r\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sizes.bottom + \"px\";\r\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\r\n } else { d.gutterFiller.style.display = \"\"; }\r\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function createScrollBar() {\n\tvar $d = $('#skill_content');\n\tvar $j = $d.data('jsp');\n\n\tif ( $j ) {\n\t\t$j.reinitialise();\n\t} else {\n\t\t$d.jScrollPane({verticalGutter: 10});\n\t\tvar $e = $d.data('jsp').getContentPane();\n\t\t\n\t\tif ( $e.next().hasClass('jspVerticalBar') ) {\n\t\t\t$e.addClass('filler');\n\t\t} else {\n\t\t\t$d.css({'background-color': 'rgba(0,0,0,0.5)'});\n\t\t}\n\t}\n}", "function createNodeScrollBar() {\r\n\tfor (let i = 0; i < nodesPayload.length; i++) {\r\n\t\tcreateNodeElement(nodesPayload[i]);\r\n\t}\r\n}", "function createScrollBarHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createScrollBar($(this));\n });\n }else{\n createScrollBar($(this));\n }\n\n });\n afterRenderActions();\n }", "function createScrollBarHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createScrollBar($(this));\n });\n }else{\n createScrollBar($(this));\n }\n\n });\n afterRenderActions();\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('jqx-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "function createScrollBarHandler(){\r\n $(SECTION_SEL).each(function(){\r\n var slides = $(this).find(SLIDE_SEL);\r\n\r\n if(slides.length){\r\n slides.each(function(){\r\n createScrollBar($(this));\r\n });\r\n }else{\r\n createScrollBar($(this));\r\n }\r\n\r\n });\r\n afterRenderActions();\r\n }", "function createScrollBarHandler(){\r\n $(SECTION_SEL).each(function(){\r\n var slides = $(this).find(SLIDE_SEL);\r\n\r\n if(slides.length){\r\n slides.each(function(){\r\n createScrollBar($(this));\r\n });\r\n }else{\r\n createScrollBar($(this));\r\n }\r\n\r\n });\r\n afterRenderActions();\r\n }", "function updateScrollbars(cm, measure) {\r\n if (!measure) measure = measureForScrollbars(cm);\r\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\r\n var scrollHeight = measure.docHeight + scrollerCutOff;\r\n var needsH = measure.scrollWidth > measure.clientWidth;\r\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\r\n sWidth > 0 && !measure.hScrollbarTakesSpace)\r\n needsH = false; // (Issue #2562)\r\n var needsV = scrollHeight > measure.clientHeight;\r\n\r\n if (needsV) {\r\n d.scrollbarV.style.display = \"block\";\r\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\r\n // A bug in IE8 can cause this value to be negative, so guard it.\r\n d.scrollbarV.firstChild.style.height =\r\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\r\n } else {\r\n d.scrollbarV.style.display = \"\";\r\n d.scrollbarV.firstChild.style.height = \"0\";\r\n }\r\n if (needsH) {\r\n d.scrollbarH.style.display = \"block\";\r\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\r\n d.scrollbarH.firstChild.style.width =\r\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\r\n } else {\r\n d.scrollbarH.style.display = \"\";\r\n d.scrollbarH.firstChild.style.width = \"0\";\r\n }\r\n if (needsH && needsV) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\r\n } else d.scrollbarFiller.style.display = \"\";\r\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sWidth + \"px\";\r\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\r\n } else d.gutterFiller.style.display = \"\";\r\n\r\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\r\n if (sWidth === 0) {\r\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\r\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\r\n var barMouseDown = function(e) {\r\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\r\n operation(cm, onMouseDown)(e);\r\n };\r\n on(d.scrollbarV, \"mousedown\", barMouseDown);\r\n on(d.scrollbarH, \"mousedown\", barMouseDown);\r\n }\r\n cm.state.checkedOverlayScrollbar = true;\r\n }\r\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function initializeScrollbar() { \n $(\".mcustomScroll\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"yx\",\n advanced:{\n updateOnContentResize: true\n }\n });\n\n $(\".mcustomScroll.mcustomScrollVerticalOnly\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"y\",\n advanced:{\n updateOnContentResize: true\n }\n });\n }", "_refreshLayout() {\n const that = this;\n const source = that.rows;\n\n if (that._layoutSuspended) {\n return;\n }\n\n that._visibleRows = null;\n that.__viewRows = null;\n that.__clientSize = null;\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that.__parentCells = null;\n\n that.$.columnFarContainer.classList.remove('vscroll');\n that.$.columnNearContainer.classList.remove('vscroll');\n\n that.$.scrollView.classList.remove('hscroll');\n that.$.scrollView.classList.remove('vscroll');\n\n that._refreshElementsVisibility();\n that._refreshColumnHeights();\n that._refreshContentHeight();\n\n if (!(source && source.url)) {\n if (!source || source === null || source.length === 0 || that.columns.length === 0) {\n that.$.placeholder.classList.remove('smart-hidden');\n\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n\n return;\n }\n }\n\n if (!that.__columnHeaderHeight) {\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\n }\n\n if (!that.__filterFooterOffsetHeight) {\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains('smart-hidden') ? 0 : that.$.filterFooter.offsetHeight;\n }\n\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\n\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\n\n\n if (that.paging.spinner.enabled && that.paging.enabled) {\n if (!that.pageScroll) {\n const pageScroll = document.createElement('smart-scroll-bar');\n\n pageScroll.orientation = 'vertical';\n pageScroll.style.height = '100%';\n pageScroll.style.width = '100%';\n pageScroll.max = Math.ceil(that.dataSource.length / that.paging.pageSize);\n pageScroll.step = that.paging.spinner.step;\n pageScroll.largeStep = that.paging.spinner.step;\n pageScroll.setAttribute('spinner', '');\n pageScroll.setAttribute('smart-id', 'spinner');\n pageScroll.ownerElement = that;\n\n that.addPropertyBinding('[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader);\n\n pageScroll.addEventListener('change', function (event) {\n that.paging.pageIndex = event.detail.value;\n });\n\n that.pageScroll = pageScroll;\n }\n\n that.htmlColumnLastChild.appendChild(that.pageScroll);\n }\n else {\n that.htmlColumnLastChild.innerHTML = '';\n }\n\n that._refreshScrollBars();\n\n }", "refreshVirtualScrollbars() {\n const { scrollBarWidth } = DomHelper;\n\n if (scrollBarWidth) {\n const me = this,\n { headerContainer, footerContainer, virtualScrollers } = me,\n hasVerticalOverflow = me.virtualScrollHeight > me.bodyHeight, //bodyContainer.scrollHeight > bodyContainer.clientHeight,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some((subGrid) => subGrid.overflowingHorizontally);\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n }\n\n if (hasVerticalOverflow) {\n if (!headerContainer.classList.contains('b-grid-vertical-overflow')) {\n headerContainer.classList.add('b-grid-vertical-overflow');\n }\n } else {\n headerContainer.classList.remove('b-grid-vertical-overflow');\n }\n\n // can get called before headers are rendered. headers might also be hidden (such as in docs)\n const lastHeaderScroller = headerContainer.querySelector('.b-grid-header-scroller:last-child');\n if (lastHeaderScroller && hasVerticalOverflow) {\n const headerBorderWidth = parseInt(DomHelper.getStyleValue(lastHeaderScroller, 'border-right-width'));\n // Add a style to pad the header-container to clear the grid's vertical scrollbar\n // TODO: regions part of calculation is to compensate for 1px off with third region, but it should be solvable using CSS. Not finding how though...\n headerContainer.style.paddingRight =\n scrollBarWidth - headerBorderWidth + (me.regions.length > 2 ? 1 : 0) + 'px';\n footerContainer.style.paddingRight = `${scrollBarWidth}px`;\n } else {\n headerContainer.style.paddingRight = '0';\n footerContainer.style.paddingRight = '0';\n }\n }\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('smart-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "static resetScrollBarWidth() {\n scrollBarWidth = null;\n }", "static resetScrollBarWidth() {\n scrollBarWidth = null;\n }", "function ListView_UpdateScrollBars(theObject)\n{\n\t//content exits?\n\tif (theObject.Content && theObject.Content.Item_Panel)\n\t{\n\t\t//set scrollbars\n\t\ttheObject.Content.Item_Panel.style.overflowX = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\ttheObject.Content.Item_Panel.style.overflowY = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\t//has vertical scroll position?\n\t\tvar vertical = Get_String(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_POS], null);\n\t\t//and horizontal\n\t\tvar horizontal = Get_String(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_POS], null);\n\t\t//at least one is valid?\n\t\tif (vertical != null || horizontal != null)\n\t\t{\n\t\t\t//vertical?\n\t\t\tif (vertical != null)\n\t\t\t{\n\t\t\t\t//set vertical\n\t\t\t\ttheObject.Content.Item_Panel.scrollTop = vertical * theObject.Content.Item_Height;\n\t\t\t}\n\t\t\t//has horizontal\n\t\t\tif (horizontal != null)\n\t\t\t{\n\t\t\t\t//set horizontal\n\t\t\t\ttheObject.Content.Item_Panel.scrollLeft = horizontal;\n\t\t\t\t//has header panel?\n\t\t\t\tif (theObject.Content.Header_Panel)\n\t\t\t\t{\n\t\t\t\t\t//match scroll pos\n\t\t\t\t\ttheObject.Content.Header_Panel.scrollLeft = theObject.Content.Item_Panel.scrollLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//trigger a repaint\n\t\t\tListView_Paint(theObject);\n\t\t}\n\t}\n}", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t };\n\t\t }", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t }\n\t\t }", "function adjustPagesForScrollBar() {\n var scrollBarWidth = 0;\n $.each($(\".page\"), function () {\n var $page = $(this);\n if ($page.css(\"display\") != \"none\") {\n var $pageRowScrollContainer = $page.children(\".pageRowScrollContainer\");\n if ($pageRowScrollContainer.outerWidth(true) > $pageRowScrollContainer.children(\".pageRow\").outerWidth(true)) {\n scrollBarWidth = $pageRowScrollContainer.outerWidth(true) - $pageRowScrollContainer.children(\".pageRow\").outerWidth(true);\n $page.children(\".pageTitles\").css(\"padding-right\", scrollBarWidth + \"px\");\n } else {\n $page.children(\".pageTitles\").css(\"padding-right\", \"\");\n }\n }\n });\n\n var $comparePage = $(\".comparePage\");\n if ($comparePage.css(\"display\") != \"none\") {\n var $compareRowsContainer = $comparePage.children(\".compareRows\");\n if ($compareRowsContainer.outerWidth(true) > $compareRowsContainer.children(\".pageRow\").outerWidth(true)) {\n scrollBarWidth = $compareRowsContainer.outerWidth(true) - $compareRowsContainer.children(\".pageRow\").outerWidth(true);\n $comparePage.children(\".comparePageTitles\").css(\"padding-right\", scrollBarWidth + \"px\");\n } else {\n $comparePage.children(\".comparePageTitles\").css(\"padding-right\", \"\");\n }\n }\n }", "initSnap(){\n\t\tthis.currentPage = {};\n\t\tconst snap = this.options.snap;\n\n\t\tif (snap.loop) {\n\t\t\tlet children = this.scroller.children;\n\t\t\tif (children.length > 0) {\n\t\t\t\tprepend(children[children.length - 1].cloneNode(true), this.scroller);\n\t\t\t\tthis.scroller.appendChild(children[1].cloneNode(true));\n\t\t\t}\n\t\t}\n\n\t\tlet el = snap.el;\n\t\tif (typeof el === 'string') {\n\t\t\tel = this.scroller.querySelectorAll(el);\n\t\t}\n\n\t\tthis.on('refresh', () => {\n\t\t\tthis.pages = [];\n\n\t\t\tif (!this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet stepX = snap.stepX || this.wrapperWidth;\n\t\t\tlet stepY = snap.stepY || this.wrapperHeight;\n\n\t\t\tlet x = 0;\n\t\t\tlet y;\n\t\t\tlet cx;\n\t\t\tlet cy;\n\t\t\tlet i = 0;\n\t\t\tlet l;\n\t\t\tlet m = 0;\n\t\t\tlet n;\n\t\t\tlet rect;\n\t\t\tif (!el) {\n\t\t\t\tcx = Math.round(stepX / 2);\n\t\t\t\tcy = Math.round(stepY / 2);\n\n\t\t\t\twhile (x > -this.scrollerWidth) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile (y > -this.scrollerHeight) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor (; i < l; i++) {\n\t\t\t\t\trect = getRect(el[i]);\n\t\t\t\t\tif (i === 0 || rect.left <= getRect(el[i - 1]).left) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.pages[m]) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif (x > this.maxScrollX) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet initPage = snap.loop ? 1 : 0;\n\t\t\tthis.goToPage(this.currentPage.pageX || initPage, this.currentPage.pageY || 0, 0);\n\n\t\t\tconst snapThreshold = snap.threshold;\n\t\t\tif (snapThreshold % 1 === 0) {\n\t\t\t\tthis.snapThresholdX = snapThreshold;\n\t\t\t\tthis.snapThresholdY = snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('scrollEnd', () => {\n\t\t\tif (snap.loop) {\n\t\t\t\tif (this.currentPage.pageX === 0) {\n\t\t\t\t\tthis.goToPage(this.pages.length - 2, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t\tif (this.currentPage.pageX === this.pages.length - 1) {\n\t\t\t\t\tthis.goToPage(1, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (snap.listenFlick !== false) {\n\t\t\tthis.on('flick', () => {\n\t\t\t\tlet time = snap.speed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\t\tthis.goToPage(\n\t\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\t\ttime\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t}", "_handleScrollbarsDisplay(event) {\n const that = this,\n textBox = that.$.input;\n\n setTimeout(function () {\n switch (that.horizontalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('hscroll');\n that.$.horizontalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('hscroll');\n break;\n case 'visible':\n that.$container.addClass('hscroll');\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n that.$.horizontalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollWidth > textBox.clientWidth) {\n that.$container.addClass('hscroll');\n\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollLeft = that._scrollView.scrollLeft;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n }\n }\n else {\n that.$container.removeClass('hscroll');\n }\n that.$.horizontalScrollBar.disabled = false;\n }\n\n switch (that.verticalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('vscroll');\n that.$.verticalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('vscroll');\n break;\n case 'visible':\n that.$container.addClass('vscroll');\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n that._scrollView.scrollTo(that.$.input.scrollTop);\n that.$.verticalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollHeight > textBox.clientHeight) {\n that.$container.addClass('vscroll');\n\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollTop = that._scrollView.scrollTop;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n }\n else {\n that.$container.removeClass('vscroll');\n }\n that.$.verticalScrollBar.disabled = false;\n }\n }, 0);\n\n }", "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "function measureForScrollbars(cm) {\n\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t return {\n\t clientHeight: d.scroller.clientHeight,\n\t viewHeight: d.wrapper.clientHeight,\n\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t viewWidth: d.wrapper.clientWidth,\n\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t docHeight: docH,\n\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t nativeBarWidth: d.nativeBarWidth,\n\t gutterWidth: gutterW\n\t };\n\t }", "function initProgressBars(){\n\t\"use strict\";\n\n\tif($j('.q_progress_bar').length){\n\t\t$j('.q_progress_bar').each(function() {\n\t\t\tif($j(this).parents('.vertical_split_slider').length){\n\t\t\t\tinitToCounterHorizontalProgressBar($j(this));\n\t\t\t\tvar percentage = $j(this).find('.progress_content').data('percentage');\n\t\t\t\t$j(this).find('.progress_content').css('width', '0%');\n\t\t\t\t$j(this).find('.progress_content').animate({'width': percentage+'%'}, 1500);\n\t\t\t\t$j(this).find('.progress_number_wrapper').css('width', '0%');\n\t\t\t\t$j(this).find('.progress_number_wrapper').animate({'width': percentage+'%'}, 1500);\n\t\t\t}\n else {\n\t\t\t\t$j(this).appear(function() {\n\t\t\t\t\tinitToCounterHorizontalProgressBar($j(this));\n\t\t\t\t\tvar percentage = $j(this).find('.progress_content').data('percentage');\n\t\t\t\t\t$j(this).find('.progress_content').css('width', '0%');\n\t\t\t\t\t$j(this).find('.progress_content').animate({'width': percentage+'%'}, 1500);\n\t\t\t\t\t$j(this).find('.progress_number_wrapper').css('width', '0%');\n\t $j(this).find('.progress_number_wrapper').animate({'width': percentage+'%'}, 1500);\n\t \n\t\t\t\t\t\n\t\t\t\t},{accX: 0, accY: -200});\n\t\t\t}\n\t\t});\n\t}\n}", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }" ]
[ "0.6921312", "0.68662924", "0.6864566", "0.68187743", "0.6620011", "0.6620011", "0.6620011", "0.6611088", "0.64639276", "0.64639276", "0.64639276", "0.6461143", "0.644743", "0.6399939", "0.63948166", "0.63774943", "0.6359205", "0.6356848", "0.6355177", "0.63363695", "0.63287604", "0.6313503", "0.6306461", "0.63061345", "0.628916", "0.628916", "0.628916", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.62857956", "0.6274581", "0.6212062", "0.6212062", "0.6208633", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61789554", "0.61691624", "0.61398184", "0.6094555", "0.6094555", "0.60794824", "0.60615337", "0.60615337", "0.60613376", "0.60311544", "0.60311544", "0.60311544", "0.60311544", "0.5942073", "0.593789", "0.59350264", "0.5917843", "0.59107333", "0.59107333", "0.5909884", "0.5848493", "0.5846428", "0.58108175", "0.57742095", "0.5747094", "0.5738732", "0.5738732", "0.5738732", "0.5732348", "0.5678113", "0.5678113", "0.5678113", "0.5678113" ]
0.0
-1
Resynchronize the fake scrollbars with the actual size of the content.
function updateScrollbarsInner(cm, measure) { var d = cm.display; var sizes = d.scrollbars.update(measure); d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; if (sizes.right && sizes.bottom) { d.scrollbarFiller.style.display = "block"; d.scrollbarFiller.style.height = sizes.bottom + "px"; d.scrollbarFiller.style.width = sizes.right + "px"; } else { d.scrollbarFiller.style.display = ""; } if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { d.gutterFiller.style.display = "block"; d.gutterFiller.style.height = sizes.bottom + "px"; d.gutterFiller.style.width = measure.gutterWidth + "px"; } else { d.gutterFiller.style.display = ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateScrollableContents() {\n if (this.intervalId_ !== null) {\n return;\n } // notifyResize is already in progress.\n\n this.requestUpdateScroll();\n\n const nodeList = this.shadowRoot.querySelectorAll('[scrollable] iron-list');\n if (!nodeList.length) {\n return;\n }\n\n let nodesToResize = Array.from(nodeList).map(node => ({\n node: node,\n lastScrollHeight: 0,\n }));\n // Use setInterval to avoid initial render / sizing issues.\n this.intervalId_ = window.setInterval(() => {\n const checkAgain = [];\n nodesToResize.forEach(({node, lastScrollHeight}) => {\n const scrollHeight = node.parentNode.scrollHeight;\n // A hidden scroll-container has a height of 0. When not hidden, it has\n // a min-height of 1px and the iron-list needs a resize to show the\n // initial items and update the |scrollHeight|. The initial item count\n // is determined by the |scrollHeight|. A scrollHeight of 1px will\n // result in the minimum default item count (currently 3). After the\n // |scrollHeight| is updated to be greater than 1px, another resize is\n // needed to correctly calculate the number of physical iron-list items\n // to render.\n if (scrollHeight !== lastScrollHeight) {\n const ironList = /** @type {!IronListElement} */ (node);\n ironList.notifyResize();\n }\n\n // TODO(crbug.com/1121679): Add UI Test for this behavior.\n if (scrollHeight <= 1 &&\n window.getComputedStyle(node.parentNode).display !== 'none') {\n checkAgain.push({\n node: node,\n lastScrollHeight: scrollHeight,\n });\n }\n });\n if (checkAgain.length === 0) {\n window.clearInterval(this.intervalId_);\n this.intervalId_ = null;\n } else {\n nodesToResize = checkAgain;\n }\n }, 10);\n }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\t\t\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\t\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else d.scrollbarFiller.style.display = \"\";\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else d.gutterFiller.style.display = \"\";\n\t\t }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else { d.gutterFiller.style.display = \"\"; }\n\t\t }", "updateScrollerSize_() {\n if (this.$.selector.items.length !== 0) {\n const estScrollHeight = this.items.length * this.domItemAverageHeight_();\n this.$.items.style.height = estScrollHeight + 'px';\n }\n }", "_resizeHandler() {\n const that = this;\n\n that.$.scrollableContainer.refresh();\n }", "_refreshLayout() {\n const that = this;\n const source = that._items;\n\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that._height = null;\n\n if (!that._scrollView) {\n that._scrollView = new JQX.Utilities.Scroll(that, that.$.horizontalScrollBar, that.$.verticalScrollBar);\n }\n\n that.$itemsContainer.removeClass('hscroll');\n that.$itemsContainer.removeClass('vscroll');\n\n if (!source || source === null || source.length === 0) {\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n that.$filterInputContainer.removeClass('vscroll');\n that.$placeholder.removeClass('jqx-hidden');\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n that.$placeholder.addClass('jqx-hidden');\n\n const horizontalOffset = 2 * (parseInt(getComputedStyle(that.$.itemsInnerContainer).getPropertyValue('--jqx-list-item-horizontal-offset')) || 0);\n\n let hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n let vScrollHeight = that._scrollHeight;\n\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n that._refreshVerticalScrollBarVisibility(vScrollHeight);\n\n\n if (that.horizontalScrollBarVisibility === 'hidden') {\n that.$.itemsInnerContainer.style.width = that.$.itemsContainer.offsetWidth - horizontalOffset;\n }\n else {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth) + 'px';\n }\n\n if (that.computedVerticalScrollBarVisibility) {\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - that._scrollView.vScrollBar.offsetWidth;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.horizontalScrollBarVisibility !== 'hidden') {\n that.$.itemsInnerContainer.style.width = Math.max(that.$.itemsContainer.offsetWidth - horizontalOffset, -horizontalOffset + that.__scrollWidth - that._scrollView.vScrollBar.offsetWidth) + 'px';\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n if (!(that.horizontalScrollBarVisibility === 'visible' && that.scrollWidth === 0)) {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n else if (that.horizontalScrollBarVisibility === 'visible') {\n that.__scrollHeight += that._scrollView.hScrollBar.offsetHeight;\n }\n\n that.scrollHeight = that.__scrollHeight;\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n return;\n }\n\n hScrollWidth = that._scrollWidth - that.$.itemsContainer.offsetWidth - horizontalOffset;\n that._refreshHorizontalScrollBarVisibility(hScrollWidth);\n\n if (that.computedHorizontalScrollBarVisibility) {\n that.scrollHeight = that._scrollHeight;\n that._refreshVerticalScrollBarVisibility(that.scrollHeight);\n\n //Resize event not thrown after 'bottom-corner' is applied\n if (that._scrollView.vScrollBar.$.hasClass('bottom-corner')) {\n that._scrollView.vScrollBar.refresh();\n }\n }\n\n if (that.isVirtualized) {\n that._recycle();\n }\n\n const isIE = /Trident|Edge/.test(navigator.userAgent);\n if (!that.isRefreshing && isIE) {\n setTimeout(function () {\n that.isRefreshing = true;\n that._refreshLayout();\n that.isRefreshing = false;\n }, 50);\n }\n }", "function updateScrollbarsInner(cm, measure) {\r\n var d = cm.display;\r\n var sizes = d.scrollbars.update(measure);\r\n\r\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\r\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\r\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\r\n\r\n if (sizes.right && sizes.bottom) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\r\n d.scrollbarFiller.style.width = sizes.right + \"px\";\r\n } else { d.scrollbarFiller.style.display = \"\"; }\r\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sizes.bottom + \"px\";\r\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\r\n } else { d.gutterFiller.style.display = \"\"; }\r\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n const me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n } // Auto-widthed padding element at end hides or shows to create matching margin.\n\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n } // Change of scrollbar status means height change\n\n me.onHeightChange();\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function sizeScrollbar() {\n var remainder = $scrollContent.width() - $scrollPane.width();\n var proportion = remainder / $scrollContent.width();\n var handleSize = $scrollPane.width() - (proportion * $scrollPane.width());\n $scrollbar.find(\".ui-slider-handle\").css({\n width: handleSize,\n \"margin-left\": -handleSize / 2\n });\n handleHelper.width(\"\").width($scrollbar.width() - handleSize);\n }", "function sizeScrollbar(){\n\t\tvar remainder = scrollContent.width() - scrollPane.width();\n\t\tvar proportion = remainder / scrollContent.width();\n\t\tvar handleSize = scrollPane.width() - (proportion * scrollPane.width());\n\t\tscrollbar.find('.ui-slider-handle').css({\n\t\t\twidth: handleSize,\n\t\t\t'margin-left': -handleSize/2\n\t\t});\n\t\thandleHelper.width('').width( scrollbar.width() - handleSize);\n\t}", "function sizeScrollbar() {\n\t\t\t}", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "updateScroll(){\n \t\tif (this.$.content.scrollHeight > this.$.content.offsetHeight){\n \t\t\tthis.$.content.scrollTop = this.$.content.scrollHeight - this.$.content.offsetHeight;\n \t\t}\n \t}", "function sizeScrollbar() {\r\n\t\t\tvar remainder = scrollContent.width() - scrollPane.width();\r\n\t\t\tvar proportion = remainder / scrollContent.width();\r\n\t\t\tvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\r\n\t\t\tscrollbar.find( \".ui-slider-handle\" ).css({\r\n\t\t\t\twidth: handleSize,\r\n\t\t\t\t\"margin-left\": -handleSize / 2\r\n\t\t\t});\r\n\t\t\thandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\r\n\t\t}", "_setScrollBars() {\r\n const that = this;\r\n\r\n if (!that._scrollView) {\r\n that._scrollView = new LW.Utilities.Scroll(that.$.timeline, that.$.horizontalScrollBar, that.$.verticalScrollBar);\r\n }\r\n\r\n const vScrollBar = that._scrollView.vScrollBar,\r\n hScrollBar = that._scrollView.hScrollBar;\r\n\r\n hScrollBar.$.addClass('lw-hidden');\r\n vScrollBar.$.addClass('lw-hidden');\r\n\r\n //Cancel Style/Resize observers of the ScrollBars\r\n vScrollBar.hasStyleObserver = false;\r\n hScrollBar.hasStyleObserver = false;\r\n vScrollBar.hasResizeObserver = false;\r\n hScrollBar.hasResizeObserver = false;\r\n\r\n hScrollBar.wait = false;\r\n vScrollBar.wait = false;\r\n\r\n //Refreshes the ScrollBars\r\n that._refresh();\r\n }", "_resizeContent(e) {\n // fake a resize event to make contents happy\n async.microTask.run(() => {\n window.dispatchEvent(new Event(\"resize\"));\n });\n }", "updateHeight_() {\n const estScrollHeight = this.items.length > 0 ?\n this.items.length * this.domItemAverageHeight_() :\n 0;\n this.$.container.style.height = estScrollHeight + 'px';\n }", "refreshFakeScroll() {\n const me = this,\n {\n element,\n virtualScrollerElement,\n virtualScrollerWidth,\n totalFixedWidth,\n store\n } = me,\n scroller = me.scrollable; // Use a fixed scroll width if grid is empty, to make it scrollable without rows\n // https://app.assembla.com/spaces/bryntum/tickets/7184\n\n scroller.scrollWidth = store && store.count ? null : totalFixedWidth; // Scroller lays out in the same way as subgrid.\n // If we are flexed, the scroller is flexed etc.\n\n virtualScrollerElement.style.width = element.style.width;\n virtualScrollerElement.style.flex = element.style.flex;\n\n if (!me.collapsed) {\n if (me.overflowingHorizontally) {\n virtualScrollerWidth.style.width = `${scroller.scrollWidth}px`;\n me.header.element.classList.add('b-overflowing');\n me.footer && me.footer.element.classList.add('b-overflowing'); // If *any* SubGrids have horizontal overflow, the main grid\n // has to show its virtual horizontal scollbar.\n\n me.grid.virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollerWidth.style.width = 0;\n me.header.element.classList.remove('b-overflowing');\n me.footer && me.footer.element.classList.remove('b-overflowing');\n }\n }\n }", "function determineScrollbars() {\n var docStyle = inlineStyle(docElem);\n mainBodyRect = bodyGeo.getCurrentBodyInfo();\n\n // -- Clear the scrollbars --\n if (shouldComputeMainBodyScrollbars) {\n defaultOverflowX = defaultOverflowY = 'hidden';\n }\n else {\n defaultOverflowX = docStyle.overflowX;\n defaultOverflowY = docStyle.overflowY;\n }\n\n // -- Set the scrollbars after a delay --\n // If the right side of the visible content is beyond the window width,\n // or the visible content is wider than the window width, show the scrollbars.\n // Doing this after a timeout fixes SC-3722 for some reason -- the toolbar was moving up and down by the height\n // of the horizontal scrollbar. It's as if doing it on a delay gives IE/Edge a chance to\n // deal with zoom first, and then scrollbars separately\n // The delay also allows us to collect several concurrent requests and handle them once.\n clearTimeout(finalizeScrollbarsTimer);\n\n var\n doUseHorizScrollbar = doForceHorizScrollbar || isBodyTooWide(),\n doUseVertScrollbar = doForceVertScrollbar || isBodyTooTall(),\n newOverflowX = doUseHorizScrollbar ? 'scroll' : defaultOverflowX,\n newOverflowY = doUseVertScrollbar ? 'scroll' : defaultOverflowY;\n\n if (newOverflowX !== docStyle.overflowX || newOverflowY !== docStyle.overflowY) {\n if (shouldComputeMainBodyScrollbars) {\n // MS browsers need to reset first, otherwise causes SC-3722\n setOverflow('hidden', 'hidden');\n }\n finalizeScrollbarsTimer = nativeGlobal.setTimeout(function() {\n setOverflow(newOverflowX, newOverflowY);\n }, 0);\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function setCustomScrollBars() {\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : BEGIN * * */\n /*http://manos.malihu.gr/jquery-custom-content-scroller/*/\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">$(window).load() event starting.</div>');\n if (Compass.Global.isInternetExplorer === false) {\n $(\"#LoanDatesPanelContent_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n callbacks: {\n onScrollStart: function () {\n Compass.Helm.hideHelpPopOvers();\n }\n },\n scrollInertia: 500\n\n });\n $(\"#LoanContactsListContainer_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n scrollInertia: 500\n\n });\n }\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : END * * */\n }", "_handleScrollbarsDisplay(event) {\n const that = this,\n textBox = that.$.input;\n\n setTimeout(function () {\n switch (that.horizontalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('hscroll');\n that.$.horizontalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('hscroll');\n break;\n case 'visible':\n that.$container.addClass('hscroll');\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n that.$.horizontalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollWidth > textBox.clientWidth) {\n that.$container.addClass('hscroll');\n\n that._scrollView.scrollWidth = textBox.scrollWidth - textBox.clientWidth;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollLeft = that._scrollView.scrollLeft;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollLeft, true);\n }\n }\n else {\n that.$container.removeClass('hscroll');\n }\n that.$.horizontalScrollBar.disabled = false;\n }\n\n switch (that.verticalScrollBarVisibility) {\n case 'disabled':\n that.$container.addClass('vscroll');\n that.$.verticalScrollBar.disabled = true;\n break;\n case 'hidden':\n that.$container.removeClass('vscroll');\n break;\n case 'visible':\n that.$container.addClass('vscroll');\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n that._scrollView.scrollTo(that.$.input.scrollTop);\n that.$.verticalScrollBar.disabled = false;\n break;\n default:\n if (textBox.scrollHeight > textBox.clientHeight) {\n that.$container.addClass('vscroll');\n\n that._scrollView.scrollHeight = textBox.scrollHeight - textBox.clientHeight;\n\n if (event && event.type === 'resize') {\n that.$.input.scrollTop = that._scrollView.scrollTop;\n }\n else {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n }\n else {\n that.$container.removeClass('vscroll');\n }\n that.$.verticalScrollBar.disabled = false;\n }\n }, 0);\n\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function sizeScrollbar() {\n\tvar remainder = scrollContent.width() - scrollPane.width();\n\tif(remainder < 1){\n\t\t//remainder = scrollContent.width();\n\t\tscrollbar.find( \".ui-slider-handle\" ).hide();\n\t}else{\n\t\tscrollbar.find( \".ui-slider-handle\" ).show();\n\t}\n\tvar proportion = remainder / scrollContent.width();\n\tvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\n\tscrollbar.find( \".ui-slider-handle\" ).css({\n\t\twidth: handleSize,\n\t\t\"margin-left\": -handleSize / 2\n\t});\n\thandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\n}", "function sizeScrollbar() {\nvar remainder = scrollContent.width() - scrollPane.width();\nvar proportion = remainder / scrollContent.width();\nvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\nscrollbar.find( \".ui-slider-handle\" ).css({\nwidth: handleSize,\n\"margin-left\": -handleSize / 2\n});\nhandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\n}", "_updateSizeRowsCols() {\n const that = this;\n\n that.$.container.removeAttribute('style');\n\n setTimeout(function () {\n if ((that.horizontalScrollBarVisibility === 'disabled' || that.horizontalScrollBarVisibility === 'hidden') && (that.verticalScrollBarVisibility === 'disabled' || that.verticalScrollBarVisibility === 'hidden')) {\n return;\n }\n\n const rectObject = that.getBoundingClientRect();\n\n that.$.container.style.width = rectObject.width + 'px';\n that.$.container.style.height = rectObject.height + 'px';\n }, 0);\n }", "handleResize() {\n if (this.scrollHeight !== this.contentNode.scrollHeight || this.clientHeight !== this.contentNode.clientHeight) {\n this.adjustHeight();\n }\n this.forceUpdate();\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\n if (!measure) measure = measureForScrollbars(cm);\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\n var scrollHeight = measure.docHeight + scrollerCutOff;\n var needsH = measure.scrollWidth > measure.clientWidth;\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\n sWidth > 0 && !measure.hScrollbarTakesSpace)\n needsH = false; // (Issue #2562)\n var needsV = scrollHeight > measure.clientHeight;\n\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n // A bug in IE8 can cause this value to be negative, so guard it.\n d.scrollbarV.firstChild.style.height =\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sWidth + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\n if (sWidth === 0) {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\n var barMouseDown = function(e) {\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\n operation(cm, onMouseDown)(e);\n };\n on(d.scrollbarV, \"mousedown\", barMouseDown);\n on(d.scrollbarH, \"mousedown\", barMouseDown);\n }\n cm.state.checkedOverlayScrollbar = true;\n }\n }", "function updateScrollbars(cm, measure) {\r\n if (!measure) measure = measureForScrollbars(cm);\r\n var d = cm.display, sWidth = scrollbarWidth(d.measure);\r\n var scrollHeight = measure.docHeight + scrollerCutOff;\r\n var needsH = measure.scrollWidth > measure.clientWidth;\r\n if (needsH && measure.scrollWidth <= measure.clientWidth + 1 &&\r\n sWidth > 0 && !measure.hScrollbarTakesSpace)\r\n needsH = false; // (Issue #2562)\r\n var needsV = scrollHeight > measure.clientHeight;\r\n\r\n if (needsV) {\r\n d.scrollbarV.style.display = \"block\";\r\n d.scrollbarV.style.bottom = needsH ? sWidth + \"px\" : \"0\";\r\n // A bug in IE8 can cause this value to be negative, so guard it.\r\n d.scrollbarV.firstChild.style.height =\r\n Math.max(0, scrollHeight - measure.clientHeight + (measure.barHeight || d.scrollbarV.clientHeight)) + \"px\";\r\n } else {\r\n d.scrollbarV.style.display = \"\";\r\n d.scrollbarV.firstChild.style.height = \"0\";\r\n }\r\n if (needsH) {\r\n d.scrollbarH.style.display = \"block\";\r\n d.scrollbarH.style.right = needsV ? sWidth + \"px\" : \"0\";\r\n d.scrollbarH.firstChild.style.width =\r\n (measure.scrollWidth - measure.clientWidth + (measure.barWidth || d.scrollbarH.clientWidth)) + \"px\";\r\n } else {\r\n d.scrollbarH.style.display = \"\";\r\n d.scrollbarH.firstChild.style.width = \"0\";\r\n }\r\n if (needsH && needsV) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = sWidth + \"px\";\r\n } else d.scrollbarFiller.style.display = \"\";\r\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sWidth + \"px\";\r\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\r\n } else d.gutterFiller.style.display = \"\";\r\n\r\n if (!cm.state.checkedOverlayScrollbar && measure.clientHeight > 0) {\r\n if (sWidth === 0) {\r\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\r\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = w;\r\n var barMouseDown = function(e) {\r\n if (e_target(e) != d.scrollbarV && e_target(e) != d.scrollbarH)\r\n operation(cm, onMouseDown)(e);\r\n };\r\n on(d.scrollbarV, \"mousedown\", barMouseDown);\r\n on(d.scrollbarH, \"mousedown\", barMouseDown);\r\n }\r\n cm.state.checkedOverlayScrollbar = true;\r\n }\r\n }", "_addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }", "_resizeHandler(event) {\n const that = this;\n\n if (event.target === that && !that._isUpdatingScrollBars) {\n that._isUpdatingScrollBars = true;\n that._initializeRecyclingItems();\n that._refreshLayout();\n that._isUpdatingScrollBars = false;\n }\n }", "refreshFakeScroll() {\n const me = this,\n { element, virtualScrollerElement, virtualScrollerWidth } = me,\n scroller = me.scrollable;\n\n // Use a fixed scroll width if grid is empty, to make it scrollable without rows\n // https://app.assembla.com/spaces/bryntum/tickets/7184\n scroller.scrollWidth = me.store.count ? null : me.totalFixedWidth;\n\n virtualScrollerElement.style.width = `${element.offsetWidth}px`;\n\n //if (BrowserHelper.isEdge) {\n // Needed for Edge, it does not size correctly\n if (me.totalFixedWidth > scroller.clientWidth) {\n element.classList.add('b-overflowing-horizontally');\n } else {\n element.classList.remove('b-overflowing-horizontally');\n }\n //}\n\n // This is if *this* subGrid has horizontal overflow\n // +1 is for Edge, it messes up otherwise\n if (scroller.scrollWidth > scroller.clientWidth + (BrowserHelper.isEdge ? 1 : 0)) {\n virtualScrollerWidth.style.width = `${scroller.scrollWidth}px`;\n me.header.element.classList.add('b-overflowing');\n me.footer && me.footer.element.classList.add('b-overflowing');\n me.overflowingHorizontally = true;\n // If *any* SubGrids have horizontal overflow, the main grid\n // has to show its virtual horizontal scollbar.\n me.grid.virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollerWidth.style.width = 0;\n me.header.element.classList.remove('b-overflowing');\n me.footer && me.footer.element.classList.remove('b-overflowing');\n me.overflowingHorizontally = false;\n }\n }", "refresh() {\n this._resizeEventHandler();\n }", "function createScrollBarForAll(){\n if($('body').hasClass(RESPONSIVE)){\n removeResponsiveScrollOverflows();\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }", "_updateSize() {\n if (qx.ui.mobile.core.Blocker.ROOT == this.getLayoutParent()) {\n this.getContainerElement().style.top =\n qx.bom.Viewport.getScrollTop() + \"px\";\n this.getContainerElement().style.left =\n qx.bom.Viewport.getScrollLeft() + \"px\";\n this.getContainerElement().style.width =\n qx.bom.Viewport.getWidth() + \"px\";\n this.getContainerElement().style.height =\n qx.bom.Viewport.getHeight() + \"px\";\n } else if (this.getLayoutParent() != null) {\n var dimension = qx.bom.element.Dimension.getSize(\n this.getLayoutParent().getContainerElement()\n );\n\n this.getContainerElement().style.width = dimension.width + \"px\";\n this.getContainerElement().style.height = dimension.height + \"px\";\n }\n }", "function createScrollBarForAll() {\n if ($('body').hasClass(RESPONSIVE)) {\n removeResponsiveScrollOverflows();\n } else {\n forEachSectionAndSlide(createScrollBar);\n }\n }", "function ListView_UpdateScrollBars(theObject)\n{\n\t//content exits?\n\tif (theObject.Content && theObject.Content.Item_Panel)\n\t{\n\t\t//set scrollbars\n\t\ttheObject.Content.Item_Panel.style.overflowX = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\ttheObject.Content.Item_Panel.style.overflowY = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_BAR], true) ? \"auto\" : \"hidden\";\n\t\t//has vertical scroll position?\n\t\tvar vertical = Get_String(theObject.Properties[__NEMESIS_PROPERTY_VERTICAL_SCROLL_POS], null);\n\t\t//and horizontal\n\t\tvar horizontal = Get_String(theObject.Properties[__NEMESIS_PROPERTY_HORIZONTAL_SCROLL_POS], null);\n\t\t//at least one is valid?\n\t\tif (vertical != null || horizontal != null)\n\t\t{\n\t\t\t//vertical?\n\t\t\tif (vertical != null)\n\t\t\t{\n\t\t\t\t//set vertical\n\t\t\t\ttheObject.Content.Item_Panel.scrollTop = vertical * theObject.Content.Item_Height;\n\t\t\t}\n\t\t\t//has horizontal\n\t\t\tif (horizontal != null)\n\t\t\t{\n\t\t\t\t//set horizontal\n\t\t\t\ttheObject.Content.Item_Panel.scrollLeft = horizontal;\n\t\t\t\t//has header panel?\n\t\t\t\tif (theObject.Content.Header_Panel)\n\t\t\t\t{\n\t\t\t\t\t//match scroll pos\n\t\t\t\t\ttheObject.Content.Header_Panel.scrollLeft = theObject.Content.Item_Panel.scrollLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//trigger a repaint\n\t\t\tListView_Paint(theObject);\n\t\t}\n\t}\n}", "function OnClientResize_DocView(sender, eventArgs)\r\n{ \r\n var rcp = $find('ResizableControlBehavior1');\r\n\r\n if (isLoaded)\r\n {\r\n var width = rcp.get_Size().width;\r\n var height = rcp.get_Size().height;\r\n PageMethods.SetDocDimensions(width, height);\r\n }\r\n}", "componentDidUpdate () {\n this.setHeight();\n this.scrollList();\n }", "_refreshScrollerPosition() {\n this.__carouselScrollerWidth = qx.bom.element.Dimension.getWidth(\n this.__carouselScroller.getContentElement()\n );\n\n this._scrollToPage(this.getCurrentIndex());\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('jqx-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "renderAndAdjust() {\n this.hot.render();\n\n // Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.\n this.hot.view.adjustElementsSize();\n }", "handleResize() {\n this.refresh();\n }", "_refreshVerticalScrollBarVisibility(scrollHeight) {\n const that = this;\n\n if (that._autoHeight) {\n that.scrollTop = 0;\n that.scrollHeight = 0;\n return;\n }\n\n if (that.computedHorizontalScrollBarVisibility) {\n scrollHeight += that.$.horizontalScrollBar.offsetHeight;\n }\n\n that.scrollHeight = scrollHeight;\n\n if (that.paging.enabled && that.paging.spinner.visible) {\n that.$.verticalScrollBarVisibility.classList.remove('smart-hidden');\n }\n\n if (!that.computedVerticalScrollBarVisibility) {\n that.scrollTop = 0;\n }\n }", "function init() {\n \n if (initDone || !document.body) return;\n\n initDone = true;\n\n var body = document.body;\n var html = document.documentElement;\n var windowHeight = window.innerHeight; \n var scrollHeight = body.scrollHeight;\n \n // check compat mode for root element\n root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;\n activeElement = body;\n \n initTest();\n\n // Checks if this script is running in a frame\n if (top != self) {\n isFrame = true;\n }\n\n /**\n * Please duplicate this radar for a Safari fix! \n * rdar://22376037\n * https://openradar.appspot.com/radar?id=4965070979203072\n * \n * Only applies to Safari now, Chrome fixed it in v45:\n * This fixes a bug where the areas left and right to \n * the content does not trigger the onmousewheel event\n * on some pages. e.g.: html, body { height: 100% }\n */\n else if (scrollHeight > windowHeight &&\n (body.offsetHeight <= windowHeight || \n html.offsetHeight <= windowHeight)) {\n\n var fullPageElem = document.createElement('div');\n fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +\n 'top:0; left:0; right:0; height:' + \n root.scrollHeight + 'px';\n document.body.appendChild(fullPageElem);\n \n // DOM changed (throttled) to fix height\n var pendingRefresh;\n refreshSize = function () {\n if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);\n pendingRefresh = setTimeout(function () {\n if (isExcluded) return; // could be running after cleanup\n fullPageElem.style.height = '0';\n fullPageElem.style.height = root.scrollHeight + 'px';\n pendingRefresh = null;\n }, 500); // act rarely to stay fast\n };\n \n setTimeout(refreshSize, 10);\n\n addEvent('resize', refreshSize);\n\n // TODO: attributeFilter?\n var config = {\n attributes: true, \n childList: true, \n characterData: false \n // subtree: true\n };\n\n observer = new MutationObserver(refreshSize);\n observer.observe(body, config);\n\n if (root.offsetHeight <= windowHeight) {\n var clearfix = document.createElement('div'); \n clearfix.style.clear = 'both';\n body.appendChild(clearfix);\n }\n }\n\n // disable fixed background\n if (!options.fixedBackground && !isExcluded) {\n body.style.backgroundAttachment = 'scroll';\n html.style.backgroundAttachment = 'scroll';\n }\n}", "bindResize() {\n const self = this;\n const el = $(suiController.scrollable)[0];\n // unit test programs don't have resize html\n if (!el) {\n return;\n }\n this._setMusicDimensions();\n // $(suiController.scrollable).height(window.innerHeight - $('.musicRelief').offset().top);\n\n window.addEventListener('resize', function () {\n self.resizeEvent();\n });\n\n let scrollCallback = (ev) => {\n self.handleScrollEvent(ev);\n };\n el.onscroll = scrollCallback;\n }", "function sizeSlider(scrollpane, scrollcontent, slider) {\n \n var scrollpane_h = scrollpane.height(),\n scrollcontent_h = scrollcontent.height(),\n scrollbar_wrap_h = scrollpane_h - scrollpane_h * 0.02,\n diff1\t = scrollcontent_h - scrollpane_h,\n prop\t = diff1 / scrollcontent_h,\n scroll_area = scrollbar_wrap_h - def_opt.btnsWidth * 2,\n stopScroll = Math.floor(scroll_area * prop),\n size_slider = scrollbar_wrap_h - def_opt.btnsWidth * 2 - stopScroll - def_opt.bordersWidth * 2,\n //multiple = diff1 / (scrollbar_wrap_h - def_opt.btnsWidth * 2 - size_slider),\n multiple = scrollcontent_h / scroll_area,\n percentContent = diff1 / 100,\n percentSlider = stopScroll / 100;\n\n /*if (slider !== undefined) {\n size_slider = height2;\n slider.height(height2);\n }*/\n\n return {\n // container height\n scrollpane_h: scrollpane_h,\n // content height\n scrollcontent_h: scrollcontent_h,\n // content stop coordinates\n scrollcontent_stop: scrollpane_h - scrollcontent_h,\n // scrollbar container height\n scrollbar_wrap_h: scrollbar_wrap_h,\n // slider height\n size_slider: size_slider,\n // content height growth while scrolling index\n multiple: multiple,\n // when the coordinate limit is reached than stop the scrollbar\n stopScroll: stopScroll,\n // the number of pixels in one percent of movement by the content\n percentContent: percentContent,\n // the number of pixels in one percent of movement by the slider\n percentSlider: percentSlider\n };\n }", "function refreshScrollForBillers() {\n\tif(mainScroll) {\n\t\tsetTimeout(function() {\n\t\t\tmainScroll.refresh(); \n\t\t}, 1000);\n\t}\n}", "function sizeScrollbar() {\r\n\t\t var remainder = scrollContent.width() - scrollPane.width();\r\n\t\t var proportion = scrollPane.width() / scrollContent.width(); //remainder / scrollContent.width();\r\n\t\t var handleSize = jQuery('.slider-lb:eq(0)').width(); //scrollPane.width() * proportion; // - (proportion * scrollPane.width());\r\n\t\t var pos = jQuery(jQuery(jQuery(scrollPane.next('.scroll-bar-container').children(\".scroll-bar-start\")).prev(\".scroll-bar-wrap\").children(\".scroll-bar\").children(\".slider-lb1\"))).position();\r\n\t\t scrollbar.find('.ui-slider-handle').css({\r\n\t\t\twidth: handleSize+100,\r\n\t\t\tleft: pos.left-50\r\n\t\t });\r\n\t\t// var scrollContentWidth = 1200;\r\n\t\t handleHelper.width('').width(scrollbar.width() - handleSize - 150);\r\n\t\t var scrollBarSize = jQuery(\".scroll-bar-container\").width()-100;\r\n\t\t var offsetFactor = Math.round(handleSize / 2) + 14; // for left padding scrollbar\r\n\t\t Group2First = (group1 * scrollBarSize) / (scrollContentWidth)\r\n\t\t Group3First = ((group1 + group2) * scrollBarSize) / (scrollContentWidth)\r\n\t\t Group4First = ((group1 + group2 + group3) * scrollBarSize) / (scrollContentWidth)\r\n\t\t jQuery(\".slider-lb2\").css('left', (Group2First + offsetFactor + 50) + 'px');\r\n\t\t jQuery(\".slider-lb3\").css('left', (Group3First + offsetFactor + 100) + 'px');\r\n\t\t /*trick to handle overlapping labels*/\r\n\t\t var group5Offset = (scrollBarSize - jQuery(\".slider-lb5\").width());\r\n\t\t var group4Offset = Group4First + offsetFactor;\r\n\t\t var fwLength = jQuery(\".slider-lb4\").width();\r\n\t\t if ((group4Offset + fwLength) > group5Offset) group4Offset -= ((group4Offset + fwLength) - group5Offset) + 35;\r\n\t\t if (((group4Offset + fwLength) - group5Offset) < 10) group4Offset -= 30;\r\n\t\t Group4First = group4Offset - offsetFactor;\r\n\t\t jQuery(\".slider-lb4\").css('left', group4Offset+150+'px');\r\n\t\t jQuery(\".slider-lb5\").css('left', group5Offset+50+'px');\r\n\t\t}", "_setContentSizeCss()\n {\n const clientRect = this.getBoundingClientRect();\n this.style.setProperty(\"--content-width\", `${clientRect.width}px`);\n this.style.setProperty(\"--content-height\", `${clientRect.height}px`);\n }", "function updateAllTransientScrollbars() {\n for (var i = 0; i < transientScrollbarEls.length; i++) {\n var el = transientScrollbarEls[i];\n updateTransientScrollbars(el);\n }\n}", "function init() {\n \n if (initDone || !document.body) return;\n\n initDone = true;\n\n var body = document.body;\n var html = document.documentElement;\n var windowHeight = window.innerHeight; \n var scrollHeight = body.scrollHeight;\n \n // check compat mode for root element\n root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;\n activeElement = body;\n \n initTest();\n\n // Checks if this script is running in a frame\n if (top != self) {\n isFrame = true;\n }\n\n /**\n * Safari 10 fixed it, Chrome fixed it in v45:\n * This fixes a bug where the areas left and right to \n * the content does not trigger the onmousewheel event\n * on some pages. e.g.: html, body { height: 100% }\n */\n else if (isOldSafari &&\n scrollHeight > windowHeight &&\n (body.offsetHeight <= windowHeight || \n html.offsetHeight <= windowHeight)) {\n\n var fullPageElem = document.createElement('div');\n fullPageElem.style.cssText = 'position:absolute; z-index:-10000; ' +\n 'top:0; left:0; right:0; height:' + \n root.scrollHeight + 'px';\n document.body.appendChild(fullPageElem);\n \n // DOM changed (throttled) to fix height\n var pendingRefresh;\n refreshSize = function () {\n if (pendingRefresh) return; // could also be: clearTimeout(pendingRefresh);\n pendingRefresh = setTimeout(function () {\n if (isExcluded) return; // could be running after cleanup\n fullPageElem.style.height = '0';\n fullPageElem.style.height = root.scrollHeight + 'px';\n pendingRefresh = null;\n }, 500); // act rarely to stay fast\n };\n \n setTimeout(refreshSize, 10);\n\n addEvent('resize', refreshSize);\n\n // TODO: attributeFilter?\n var config = {\n attributes: true, \n childList: true, \n characterData: false \n // subtree: true\n };\n\n observer = new MutationObserver(refreshSize);\n observer.observe(body, config);\n\n if (root.offsetHeight <= windowHeight) {\n var clearfix = document.createElement('div'); \n clearfix.style.clear = 'both';\n body.appendChild(clearfix);\n }\n }\n\n // disable fixed background\n if (!options.fixedBackground && !isExcluded) {\n body.style.backgroundAttachment = 'scroll';\n html.style.backgroundAttachment = 'scroll';\n }\n}", "update() {\n\t\tthis.scroll.update();\n\t}", "_refreshLayout() {\n const that = this;\n const source = that.rows;\n\n if (that._layoutSuspended) {\n return;\n }\n\n that._visibleRows = null;\n that.__viewRows = null;\n that.__clientSize = null;\n that.__scrollHeight = null;\n that.__scrollWidth = null;\n that.__parentCells = null;\n\n that.$.columnFarContainer.classList.remove('vscroll');\n that.$.scrollView.classList.remove('hscroll');\n that.$.scrollView.classList.remove('vscroll');\n\n that._refreshElementsVisibility();\n that._refreshColumnHeights();\n that._refreshContentHeight();\n\n if (!(source && source.url)) {\n if (!source || source === null || source.length === 0 || that.columns.length === 0) {\n that.$.placeholder.classList.remove('jqx-hidden');\n\n that.scrollWidth = 0;\n that.scrollHeight = 0;\n\n return;\n }\n }\n\n if (!that.__columnHeaderHeight) {\n that.__columnHeaderHeight = that.$.columnHeader.offsetHeight;\n }\n\n if (!that.__filterFooterOffsetHeight) {\n that.__filterFooterOffsetHeight = that.$.filterFooter.classList.contains('jqx-hidden') ? 0 : that.$.filterFooter.offsetHeight;\n }\n\n const scrollViewOffsetHeight = that._contentHeight - that.__filterFooterOffsetHeight - that.__columnHeaderHeight;\n\n that.$.scrollView.style.height = scrollViewOffsetHeight + 'px';\n that.htmlColumnLastChild.style.height = that.__columnHeaderHeight + 'px';\n\n\n if (that.paging.spinner.enabled && that.paging.enabled) {\n if (!that.pageScroll) {\n const pageScroll = document.createElement('jqx-scroll-bar');\n\n pageScroll.orientation = 'vertical';\n pageScroll.style.height = '100%';\n pageScroll.style.width = '100%';\n pageScroll.max = Math.ceil(that.dataSource.length / that.paging.pageSize);\n pageScroll.step = that.paging.spinner.step;\n pageScroll.largeStep = that.paging.spinner.step;\n pageScroll.setAttribute('spinner', '');\n pageScroll.setAttribute('jqx-id', 'spinner');\n pageScroll.ownerElement = that;\n\n that.addPropertyBinding('[[paging_spinner_step]]', 'step', pageScroll, that.$.columnHeader);\n\n pageScroll.addEventListener('change', function (event) {\n that.paging.pageIndex = event.detail.value;\n });\n\n that.pageScroll = pageScroll;\n }\n\n that.htmlColumnLastChild.appendChild(that.pageScroll);\n }\n else {\n that.htmlColumnLastChild.innerHTML = '';\n }\n\n that._refreshScrollBars();\n\n }", "refreshVirtualScrollbars() {\n const { scrollBarWidth } = DomHelper;\n\n if (scrollBarWidth) {\n const me = this,\n { headerContainer, footerContainer, virtualScrollers } = me,\n hasVerticalOverflow = me.virtualScrollHeight > me.bodyHeight, //bodyContainer.scrollHeight > bodyContainer.clientHeight,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some((subGrid) => subGrid.overflowingHorizontally);\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n }\n\n if (hasVerticalOverflow) {\n if (!headerContainer.classList.contains('b-grid-vertical-overflow')) {\n headerContainer.classList.add('b-grid-vertical-overflow');\n }\n } else {\n headerContainer.classList.remove('b-grid-vertical-overflow');\n }\n\n // can get called before headers are rendered. headers might also be hidden (such as in docs)\n const lastHeaderScroller = headerContainer.querySelector('.b-grid-header-scroller:last-child');\n if (lastHeaderScroller && hasVerticalOverflow) {\n const headerBorderWidth = parseInt(DomHelper.getStyleValue(lastHeaderScroller, 'border-right-width'));\n // Add a style to pad the header-container to clear the grid's vertical scrollbar\n // TODO: regions part of calculation is to compensate for 1px off with third region, but it should be solvable using CSS. Not finding how though...\n headerContainer.style.paddingRight =\n scrollBarWidth - headerBorderWidth + (me.regions.length > 2 ? 1 : 0) + 'px';\n footerContainer.style.paddingRight = `${scrollBarWidth}px`;\n } else {\n headerContainer.style.paddingRight = '0';\n footerContainer.style.paddingRight = '0';\n }\n }\n }", "resizeToFitContent() {}", "resizeToFitContent() {}" ]
[ "0.6747355", "0.6548594", "0.65442073", "0.65442073", "0.65442073", "0.6540787", "0.6537264", "0.651434", "0.65052766", "0.65027726", "0.65005", "0.6498004", "0.64838076", "0.6422503", "0.64178014", "0.64178014", "0.6414308", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.64107054", "0.6391625", "0.6379125", "0.6376719", "0.636342", "0.636342", "0.636342", "0.63490796", "0.6345732", "0.63246083", "0.62245905", "0.6212744", "0.62013066", "0.62002224", "0.61949056", "0.61949056", "0.61949056", "0.61832", "0.6174226", "0.61656153", "0.6160151", "0.6150486", "0.6126815", "0.6036243", "0.59756315", "0.59756315", "0.59756315", "0.59756315", "0.5968419", "0.59587467", "0.5954357", "0.5954311", "0.594984", "0.5921189", "0.59182805", "0.5906147", "0.59058726", "0.59013546", "0.5885577", "0.58844215", "0.5880973", "0.58712834", "0.58493704", "0.58445156", "0.5832808", "0.58307457", "0.58272994", "0.5819357", "0.5816323", "0.5815146", "0.5812255", "0.58050954", "0.57954264", "0.57928264", "0.5789757", "0.57842654", "0.57842654" ]
0.6532036
22
Start a new operation.
function startOperation(cm) { cm.curOp = { cm: cm, viewChanged: false, // Flag that indicates that lines might need to be redrawn startHeight: cm.doc.height, // Used to detect need to update scrollbar forceUpdate: false, // Used to force a redraw updateInput: null, // Whether to reset the input textarea typing: false, // Whether this reset should be careful to leave existing text (for compositing) changeObjs: null, // Accumulated changes, for firing change events cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already selectionChanged: false, // Whether the selection needs to be redrawn updateMaxLine: false, // Set when the widest line needs to be determined anew scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet scrollToPos: null, // Used to scroll to a specific position focus: false, id: ++nextOpId // Unique ID }; pushOperation(cm.curOp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startNew(options) {\n if (options === void 0) { options = {}; }\n return default_1.DefaultKernel.startNew(options);\n }", "function startNew(options) {\n return Private.startNew(options);\n }", "function startNew(options) {\n return Private.startNew(options);\n }", "start() {\n this.do(\"start\")\n }", "start() {\n this.createContext();\n }", "started () { this.state = Command.STATE.CREATE; }", "function startOperation(cm) {\r\n cm.curOp = {\r\n cm: cm,\r\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\r\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\r\n forceUpdate: false, // Used to force a redraw\r\n updateInput: null, // Whether to reset the input textarea\r\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\r\n changeObjs: null, // Accumulated changes, for firing change events\r\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\r\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\r\n selectionChanged: false, // Whether the selection needs to be redrawn\r\n updateMaxLine: false, // Set when the widest line needs to be determined anew\r\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\r\n scrollToPos: null, // Used to scroll to a specific position\r\n id: ++nextOpId // Unique ID\r\n };\r\n if (operationGroup) {\r\n operationGroup.ops.push(cm.curOp);\r\n } else {\r\n cm.curOp.ownsGroup = operationGroup = {\r\n ops: [cm.curOp],\r\n delayedCallbacks: []\r\n };\r\n }\r\n }", "function startOperation(cm) {\n\t\t cm.curOp = {\n\t\t cm: cm,\n\t\t viewChanged: false, // Flag that indicates that lines might need to be redrawn\n\t\t startHeight: cm.doc.height, // Used to detect need to update scrollbar\n\t\t forceUpdate: false, // Used to force a redraw\n\t\t updateInput: null, // Whether to reset the input textarea\n\t\t typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n\t\t changeObjs: null, // Accumulated changes, for firing change events\n\t\t cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n\t\t cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n\t\t selectionChanged: false, // Whether the selection needs to be redrawn\n\t\t updateMaxLine: false, // Set when the widest line needs to be determined anew\n\t\t scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n\t\t scrollToPos: null, // Used to scroll to a specific position\n\t\t focus: false,\n\t\t id: ++nextOpId // Unique ID\n\t\t };\n\t\t if (operationGroup) {\n\t\t operationGroup.ops.push(cm.curOp);\n\t\t } else {\n\t\t cm.curOp.ownsGroup = operationGroup = {\n\t\t ops: [cm.curOp],\n\t\t delayedCallbacks: []\n\t\t };\n\t\t }\n\t\t }", "function startNew(options) {\n var settings = options.serverSettings || __1.ServerConnection.makeSettings();\n var request = {\n url: coreutils_1.URLExt.join(settings.baseUrl, KERNEL_SERVICE_URL),\n method: 'POST',\n data: JSON.stringify({ name: options.name }),\n contentType: 'application/json',\n cache: false\n };\n return __1.ServerConnection.makeRequest(request, settings).then(function (response) {\n if (response.xhr.status !== 201) {\n throw __1.ServerConnection.makeError(response);\n }\n validate.validateModel(response.data);\n return new DefaultKernel(__assign({}, options, { name: response.data.name, serverSettings: settings }), response.data.id);\n }, onKernelError);\n }", "function startOperation(cm) {\n\t cm.curOp = {\n\t cm: cm,\n\t viewChanged: false, // Flag that indicates that lines might need to be redrawn\n\t startHeight: cm.doc.height, // Used to detect need to update scrollbar\n\t forceUpdate: false, // Used to force a redraw\n\t updateInput: null, // Whether to reset the input textarea\n\t typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n\t changeObjs: null, // Accumulated changes, for firing change events\n\t cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n\t cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n\t selectionChanged: false, // Whether the selection needs to be redrawn\n\t updateMaxLine: false, // Set when the widest line needs to be determined anew\n\t scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n\t scrollToPos: null, // Used to scroll to a specific position\n\t focus: false,\n\t id: ++nextOpId // Unique ID\n\t };\n\t if (operationGroup) {\n\t operationGroup.ops.push(cm.curOp);\n\t } else {\n\t cm.curOp.ownsGroup = operationGroup = {\n\t ops: [cm.curOp],\n\t delayedCallbacks: []\n\t };\n\t }\n\t }", "function startOperation(cm) {\n\t cm.curOp = {\n\t cm: cm,\n\t viewChanged: false, // Flag that indicates that lines might need to be redrawn\n\t startHeight: cm.doc.height, // Used to detect need to update scrollbar\n\t forceUpdate: false, // Used to force a redraw\n\t updateInput: null, // Whether to reset the input textarea\n\t typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n\t changeObjs: null, // Accumulated changes, for firing change events\n\t cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n\t cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n\t selectionChanged: false, // Whether the selection needs to be redrawn\n\t updateMaxLine: false, // Set when the widest line needs to be determined anew\n\t scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n\t scrollToPos: null, // Used to scroll to a specific position\n\t focus: false,\n\t id: ++nextOpId // Unique ID\n\t };\n\t if (operationGroup) {\n\t operationGroup.ops.push(cm.curOp);\n\t } else {\n\t cm.curOp.ownsGroup = operationGroup = {\n\t ops: [cm.curOp],\n\t delayedCallbacks: []\n\t };\n\t }\n\t }", "function startOperation(cm) {\n\t cm.curOp = {\n\t cm: cm,\n\t viewChanged: false, // Flag that indicates that lines might need to be redrawn\n\t startHeight: cm.doc.height, // Used to detect need to update scrollbar\n\t forceUpdate: false, // Used to force a redraw\n\t updateInput: null, // Whether to reset the input textarea\n\t typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n\t changeObjs: null, // Accumulated changes, for firing change events\n\t cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n\t cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n\t selectionChanged: false, // Whether the selection needs to be redrawn\n\t updateMaxLine: false, // Set when the widest line needs to be determined anew\n\t scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n\t scrollToPos: null, // Used to scroll to a specific position\n\t focus: false,\n\t id: ++nextOpId // Unique ID\n\t };\n\t if (operationGroup) {\n\t operationGroup.ops.push(cm.curOp);\n\t } else {\n\t cm.curOp.ownsGroup = operationGroup = {\n\t ops: [cm.curOp],\n\t delayedCallbacks: []\n\t };\n\t }\n\t }", "addNewOp(opName, opId, opCode, parentPart, opIntervals, isSequential) {\n if (!isSequential) isSequential = false;\n return ops.create({\n opId: opId,\n opCode: opCode,\n opName: opName,\n parentPartId: parentPart,\n intervals: opIntervals,\n isSequential: isSequential\n });\n }", "function startOperation(cm) {\n\t\t cm.curOp = {\n\t\t cm: cm,\n\t\t viewChanged: false, // Flag that indicates that lines might need to be redrawn\n\t\t startHeight: cm.doc.height, // Used to detect need to update scrollbar\n\t\t forceUpdate: false, // Used to force a redraw\n\t\t updateInput: 0, // Whether to reset the input textarea\n\t\t typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n\t\t changeObjs: null, // Accumulated changes, for firing change events\n\t\t cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n\t\t cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n\t\t selectionChanged: false, // Whether the selection needs to be redrawn\n\t\t updateMaxLine: false, // Set when the widest line needs to be determined anew\n\t\t scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n\t\t scrollToPos: null, // Used to scroll to a specific position\n\t\t focus: false,\n\t\t id: ++nextOpId, // Unique ID\n\t\t markArrays: null // Used by addMarkedSpan\n\t\t };\n\t\t pushOperation(cm.curOp);\n\t\t }", "start() {\n this.isStarted = true;\n this._startRequest();\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n if (operationGroup) {\n operationGroup.ops.push(cm.curOp);\n } else {\n cm.curOp.ownsGroup = operationGroup = {\n ops: [cm.curOp],\n delayedCallbacks: []\n };\n }\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }", "function startNewCall() {\n\n}", "function _startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false,\n // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height,\n // Used to detect need to update scrollbar\n forceUpdate: false,\n // Used to force a redraw\n updateInput: 0,\n // Whether to reset the input textarea\n typing: false,\n // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null,\n // Accumulated changes, for firing change events\n cursorActivityHandlers: null,\n // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0,\n // Tracks which cursorActivity handlers have been called already\n selectionChanged: false,\n // Whether the selection needs to be redrawn\n updateMaxLine: false,\n // Set when the widest line needs to be determined anew\n scrollLeft: null,\n scrollTop: null,\n // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null,\n // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n\n };\n pushOperation(cm.curOp);\n } // Finish an operation, updating the display and signalling delayed events", "startEdit() {\n const basicProgram = this.trs80.getBasicProgramFromMemory();\n if (typeof basicProgram === \"string\") {\n // TODO show error.\n console.error(basicProgram);\n }\n else {\n this.wasStarted = this.trs80.stop();\n this.setProgram(basicProgram);\n this.show();\n }\n }", "function startOperation(cm) {\r\n cm.curOp = {\r\n cm: cm,\r\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\r\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\r\n forceUpdate: false, // Used to force a redraw\r\n updateInput: null, // Whether to reset the input textarea\r\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\r\n changeObjs: null, // Accumulated changes, for firing change events\r\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\r\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\r\n selectionChanged: false, // Whether the selection needs to be redrawn\r\n updateMaxLine: false, // Set when the widest line needs to be determined anew\r\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\r\n scrollToPos: null, // Used to scroll to a specific position\r\n focus: false,\r\n id: ++nextOpId // Unique ID\r\n };\r\n pushOperation(cm.curOp);\r\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n }\n pushOperation(cm.curOp)\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: null, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n}", "makeStart() {\n this.type = Node.START;\n this.state = null;\n }", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {\n this._child.send({\n cmd: 'start',\n data: null\n });\n }", "function startNew(options) {\n return default_1.DefaultTerminalSession.startNew(options);\n }", "_start_instruction() {\n\t\t\tthis.current_start_time = Date.now();\n\t\t\tthis._start_mouse_track();\n\t\t}", "function startOperation(cm) {\n if (cm.curOp) ++cm.curOp.depth;\n else cm.curOp = {\n // Nested operations delay update until the outermost one\n // finishes.\n depth: 1,\n // An array of ranges of lines that have to be updated. See\n // updateDisplay.\n changes: [],\n delayedCallbacks: [],\n updateInput: null,\n userSelChange: null,\n textChanged: null,\n selectionChanged: false,\n updateMaxLine: false,\n id: ++cm.nextOpId\n };\n }", "function startOperation(cm) {\n if (cm.curOp) ++cm.curOp.depth;\n else cm.curOp = {\n // Nested operations delay update until the outermost one\n // finishes.\n depth: 1,\n // An array of ranges of lines that have to be updated. See\n // updateDisplay.\n changes: [],\n delayedCallbacks: [],\n updateInput: null,\n userSelChange: null,\n textChanged: null,\n selectionChanged: false,\n updateMaxLine: false,\n id: ++cm.nextOpId\n };\n }", "function startOperation(cm) {\n if (cm.curOp) ++cm.curOp.depth;\n else cm.curOp = {\n // Nested operations delay update until the outermost one\n // finishes.\n depth: 1,\n // An array of ranges of lines that have to be updated. See\n // updateDisplay.\n changes: [],\n delayedCallbacks: [],\n updateInput: null,\n userSelChange: null,\n textChanged: null,\n selectionChanged: false,\n updateMaxLine: false,\n id: ++cm.nextOpId\n };\n }", "start () {}", "addOperation(operation) {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n }\n catch (error) {\n this.emitter.emit(\"error\", error);\n }\n });\n }", "addOperation(operation) {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n }\n catch (error) {\n this.emitter.emit(\"error\", error);\n }\n });\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }", "get start() {}", "function start() {\n status = -1;\n action(1, 0, 0);\n}", "function vipsOperationNew (name) {\n return libvips.vips_operation_new(name);\n }", "function startNew(options) {\n return default_1.DefaultSession.startNew(options);\n }", "function op(id, nargs) {\n return function() {\n var r = new Operation(id);\n r.args = toArray(arguments).slice(0, nargs);\n return r;\n };\n }", "function start() {\r\n\tstatus = -1;\r\n\taction(1, 0, 0);\r\n}", "function executeOperation(source, type, id, operationName) {\n var btn = $(source);\n btn.button('loading');\n btn.append($('<input />', { type: 'hidden', name: 'instanceType', value: type }));\n btn.append($('<input />', { type: 'hidden', name: 'instanceId', value: id }));\n btn.append($('<input />', { type: 'hidden', name: 'operationName', value: operationName }));\n $(\"#outerForm\").attr(\"action\", \"operation\").submit();\n}", "function start() {\n init();\n run();\n }", "start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n }", "function startCreating() {\n mainVm.isCreating = true;\n mainVm.isEditing = false;\n }", "get isStarted () { return this.state == Command.STATE.CREATE; }", "start() {\n this.executeNextTask();\n }", "function start() {\r\n status = -1;\r\n action(1, 0, 0);\r\n}", "function StartSpeechSynthesisTaskCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function StartStreamProcessorCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function operation(operatorName, args) {\n\t return { type: 'operation', operator: operatorName, args: args || [] };\n\t }", "start() {\n const { creator, conf } = this;\n const upStreaming = conf.getVal('upStreaming');\n\n if (upStreaming) {\n this.liveOutput();\n } else if (ScenesUtil.isSingle(creator)) {\n this.mvOutput();\n } else {\n if (ScenesUtil.hasTransition(creator)) {\n ScenesUtil.fillTransition(creator);\n this.addXfadeInput();\n } else {\n this.addConcatInput();\n }\n\n this.addAudio();\n this.addOutputOptions();\n this.addCommandEvents();\n this.addOutput();\n this.command.run();\n }\n }", "function runInOp(cm, f) {\n\t\t if (cm.curOp) return f();\n\t\t startOperation(cm);\n\t\t try { return f(); }\n\t\t finally { endOperation(cm); }\n\t\t }", "start() {\n this.taskFunction_.apply(null, Array.prototype.slice.call(arguments));\n this.onTaskDone();\n }", "start() {\n this.running = true;\n }", "async start(options) {\n const job = {\n _id: self.apos.util.generateId(),\n good: 0,\n bad: 0,\n processed: 0,\n status: 'running',\n ended: false,\n when: new Date()\n };\n const context = {\n _id: job._id,\n options: options\n };\n\n await self.db.insertOne(job);\n return context;\n }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function start() { \n initiate_graph_builder();\n initiate_job_info(); \n initiate_aggregate_info();\n initiate_node_info();\n}", "function startOperation() {\n updateInput = userSelChange = textChanged = null;\n changes = []; selectionChanged = false; callbacks = [];\n }" ]
[ "0.61408204", "0.61112124", "0.61112124", "0.5981286", "0.58847827", "0.5828475", "0.57273746", "0.57061714", "0.5692559", "0.5688068", "0.5688068", "0.5688068", "0.5681768", "0.5661453", "0.5646481", "0.5626896", "0.5626896", "0.5626896", "0.5626896", "0.5626896", "0.5621532", "0.5621532", "0.56057477", "0.56057477", "0.56057477", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5602222", "0.5585921", "0.5567218", "0.55530095", "0.5552023", "0.5551109", "0.5551109", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5549228", "0.5537494", "0.5526427", "0.5526427", "0.5526427", "0.5526427", "0.5526427", "0.5526427", "0.55243653", "0.5485008", "0.5481153", "0.5472381", "0.5472381", "0.5472381", "0.5405285", "0.5403993", "0.5403993", "0.5394596", "0.5394596", "0.5394596", "0.534292", "0.534222", "0.5322331", "0.5317555", "0.53013676", "0.5300209", "0.52901477", "0.52826947", "0.52784973", "0.5278173", "0.52730346", "0.52554095", "0.52479094", "0.524491", "0.521709", "0.52167654", "0.52114916", "0.52078676", "0.52072483", "0.5200378", "0.5199619", "0.5194645", "0.5194645", "0.5194645", "0.5183839", "0.5169421" ]
0.55949545
38
Finish an operation, updating the display and signalling delayed events
function endOperation(cm) { var op = cm.curOp; if (op) { finishOperation(op, function (group) { for (var i = 0; i < group.ops.length; i++) { group.ops[i].cm.curOp = null; } endOperations(group); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "function handleFinish(values) {\n job.current = getJob(values, job.current, writeMessage);\n setBusy(job.current.pendingTime);\n }", "finish() {\n window.setTimeout(\n this.displayAbsorptionTexts.bind(this),\n absorptionDuration\n );\n const lastStep = this.measurementHistory.length - 1;\n window.setTimeout(\n this.displayMeasurementTexts.bind(this, lastStep),\n this.animationStepDuration\n );\n window.setTimeout(\n this.finishCallback.bind(this),\n this.absorptionDuration\n );\n window.setTimeout(\n () => {this.board.animationExists = false;},\n this.absorptionDuration\n );\n // Make text groups disappear\n window.setTimeout(\n this.removeTexts.bind(this),\n absorptionDuration + absorptionTextDuration\n );\n }", "function finishProcess(){\n self.updateBars(callback);\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function renderUpdateComplete() {\n exportData.renderUpdateRunning = false;\n $loadingBar.css('opacity', 0);\n }", "onFinish() {\n\t\tif (this.props.onFinish) {\n\t\t\tthis.props.onFinish();\n\t\t}\n\t}", "function callbackDone() {\n module.presentation.set('contents', module.contents);\n module.callback(module.command);\n }", "onFinish() {}", "function finish() {\n var latency = Math.floor((+new Date) - check.start);\n check.start = +new Date;\n\n avg = Math.floor((avg + latency) / 2);\n latest = latency;\n max = latency > max ? latency : max;\n avg = avg ? avg : 100;\n\n add_result(latency);\n\n check.used = 0;\n clearTimeout(check.ival);\n p.css( delay, { opacity : '1' } )\n p.css( blink, { width : '0' } )\n }", "function complete()\n\t{\n\t\t_queryInProgress = false;\n\t\t_dispatcher.trigger(_options.completeEvent);\n\t}", "function finish() {\n\t if (!isIn) element.hide();\n\t reset();\n\t if (cb) cb.apply(element);\n\t }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }", "function onFinish() {\n\t\tclbk();\n\t}", "done() {\n this.calc();\n this.stop();\n\n this.el.fire('drawdone');\n }", "handleUpdateFinished() {\n if(this.isLoop) {\n this.curTime = 0;\n }\n else {\n this.pause();\n }\n\n this.invokeResetter();\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "finish(){\n model.stat.timer.stop();\n alert(model.algorithm.getCurrStep().description+' '+model.algorithm.getCurrStep().help);\n\t\tdocument.getElementById('nextBtn').disabled=true;\n\t\tdocument.getElementById('autoRunBtn').disabled=true;\n }", "function finishTask() {\n var task_panel = GetId(\"task_panel\");\n setTimeout(() => fade1(task_panel), 500);\n setTimeout(() => removeElement(\"task_panel\"), 1000);\n setTimeout(loadNextTask, 1000);\n // loadNextTask();\n}", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "function taskDone(e) {\n\tJSL.event(e).stop();\n\tvar lnk = JSL.event(e).getTarget();\n\tvar data = {\"success\":\"Done\"};\n\tloading();\n\tJSL.ajax(lnk.href+\"&ajax=1\").load(function(data) {\n\t\tloaded();\n\t\tif(data.success) removeTask(lnk);\n\t\tshowMessage(data);\n\t},\"json\");\n}", "end () {\n this.html.classList.remove(Action.RUNNING_CLASS);\n\n const effect = {\n action: this.data,\n people: this.owner,\n };\n const data = this.mergeWithOption(this.chosenOptionId);\n this.chosenOptionId = null;\n\n this.owner.finishAction();\n\n // Effect\n if (Utils.isFunction(this.data.effect)) {\n this.data.effect(this, data, effect);\n }\n\n const result = this.resolveAction(effect, data);\n\n // Give\n if (result.give.length) {\n MessageBus.notify(MessageBus.MSG_TYPES.GIVE, {\n give: result.give,\n initiator: this,\n });\n }\n\n // Unlock for all\n if (result.unlock.forAll.length) {\n // add to all\n MessageBus.notify(MessageBus.MSG_TYPES.UNLOCK, result.unlock.forAll);\n }\n // add to owner\n this.owner.addAction(result.unlock.forOne);\n\n // Lock for all\n if (result.lock.forAll.length) {\n // lock to all\n MessageBus.notify(MessageBus.MSG_TYPES.LOCK, result.lock.forAll);\n }\n // lock to owner\n this.owner.lockAction(result.lock.forOne);\n\n // Build\n if (result.build) {\n MessageBus.notify(MessageBus.MSG_TYPES.BUILD, result.build);\n }\n\n MessageBus.notify(MessageBus.MSG_TYPES.ACTION_END, result.log);\n }", "end() {\n this.cancel();\n this.callback();\n }", "function doneWork() {\n updateHTML(false);\t\t\t/* input boolean parameter set to false */\n}", "function renderUpdateComplete() {\n autotrace.renderUpdateRunning = false;\n $loadingBar.css('opacity', 0);\n }", "function jscoverage_endLengthyOperation() {\n\tProgressBar.setPercentage(100, 'Done');\n\t// fadeToBackground\n\n\tsetTimeout(function () {\n\t\tjscoverage_inLengthyOperation = false;\n\t\tProgressBar.makeInvisible();\n\t}, 500);\n}", "finish() {\n this.done = true;\n }", "function onFinish() {\n console.log('finished!');\n}", "function doneUpdate(stringIfsuccessfulOrRequestIfNot, success, statusText){\n\t\t\t$(e).add(ersatz).removeClass('pending') ;\n\n\t\t\tif (success) {\n\t\t\t\tif ( e.originalHeight ) e.style.height = e.originalHeight ;\n\t\t\t\tif ( e.originalValue != null && e.value == sentValue ) e.value = e.originalValue ;\n\t\t\t} else if ( !isPeriodic ) { // periodic updater dies quietly\n\t\t\t\tvar tag = target.css('display') == 'block' ? 'div' : 'span';\n\t\t\t\ttarget.append('<'+tag+' class=\"error\"><strong>Error:</strong> '+statusText+'</'+tag+'>');\n\t\t\t\tif (e.htmlcode == '#') return;\n\t\t\t\tersatz.replaceWith(target);\n\t\t\t\te2(target); // jquery unbinds all the magic when you take it out of the DOM\n\t\t\t}\n\n\t\t\tif (hadFocus && $('#'+hadFocus).length)\n\t\t\t\te2(function(){$('#'+hadFocus).focus();}).defer() ; // IE8 fails without defer\n\t\t}", "_finishDismiss() {\n this._overlayRef.dispose();\n if (!this._onAction.closed) {\n this._onAction.complete();\n }\n this._afterDismissed.next({ dismissedByAction: this._dismissedByAction });\n this._afterDismissed.complete();\n this._dismissedByAction = false;\n }", "onFinish() {\n this.props.store.dispatch(ACTIONS.FINISH);\n }", "complete () {\n this.detailBox.innerHTML = 'Click to begin'\n this.container.addEventListener('click', this.begin.bind(this))\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function runOperation() {\n\tsetConfig();\n\tcreatePrints();\n\trunDialog.close();\n}", "function complete() {\n Y.log('complete');\n }", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "function showEnd() {\n $(\"#ui_3\").fadeOut(null, ()=>{\n $(\"#ui_end\").fadeIn();\n postLog();\n });\n}", "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "_onComplete() {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop();\n }", "_complete() {\n if(this.get('isDestroyed') || this.get('isDestroying')){\n return;\n }\n\n invokeAction(this, 'onDragStop', this.get('model'));\n this.set('isDropping', false);\n this.set('wasDropped', true);\n this._tellGroup('commit');\n }", "function _finishedLoading() {\n if ( that.lastFunction ){\n that.lastFunction();\n that.lastFunction = false;\n }\n that.ajaxBusy = false;\n\n // make sure the search menu is completed in error cases\n if ( that.currentControl === \"SEARCH_COLUMN\" && that.searchMenuCallback ) {\n that.searchMenuCallback( false );\n that.searchMenuCallback = null;\n that.searchMenu = null;\n }\n } // _finishedLoading", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "function finishTask(pomoID) {\n setStatus(pomoID, SESSION_STATUS.complete);\n setCurrentPomo(INVALID_POMOID);\n closeFinishDialog();\n updateTable();\n}", "function handleComplete(size, status, index) {\n console.log(\"completed\");\n drawProgress(1, status);\n }", "function clickDone(data) {\n messageDiv.html(\"server response: \" + data);\n}", "function finish()\r\n{\r\n\t\t//Before calling any LMS function, we will always check for the API.\r\n\t\tAPI = GetAPI();\t\t\r\n\t\tif( API != null )\r\n\t\t{\r\n\t\t\t//Submit Data to the LMS\r\n\t\t\tset_val(\"cmi.suspend_data\",Bookmark_location);\t\t\t\r\n\t\t\tsTime=stopclock();\r\n\t\t\tsTime=String(sTime);\r\n\t\t\t//Submit Tile value to the LMS.\r\n\t\t\tset_val(\"cmi.core.session_time\",sTime);\t\t\r\n\t\t\t//call LMS Finish\r\n\t\t\tret1 = API.LMSFinish(\"\");\r\n\t\t\tfnCheckErrors();\t\r\n\t\t}\r\n\t\t\r\n}", "function finish(){\n if( settings.onFinish ) {\n settings.onFinish( data );\n }\n }", "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(state.value);\n }", "onEnd(state) {\n this.status = 'answered';\n\n // Rerender prompt (and clean subline error)\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(state.value);\n }", "function after() {\n\t\t\t\t// Re-display tip if loading and first time, and reset first flag\n\t\t\t\tif(hideFirst) { api.show(event.originalEvent); first = FALSE; }\n\n\t\t\t\t// Call users complete if it was defined\n\t\t\t\tif($.isFunction(opts.complete)) { opts.complete.apply(this, arguments); }\n\t\t\t}", "function done() {\n // User is done, remove buttons on the screen\n readNextInput = false;\n layout.RemoveChild(startButton);\n layout.RemoveChild(doneButton);\n text.SetText(\"Cool!\");\n console.log(\"Done.\");\n}", "function _complete() {\n\t\t\tif (_errorState) {\n\t\t\t\t_eventDispatcher.sendEvent(events.ERROR, {message: _errorMessage});\n\t\t\t} else if (!_iscomplete) {\n\t\t\t\t_iscomplete = true;\n\t\t\t\t_status = utils.loaderstatus.COMPLETE;\n\t\t\t\t_eventDispatcher.sendEvent(events.COMPLETE);\n\t\t\t}\n\t\t}", "function after_loop()\n {\n disable_buttons(); //Disable control buttons.\n display_output($result); //Display output based on the result; Error or Accept\n }", "function onComplete() {\n\t// Print the time response received\n\t$('#info').append('<p>Response received at: ' + new Date() + '</p>');\n}", "function WaitForPhotoshopRedraw()\n{\n\tvar desc = new ActionDescriptor();\n desc.putEnumerated( keyState, typeState, enumRedrawComplete );\n\texecuteAction( eventWait, desc, DialogModes.NO );\n}", "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "workFinishCall() {\n\t\t// all nodes have been downloaded\n if (this.finishCount === this.worklist.length) {\n this.state = 'finish'\n this.finishDate = utils.formatDate()\n userTasks.splice(userTasks.indexOf(this), 1)\n finishTasks.unshift(this)\n clearInterval(this.countSpeed)\n sendMessage()\n this.recordInfor(`${this.name} 下载完成`)\n this.finishStore()\n } else {\n\t\t\t// running next\n this.updateStore()\n this.downloadSchedule()\n }\n }", "function _on_timeout(){\n\t anchor.finish_wait();\n\t}", "transitionCompleted() {\n // implement if needed\n }", "function complete() {\n\tconsole.log('Completed');\n}", "function success_handler(object_link, desc, after) {\n\tif (job_count.length == 1 && after != null) {\n\t\tafter();\n\t}\n\n\tvar log = document.getElementById('log');\n\tlog.innerHTML = '&nbsp;' + job_count.pop() + ' ' + object_link + ' : <span class=\"text-success\">' + desc + \"</span><br/>\\n\" + log.innerHTML;\n\tif (job_count.length == 0) {\n\t\tlog.innerHTML = \"Done!\\n<br/>\"+log.innerHTML;\n $(\".stop_button\").hide();\n\t}\n}", "function showEnd() {\n console.log(\"showEnd ran\");\n getResult();\n $(\"#topright\").hide();\n $(\"#gamecontents\").hide();\n $(\"#end\").show();\n }", "_onUpdateDisplay() {}", "function actionCompleted () {\n\n\talert('Completed');\n}", "function doneTask() {\n if (currDuration == workingTime) {\n doneClicked = true;\n skipAdd = true;\n }\n}", "function completeDisplay () {\n savedFldrOpenList = undefined;\n isDisplayComplete = true;\n WaitingImg.hidden = true; // Stop displaying the waiting glass\n// if (options.delayLoad)\n//\tBookmarks.appendChild(docFragment); // Display the table of bookmarks + reflow\n endDisplayTime = (new Date ()).getTime();\n trace(\"Display duration: \"+(endDisplayTime - endGetTreetime)+\" ms\", true);\n trace(\"Total duration: \"+(endDisplayTime - startTime)+\" ms\", true);\n\n // Finish displaying favicons asynchronously\n if (!options.disableFavicons && !options.immediateFavDisplay) {\n\tsetTimeout(completeFavicons, 0);\n }\n\n // If 16x16 migration is planned but nothing scheduled yet, do it\n if (migration_img16 && (migrationTimeout == null)) {\n\tmigrationTimeout = setTimeout(trigMigrate16x16, Migr16x16Timeout);\n }\n\n\n // Setup mouse handlers for bookmarks and results\n SearchResult.addEventListener(\"mousedown\", resultsMouseDownHandler);\n Bookmarks.addEventListener(\"mousedown\", bkmkMouseDownHandler);\n SearchResult.addEventListener(\"click\", resultsMouseHandler);\n Bookmarks.addEventListener(\"click\", bkmkMouseHandler);\n SearchResult.addEventListener(\"contextmenu\", resultsContextHandler);\n Bookmarks.addEventListener(\"contextmenu\", bkmkContextHandler);\n SearchResult.addEventListener(\"auxclick\", resultsAuxHandler);\n Bookmarks.addEventListener(\"auxclick\", bkmkAuxHandler);\n SearchResult.addEventListener(\"scroll\", rsltScrollHandler);\n Bookmarks.addEventListener(\"scroll\", bkmkScrollHandler);\n if (isLinux) {\n\tBookmarks.addEventListener(\"dragenter\", bkmkMouseEnterHandler, true);\n\tBookmarks.addEventListener(\"dragexit\", bkmkMouseLeaveHandler, true);\n\tBookmarks.addEventListener(\"dragleave\", bkmkMouseLeaveHandler, true);\n\tSearchResult.addEventListener(\"dragenter\", rsltMouseEnterHandler, true);\n\tSearchResult.addEventListener(\"dragexit\", rsltMouseLeaveHandler, true);\n\tSearchResult.addEventListener(\"dragleave\", rsltMouseLeaveHandler, true);\n }\n\n // Setup mouse handlers for search buttons\n ResetFiltersButtonInput.addEventListener(\"click\", resetFiltersButtonHandler);\n SearchButtonInput.addEventListener(\"click\", searchButtonHandler);\n SearchButtonInput.addEventListener(\"contextmenu\", searchButtonHandler);\n SearchButtonInput.addEventListener(\"auxclick\", searchButtonSwitchMode);\n\n // General event handlers for a click anywhere in the document .. used to clear menus\n // and prevent default menus\n addEventListener(\"keydown\", keyHandler);\n addEventListener(\"click\", clickHandler);\n addEventListener(\"mousedown\", noDefaultAction);\n addEventListener(\"contextmenu\", noDefaultAction);\n addEventListener(\"auxclick\", noDefaultAction);\n addEventListener(\"blur\", onBlur);\n Bookmarks.addEventListener(\"focusout\", bookmarksFocusout);\n SearchResult.addEventListener(\"focusout\", resultsFocusout);\n Bookmarks.addEventListener(\"focusin\", bookmarksFocusin);\n SearchResult.addEventListener(\"focusin\", resultsFocusin);\n addEventListener('wheel', onWheel, {capture: true, passive: false}); // To disable zooming\n addEventListener('resize', windowSizeHandler);\n\n if (!beforeFF64) { // Handle integrated FF menu items on sidebar\n\tbrowser.menus.onClicked.addListener(onClickedContextMenuHandler);\n\tbrowser.menus.onHidden.addListener(onHiddenContextMenuHandler);\n }\n\n // Detect when sidebar is closed\n// addEventListener(\"beforeunload\", closeHandler);\n// addEventListener(\"pagehide\", closeHandler);\n addEventListener(\"unload\", closeHandler);\n// window.onclose = closeHandler;\n\n // Event handlers for drag & drop\n Bookmarks.addEventListener(\"dragstart\", bkmkDragStartHandler);\n Bookmarks.addEventListener(\"dragend\", bkmkDragEndHandler);\n SearchResult.addEventListener(\"dragstart\", resultsDragStartHandler);\n SearchResult.addEventListener(\"dragend\", resultsDragEndHandler);\n Bookmarks.addEventListener(\"dragenter\", bkmkDragEnterHandler);\n Bookmarks.addEventListener(\"dragover\", bkmkDragOverHandler);\n Bookmarks.addEventListener(\"dragleave\", bkmkDragLeaveHandler);\n Bookmarks.addEventListener(\"dragexit\", bkmkDragExitHandler);\n Bookmarks.addEventListener(\"drop\", bkmkDropHandler);\n SearchResult.addEventListener(\"dragenter\", rsltDragEnterHandler);\n SearchResult.addEventListener(\"dragover\", rsltDragOverHandler);\n SearchResult.addEventListener(\"dragleave\", rsltDragLeaveHandler);\n SearchResult.addEventListener(\"dragexit\", rsltDragExitHandler);\n\n let computedStyle = window.getComputedStyle(MyBProtMenu, null);\n trace(\"fontFamily = '\"+computedStyle[\"fontFamily\"]+\"'\", true);\n trace(\"fontSize = '\"+computedStyle[\"fontSize\"]+\"'\", true);\n// for (let prop in computedStyle) {\n// trace(prop+\" = '\"+computedStyle[prop]+\"'\");\n// }\n\n // If we are running in the sidebar, signal to background page we are here,\n // and show laat selected bookmark if any\n if (isInSidebar) {\n\tif (backgroundPage == undefined) {\n\t sendAddonMessage(\"New:\"+myWindowId);\n\t}\n\telse {\n\t // Trace stats\n\t trace(\"Stats:\\r\\n------\", true);\n\t trace(\"Bookmarks: \"+countBookmarks, true);\n\t trace(\"Favicons to fetch: \"+countFetchFav, true);\n\t trace(\"Unsuccessful favicons: \"+countNoFavicon, true);\n\t trace(\"Folders: \"+countFolders, true);\n\t trace(\"Separators: \"+countSeparators, true);\n\t trace(\"Oddities: \"+countOddities, true);\n\t trace(\"--------------------\", true);\n\n\t let bnId = backgroundPage.newSidebar(myWindowId);\n\t goBkmkItem(bnId);\n\t}\n }\n\n // Focus on searchtext input at initial load\n// window.focus();\n// SearchTextInput.focus();\n}", "function finishButtonListener() {\n\t$(\"#finish\").click(function(e) {\n\t\te.preventDefault();\n\t\tif (!$(this).hasClass('disabled')) {\n\t json_data.filled = 1;\n\t // json_data.is_public = $('#privacy_checkbox').is(\":checked\");\t// check privacy setting (true for public, false for private)\n\n\t\t\tconsole.log('finishButtonListener');\n\t\t\tconsole.log('json_data');\n\t\t\tconsole.log(json_data);\n\t\t\tconsole.log('fb_collage_id='+fb_collage_id);\n\t\t\tconsole.log('fb_tile_id='+fb_tile_id);\n\t\t\t$(\"#finish_waiting\").removeClass('hide_stuff');\n\t\t\t$(\"#finish\").addClass('disabled');\n\n\t\t\tfinishedTileIDs.push(fb_tile_id);\t// update finishedTileIDs array\n\n\t\t\tupdateTile(fb,fb_collage_id,fb_tile_id,json_data,onComplete);\n\n\t\t}\n\t});\n}", "function success() {\n finish( false );\n }", "function finishProgress ( progElem ) {\n\n // Leave up for a bit, then fade out\n\n delay( 500, function () {\n\n // Hide the message with fading, remove when invisible\n\n fadeOut ( progElem.parentNode, 0.1, function () {\n\n hideProgress( progElem );\n\n } );\n\n } );\n\n }", "function finish(){\n\n // sound-effect\n playIncorrect()\n // Disable buttons, because we don't need them.\n elements.correctButton.disabled = true\n elements.incorrectButton.disabled = true\n window.setTimeout(displayGameOver,1500)\n}", "handleFinish(useful) {\n recordFinish(this.state.currentGuide.id, useful);\n closeGuide();\n }", "static finishedRenderingComponent() {\n\t\trenderingComponents_.pop();\n\t}", "function ifComplete() {\r\n\t\t\t\t\tif (isFinished == false) {\r\n\t\t\t\t\t\tisFinished = true;\r\n\r\n\t\t\t\t\t\t// show the flag animation when a car reaches the finish line\r\n\t\t\t\t\t\tfinishedImage.attr('src', 'Assets/img/finish.gif');\r\n\r\n\t\t\t\t\t\t// add a background shadow effect while the flag animation is on\r\n\t\t\t\t\t\t$('#raceTrack').addClass('shadow');\r\n\r\n\t\t\t\t\t\t// timeout function for removal of flag animation and enable the buttons\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t// remove flag animation and background shadow\r\n\t\t\t\t\t\t\tfinishedImage.attr('src', '');\r\n\t\t\t\t\t\t\t$('#raceTrack').removeClass('shadow');\r\n\r\n\t\t\t\t\t\t\t// set buttons to enable when the animation and race finish\r\n\t\t\t\t\t\t\traceBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t\trestartBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t}, 3500);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinishedIn = 'second';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function finishTask(self){\n clearInterval(timeVar);\n var neededId = getNeededId(self);\n EndDate = new Date();\n EndTimeString = EndDate.toLocaleTimeString();\n EndDateString = EndDate.toLocaleDateString();\n e_datetime = EndDateString.concat('|',EndTimeString);\n updateTimeData(DateTimeStorage, e_datetime, 'finished', neededId);\n sel = '#'+neededId;\n $(sel).remove();\n}", "function _finish() {\n\t\t\t$('#jquery-lightbox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "function displayResult(result) {\n output.textContent = result;\n calculationIsDone = true;\n}", "async onFinished() {}", "function onClickManualOutputBtn() {\n $(\"#ConfigurePID_ContainerNewSetPoint\").hide();\n $(\"#ConfigurePID_ContainerNewRampTarget\").hide();\n $(\"#ConfigurePID_ContainerNewOutput\").show();\n\n writeCommand(\"manual\");\n\nfunction pausecomp(millis)\n {\n var date = new Date();\n var curDate = null;\n do { curDate = new Date(); }\n while(curDate-date < millis);\n}\npausecomp(500);\n\n\n writeCommand(\"manualSetOutput\");\n}", "function finishPendingActions() {\n if (grid.api) {\n grid.api.grid.refresh();\n }\n }", "function taskProgressChanged(data) {\n s.completionContainer.html(data.partial);\n }", "function _finishLoading() {\n loadsToFinish--;\n if (loadsToFinish <= 0) {\n loading = false;\n viewModel.set(\"loading\", loading);\n }\n}", "endUpdate() {\r\n\r\n }", "function _finish() {\n\t\t\t$('#jquery-largephotobox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "static finish() {\n this.progress = 100;\n setTimeout(() => {\n this.bar.style.width = `${this.progress}%`;\n }, 100);\n setTimeout(() => {\n this.parent.style.height = '0px';\n }, 1000);\n }", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "function end() {\n\tsetTimeout(function () {\n\t\t$(\"#stage\").fadeOut();\n\t}, normalpause);\n\n\t$('#finished').append($('<p style=\"font-size:35px\">' + data.subject_id + '</p>'));\n\n\tshowSlide(\"finished\");\n\tdocument.body.style.background = \"black\";\n\t// upload_to_dropbox();\n}", "function endLoadImage(){\n\tchangeDisplayStatus( $('#ImageLoadZone'), $('#ImageZone') );\n}" ]
[ "0.6298353", "0.6149194", "0.6141501", "0.61294717", "0.61197203", "0.6094414", "0.60886836", "0.6063711", "0.60263014", "0.602398", "0.60091406", "0.6005056", "0.59634334", "0.59634334", "0.59634334", "0.59634334", "0.5962261", "0.59593785", "0.5950094", "0.5950094", "0.593192", "0.5928768", "0.590924", "0.58802146", "0.58802146", "0.5879688", "0.58751327", "0.5870707", "0.5868476", "0.5852064", "0.58129066", "0.58059686", "0.57965326", "0.5795937", "0.5778595", "0.57680464", "0.5753498", "0.57385105", "0.57243127", "0.57148534", "0.5708526", "0.5681974", "0.5681974", "0.5681974", "0.5681974", "0.5680103", "0.5677943", "0.567536", "0.56644976", "0.56453013", "0.5635252", "0.5629623", "0.5609881", "0.55921", "0.5586349", "0.55672765", "0.55653715", "0.5557639", "0.55534625", "0.5551402", "0.5551402", "0.5549748", "0.55479616", "0.553163", "0.55287826", "0.55174834", "0.5514519", "0.5511729", "0.55101305", "0.5502508", "0.5501853", "0.5498745", "0.5495542", "0.5486121", "0.5485626", "0.5484282", "0.5482523", "0.54810935", "0.54773307", "0.5474284", "0.5473932", "0.54494166", "0.5448706", "0.54472226", "0.5437998", "0.5433681", "0.5424905", "0.54205245", "0.5413718", "0.54115963", "0.5408121", "0.54004884", "0.5395226", "0.53933984", "0.5392742", "0.5388678", "0.5381033", "0.5381033", "0.5381033", "0.53802586", "0.5376221" ]
0.0
-1
The DOM updates done when an operation finishes are batched so that the minimum number of relayouts are required.
function endOperations(group) { var ops = group.ops; for (var i = 0; i < ops.length; i++) // Read DOM { endOperation_R1(ops[i]); } for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) { endOperation_W1(ops[i$1]); } for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM { endOperation_R2(ops[i$2]); } for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) { endOperation_W2(ops[i$3]); } for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM { endOperation_finish(ops[i$4]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processQueue() {\n\t\t if (updateQueue.length) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t\t clearQueue();\n\t\t }\n\t\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function updateElements() { //Main loop logic here.\r\n updateResourceDisplay();\r\n updateCoreDisplay();\r\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function do_full_update() {\n const rendered_dom = exports.render_tag(new_dom);\n replace_content(rendered_dom);\n }", "_updateDOM() {\n this._updateAttributes();\n this._updateStyles();\n }", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function doneWork() {\n updateHTML(false);\t\t\t/* input boolean parameter set to false */\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "forceUpdate() {\n if (this[_queuedUpdate]) {\n this[_dirty] = true;\n return;\n }\n\n this[_virtualRender]();\n this[_queuedUpdate] = true;\n\n TaskQueue.push(() => {\n if (this[_dirty] && !this.isDisposed) {\n this[_virtualRender]();\n this[_dirty] = false;\n }\n this[_queuedUpdate] = false;\n });\n }", "function batchedUpdates(callback) {\n if (isBatchingUpdates) {\n // We're already executing in an environment where updates will be batched,\n // so this is a no-op.\n callback();\n return;\n }\n\n isBatchingUpdates = true;\n\n try {\n callback();\n // TODO: Sort components by depth such that parent components update first\n for (var i = 0; i < dirtyComponents.length; i++) {\n // If a component is unmounted before pending changes apply, ignore them\n // TODO: Queue unmounts in the same list to avoid this happening at all\n var component = dirtyComponents[i];\n if (component.isMounted()) {\n // If performUpdateIfNecessary happens to enqueue any new updates, we\n // shouldn't execute the callbacks until the next render happens, so\n // stash the callbacks first\n var callbacks = component._pendingCallbacks;\n component._pendingCallbacks = null;\n component.performUpdateIfNecessary();\n if (callbacks) {\n for (var j = 0; j < callbacks.length; j++) {\n callbacks[j].call(component);\n }\n }\n }\n }\n } catch (error) {\n // IE8 requires `catch` in order to use `finally`.\n throw error;\n } finally {\n dirtyComponents.length = 0;\n isBatchingUpdates = false;\n }\n}", "function work() {\n\t\t// Set running to true to prevent more calls until the first one is done\n\t\trunning = true;\n\t\t\n\t\t// Go through the DOM\n\t\twalk(document.body);\n\n\t\t// Set running to false to allow additional calls\n\t\trunning = false;\n\t}", "static whenDOMUpdated() {\n\t\tif (renderTaskPromise) {\n\t\t\treturn renderTaskPromise;\n\t\t}\n\n\t\trenderTaskPromise = new Promise(resolve => {\n\t\t\trenderTaskPromiseResolve = resolve;\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\tif (invalidatedWebComponents.getList().length === 0) {\n\t\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\treturn renderTaskPromise;\n\t}", "function processNextUpdateRequest() {\n if(vis_queue.length > 0) {\n let temp = vis_queue.pop();\n update(temp.svg, temp.pack, temp.path, temp.id, temp.cb_keyword);\n } else {\n hook_busy = false;\n }\n}", "function updateDOM() {\n\tvar newTree = render(data);\n\tvar patches = diff(tree, newTree);\n\trootNode = patch(rootNode, patches);\n\ttree = newTree;\n}", "function rerenderall() {\n console.log(\"Step 4\");\n rerenderElements(\"runs\");\n rerenderElements(\"configs\");\n rerenderElements(\"evals\");\n rerenderElements(\"locations\");\n}", "function updateWatched() {\n var selectors = watching.sel.join(',');\n var selectedElements = getElementsList(selectors);\n var elements = Array.prototype.concat.apply(watching.el, selectedElements);\n balanceText(elements);\n }", "processQueue () {\n var isEmpty = !unwrap(this.data).length;\n var lowestIndexChanged = MAX_LIST_SIZE;\n\n this.startQueueFlush();\n\n arrayForEach(this.changeQueue, (changeItem) => {\n if (typeof changeItem.index === 'number') {\n lowestIndexChanged = Math.min(lowestIndexChanged, changeItem.index);\n }\n this[changeItem.status](changeItem);\n });\n this.flushPendingDeletes();\n this.rendering_queued = false;\n\n // Update our indexes.\n if (this.$indexHasBeenRequested) {\n this.updateIndexes(lowestIndexChanged);\n }\n\n this.endQueueFlush();\n this.changeQueue = [];\n\n // Update the conditional exposed on the domData\n if (isEmpty !== !this.isNotEmpty()) {\n this.isNotEmpty(!isEmpty);\n }\n }", "function flushToDom() {\n var oldDebounceRendering = n.debounceRendering; // orig\n var callbackQ = [];\n function execCallbackSync(callback) {\n callbackQ.push(callback);\n }\n n.debounceRendering = execCallbackSync;\n O(v(FakeComponent, {}), document.createElement('div'));\n while (callbackQ.length) {\n callbackQ.shift()();\n }\n n.debounceRendering = oldDebounceRendering;\n }", "function endOperations(group) {\r\n var ops = group.ops;\r\n for (var i = 0; i < ops.length; i++) // Read DOM\r\n endOperation_R1(ops[i]);\r\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\r\n endOperation_W1(ops[i]);\r\n for (var i = 0; i < ops.length; i++) // Read DOM\r\n endOperation_R2(ops[i]);\r\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\r\n endOperation_W2(ops[i]);\r\n for (var i = 0; i < ops.length; i++) // Read DOM\r\n endOperation_finish(ops[i]);\r\n }", "function updateDOM() {\n backlogListArray = updateColumnInDOM(backlogList, arrayNames.indexOf('backlog'), backlogListArray);\n progressListArray = updateColumnInDOM(progressList, arrayNames.indexOf('progress'), progressListArray);\n completeListArray = updateColumnInDOM(completeList, arrayNames.indexOf('complete'), completeListArray);\n onHoldListArray = updateColumnInDOM(onHoldList, arrayNames.indexOf('onHold'), onHoldListArray);\n\n // Update Local Storage\n updateSavedColumns();\n}", "function update()\n{\n // First, clear the page contents. Necessary because update() might be\n // called more than once due to ChildMemoryListener.\n var content = $(\"content\");\n content.parentNode.replaceChild(content.cloneNode(false), content);\n content = $(\"content\");\n\n if (gVerbose)\n content.parentNode.classList.add('verbose');\n else\n content.parentNode.classList.add('non-verbose');\n\n // Generate output for one process at a time. Always start with the\n // Main process.\n var reportersByProcess = getReportersByProcess();\n var text = genProcessText(\"Main\", reportersByProcess[\"Main\"]);\n for (var process in reportersByProcess) {\n if (process !== \"Main\") {\n text += genProcessText(process, reportersByProcess[process]);\n }\n }\n\n // Memory-related actions.\n const GCDesc = \"Do a global garbage collection.\";\n const CCDesc = \"Do a cycle collection.\";\n const MPDesc = \"Send three \\\"heap-minimize\\\" notifications in a \" +\n \"row. Each notification triggers a global garbage \" +\n \"collection followed by a cycle collection, and causes the \" +\n \"process to reduce memory usage in other ways, e.g. by \" +\n \"flushing various caches.\";\n\n text += \"<div>\" +\n \"<button title='\" + GCDesc + \"' onclick='doGlobalGC()'>GC</button>\" +\n \"<button title='\" + CCDesc + \"' onclick='doCC()'>CC</button>\" +\n \"<button title='\" + MPDesc + \"' onclick='sendHeapMinNotifications()'>\" + \"Minimize memory usage</button>\" +\n \"</div>\";\n\n // Generate verbosity option link at the bottom.\n text += \"<div>\";\n text += gVerbose\n ? \"<span class='option'><a href='about:memory'>Less verbose</a></span>\"\n : \"<span class='option'><a href='about:memory?verbose'>More verbose</a></span>\";\n text += \"</div>\";\n\n text += \"<div>\" +\n \"<span class='option'><a href='about:support'>Troubleshooting information</a></span>\" +\n \"</div>\";\n\n text += \"<div>\" +\n \"<span class='legend'>Hover the pointer over the name of a memory \" +\n \"reporter to see a detailed description of what it measures. Click a \" +\n \"heading to expand or collapse its tree.</span>\" +\n \"</div>\";\n\n var div = document.createElement(\"div\");\n div.innerHTML = text;\n content.appendChild(div);\n}", "function runUpdate(){\n people.forEach(function(element){\n element.update();\n });\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W1(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_R2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Write DOM (maybe)\n endOperation_W2(ops[i]);\n for (var i = 0; i < ops.length; i++) // Read DOM\n endOperation_finish(ops[i]);\n }", "update() {\n\t\tif (this.hasChangedBesidesElement_() && this.shouldUpdate(this.changes_)) {\n\t\t\tthis.patch();\n\t\t\tthis.eventsCollector_.detachUnusedListeners();\n\t\t\tthis.disposeUnusedSubComponents_();\n\t\t}\n\t}", "function ReceiveUpdate(doc) {\n myDoc = doc;\n for (i = 0; i < functionQueue.length; i++) {\n var t = functionQueue[i];\n t[0](myDoc, t[1]);\n }\n Render(doc);\n}", "function updateAll() {\n\tdrawAll();\n\tblob.move();\n}" ]
[ "0.65617603", "0.6510302", "0.6510302", "0.6510302", "0.6510302", "0.6510302", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64980775", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64489067", "0.64282495", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6361654", "0.6338403", "0.6338403", "0.63005453", "0.62414485", "0.6202344", "0.6202344", "0.6137694", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.60236585", "0.595835", "0.5895925", "0.5890483", "0.58895415", "0.5875187", "0.5872677", "0.5829339", "0.58217144", "0.58170146", "0.5751939", "0.5745377", "0.574361", "0.5739134", "0.57381755", "0.573557", "0.573557", "0.573557", "0.573557", "0.573557", "0.573557", "0.573557", "0.5717219", "0.5715495", "0.57101506" ]
0.0
-1
Run the given function in an operation
function runInOp(cm, f) { if (cm.curOp) { return f() } startOperation(cm); try { return f() } finally { endOperation(cm); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runInOp(cm, f) {\n\t\t if (cm.curOp) { return f() }\n\t\t startOperation(cm);\n\t\t try { return f() }\n\t\t finally { endOperation(cm); }\n\t\t }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function runInOp(cm, f) {\n\t if (cm.curOp) return f();\n\t startOperation(cm);\n\t try { return f(); }\n\t finally { endOperation(cm); }\n\t }", "function runInOp(cm, f) {\n\t\t if (cm.curOp) return f();\n\t\t startOperation(cm);\n\t\t try { return f(); }\n\t\t finally { endOperation(cm); }\n\t\t }", "function run(fun) {\n fun(); // Executa a funcao passada como parametro\n}", "function run (fun) {\n fun() \n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function run(fun){\n fun()\n}", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\n if (cm.curOp) return f();\n startOperation(cm);\n try { return f(); }\n finally { endOperation(cm); }\n }", "function runInOp(cm, f) {\r\n if (cm.curOp) return f();\r\n startOperation(cm);\r\n try { return f(); }\r\n finally { endOperation(cm); }\r\n }", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function run(fun) {\n fun()\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}", "function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm)\n try { return f() }\n finally { endOperation(cm) }\n}", "function runInOp(cm, f) {\r\n if (cm.curOp) { return f() }\r\n startOperation(cm);\r\n try { return f() }\r\n finally { endOperation(cm); }\r\n}", "function doOperationOn(x, operation){\n\treturn operation(x);\n}", "function op(f) {\n var keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\"Please provide an object with a single key \" +\n \"(operation name) mapping to a function. Got an object with \" +\n (keys.length + \" keys.\"));\n }\n var opName = keys[0];\n var fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // tslint:disable-next-line:no-any\n var f2 = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n engine_1.ENGINE.startScope(opName);\n try {\n var result = fn.apply(void 0, args);\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n engine_1.ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n engine_1.ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}", "function applyOp(node, func) {\n node = $(node);\n node.trigger(\"fluid-\"+func);\n node[func]();\n }", "function run(func, params) { window[func](params); }", "function run(func, params) { window[func](params); }", "function run (fun1) {\n fun1()\n}", "function operate(x, y, func) {\n return func(x, y);\n}", "function someRunner(anyFunction){ \n \tconsole.log(2+2); \n \tanyFunction(); \n }", "function op(f) {\n const keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(`Please provide an object with a single key ` +\n `(operation name) mapping to a function. Got an object with ` +\n `${keys.length} keys.`);\n }\n let opName = keys[0];\n const fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // add an __op suffix to distinguish ops from kernels in tf.profile\n opName = opName + OP_SCOPE_SUFFIX;\n // tslint:disable-next-line:no-any\n const f2 = (...args) => {\n _engine__WEBPACK_IMPORTED_MODULE_0__[\"ENGINE\"].startScope(opName);\n try {\n const result = fn(...args);\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isPromise\"])(result)) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n _engine__WEBPACK_IMPORTED_MODULE_0__[\"ENGINE\"].endScope(result);\n return result;\n }\n catch (ex) {\n _engine__WEBPACK_IMPORTED_MODULE_0__[\"ENGINE\"].endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}", "function executaFuncao (funcao){\n funcao();\n}", "function operation(cm, f) {\n\t return function() {\n\t if (cm.curOp) return f.apply(cm, arguments);\n\t startOperation(cm);\n\t try { return f.apply(cm, arguments); }\n\t finally { endOperation(cm); }\n\t };\n\t }", "function operation(cm, f) {\n\t return function() {\n\t if (cm.curOp) return f.apply(cm, arguments);\n\t startOperation(cm);\n\t try { return f.apply(cm, arguments); }\n\t finally { endOperation(cm); }\n\t };\n\t }", "function operation(cm, f) {\n\t return function() {\n\t if (cm.curOp) return f.apply(cm, arguments);\n\t startOperation(cm);\n\t try { return f.apply(cm, arguments); }\n\t finally { endOperation(cm); }\n\t };\n\t }", "function operation(cm, f) {\n\t\t return function() {\n\t\t if (cm.curOp) { return f.apply(cm, arguments) }\n\t\t startOperation(cm);\n\t\t try { return f.apply(cm, arguments) }\n\t\t finally { endOperation(cm); }\n\t\t }\n\t\t }", "function operation(cm, f) {\n\t\t return function() {\n\t\t if (cm.curOp) return f.apply(cm, arguments);\n\t\t startOperation(cm);\n\t\t try { return f.apply(cm, arguments); }\n\t\t finally { endOperation(cm); }\n\t\t };\n\t\t }", "function doIt() {\n eval(func);\n }", "function run() {\n // do something\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) return f.apply(cm, arguments);\n startOperation(cm);\n try { return f.apply(cm, arguments); }\n finally { endOperation(cm); }\n };\n }", "function run(func1){\n func1()\n}", "function run() {}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }", "function executeOp(node, tensorMap, context) {\n var value = (function (node, tensorMap, context) {\n switch (node.category) {\n case 'arithmetic':\n return arithmetic.executeOp(node, tensorMap, context);\n case 'basic_math':\n return basicMath.executeOp(node, tensorMap, context);\n case 'control':\n return control.executeOp(node, tensorMap, context);\n case 'convolution':\n return convolution.executeOp(node, tensorMap, context);\n case 'creation':\n return creation.executeOp(node, tensorMap, context);\n case 'dynamic':\n return dynamic.executeOp(node, tensorMap, context);\n case 'evaluation':\n return evaluation.executeOp(node, tensorMap, context);\n case 'image':\n return image.executeOp(node, tensorMap, context);\n case 'graph':\n return graph.executeOp(node, tensorMap, context);\n case 'logical':\n return logical.executeOp(node, tensorMap, context);\n case 'matrices':\n return matrices.executeOp(node, tensorMap, context);\n case 'normalization':\n return normalization.executeOp(node, tensorMap, context);\n case 'reduction':\n return reduction.executeOp(node, tensorMap, context);\n case 'slice_join':\n return sliceJoin.executeOp(node, tensorMap, context);\n case 'spectral':\n return spectral.executeOp(node, tensorMap, context);\n case 'transformation':\n return transformation.executeOp(node, tensorMap, context);\n case 'custom':\n var opMapper = register_1.getRegisteredOp(node.op);\n if (opMapper && opMapper.customExecutor) {\n return opMapper.customExecutor(new node_value_impl_1.NodeValueImpl(node, tensorMap, context));\n }\n else {\n throw TypeError(\"Custom op \" + node.op + \" is not registered.\");\n }\n default:\n throw TypeError(\"Unknown op '\" + node.op + \"'. File an issue at \" +\n \"https://github.com/tensorflow/tfjs/issues so we can add it\" +\n \", or register a custom execution with tf.registerOp()\");\n }\n })(node, tensorMap, context);\n if (value instanceof Promise) {\n return value.then(function (data) { return [].concat(data); });\n }\n return [].concat(value);\n}", "step_func(func) { func(); }", "function justInvoke(fn){\n return fn()\n}//justInvoke", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}" ]
[ "0.7219417", "0.72104615", "0.72104615", "0.72104615", "0.7193035", "0.7189245", "0.7069788", "0.7069391", "0.7069391", "0.7069391", "0.7026925", "0.7026925", "0.7026925", "0.7026925", "0.7026925", "0.7026925", "0.7026925", "0.7026925", "0.70114744", "0.6984739", "0.6984739", "0.6984739", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.69052297", "0.68961626", "0.68961626", "0.6844502", "0.68327516", "0.67587805", "0.6654557", "0.6616031", "0.6616031", "0.6599138", "0.65985", "0.6473432", "0.64669377", "0.64663833", "0.64317465", "0.64317465", "0.64317465", "0.64064455", "0.6399208", "0.63313156", "0.63138306", "0.63044184", "0.63044184", "0.63044184", "0.63044184", "0.63044184", "0.63044184", "0.63044184", "0.63044184", "0.6298937", "0.6288109", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.6283922", "0.62773883", "0.6271255", "0.6206269", "0.6198404" ]
0.7037876
24
Wraps a function in an operation. Returns the wrapped function.
function operation(cm, f) { return function() { if (cm.curOp) { return f.apply(cm, arguments) } startOperation(cm); try { return f.apply(cm, arguments) } finally { endOperation(cm); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(fn) {\n return helpers.wrap(fn)();\n}", "function op(f) {\n var keys = Object.keys(f);\n if (keys.length !== 1) {\n throw new Error(\"Please provide an object with a single key \" +\n \"(operation name) mapping to a function. Got an object with \" +\n (keys.length + \" keys.\"));\n }\n var opName = keys[0];\n var fn = f[opName];\n // Strip the underscore from the end of the function name.\n if (opName.endsWith('_')) {\n opName = opName.substring(0, opName.length - 1);\n }\n // tslint:disable-next-line:no-any\n var f2 = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n engine_1.ENGINE.startScope(opName);\n try {\n var result = fn.apply(void 0, args);\n if (result instanceof Promise) {\n console.error('Cannot return a Promise inside of tidy.');\n }\n engine_1.ENGINE.endScope(result);\n return result;\n }\n catch (ex) {\n engine_1.ENGINE.endScope(null);\n throw ex;\n }\n };\n Object.defineProperty(f2, 'name', { value: opName, configurable: true });\n // tslint:disable-next-line:no-any\n return f2;\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }", "function WrappedOperation (operation, meta) {\n this.wrapped = operation;\n this.meta = meta;\n }", "function WrappedOperation (operation, meta) {\n this.wrapped = operation;\n this.meta = meta;\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) return f.apply(this, arguments);\n startOperation(this);\n try { return f.apply(this, arguments); }\n finally { endOperation(this); }\n };\n }", "function methodOp(f) {\n\t\t return function() {\n\t\t if (this.curOp) { return f.apply(this, arguments) }\n\t\t startOperation(this);\n\t\t try { return f.apply(this, arguments) }\n\t\t finally { endOperation(this); }\n\t\t }\n\t\t }", "function wrap(fn) {\n return function(cb) { fn.call(null, cb.bind(null, null)); };\n }", "function wrap(fn) {\n return function wrapper() {\n var cb = arguments[arguments.length - 1]\n try {\n var result = fn.apply(\n null,\n Array.prototype.slice.call(arguments, 0, arguments.length - 1)\n )\n cb(null, result)\n } catch (e) {\n cb(e)\n }\n }\n }", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this)\n try { return f.apply(this, arguments) }\n finally { endOperation(this) }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n}", "function methodOp(f) {\n\t\t return function() {\n\t\t if (this.curOp) return f.apply(this, arguments);\n\t\t startOperation(this);\n\t\t try { return f.apply(this, arguments); }\n\t\t finally { endOperation(this); }\n\t\t };\n\t\t }", "function methodOp(f) {\r\n return function() {\r\n if (this.curOp) return f.apply(this, arguments);\r\n startOperation(this);\r\n try { return f.apply(this, arguments); }\r\n finally { endOperation(this); }\r\n };\r\n }", "function makeFunctionWrapper(original, functionName) {\n //log(\"wrap fn: \" + functionName);\n var f = original[functionName];\n return function() {\n //log(\"call: \" + functionName);\n var result = f.apply(original, arguments);\n return result;\n };\n}", "function methodOp(f) {\n\t return function() {\n\t if (this.curOp) return f.apply(this, arguments);\n\t startOperation(this);\n\t try { return f.apply(this, arguments); }\n\t finally { endOperation(this); }\n\t };\n\t }", "function methodOp(f) {\n\t return function() {\n\t if (this.curOp) return f.apply(this, arguments);\n\t startOperation(this);\n\t try { return f.apply(this, arguments); }\n\t finally { endOperation(this); }\n\t };\n\t }", "function methodOp(f) {\n\t return function() {\n\t if (this.curOp) return f.apply(this, arguments);\n\t startOperation(this);\n\t try { return f.apply(this, arguments); }\n\t finally { endOperation(this); }\n\t };\n\t }", "function createWrap(fn) {\n if (!fn)\n return fn;\n\n // Avoid double-wrapping the same callback\n if (fn._wrapped)\n return fn._wrapped;\n\n function wrap() {\n //log(\"wrap called: \", this);\n try {\n return fn.apply(this, arguments);\n }\n catch (e) {\n //log(\"wrap caught error\", e);\n reportError(e);\n if (_rethrow)\n throw e;\n }\n }\n\n fn._wrapped = wrap;\n\n return wrap;\n }", "function makeFunctionWrapper(original, functionName) {\n //log(\"wrap fn: \" + functionName);\n var f = original[functionName];\n return function() {\n //log(\"call: \" + functionName);\n var result = f.apply(original, arguments);\n return result;\n };\n }", "function wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n return fn\n}", "function wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n return fn\n}", "function wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n return fn\n}", "function wrapfunction (fn, message) {\n if (typeof fn !== 'function') {\n throw new TypeError('argument fn must be a function')\n }\n\n return fn\n}", "function methodOp(f) {\r\n return function() {\r\n if (this.curOp) { return f.apply(this, arguments) }\r\n startOperation(this);\r\n try { return f.apply(this, arguments) }\r\n finally { endOperation(this); }\r\n }\r\n}", "wrapFunction(fn, context, params) {\n return function() {\n fn.apply(context, params);\n }\n }", "function wrap$1(fn) {\n\t return wrap$2(fn)();\n\t}", "function wrap(fn, next) {\n return function () {\n fn(next);\n };\n}", "function operation(cm, f) {\n\t\t return function() {\n\t\t if (cm.curOp) { return f.apply(cm, arguments) }\n\t\t startOperation(cm);\n\t\t try { return f.apply(cm, arguments) }\n\t\t finally { endOperation(cm); }\n\t\t }\n\t\t }", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm)\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm) }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}", "function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n}" ]
[ "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.6697844", "0.66415626", "0.6519331", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.64675987", "0.6465005", "0.6465005", "0.6370447", "0.6370447", "0.6370447", "0.6370447", "0.6370447", "0.6370447", "0.6370447", "0.6370447", "0.63509315", "0.62979764", "0.62902766", "0.6288788", "0.6288788", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.62809837", "0.6258988", "0.6258858", "0.6254702", "0.6236406", "0.6236406", "0.6236406", "0.620435", "0.6193494", "0.6180925", "0.6180925", "0.6180925", "0.6180925", "0.61767346", "0.6149577", "0.6092178", "0.6088146", "0.6057627", "0.60563165", "0.60563165", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247", "0.60250247" ]
0.60960025
83
Used to add methods to editor and doc instances, wrapping them in operations.
function methodOp(f) { return function() { if (this.curOp) { return f.apply(this, arguments) } startOperation(this); try { return f.apply(this, arguments) } finally { endOperation(this); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEditorMethods(CodeMirror) {\n\t\t var optionHandlers = CodeMirror.optionHandlers;\n\n\t\t var helpers = CodeMirror.helpers = {};\n\n\t\t CodeMirror.prototype = {\n\t\t constructor: CodeMirror,\n\t\t focus: function(){win(this).focus(); this.display.input.focus();},\n\n\t\t setOption: function(option, value) {\n\t\t var options = this.options, old = options[option];\n\t\t if (options[option] == value && option != \"mode\") { return }\n\t\t options[option] = value;\n\t\t if (optionHandlers.hasOwnProperty(option))\n\t\t { operation(this, optionHandlers[option])(this, value, old); }\n\t\t signal(this, \"optionChange\", this, option);\n\t\t },\n\n\t\t getOption: function(option) {return this.options[option]},\n\t\t getDoc: function() {return this.doc},\n\n\t\t addKeyMap: function(map, bottom) {\n\t\t this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n\t\t },\n\t\t removeKeyMap: function(map) {\n\t\t var maps = this.state.keyMaps;\n\t\t for (var i = 0; i < maps.length; ++i)\n\t\t { if (maps[i] == map || maps[i].name == map) {\n\t\t maps.splice(i, 1);\n\t\t return true\n\t\t } }\n\t\t },\n\n\t\t addOverlay: methodOp(function(spec, options) {\n\t\t var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n\t\t if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n\t\t insertSorted(this.state.overlays,\n\t\t {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n\t\t priority: (options && options.priority) || 0},\n\t\t function (overlay) { return overlay.priority; });\n\t\t this.state.modeGen++;\n\t\t regChange(this);\n\t\t }),\n\t\t removeOverlay: methodOp(function(spec) {\n\t\t var overlays = this.state.overlays;\n\t\t for (var i = 0; i < overlays.length; ++i) {\n\t\t var cur = overlays[i].modeSpec;\n\t\t if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n\t\t overlays.splice(i, 1);\n\t\t this.state.modeGen++;\n\t\t regChange(this);\n\t\t return\n\t\t }\n\t\t }\n\t\t }),\n\n\t\t indentLine: methodOp(function(n, dir, aggressive) {\n\t\t if (typeof dir != \"string\" && typeof dir != \"number\") {\n\t\t if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n\t\t else { dir = dir ? \"add\" : \"subtract\"; }\n\t\t }\n\t\t if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n\t\t }),\n\t\t indentSelection: methodOp(function(how) {\n\t\t var ranges = this.doc.sel.ranges, end = -1;\n\t\t for (var i = 0; i < ranges.length; i++) {\n\t\t var range = ranges[i];\n\t\t if (!range.empty()) {\n\t\t var from = range.from(), to = range.to();\n\t\t var start = Math.max(end, from.line);\n\t\t end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n\t\t for (var j = start; j < end; ++j)\n\t\t { indentLine(this, j, how); }\n\t\t var newRanges = this.doc.sel.ranges;\n\t\t if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n\t\t { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n\t\t } else if (range.head.line > end) {\n\t\t indentLine(this, range.head.line, how, true);\n\t\t end = range.head.line;\n\t\t if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n\t\t }\n\t\t }\n\t\t }),\n\n\t\t // Fetch the parser token for a given character. Useful for hacks\n\t\t // that want to inspect the mode state (say, for completion).\n\t\t getTokenAt: function(pos, precise) {\n\t\t return takeToken(this, pos, precise)\n\t\t },\n\n\t\t getLineTokens: function(line, precise) {\n\t\t return takeToken(this, Pos(line), precise, true)\n\t\t },\n\n\t\t getTokenTypeAt: function(pos) {\n\t\t pos = clipPos(this.doc, pos);\n\t\t var styles = getLineStyles(this, getLine(this.doc, pos.line));\n\t\t var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n\t\t var type;\n\t\t if (ch == 0) { type = styles[2]; }\n\t\t else { for (;;) {\n\t\t var mid = (before + after) >> 1;\n\t\t if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n\t\t else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n\t\t else { type = styles[mid * 2 + 2]; break }\n\t\t } }\n\t\t var cut = type ? type.indexOf(\"overlay \") : -1;\n\t\t return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n\t\t },\n\n\t\t getModeAt: function(pos) {\n\t\t var mode = this.doc.mode;\n\t\t if (!mode.innerMode) { return mode }\n\t\t return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n\t\t },\n\n\t\t getHelper: function(pos, type) {\n\t\t return this.getHelpers(pos, type)[0]\n\t\t },\n\n\t\t getHelpers: function(pos, type) {\n\t\t var found = [];\n\t\t if (!helpers.hasOwnProperty(type)) { return found }\n\t\t var help = helpers[type], mode = this.getModeAt(pos);\n\t\t if (typeof mode[type] == \"string\") {\n\t\t if (help[mode[type]]) { found.push(help[mode[type]]); }\n\t\t } else if (mode[type]) {\n\t\t for (var i = 0; i < mode[type].length; i++) {\n\t\t var val = help[mode[type][i]];\n\t\t if (val) { found.push(val); }\n\t\t }\n\t\t } else if (mode.helperType && help[mode.helperType]) {\n\t\t found.push(help[mode.helperType]);\n\t\t } else if (help[mode.name]) {\n\t\t found.push(help[mode.name]);\n\t\t }\n\t\t for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n\t\t var cur = help._global[i$1];\n\t\t if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n\t\t { found.push(cur.val); }\n\t\t }\n\t\t return found\n\t\t },\n\n\t\t getStateAfter: function(line, precise) {\n\t\t var doc = this.doc;\n\t\t line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n\t\t return getContextBefore(this, line + 1, precise).state\n\t\t },\n\n\t\t cursorCoords: function(start, mode) {\n\t\t var pos, range = this.doc.sel.primary();\n\t\t if (start == null) { pos = range.head; }\n\t\t else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n\t\t else { pos = start ? range.from() : range.to(); }\n\t\t return cursorCoords(this, pos, mode || \"page\")\n\t\t },\n\n\t\t charCoords: function(pos, mode) {\n\t\t return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n\t\t },\n\n\t\t coordsChar: function(coords, mode) {\n\t\t coords = fromCoordSystem(this, coords, mode || \"page\");\n\t\t return coordsChar(this, coords.left, coords.top)\n\t\t },\n\n\t\t lineAtHeight: function(height, mode) {\n\t\t height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n\t\t return lineAtHeight(this.doc, height + this.display.viewOffset)\n\t\t },\n\t\t heightAtLine: function(line, mode, includeWidgets) {\n\t\t var end = false, lineObj;\n\t\t if (typeof line == \"number\") {\n\t\t var last = this.doc.first + this.doc.size - 1;\n\t\t if (line < this.doc.first) { line = this.doc.first; }\n\t\t else if (line > last) { line = last; end = true; }\n\t\t lineObj = getLine(this.doc, line);\n\t\t } else {\n\t\t lineObj = line;\n\t\t }\n\t\t return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n\t\t (end ? this.doc.height - heightAtLine(lineObj) : 0)\n\t\t },\n\n\t\t defaultTextHeight: function() { return textHeight(this.display) },\n\t\t defaultCharWidth: function() { return charWidth(this.display) },\n\n\t\t getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n\t\t addWidget: function(pos, node, scroll, vert, horiz) {\n\t\t var display = this.display;\n\t\t pos = cursorCoords(this, clipPos(this.doc, pos));\n\t\t var top = pos.bottom, left = pos.left;\n\t\t node.style.position = \"absolute\";\n\t\t node.setAttribute(\"cm-ignore-events\", \"true\");\n\t\t this.display.input.setUneditable(node);\n\t\t display.sizer.appendChild(node);\n\t\t if (vert == \"over\") {\n\t\t top = pos.top;\n\t\t } else if (vert == \"above\" || vert == \"near\") {\n\t\t var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n\t\t hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n\t\t // Default to positioning above (if specified and possible); otherwise default to positioning below\n\t\t if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n\t\t { top = pos.top - node.offsetHeight; }\n\t\t else if (pos.bottom + node.offsetHeight <= vspace)\n\t\t { top = pos.bottom; }\n\t\t if (left + node.offsetWidth > hspace)\n\t\t { left = hspace - node.offsetWidth; }\n\t\t }\n\t\t node.style.top = top + \"px\";\n\t\t node.style.left = node.style.right = \"\";\n\t\t if (horiz == \"right\") {\n\t\t left = display.sizer.clientWidth - node.offsetWidth;\n\t\t node.style.right = \"0px\";\n\t\t } else {\n\t\t if (horiz == \"left\") { left = 0; }\n\t\t else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n\t\t node.style.left = left + \"px\";\n\t\t }\n\t\t if (scroll)\n\t\t { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n\t\t },\n\n\t\t triggerOnKeyDown: methodOp(onKeyDown),\n\t\t triggerOnKeyPress: methodOp(onKeyPress),\n\t\t triggerOnKeyUp: onKeyUp,\n\t\t triggerOnMouseDown: methodOp(onMouseDown),\n\n\t\t execCommand: function(cmd) {\n\t\t if (commands.hasOwnProperty(cmd))\n\t\t { return commands[cmd].call(null, this) }\n\t\t },\n\n\t\t triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n\t\t findPosH: function(from, amount, unit, visually) {\n\t\t var dir = 1;\n\t\t if (amount < 0) { dir = -1; amount = -amount; }\n\t\t var cur = clipPos(this.doc, from);\n\t\t for (var i = 0; i < amount; ++i) {\n\t\t cur = findPosH(this.doc, cur, dir, unit, visually);\n\t\t if (cur.hitSide) { break }\n\t\t }\n\t\t return cur\n\t\t },\n\n\t\t moveH: methodOp(function(dir, unit) {\n\t\t var this$1$1 = this;\n\n\t\t this.extendSelectionsBy(function (range) {\n\t\t if (this$1$1.display.shift || this$1$1.doc.extend || range.empty())\n\t\t { return findPosH(this$1$1.doc, range.head, dir, unit, this$1$1.options.rtlMoveVisually) }\n\t\t else\n\t\t { return dir < 0 ? range.from() : range.to() }\n\t\t }, sel_move);\n\t\t }),\n\n\t\t deleteH: methodOp(function(dir, unit) {\n\t\t var sel = this.doc.sel, doc = this.doc;\n\t\t if (sel.somethingSelected())\n\t\t { doc.replaceSelection(\"\", null, \"+delete\"); }\n\t\t else\n\t\t { deleteNearSelection(this, function (range) {\n\t\t var other = findPosH(doc, range.head, dir, unit, false);\n\t\t return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n\t\t }); }\n\t\t }),\n\n\t\t findPosV: function(from, amount, unit, goalColumn) {\n\t\t var dir = 1, x = goalColumn;\n\t\t if (amount < 0) { dir = -1; amount = -amount; }\n\t\t var cur = clipPos(this.doc, from);\n\t\t for (var i = 0; i < amount; ++i) {\n\t\t var coords = cursorCoords(this, cur, \"div\");\n\t\t if (x == null) { x = coords.left; }\n\t\t else { coords.left = x; }\n\t\t cur = findPosV(this, coords, dir, unit);\n\t\t if (cur.hitSide) { break }\n\t\t }\n\t\t return cur\n\t\t },\n\n\t\t moveV: methodOp(function(dir, unit) {\n\t\t var this$1$1 = this;\n\n\t\t var doc = this.doc, goals = [];\n\t\t var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n\t\t doc.extendSelectionsBy(function (range) {\n\t\t if (collapse)\n\t\t { return dir < 0 ? range.from() : range.to() }\n\t\t var headPos = cursorCoords(this$1$1, range.head, \"div\");\n\t\t if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n\t\t goals.push(headPos.left);\n\t\t var pos = findPosV(this$1$1, headPos, dir, unit);\n\t\t if (unit == \"page\" && range == doc.sel.primary())\n\t\t { addToScrollTop(this$1$1, charCoords(this$1$1, pos, \"div\").top - headPos.top); }\n\t\t return pos\n\t\t }, sel_move);\n\t\t if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n\t\t { doc.sel.ranges[i].goalColumn = goals[i]; } }\n\t\t }),\n\n\t\t // Find the word at the given position (as returned by coordsChar).\n\t\t findWordAt: function(pos) {\n\t\t var doc = this.doc, line = getLine(doc, pos.line).text;\n\t\t var start = pos.ch, end = pos.ch;\n\t\t if (line) {\n\t\t var helper = this.getHelper(pos, \"wordChars\");\n\t\t if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n\t\t var startChar = line.charAt(start);\n\t\t var check = isWordChar(startChar, helper)\n\t\t ? function (ch) { return isWordChar(ch, helper); }\n\t\t : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n\t\t : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n\t\t while (start > 0 && check(line.charAt(start - 1))) { --start; }\n\t\t while (end < line.length && check(line.charAt(end))) { ++end; }\n\t\t }\n\t\t return new Range(Pos(pos.line, start), Pos(pos.line, end))\n\t\t },\n\n\t\t toggleOverwrite: function(value) {\n\t\t if (value != null && value == this.state.overwrite) { return }\n\t\t if (this.state.overwrite = !this.state.overwrite)\n\t\t { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\t\t else\n\t\t { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n\t\t signal(this, \"overwriteToggle\", this, this.state.overwrite);\n\t\t },\n\t\t hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n\t\t isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n\t\t scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n\t\t getScrollInfo: function() {\n\t\t var scroller = this.display.scroller;\n\t\t return {left: scroller.scrollLeft, top: scroller.scrollTop,\n\t\t height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n\t\t width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n\t\t clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n\t\t },\n\n\t\t scrollIntoView: methodOp(function(range, margin) {\n\t\t if (range == null) {\n\t\t range = {from: this.doc.sel.primary().head, to: null};\n\t\t if (margin == null) { margin = this.options.cursorScrollMargin; }\n\t\t } else if (typeof range == \"number\") {\n\t\t range = {from: Pos(range, 0), to: null};\n\t\t } else if (range.from == null) {\n\t\t range = {from: range, to: null};\n\t\t }\n\t\t if (!range.to) { range.to = range.from; }\n\t\t range.margin = margin || 0;\n\n\t\t if (range.from.line != null) {\n\t\t scrollToRange(this, range);\n\t\t } else {\n\t\t scrollToCoordsRange(this, range.from, range.to, range.margin);\n\t\t }\n\t\t }),\n\n\t\t setSize: methodOp(function(width, height) {\n\t\t var this$1$1 = this;\n\n\t\t var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n\t\t if (width != null) { this.display.wrapper.style.width = interpret(width); }\n\t\t if (height != null) { this.display.wrapper.style.height = interpret(height); }\n\t\t if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n\t\t var lineNo = this.display.viewFrom;\n\t\t this.doc.iter(lineNo, this.display.viewTo, function (line) {\n\t\t if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n\t\t { if (line.widgets[i].noHScroll) { regLineChange(this$1$1, lineNo, \"widget\"); break } } }\n\t\t ++lineNo;\n\t\t });\n\t\t this.curOp.forceUpdate = true;\n\t\t signal(this, \"refresh\", this);\n\t\t }),\n\n\t\t operation: function(f){return runInOp(this, f)},\n\t\t startOperation: function(){return startOperation(this)},\n\t\t endOperation: function(){return endOperation(this)},\n\n\t\t refresh: methodOp(function() {\n\t\t var oldHeight = this.display.cachedTextHeight;\n\t\t regChange(this);\n\t\t this.curOp.forceUpdate = true;\n\t\t clearCaches(this);\n\t\t scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n\t\t updateGutterSpace(this.display);\n\t\t if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n\t\t { estimateLineHeights(this); }\n\t\t signal(this, \"refresh\", this);\n\t\t }),\n\n\t\t swapDoc: methodOp(function(doc) {\n\t\t var old = this.doc;\n\t\t old.cm = null;\n\t\t // Cancel the current text selection if any (#5821)\n\t\t if (this.state.selectingText) { this.state.selectingText(); }\n\t\t attachDoc(this, doc);\n\t\t clearCaches(this);\n\t\t this.display.input.reset();\n\t\t scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n\t\t this.curOp.forceScroll = true;\n\t\t signalLater(this, \"swapDoc\", this, old);\n\t\t return old\n\t\t }),\n\n\t\t phrase: function(phraseText) {\n\t\t var phrases = this.options.phrases;\n\t\t return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n\t\t },\n\n\t\t getInputField: function(){return this.display.input.getField()},\n\t\t getWrapperElement: function(){return this.display.wrapper},\n\t\t getScrollerElement: function(){return this.display.scroller},\n\t\t getGutterElement: function(){return this.display.gutters}\n\t\t };\n\t\t eventMixin(CodeMirror);\n\n\t\t CodeMirror.registerHelper = function(type, name, value) {\n\t\t if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n\t\t helpers[type][name] = value;\n\t\t };\n\t\t CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n\t\t CodeMirror.registerHelper(type, name, value);\n\t\t helpers[type]._global.push({pred: predicate, val: value});\n\t\t };\n\t\t }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n var helpers = CodeMirror.helpers = {};\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function focus() {\n window.focus();\n this.display.input.focus();\n },\n setOption: function setOption(option, value) {\n var options = this.options,\n old = options[option];\n\n if (options[option] == value && option != \"mode\") {\n return;\n }\n\n options[option] = value;\n\n if (optionHandlers.hasOwnProperty(option)) {\n operation(this, optionHandlers[option])(this, value, old);\n }\n\n signal(this, \"optionChange\", this, option);\n },\n getOption: function getOption(option) {\n return this.options[option];\n },\n getDoc: function getDoc() {\n return this.doc;\n },\n addKeyMap: function addKeyMap(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function removeKeyMap(map) {\n var maps = this.state.keyMaps;\n\n for (var i = 0; i < maps.length; ++i) {\n if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true;\n }\n }\n },\n addOverlay: methodOp(function (spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n\n if (mode.startState) {\n throw new Error(\"Overlays may not be stateful.\");\n }\n\n insertSorted(this.state.overlays, {\n mode: mode,\n modeSpec: spec,\n opaque: options && options.opaque,\n priority: options && options.priority || 0\n }, function (overlay) {\n return overlay.priority;\n });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function (spec) {\n var overlays = this.state.overlays;\n\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return;\n }\n }\n }),\n indentLine: methodOp(function (n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) {\n dir = this.options.smartIndent ? \"smart\" : \"prev\";\n } else {\n dir = dir ? \"add\" : \"subtract\";\n }\n }\n\n if (isLine(this.doc, n)) {\n indentLine(this, n, dir, aggressive);\n }\n }),\n indentSelection: methodOp(function (how) {\n var ranges = this.doc.sel.ranges,\n end = -1;\n\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n\n if (!range.empty()) {\n var from = range.from(),\n to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n\n for (var j = start; j < end; ++j) {\n indentLine(this, j, how);\n }\n\n var newRanges = this.doc.sel.ranges;\n\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) {\n replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll);\n }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n\n if (i == this.doc.sel.primIndex) {\n ensureCursorVisible(this);\n }\n }\n }\n }),\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function getTokenAt(pos, precise) {\n return takeToken(this, pos, precise);\n },\n getLineTokens: function getLineTokens(line, precise) {\n return takeToken(this, Pos(line), precise, true);\n },\n getTokenTypeAt: function getTokenTypeAt(pos) {\n pos = _clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0,\n after = (styles.length - 1) / 2,\n ch = pos.ch;\n var type;\n\n if (ch == 0) {\n type = styles[2];\n } else {\n for (;;) {\n var mid = before + after >> 1;\n\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) {\n after = mid;\n } else if (styles[mid * 2 + 1] < ch) {\n before = mid + 1;\n } else {\n type = styles[mid * 2 + 2];\n break;\n }\n }\n }\n\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1);\n },\n getModeAt: function getModeAt(pos) {\n var mode = this.doc.mode;\n\n if (!mode.innerMode) {\n return mode;\n }\n\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode;\n },\n getHelper: function getHelper(pos, type) {\n return this.getHelpers(pos, type)[0];\n },\n getHelpers: function getHelpers(pos, type) {\n var found = [];\n\n if (!helpers.hasOwnProperty(type)) {\n return found;\n }\n\n var help = helpers[type],\n mode = this.getModeAt(pos);\n\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) {\n found.push(help[mode[type]]);\n }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n\n if (val) {\n found.push(val);\n }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) {\n found.push(cur.val);\n }\n }\n\n return found;\n },\n getStateAfter: function getStateAfter(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1 : line);\n return getContextBefore(this, line + 1, precise).state;\n },\n cursorCoords: function cursorCoords(start, mode) {\n var pos,\n range = this.doc.sel.primary();\n\n if (start == null) {\n pos = range.head;\n } else if (_typeof(start) == \"object\") {\n pos = _clipPos(this.doc, start);\n } else {\n pos = start ? range.from() : range.to();\n }\n\n return _cursorCoords(this, pos, mode || \"page\");\n },\n charCoords: function charCoords(pos, mode) {\n return _charCoords(this, _clipPos(this.doc, pos), mode || \"page\");\n },\n coordsChar: function coordsChar(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return _coordsChar(this, coords.left, coords.top);\n },\n lineAtHeight: function lineAtHeight(height, mode) {\n height = fromCoordSystem(this, {\n top: height,\n left: 0\n }, mode || \"page\").top;\n return _lineAtHeight(this.doc, height + this.display.viewOffset);\n },\n heightAtLine: function heightAtLine(line, mode, includeWidgets) {\n var end = false,\n lineObj;\n\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n\n if (line < this.doc.first) {\n line = this.doc.first;\n } else if (line > last) {\n line = last;\n end = true;\n }\n\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n\n return intoCoordSystem(this, lineObj, {\n top: 0,\n left: 0\n }, mode || \"page\", includeWidgets || end).top + (end ? this.doc.height - _heightAtLine(lineObj) : 0);\n },\n defaultTextHeight: function defaultTextHeight() {\n return textHeight(this.display);\n },\n defaultCharWidth: function defaultCharWidth() {\n return charWidth(this.display);\n },\n getViewport: function getViewport() {\n return {\n from: this.display.viewFrom,\n to: this.display.viewTo\n };\n },\n addWidget: function addWidget(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = _cursorCoords(this, _clipPos(this.doc, pos));\n var top = pos.bottom,\n left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); // Default to positioning above (if specified and possible); otherwise default to positioning below\n\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) {\n top = pos.top - node.offsetHeight;\n } else if (pos.bottom + node.offsetHeight <= vspace) {\n top = pos.bottom;\n }\n\n if (left + node.offsetWidth > hspace) {\n left = hspace - node.offsetWidth;\n }\n }\n\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") {\n left = 0;\n } else if (horiz == \"middle\") {\n left = (display.sizer.clientWidth - node.offsetWidth) / 2;\n }\n\n node.style.left = left + \"px\";\n }\n\n if (scroll) {\n scrollIntoView(this, {\n left: left,\n top: top,\n right: left + node.offsetWidth,\n bottom: top + node.offsetHeight\n });\n }\n },\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n execCommand: function execCommand(cmd) {\n if (commands.hasOwnProperty(cmd)) {\n return commands[cmd].call(null, this);\n }\n },\n triggerElectric: methodOp(function (text) {\n triggerElectric(this, text);\n }),\n findPosH: function findPosH(from, amount, unit, visually) {\n var dir = 1;\n\n if (amount < 0) {\n dir = -1;\n amount = -amount;\n }\n\n var cur = _clipPos(this.doc, from);\n\n for (var i = 0; i < amount; ++i) {\n cur = _findPosH(this.doc, cur, dir, unit, visually);\n\n if (cur.hitSide) {\n break;\n }\n }\n\n return cur;\n },\n moveH: methodOp(function (dir, unit) {\n var this$1 = this;\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty()) {\n return _findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually);\n } else {\n return dir < 0 ? range.from() : range.to();\n }\n }, sel_move);\n }),\n deleteH: methodOp(function (dir, unit) {\n var sel = this.doc.sel,\n doc = this.doc;\n\n if (sel.somethingSelected()) {\n doc.replaceSelection(\"\", null, \"+delete\");\n } else {\n deleteNearSelection(this, function (range) {\n var other = _findPosH(doc, range.head, dir, unit, false);\n\n return dir < 0 ? {\n from: other,\n to: range.head\n } : {\n from: range.head,\n to: other\n };\n });\n }\n }),\n findPosV: function findPosV(from, amount, unit, goalColumn) {\n var dir = 1,\n x = goalColumn;\n\n if (amount < 0) {\n dir = -1;\n amount = -amount;\n }\n\n var cur = _clipPos(this.doc, from);\n\n for (var i = 0; i < amount; ++i) {\n var coords = _cursorCoords(this, cur, \"div\");\n\n if (x == null) {\n x = coords.left;\n } else {\n coords.left = x;\n }\n\n cur = _findPosV(this, coords, dir, unit);\n\n if (cur.hitSide) {\n break;\n }\n }\n\n return cur;\n },\n moveV: methodOp(function (dir, unit) {\n var this$1 = this;\n var doc = this.doc,\n goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse) {\n return dir < 0 ? range.from() : range.to();\n }\n\n var headPos = _cursorCoords(this$1, range.head, \"div\");\n\n if (range.goalColumn != null) {\n headPos.left = range.goalColumn;\n }\n\n goals.push(headPos.left);\n\n var pos = _findPosV(this$1, headPos, dir, unit);\n\n if (unit == \"page\" && range == doc.sel.primary()) {\n addToScrollTop(this$1, _charCoords(this$1, pos, \"div\").top - headPos.top);\n }\n\n return pos;\n }, sel_move);\n\n if (goals.length) {\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n doc.sel.ranges[i].goalColumn = goals[i];\n }\n }\n }),\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function findWordAt(pos) {\n var doc = this.doc,\n line = getLine(doc, pos.line).text;\n var start = pos.ch,\n end = pos.ch;\n\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n\n if ((pos.sticky == \"before\" || end == line.length) && start) {\n --start;\n } else {\n ++end;\n }\n\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper) ? function (ch) {\n return isWordChar(ch, helper);\n } : /\\s/.test(startChar) ? function (ch) {\n return /\\s/.test(ch);\n } : function (ch) {\n return !/\\s/.test(ch) && !isWordChar(ch);\n };\n\n while (start > 0 && check(line.charAt(start - 1))) {\n --start;\n }\n\n while (end < line.length && check(line.charAt(end))) {\n ++end;\n }\n }\n\n return new Range(Pos(pos.line, start), Pos(pos.line, end));\n },\n toggleOverwrite: function toggleOverwrite(value) {\n if (value != null && value == this.state.overwrite) {\n return;\n }\n\n if (this.state.overwrite = !this.state.overwrite) {\n addClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n } else {\n rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\");\n }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function hasFocus() {\n return this.display.input.getField() == activeElt();\n },\n isReadOnly: function isReadOnly() {\n return !!(this.options.readOnly || this.doc.cantEdit);\n },\n scrollTo: methodOp(function (x, y) {\n scrollToCoords(this, x, y);\n }),\n getScrollInfo: function getScrollInfo() {\n var scroller = this.display.scroller;\n return {\n left: scroller.scrollLeft,\n top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this),\n clientWidth: displayWidth(this)\n };\n },\n scrollIntoView: methodOp(function (range, margin) {\n if (range == null) {\n range = {\n from: this.doc.sel.primary().head,\n to: null\n };\n\n if (margin == null) {\n margin = this.options.cursorScrollMargin;\n }\n } else if (typeof range == \"number\") {\n range = {\n from: Pos(range, 0),\n to: null\n };\n } else if (range.from == null) {\n range = {\n from: range,\n to: null\n };\n }\n\n if (!range.to) {\n range.to = range.from;\n }\n\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n setSize: methodOp(function (width, height) {\n var this$1 = this;\n\n var interpret = function interpret(val) {\n return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val;\n };\n\n if (width != null) {\n this.display.wrapper.style.width = interpret(width);\n }\n\n if (height != null) {\n this.display.wrapper.style.height = interpret(height);\n }\n\n if (this.options.lineWrapping) {\n clearLineMeasurementCache(this);\n }\n\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) {\n for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].noHScroll) {\n regLineChange(this$1, lineNo, \"widget\");\n break;\n }\n }\n }\n\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n operation: function operation(f) {\n return runInOp(this, f);\n },\n startOperation: function startOperation() {\n return _startOperation(this);\n },\n endOperation: function endOperation() {\n return _endOperation(this);\n },\n refresh: methodOp(function () {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping) {\n estimateLineHeights(this);\n }\n\n signal(this, \"refresh\", this);\n }),\n swapDoc: methodOp(function (doc) {\n var old = this.doc;\n old.cm = null; // Cancel the current text selection if any (#5821)\n\n if (this.state.selectingText) {\n this.state.selectingText();\n }\n\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old;\n }),\n phrase: function phrase(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText;\n },\n getInputField: function getInputField() {\n return this.display.input.getField();\n },\n getWrapperElement: function getWrapperElement() {\n return this.display.wrapper;\n },\n getScrollerElement: function getScrollerElement() {\n return this.display.scroller;\n },\n getGutterElement: function getGutterElement() {\n return this.display.gutters;\n }\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function (type, name, value) {\n if (!helpers.hasOwnProperty(type)) {\n helpers[type] = CodeMirror[type] = {\n _global: []\n };\n }\n\n helpers[type][name] = value;\n };\n\n CodeMirror.registerGlobalHelper = function (type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n\n helpers[type]._global.push({\n pred: predicate,\n val: value\n });\n };\n } // Used for horizontal relative motion. Dir is -1 or 1 (left or", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n var helpers = CodeMirror.helpers = {}\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus()},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option]\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old) }\n signal(this, \"optionChange\", this, option)\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map))\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1)\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; })\n this.state.modeGen++\n regChange(this)\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1)\n this$1.state.modeGen++\n regChange(this$1)\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\" }\n else { dir = dir ? \"add\" : \"subtract\" }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (!range.empty()) {\n var from = range.from(), to = range.to()\n var start = Math.max(end, from.line)\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how) }\n var newRanges = this$1.doc.sel.ranges\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }\n } else if (range.head.line > end) {\n indentLine(this$1, range.head.line, how, true)\n end = range.head.line\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos)\n var styles = getLineStyles(this, getLine(this.doc, pos.line))\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch\n var type\n if (ch == 0) { type = styles[2] }\n else { for (;;) {\n var mid = (before + after) >> 1\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = []\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos)\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]) }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]]\n if (val) { found.push(val) }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType])\n } else if (help[mode.name]) {\n found.push(help[mode.name])\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1]\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val) }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)\n return getStateBefore(this, line + 1, precise)\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary()\n if (start == null) { pos = range.head }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start) }\n else { pos = start ? range.from() : range.to() }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\")\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1\n if (line < this.doc.first) { line = this.doc.first }\n else if (line > last) { line = last; end = true }\n lineObj = getLine(this.doc, line)\n } else {\n lineObj = line\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display\n pos = cursorCoords(this, clipPos(this.doc, pos))\n var top = pos.bottom, left = pos.left\n node.style.position = \"absolute\"\n node.setAttribute(\"cm-ignore-events\", \"true\")\n this.display.input.setUneditable(node)\n display.sizer.appendChild(node)\n if (vert == \"over\") {\n top = pos.top\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth }\n }\n node.style.top = top + \"px\"\n node.style.left = node.style.right = \"\"\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth\n node.style.right = \"0px\"\n } else {\n if (horiz == \"left\") { left = 0 }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }\n node.style.left = left + \"px\"\n }\n if (scroll)\n { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move)\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\") }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false)\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }) }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\")\n if (x == null) { x = coords.left }\n else { coords.left = x }\n cur = findPosV(this$1, coords, dir, unit)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = []\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\")\n if (range.goalColumn != null) { headPos.left = range.goalColumn }\n goals.push(headPos.left)\n var pos = findPosV(this$1, headPos, dir, unit)\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollPos(this$1, null, charCoords(this$1, pos, \"div\").top - headPos.top) }\n return pos\n }, sel_move)\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i] } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text\n var start = pos.ch, end = pos.ch\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\")\n if ((pos.xRel < 0 || end == line.length) && start) { --start; } else { ++end }\n var startChar = line.charAt(start)\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); }\n while (start > 0 && check(line.charAt(start - 1))) { --start }\n while (end < line.length && check(line.charAt(end))) { ++end }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite)\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function(x, y) {\n if (x != null || y != null) { resolveScrollToPos(this) }\n if (x != null) { this.curOp.scrollLeft = x }\n if (y != null) { this.curOp.scrollTop = y }\n }),\n getScrollInfo: function() {\n var scroller = this.display.scroller\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null}\n if (margin == null) { margin = this.options.cursorScrollMargin }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null}\n } else if (range.from == null) {\n range = {from: range, to: null}\n }\n if (!range.to) { range.to = range.from }\n range.margin = margin || 0\n\n if (range.from.line != null) {\n resolveScrollToPos(this)\n this.curOp.scrollToPos = range\n } else {\n var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),\n Math.min(range.from.top, range.to.top) - range.margin,\n Math.max(range.from.right, range.to.right),\n Math.max(range.from.bottom, range.to.bottom) + range.margin)\n this.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; }\n if (width != null) { this.display.wrapper.style.width = interpret(width) }\n if (height != null) { this.display.wrapper.style.height = interpret(height) }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this) }\n var lineNo = this.display.viewFrom\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo\n })\n this.curOp.forceUpdate = true\n signal(this, \"refresh\", this)\n }),\n\n operation: function(f){return runInOp(this, f)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight\n regChange(this)\n this.curOp.forceUpdate = true\n clearCaches(this)\n this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)\n updateGutterSpace(this)\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this) }\n signal(this, \"refresh\", this)\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc\n old.cm = null\n attachDoc(this, doc)\n clearCaches(this)\n this.display.input.reset()\n this.scrollTo(doc.scrollLeft, doc.scrollTop)\n this.curOp.forceScroll = true\n signalLater(this, \"swapDoc\", this, old)\n return old\n }),\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n }\n eventMixin(CodeMirror)\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }\n helpers[type][name] = value\n }\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value)\n helpers[type]._global.push({pred: predicate, val: value})\n }\n}", "function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers\n\n var helpers = CodeMirror.helpers = {}\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus()},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option]\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old) }\n signal(this, \"optionChange\", this, option)\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map))\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1)\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; })\n this.state.modeGen++\n regChange(this)\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1)\n this$1.state.modeGen++\n regChange(this$1)\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\" }\n else { dir = dir ? \"add\" : \"subtract\" }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (!range.empty()) {\n var from = range.from(), to = range.to()\n var start = Math.max(end, from.line)\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how) }\n var newRanges = this$1.doc.sel.ranges\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }\n } else if (range.head.line > end) {\n indentLine(this$1, range.head.line, how, true)\n end = range.head.line\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos)\n var styles = getLineStyles(this, getLine(this.doc, pos.line))\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch\n var type\n if (ch == 0) { type = styles[2] }\n else { for (;;) {\n var mid = (before + after) >> 1\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = []\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos)\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]) }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]]\n if (val) { found.push(val) }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType])\n } else if (help[mode.name]) {\n found.push(help[mode.name])\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1]\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val) }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)\n return getStateBefore(this, line + 1, precise)\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary()\n if (start == null) { pos = range.head }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start) }\n else { pos = start ? range.from() : range.to() }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\")\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1\n if (line < this.doc.first) { line = this.doc.first }\n else if (line > last) { line = last; end = true }\n lineObj = getLine(this.doc, line)\n } else {\n lineObj = line\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display\n pos = cursorCoords(this, clipPos(this.doc, pos))\n var top = pos.bottom, left = pos.left\n node.style.position = \"absolute\"\n node.setAttribute(\"cm-ignore-events\", \"true\")\n this.display.input.setUneditable(node)\n display.sizer.appendChild(node)\n if (vert == \"over\") {\n top = pos.top\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth }\n }\n node.style.top = top + \"px\"\n node.style.left = node.style.right = \"\"\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth\n node.style.right = \"0px\"\n } else {\n if (horiz == \"left\") { left = 0 }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }\n node.style.left = left + \"px\"\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move)\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\") }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false)\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }) }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn\n if (amount < 0) { dir = -1; amount = -amount }\n var cur = clipPos(this.doc, from)\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\")\n if (x == null) { x = coords.left }\n else { coords.left = x }\n cur = findPosV(this$1, coords, dir, unit)\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = []\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\")\n if (range.goalColumn != null) { headPos.left = range.goalColumn }\n goals.push(headPos.left)\n var pos = findPosV(this$1, headPos, dir, unit)\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollPos(this$1, null, charCoords(this$1, pos, \"div\").top - headPos.top) }\n return pos\n }, sel_move)\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i] } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text\n var start = pos.ch, end = pos.ch\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\")\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end }\n var startChar = line.charAt(start)\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); }\n while (start > 0 && check(line.charAt(start - 1))) { --start }\n while (end < line.length && check(line.charAt(end))) { ++end }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\") }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite)\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function(x, y) {\n if (x != null || y != null) { resolveScrollToPos(this) }\n if (x != null) { this.curOp.scrollLeft = x }\n if (y != null) { this.curOp.scrollTop = y }\n }),\n getScrollInfo: function() {\n var scroller = this.display.scroller\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null}\n if (margin == null) { margin = this.options.cursorScrollMargin }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null}\n } else if (range.from == null) {\n range = {from: range, to: null}\n }\n if (!range.to) { range.to = range.from }\n range.margin = margin || 0\n\n if (range.from.line != null) {\n resolveScrollToPos(this)\n this.curOp.scrollToPos = range\n } else {\n var sPos = calculateScrollPos(this, {\n left: Math.min(range.from.left, range.to.left),\n top: Math.min(range.from.top, range.to.top) - range.margin,\n right: Math.max(range.from.right, range.to.right),\n bottom: Math.max(range.from.bottom, range.to.bottom) + range.margin\n })\n this.scrollTo(sPos.scrollLeft, sPos.scrollTop)\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; }\n if (width != null) { this.display.wrapper.style.width = interpret(width) }\n if (height != null) { this.display.wrapper.style.height = interpret(height) }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this) }\n var lineNo = this.display.viewFrom\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo\n })\n this.curOp.forceUpdate = true\n signal(this, \"refresh\", this)\n }),\n\n operation: function(f){return runInOp(this, f)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight\n regChange(this)\n this.curOp.forceUpdate = true\n clearCaches(this)\n this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)\n updateGutterSpace(this)\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this) }\n signal(this, \"refresh\", this)\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc\n old.cm = null\n attachDoc(this, doc)\n clearCaches(this)\n this.display.input.reset()\n this.scrollTo(doc.scrollLeft, doc.scrollTop)\n this.curOp.forceScroll = true\n signalLater(this, \"swapDoc\", this, old)\n return old\n }),\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n }\n eventMixin(CodeMirror)\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }\n helpers[type][name] = value\n }\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value)\n helpers[type]._global.push({pred: predicate, val: value})\n }\n}", "function ExtraMethods() {}", "function addMethod(name,fn){customMethods[name]=fn;return provider;}", "_addMethods(methods, namespace) {\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n if (!namespace) {\n this._addMethod(name, methods[name])\n } else {\n this._addMethod(name, methods[name], namespace)\n }\n\n }\n }\n return this\n }", "function insertMethod(method) {\r\n\tvar methods = hidden.value.split(\"\\n\");\r\n\texperior.editor.insertMethod(method);\r\n\texperior.contentWindow.focus();\r\n}", "generateOperations() {\n if (this._Operations) {\n return;\n }\n\n this._signHeadersList = this._signHeadersList || this.signHeadersList; // backward support\n this._serviceName = this._serviceName || this.serviceName;\n this._serviceVersion = this._serviceVersion || this.serviceVersion;\n\n // the holder class\n const Operations = function(needMeta, meta) {\n this.needMeta = needMeta;\n this.meta = meta;\n };\n\n // assign instance properties into prototype\n assign(Operations.prototype, this);\n\n // update supported methods, but need to bind it back to the original instance\n Operations.prototype.wmHeaders = this.wmHeaders.bind(this);\n\n this._Operations = Operations;\n\n // wrapper for each operation\n\n //\n // Each operation could specify multiple tags.\n // Each tag goes in swagger.apis[<tag>] as a group of all operations belonging to it\n // Any operations that don't have tags go into the default group.\n // In each group, there's apis object that holds the details of the operations inside it\n //\n each(this.swagger.apis, group => {\n if (!isFunction(group) && isObject(group)) {\n each(group, (fn, operationId) => {\n if (operationId !== \"help\" && isFunction(fn) && !Operations.prototype[operationId]) {\n const api = group.apis[operationId];\n const spec = this.swagger.spec.paths[api.path][api.method];\n Operations.prototype[operationId] = function swapiOperationWrapper(params, options) {\n const meta = this.useMeta();\n return apiFuncInvoke({\n api,\n spec,\n meta,\n client: this,\n fn,\n params,\n options: options || {},\n operationId\n });\n };\n // add details from Swagger\n Operations.prototype[operationId].details = group.operations[operationId];\n }\n });\n }\n });\n\n Operations.prototype.useMeta = function useMeta() {\n if (this.needMeta && !this.meta) {\n throw new Error(\"swapi operation needs meta\");\n }\n return this.meta;\n };\n\n Operations.prototype.invoke = function invoke(tag, operationId, params, options) {\n return invokeWithMeta({\n meta: this.useMeta(),\n client: this,\n tag,\n operationId,\n params,\n options\n });\n };\n }", "function createMethodsManager() {\n var methods = {};\n\n return {\n addMethod: addMethod,\n setTarget: setTarget\n };\n\n /*\n * Adds a method that will be available to extend the object.\n *\n * @param {string} name The method name\n * @param {function} [method] The handler for the specified method name.\n * @return {function} The handler for the specified method name.\n */\n function addMethod(name, method) {\n if (method !== undefined) {\n methods[name] = method;\n }\n return methods[name];\n }\n\n /*\n * Sets the target object to extend.\n *\n * @param {object} target The target object.\n */\n function setTarget(target) {\n var targetMethods = {};\n for (var name in methods) {\n targetMethods[name] = wrapMethod(target, methods[name]);\n }\n return targetMethods;\n }\n\n /*\n * Wraps the method so that it is executed with the appropriate\n * arguments.\n *\n * @param {object} target The target object.\n * @param {function} method The method to wrap.\n */\n function wrapMethod(target, method) {\n return function() {\n\n // Put arguments into a real array.\n var methodArgs = [];\n for (var i = 0; i < arguments.length; i++) {\n methodArgs.push(arguments[i]);\n }\n\n var params = method(target, parseMethodArgs, methodArgs);\n\n modifyTarget(target,\n params.source,\n params.sourceKeys,\n params.filters,\n params.overrideKeys);\n return this;\n };\n }\n}", "templateMethod() {\n this.baseOperation1();\n this.requiredOperations1();\n this.baseOperation2();\n this.hook1();\n this.requiredOperation2();\n this.baseOperation3();\n this.hook2();\n }", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }", "addExpr() {\n this.edit();\n }", "setMethods(name, type){\r\n return \"\\tvoid set\" + name +\r\n \"(\" + type + \" val) {\\n \\t \\t\" + name + \" = val;\\n\\t} \\n\";\r\n }", "function addDWOperationFunctions() {\n\ttry {\n\t\tMM.BC.log(' ---- adding dw operations ---- ')\n\t\tif (globals.webKitWin.bcEndpoints) {\n\t\t\tglobals.webKitWin.bcEndpoints.openUrl = MM.BC.UI_UTILS.openPopupWindow;\n\t\t\tglobals.webKitWin.bcEndpoints.insertCode = function(code) {\n\t\t\t\twindow.close(); \n\t\t\t\tMM.BC.codeToInsert = code;\n\t if (typeof (dw.bcLog) == \"function\") {\n\t dw.bcLog(\"insert\");\n\t }\n\t\t\t}; \n\t\t\tglobals.webKitWin.bcEndpoints.onBrowseFile = onBrowseFile; \n\t\t\tglobals.webKitWin.bcEndpoints.closePopup = closePopup;\n\t\t\tglobals.webKitWin.bcEndpoints.getCurrentDocumentPath = MM.BC.UI_UTILS.getCurrentDocumentPath;\n\t\t\tglobals.webKitWin.bcEndpoints.showRetry = showCallFailed;\n\t\t\t\n\t\t\tsetWindowButtons();\n\t\t\t\n\t\t\t// Set focus to the small browser so the next tab key drills into the elements within//\n\t\t\tif (globals.browser) globals.browser.focus();\n\t\t}\n\t\n\t\n\t} catch (e) {\n\t\tlogMessage(REP_ITEM_NOTE, 'addDWOperationFunctions', 'error connecting to the web page end points');\n\t}\n}", "function addBindings() {\n\t\tfunction clickHandler(e) {\n\t\t\t// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n\t\t\t// See: http://jacklmoore.com/notes/click-events/\n\t\t\tif (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlaunch(this);\n\t\t\t}\n\t\t}\n\n\t\tif ($box) {\n\t\t\tif (!init) {\n\t\t\t\tinit = true;\n\n\t\t\t\t// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n\t\t\t\t$next.click(function () {\n\t\t\t\t\tpublicMethod.next();\n\t\t\t\t});\n\t\t\t\t$prev.click(function () {\n\t\t\t\t\tpublicMethod.prev();\n\t\t\t\t});\n\t\t\t\t$close.click(function () {\n\t\t\t\t\tpublicMethod.close();\n\t\t\t\t});\n\t\t\t\t$overlay.click(function () {\n\t\t\t\t\tif (settings.get('overlayClose')) {\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Key Bindings\n\t\t\t\t$(document).bind('keydown.' + prefix, function (e) {\n\t\t\t\t\tvar key = e.keyCode;\n\t\t\t\t\tif (open && settings.get('escKey') && key === 27) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t\tif (open && settings.get('arrowKey') && $related[1] && !e.altKey) {\n\t\t\t\t\t\tif (key === 37) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$prev.click();\n\t\t\t\t\t\t} else if (key === 39) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$next.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ($.isFunction($.fn.on)) {\n\t\t\t\t\t// For jQuery 1.7+\n\t\t\t\t\t$(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n\t\t\t\t} else {\n\t\t\t\t\t// For jQuery 1.3.x -> 1.6.x\n\t\t\t\t\t// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n\t\t\t\t\t// This is not here for jQuery 1.9, it's here for legacy users.\n\t\t\t\t\t$('.'+boxElement).live('click.'+prefix, clickHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function addBindings() {\n\t\tfunction clickHandler(e) {\n\t\t\t// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n\t\t\t// See: http://jacklmoore.com/notes/click-events/\n\t\t\tif (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlaunch(this);\n\t\t\t}\n\t\t}\n\n\t\tif ($box) {\n\t\t\tif (!init) {\n\t\t\t\tinit = true;\n\n\t\t\t\t// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n\t\t\t\t$next.click(function () {\n\t\t\t\t\tpublicMethod.next();\n\t\t\t\t});\n\t\t\t\t$prev.click(function () {\n\t\t\t\t\tpublicMethod.prev();\n\t\t\t\t});\n\t\t\t\t$close.click(function () {\n\t\t\t\t\tpublicMethod.close();\n\t\t\t\t});\n\t\t\t\t$overlay.click(function () {\n\t\t\t\t\tif (settings.get('overlayClose')) {\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Key Bindings\n\t\t\t\t$(document).bind('keydown.' + prefix, function (e) {\n\t\t\t\t\tvar key = e.keyCode;\n\t\t\t\t\tif (open && settings.get('escKey') && key === 27) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t\tif (open && settings.get('arrowKey') && $related[1] && !e.altKey) {\n\t\t\t\t\t\tif (key === 37) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$prev.click();\n\t\t\t\t\t\t} else if (key === 39) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$next.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ($.isFunction($.fn.on)) {\n\t\t\t\t\t// For jQuery 1.7+\n\t\t\t\t\t$(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n\t\t\t\t} else {\n\t\t\t\t\t// For jQuery 1.3.x -> 1.6.x\n\t\t\t\t\t// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n\t\t\t\t\t// This is not here for jQuery 1.9, it's here for legacy users.\n\t\t\t\t\t$('.'+boxElement).live('click.'+prefix, clickHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function addBindings() {\n\t\tfunction clickHandler(e) {\n\t\t\t// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n\t\t\t// See: http://jacklmoore.com/notes/click-events/\n\t\t\tif (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlaunch(this);\n\t\t\t}\n\t\t}\n\n\t\tif ($box) {\n\t\t\tif (!init) {\n\t\t\t\tinit = true;\n\n\t\t\t\t// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n\t\t\t\t$next.click(function () {\n\t\t\t\t\tpublicMethod.next();\n\t\t\t\t});\n\t\t\t\t$prev.click(function () {\n\t\t\t\t\tpublicMethod.prev();\n\t\t\t\t});\n\t\t\t\t$close.click(function () {\n\t\t\t\t\tpublicMethod.close();\n\t\t\t\t});\n\t\t\t\t$overlay.click(function () {\n\t\t\t\t\tif (settings.get('overlayClose')) {\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Key Bindings\n\t\t\t\t$(document).bind('keydown.' + prefix, function (e) {\n\t\t\t\t\tvar key = e.keyCode;\n\t\t\t\t\tif (open && settings.get('escKey') && key === 27) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t\tif (open && settings.get('arrowKey') && $related[1] && !e.altKey) {\n\t\t\t\t\t\tif (key === 37) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$prev.click();\n\t\t\t\t\t\t} else if (key === 39) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$next.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ($.isFunction($.fn.on)) {\n\t\t\t\t\t// For jQuery 1.7+\n\t\t\t\t\t$(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n\t\t\t\t} else {\n\t\t\t\t\t// For jQuery 1.3.x -> 1.6.x\n\t\t\t\t\t// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n\t\t\t\t\t// This is not here for jQuery 1.9, it's here for legacy users.\n\t\t\t\t\t$('.'+boxElement).live('click.'+prefix, clickHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function addBindings() {\n\t\tfunction clickHandler(e) {\n\t\t\t// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n\t\t\t// See: http://jacklmoore.com/notes/click-events/\n\t\t\tif (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlaunch(this);\n\t\t\t}\n\t\t}\n\n\t\tif ($box) {\n\t\t\tif (!init) {\n\t\t\t\tinit = true;\n\n\t\t\t\t// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n\t\t\t\t$next.click(function () {\n\t\t\t\t\tpublicMethod.next();\n\t\t\t\t});\n\t\t\t\t$prev.click(function () {\n\t\t\t\t\tpublicMethod.prev();\n\t\t\t\t});\n\t\t\t\t$close.click(function () {\n\t\t\t\t\tpublicMethod.close();\n\t\t\t\t});\n\t\t\t\t$overlay.click(function () {\n\t\t\t\t\tif (settings.get('overlayClose')) {\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Key Bindings\n\t\t\t\t$(document).bind('keydown.' + prefix, function (e) {\n\t\t\t\t\tvar key = e.keyCode;\n\t\t\t\t\tif (open && settings.get('escKey') && key === 27) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t\tif (open && settings.get('arrowKey') && $related[1] && !e.altKey) {\n\t\t\t\t\t\tif (key === 37) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$prev.click();\n\t\t\t\t\t\t} else if (key === 39) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$next.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ($.isFunction($.fn.on)) {\n\t\t\t\t\t// For jQuery 1.7+\n\t\t\t\t\t$(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n\t\t\t\t} else {\n\t\t\t\t\t// For jQuery 1.3.x -> 1.6.x\n\t\t\t\t\t// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n\t\t\t\t\t// This is not here for jQuery 1.9, it's here for legacy users.\n\t\t\t\t\t$('.'+boxElement).live('click.'+prefix, clickHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function addBindings() {\n\t\tfunction clickHandler(e) {\n\t\t\t// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n\t\t\t// See: http://jacklmoore.com/notes/click-events/\n\t\t\tif (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlaunch(this);\n\t\t\t}\n\t\t}\n\n\t\tif ($box) {\n\t\t\tif (!init) {\n\t\t\t\tinit = true;\n\n\t\t\t\t// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n\t\t\t\t$next.click(function () {\n\t\t\t\t\tpublicMethod.next();\n\t\t\t\t});\n\t\t\t\t$prev.click(function () {\n\t\t\t\t\tpublicMethod.prev();\n\t\t\t\t});\n\t\t\t\t$close.click(function () {\n\t\t\t\t\tpublicMethod.close();\n\t\t\t\t});\n\t\t\t\t$overlay.click(function () {\n\t\t\t\t\tif (settings.overlayClose) {\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Key Bindings\n\t\t\t\t$(document).bind('keydown.' + prefix, function (e) {\n\t\t\t\t\tvar key = e.keyCode;\n\t\t\t\t\tif (open && settings.escKey && key === 27) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tpublicMethod.close();\n\t\t\t\t\t}\n\t\t\t\t\tif (open && settings.arrowKey && $related[1] && !e.altKey) {\n\t\t\t\t\t\tif (key === 37) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$prev.click();\n\t\t\t\t\t\t} else if (key === 39) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$next.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif ($.isFunction($.fn.on)) {\n\t\t\t\t\t// For jQuery 1.7+\n\t\t\t\t\t$(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n\t\t\t\t} else {\n\t\t\t\t\t// For jQuery 1.3.x -> 1.6.x\n\t\t\t\t\t// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n\t\t\t\t\t// This is not here for jQuery 1.9, it's here for legacy users.\n\t\t\t\t\t$('.'+boxElement).live('click.'+prefix, clickHandler);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "addEventHandlers() {\n\n\t\tthis.elementConfig.addButton.on(\"click\",this.handleAdd);\n\t\tthis.elementConfig.cancelButton.on(\"click\",this.handleCancel);\n\t\tthis.elementConfig.retrieveButton.on(\"click\",this.retrieveData);\n\n\n\t}", "addEditor() {\n // Create new editor\n this.editor = $(`\n <div id=\"${this.id}-Editor\" class=\"editCell\">\n <div class=\"editHeader\">\n <p class=\"editHeaderTitle\">${this.id} Editor</p>\n </div>\n <div class=\"editOptionTable\">\n </div>\n </div>\n `);\n propertyEditor.append(this.editor[0]);\n\n // When working within an editor hilight the relevant shape\n this.editor.on(\"mouseenter\", () => {\n this.hover = true;\n canvas.redrawCanvas();\n });\n this.editor.on(\"mouseleave\", () => {\n this.hover = false;\n canvas.redrawCanvas();\n });\n\n // Add button for deleting a shape off of the canvas\n $(`<button class=\"editHeaderButton\">Delete Shape</button>`)\n .on(\"click\", () => canvas.removeShape(this))\n .appendTo(`div#${this.id}-Editor .editHeader`);\n\n // Fill the editor with options relevant to the shape\n this.refillOptions();\n }", "function addBindings() {\n function clickHandler(e) {\n // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.\n // See: http://jacklmoore.com/notes/click-events/\n if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n launch(this);\n }\n }\n\n if ($box) {\n if (!init) {\n init = true;\n\n // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.\n $next.click(function () {\n publicMethod.next();\n });\n $prev.click(function () {\n publicMethod.prev();\n });\n $close.click(function () {\n publicMethod.close();\n });\n $overlay.click(function () {\n if (settings.get('overlayClose')) {\n publicMethod.close();\n }\n });\n\n // Key Bindings\n $(document).bind('keydown.' + prefix, function (e) {\n var key = e.keyCode;\n if (open && settings.get('escKey') && key === 27) {\n e.preventDefault();\n publicMethod.close();\n }\n if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {\n if (key === 37) {\n e.preventDefault();\n $prev.click();\n } else if (key === 39) {\n e.preventDefault();\n $next.click();\n }\n }\n });\n\n if ($.isFunction($.fn.on)) {\n // For jQuery 1.7+\n $(document).on('click.'+prefix, '.'+boxElement, clickHandler);\n } else {\n // For jQuery 1.3.x -> 1.6.x\n // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.\n // This is not here for jQuery 1.9, it's here for legacy users.\n $('.'+boxElement).live('click.'+prefix, clickHandler);\n }\n }\n return true;\n }\n return false;\n }", "function addCollectionMethod (methodName) {\n var method = Node.prototype[methodName];\n Collection.prototype[methodName] = function () {\n var result = new Collection();\n if (!this.length) {\n return result;\n }\n var args = Array.prototype.slice.apply(arguments);\n for (var i=0; i<this.length; i++) {\n var value = method.apply(this[i], args);\n if (value instanceof Collection) {\n result.push.apply(result, value);\n } else {\n result.push(value);\n }\n }\n return result;\n }\n }", "addMethod(structure) {\r\n return this.addMethods([structure])[0];\r\n }", "function WrappedOperation (operation, meta) {\n this.wrapped = operation;\n this.meta = meta;\n }", "function WrappedOperation (operation, meta) {\n this.wrapped = operation;\n this.meta = meta;\n }", "_addMethod(name, method, namespace, isNamespaceEnd) {\n\n let methodHandler = function () {\n var args = Array.prototype.slice.call(arguments)\n\n this.chain((next)=> {\n args.push(next)\n method.apply(this, args)\n })\n\n if (isNamespaceEnd || !namespace) {\n return this\n } else {\n return this[namespace]\n }\n\n }\n\n if (!namespace) {\n this[name] = methodHandler.bind(this)\n } else {\n if (!has(this, namespace)) this[namespace] = {}\n this[namespace][name] = methodHandler.bind(this)\n }\n\n return this\n }", "function addItem(method, ...args) {\n if (method == 'dropdown') {\n genDropDown(...args);\n } else if (method == 'shortinput') {\n genShortInput(...args);\n } else if (method == 'checkbox') {\n genCheckbox(...args);\n } else if (method == 'separator') {\n genSeparator(...args);\n }\n}", "function replaceEditor() {\r\n\t\treturn function () {\r\n\t\t\tvar editorInstance = CKEDITOR.replace(element, configObj);\r\n\t\t\tself.setEditorInstance(editorInstance);\r\n\t\t\t//See if we need to set the editor to mixed mode\r\n\t\t\teditorInstance.on('instanceReady', function () {\r\n\t\t\t\t//Perform any cleanup once the editor has been created.\r\n\t\t\t\tself.postEditorCleanup();\r\n\t\t\t\t//If we instantiated CKEditor on top of mixed content.. the editor alters content\r\n\t\t\t\t//We have to reset the content\r\n\t\t\t\t//Set the ddfreetext areas to be editable and apply css classes to top and bottom\r\n\t\t\t\tif (self.hasMixedContent()) {\r\n\t\t\t\t\teditorInstance.setData(self.getDocumentationContent());\r\n\t\t\t\t\tvar $freetextAreas = $(editorInstance.editable().$).find('.ddfreetext');\r\n\t\t\t\t\t$freetextAreas.attr('contenteditable', 'true');\r\n\t\t\t\t\teditorInstance.saveEditorSnapshot();\r\n\t\t\t\t\tself.enableMixedContent();\r\n\t\t\t\t\t$(editorInstance.editable().$).attr(\"ddactive\", true);\r\n\t\t\t\t\teditorInstance.fire('updateStructuredContent');\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tself.injectFreeTextElement();\r\n\t\t\t\t}\r\n\t\t\t\tif (self.isEmrEnabled()){\r\n\t\t\t\t\tself.updateEMRContent();\r\n\t\t\t\t}\r\n\t\t\t\t//After we have made all these changes, make sure to reset the undo stack. (undoing immediately could\r\n\t\t\t\t//cause severe DOM corruption).\r\n\t\t\t\teditorInstance.resetUndo();\r\n\t\t\t\t//Ensure that undo can properly go back to current state\r\n\t\t\t\tvar cernundo = editorInstance.plugins.cernundo;\r\n\t\t\t\tcernundo.handleBaseSnapshot(editorInstance);\r\n\t\t\t\t//If structure is enabled, enable the header toggle. The toggle was disabled until the editor instance\r\n\t\t\t\t//was ready, at which point it is considered safe to switch views.\r\n\t\t\t\tif (self.getStructuredDocInd()) {\r\n\t\t\t\t\tself.enableHeaderToggle(DocumentationBaseComponent.VIEWS.STRUCTURE);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\teditorInstance.on('structureElementClicked', function(event) {\r\n\t\t\t\tif (event.data) {\r\n\t\t\t\t\tself.showStructuredView(event.data);\r\n\t\t\t\t\tself.captureNavigationTimer();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\teditorInstance.on('refreshStateChange', function(){\r\n\t\t\t\tif(editorInstance.refreshState === 'stable'){\r\n\t\t\t\t\tself.postEMRRefresh();\r\n\t\t\t\t}\r\n\t\t\t\t// Disable refreshing when refresh starts, enable after ending\r\n\t\t\t\tself.updateSaveButton();\r\n\t\t\t});\r\n\t\t\teditorInstance.on('refreshEmrFail', function(event) {\r\n\t\t\t\t//Display error message if emr refresh fails\r\n\t\t\t\tself.displayEMRError();\r\n\t\t\t});\r\n\t\t\teditorInstance.on('afterddremovesection', function(){\r\n\t\t\t\t//Update styling after removing sections\r\n\t\t\t\tself.handleEmptySections();\r\n\t\t\t});\r\n\r\n\t\t};\r\n\t}", "function addMethod(object, name, fn) {\r\n var old = object[ name ];\r\n object[ name ] = function () {\r\n if (fn.length === arguments.length)\r\n return fn.apply(this, arguments);\r\n else if (typeof old === 'function')\r\n return old.apply(this, arguments);\r\n };\r\n }", "function wrapmethods(sess) {\n var _reload = sess.reload\n var _save = sess.save;\n\n function reload(callback) {\n debug('reloading %s', this.id)\n // pass this and function that put wrapper to session\n _reload.call(this, function () {\n wrapmethods(req.session)\n callback.apply(this, arguments) // pass this and pass arguments\n })\n }\n\n function save() {\n debug('saving %s', this.id);\n savedHash = hash(this);\n _save.apply(this, arguments); // pass current this with arguments\n }\n // add property to current object, sess is object\n Object.defineProperty(sess, 'reload', {\n configurable: true,\n enumerable: false,\n value: reload, // reload is function define above\n writable: true\n })\n // add property save to object sess\n Object.defineProperty(sess, 'save', {\n configurable: true,\n enumerable: false,\n value: save, // save is function define above\n writable: true\n });\n } // function wrapmethods(sess) {", "insertMethods(index, structures) {\r\n return this._insertProperty(index, structures, () => this._context.structurePrinterFactory.forMethodDeclaration({ isAmbient: false }));\r\n }", "function createCodeModeModifierCtrl() {\n var codeModeModifier = {};\n \n // @interface\n codeModeModifier.update = function(modType, text) {\n var modTypeElt = codeModeModifier.get(modType);\n if (!modTypeElt) {\n _codeModeModifierDiv.insertAdjacentHTML(\n 'beforeend', '<span id=\"' + modType +'\"></span>');\n \n modTypeElt = codeModeModifier.get(modType);\n }\n // now the modType span is sure setup. Set the content; \n modTypeElt.innerText = text; \n }; // function update(..)\n \n // @interface\n codeModeModifier.remove = function(modType) {\n var modTypeElt = codeModeModifier.get(modType);\n if (modTypeElt) {\n modTypeElt.remove();\n }\n };\n \n // @interface\n codeModeModifier.get = function(modType) {\n return _codeModeModifierDiv.querySelector('#' + modType);\n } ;\n \n return codeModeModifier;\n } // function createCodeModeModifierCtrl(..)", "addEditorButton(callback) {\n this.addButton(EDIT_ICON, callback);\n }", "function add() {}", "_handleCustomOperations() {\n const that = this;\n\n that._filterOperationDescriptions = that._defaultFilterOperationDescriptions;\n\n for (let i = 0; i < that.customOperations.length; i++) {\n const operation = that.customOperations[i];\n\n that._filterOperationDescriptions.push({\n label: operation.label,\n value: operation.name,\n custom: true,\n index: i,\n editorTemplate: operation.editorTemplate,\n valueTemplate: operation.valueTemplate,\n handleValue: operation.handleValue\n });\n }\n }", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "function extendComponent(parent, methods) {\n for (var name_1 in methods) {\n if (methods.hasOwnProperty(name_1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parent[name_1] = (0,_appendFunction__WEBPACK_IMPORTED_MODULE_0__.appendFunction)(parent, parent[name_1], methods[name_1]);\n }\n }\n}", "function extendComponent(parent, methods) {\n for (var name_1 in methods) {\n if (methods.hasOwnProperty(name_1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parent[name_1] = (0,_appendFunction__WEBPACK_IMPORTED_MODULE_0__.appendFunction)(parent, parent[name_1], methods[name_1]);\n }\n }\n}", "_add () {\n throw new Error('not implemented')\n }", "function augmentComponent(Component, methods) {\n Object.keys(methods).forEach(function (name) {\n var method = methods[name];\n if (typeof method !== 'function') {\n return;\n }\n var currentMethod = Component.prototype[name];\n Component.prototype[name] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (typeof currentMethod === 'function') {\n currentMethod.call.apply(currentMethod, [this].concat(args));\n }\n method.call.apply(method, [this].concat(args));\n };\n });\n return Component;\n}", "function extendComponent(parent, methods) {\n for (var name_1 in methods) {\n if (methods.hasOwnProperty(name_1)) {\n // tslint:disable-next-line:no-any\n parent[name_1] = Object(_appendFunction__WEBPACK_IMPORTED_MODULE_0__[\"appendFunction\"])(parent, parent[name_1], methods[name_1]);\n }\n }\n}", "function augmentComponent(Component, methods) {\n Object.keys(methods).forEach(function (name) {\n var method = methods[name];\n\n if (typeof method !== 'function') {\n return;\n }\n\n var currentMethod = Component.prototype[name];\n\n Component.prototype[name] = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (typeof currentMethod === 'function') {\n currentMethod.call.apply(currentMethod, [this].concat(args));\n }\n\n method.call.apply(method, [this].concat(args));\n };\n });\n return Component;\n}", "function add() {\n // TODO: your code here\n}", "add () {\n }", "function methodOp(f) {\n\t\t return function() {\n\t\t if (this.curOp) { return f.apply(this, arguments) }\n\t\t startOperation(this);\n\t\t try { return f.apply(this, arguments) }\n\t\t finally { endOperation(this); }\n\t\t }\n\t\t }", "function addFunctions() {\n var divList = document.getElementsByClassName('cf_inplace')\n for (let i = 0; i < divList.length; i++) {\n //console.log(divList[i].children.length)\n for (let j = 0; j < divList[i].children.length; j++) {\n if(divList[i].children[j].tagName == \"IMG\") {\n divList[i].children[j].setAttribute('ondblclick', 'changeImage(this)')\n } else {\n divList[i].children[j].setAttribute('ondblclick', 'triggerChangeElement(this)')\n }\n }\n }\n\n for (let i = 0; i < divList.length; i++) {\n //console.log(\"add\")\n divList[i].appendChild(createEditButton(divList[i]))\n }\n}", "function methodOp(f) {\n\t\t return function() {\n\t\t if (this.curOp) return f.apply(this, arguments);\n\t\t startOperation(this);\n\t\t try { return f.apply(this, arguments); }\n\t\t finally { endOperation(this); }\n\t\t };\n\t\t }", "registerHooks() {\n this.addLocalHook('click', () => this.onClick());\n this.addLocalHook('keyup', event => this.onKeyup(event));\n }", "function addExtensionMethods() {\n var carrier = hub_1.getMainCarrier();\n if (carrier.__SENTRY__) {\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startSpan) {\n carrier.__SENTRY__.extensions.startSpan = startSpan;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n }\n}", "init() {\n module_utils.patchModule(\n 'openwhisk/lib/actions.js',\n 'invoke',\n openWhiskWrapper$1,\n actions => actions.prototype\n );\n }", "function wrapMethods (proto) {\n\t\tObject.keys(proto)\n\t\t\t.filter(function (prop) {\n\t\t\t\treturn typeof proto[prop] === 'function';\n\t\t\t})\n\t\t\t.forEach(function (method) {\n\t\t\t\tproto[method] = wrapFunction(proto[method]);\n\t\t\t});\n\t}", "_handleCustomOperations() {\n const that = this;\n\n that._filterOperationDescriptions = that._defaultFilterOperationDescriptions.slice(0);\n\n for (let i = 0; i < that.customOperations.length; i++) {\n const operation = that.customOperations[i];\n\n that._filterOperationDescriptions.push({\n label: operation.label,\n value: operation.name,\n custom: true,\n index: i,\n editorTemplate: operation.editorTemplate,\n valueTemplate: operation.valueTemplate,\n handleValue: operation.handleValue,\n hideValue: operation.hideValue\n });\n }\n }", "function Editor(el){\n\n // currentEl will hold the selected element\n this.currentEl = el;\n\n /* An example of a text editing method,\n ** will add text to selected element */\n this.text = function(text) {\n this.currentEl.textContent = text;\n return this;\n };\n\n /* An example of a style editing method,\n ** will updated style on selected element */\n this.css = function(property,value) {\n this.currentEl.style[property] = value;\n return this;\n };\n}", "function _registerHandlers(editor) {\n $(editor).on(\"keyEvent\", _cursorHandler);\n $(editor.document).one(\"change\", _handler);\n editor.document.addRef();\n }", "function createMethod() {\n person.display = function(){return this.name + \" \" + this.name;};\n country.display = function(){return this.country + \" \" + this.country;};\n}", "logic() {\n if (this.currentEditor != null) {\n this.currentEditor.logic();\n }\n }", "registerMethod(method) {\n for (var i in method) {\n var methodObj = method[i];\n if (methodObj.definition && typeof methodObj.definition == 'object' && methodObj.definition.script) {\n if (methodObj.dependency) {\n customMethods[methodObj.name] = new Function(\"obj\", \"callback\", methodObj.dependency, methodObj.definition.script);\n } else {\n customMethods[methodObj.name] = new Function(\"obj\", \"callback\", methodObj.definition.script);\n }\n }\n }\n }", "function MethodDefinition(node, print) {\n\t print.list(node.decorators, { separator: \"\" });\n\n\t if (node[\"static\"]) {\n\t this.push(\"static \");\n\t }\n\n\t this._method(node, print);\n\t}", "function MethodDefinition(node, print) {\n\t print.list(node.decorators, { separator: \"\" });\n\n\t if (node[\"static\"]) {\n\t this.push(\"static \");\n\t }\n\n\t this._method(node, print);\n\t}", "function DivsTool() {\n /* tool to add 'divs' */\n\n this.initialize = function(editor) {\n /* attach the event handlers */\n this.editor = editor;\n this.editor.logMessage(_(\"Div tool initialized\"));\n };\n\n\n this.createDiv = function(divclass) {\n /* create a div */\n var currnode = this.editor.getSelectedNode();\n var currp = this.editor.getNearestParentOfType(currnode, 'p');\n\n var doc = this.editor.getInnerDocument();\n var div = doc.createElement('div');\n div.id = \"createddiv_\" + (divids++);\n if (divclass) {\n div.className = divclass;\n };\n var selection = this.editor.getSelection();\n var fragment = selection ? selection.cloneContents() : undefined;\n if(fragment == undefined || fragment.firstChild == undefined || fragment.firstChild.nodeType == Node.TEXT_NODE) {\n var child = doc.createElement(\"p\");\n if (fragment != undefined) {\n child.appendChild(selection.cloneContents());\n }\n div.appendChild(child);\n if (child.childNodes.length == 0 || (child.childNodes.length == 1 && (child.firstChild.nodeValue == \"\" || child.firstChild.nodeValue == undefined))) {\n child.appendChild(doc.createTextNode(\".\"));\n }\n } else {\n div.appendChild(fragment);\n }\n\n //var ser = new XMLSerializer();\n //alert(\"inserting \" + ser.serializeToString(div));\n\n if (currp) {\n this.editor.logMessage(_(\"Found paragraph\"));\n currp.parentNode.insertBefore(div, currp);\n this.editor.insertNodeAtSelection(doc.createTextNode(\"\"), 1);\n } else {\n this.editor.logMessage(_(\"Didn't find paragraph\"));\n //alert(\"Inserting \" + div);\n div = this.editor.insertNodeAtSelection(div, 1);\n }\n\n this.editor.logMessage(_(\"Div inserted\"));\n this.editor.updateState();\n return div;\n };\n\n this.setDivClass = function(divclass) {\n /* set the class of the selected image */\n var currnode = this.editor.getSelectedNode();\n var currdiv = this.editor.getNearestParentOfType(currnode, 'div');\n if (currdiv) {\n currdiv.className = divclass;\n };\n };\n\n this.deleteDiv = function() {\n /* delete the current link */\n var currnode = this.editor.getSelectedNode();\n var linkel = this.editor.getNearestParentOfType(currnode, 'div');\n if (!linkel) {\n this.editor.logMessage(_('Not inside block'));\n return;\n };\n while (linkel.childNodes.length) {\n linkel.parentNode.insertBefore(linkel.childNodes[0], linkel);\n };\n linkel.parentNode.removeChild(linkel);\n\n this.editor.logMessage(_('Block removed'));\n this.editor.updateState();\n };\n\n this.createContextMenuElements = function(selNode, event) {\n /* create the 'Create link' or 'Remove link' menu elements */\n var ret = [];\n var link = this.editor.getNearestParentOfType(selNode, 'div');\n if (link) {\n ret.push(new ContextMenuElement(_('Delete block'), this.deleteDiv, this));\n }\n return ret;\n };\n\n}", "transform(editor, op) {\n editor.children = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"a\" /* createDraft */])(editor.children);\n var selection = editor.selection && Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"a\" /* createDraft */])(editor.selection);\n\n switch (op.type) {\n case 'insert_node':\n {\n var {\n path,\n node\n } = op;\n var parent = Node.parent(editor, path);\n var index = path[path.length - 1];\n parent.children.splice(index, 0, node);\n\n if (selection) {\n for (var [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op);\n }\n }\n\n break;\n }\n\n case 'insert_text':\n {\n var {\n path: _path,\n offset,\n text\n } = op;\n\n var _node = Node.leaf(editor, _path);\n\n var before = _node.text.slice(0, offset);\n\n var after = _node.text.slice(offset);\n\n _node.text = before + text + after;\n\n if (selection) {\n for (var [_point, _key] of Range.points(selection)) {\n selection[_key] = Point.transform(_point, op);\n }\n }\n\n break;\n }\n\n case 'merge_node':\n {\n var {\n path: _path2\n } = op;\n\n var _node2 = Node.get(editor, _path2);\n\n var prevPath = Path.previous(_path2);\n var prev = Node.get(editor, prevPath);\n\n var _parent = Node.parent(editor, _path2);\n\n var _index = _path2[_path2.length - 1];\n\n if (Text.isText(_node2) && Text.isText(prev)) {\n prev.text += _node2.text;\n } else if (!Text.isText(_node2) && !Text.isText(prev)) {\n prev.children.push(..._node2.children);\n } else {\n throw new Error(\"Cannot apply a \\\"merge_node\\\" operation at path [\".concat(_path2, \"] to nodes of different interaces: \").concat(_node2, \" \").concat(prev));\n }\n\n _parent.children.splice(_index, 1);\n\n if (selection) {\n for (var [_point2, _key2] of Range.points(selection)) {\n selection[_key2] = Point.transform(_point2, op);\n }\n }\n\n break;\n }\n\n case 'move_node':\n {\n var {\n path: _path3,\n newPath\n } = op;\n\n if (Path.isAncestor(_path3, newPath)) {\n throw new Error(\"Cannot move a path [\".concat(_path3, \"] to new path [\").concat(newPath, \"] because the destination is inside itself.\"));\n }\n\n var _node3 = Node.get(editor, _path3);\n\n var _parent2 = Node.parent(editor, _path3);\n\n var _index2 = _path3[_path3.length - 1]; // This is tricky, but since the `path` and `newPath` both refer to\n // the same snapshot in time, there's a mismatch. After either\n // removing the original position, the second step's path can be out\n // of date. So instead of using the `op.newPath` directly, we\n // transform `op.path` to ascertain what the `newPath` would be after\n // the operation was applied.\n\n _parent2.children.splice(_index2, 1);\n\n var truePath = Path.transform(_path3, op);\n var newParent = Node.get(editor, Path.parent(truePath));\n var newIndex = truePath[truePath.length - 1];\n newParent.children.splice(newIndex, 0, _node3);\n\n if (selection) {\n for (var [_point3, _key3] of Range.points(selection)) {\n selection[_key3] = Point.transform(_point3, op);\n }\n }\n\n break;\n }\n\n case 'remove_node':\n {\n var {\n path: _path4\n } = op;\n var _index3 = _path4[_path4.length - 1];\n\n var _parent3 = Node.parent(editor, _path4);\n\n _parent3.children.splice(_index3, 1); // Transform all of the points in the value, but if the point was in the\n // node that was removed we need to update the range or remove it.\n\n\n if (selection) {\n for (var [_point4, _key4] of Range.points(selection)) {\n var result = Point.transform(_point4, op);\n\n if (selection != null && result != null) {\n selection[_key4] = result;\n } else {\n var _prev = void 0;\n\n var next = void 0;\n\n for (var [n, p] of Node.texts(editor)) {\n if (Path.compare(p, _path4) === -1) {\n _prev = [n, p];\n } else {\n next = [n, p];\n break;\n }\n }\n\n if (_prev) {\n _point4.path = _prev[1];\n _point4.offset = _prev[0].text.length;\n } else if (next) {\n _point4.path = next[1];\n _point4.offset = 0;\n } else {\n selection = null;\n }\n }\n }\n }\n\n break;\n }\n\n case 'remove_text':\n {\n var {\n path: _path5,\n offset: _offset,\n text: _text\n } = op;\n\n var _node4 = Node.leaf(editor, _path5);\n\n var _before = _node4.text.slice(0, _offset);\n\n var _after = _node4.text.slice(_offset + _text.length);\n\n _node4.text = _before + _after;\n\n if (selection) {\n for (var [_point5, _key5] of Range.points(selection)) {\n selection[_key5] = Point.transform(_point5, op);\n }\n }\n\n break;\n }\n\n case 'set_node':\n {\n var {\n path: _path6,\n newProperties\n } = op;\n\n if (_path6.length === 0) {\n throw new Error(\"Cannot set properties on the root node!\");\n }\n\n var _node5 = Node.get(editor, _path6);\n\n for (var _key6 in newProperties) {\n if (_key6 === 'children' || _key6 === 'text') {\n throw new Error(\"Cannot set the \\\"\".concat(_key6, \"\\\" property of nodes!\"));\n }\n\n var value = newProperties[_key6];\n\n if (value == null) {\n delete _node5[_key6];\n } else {\n _node5[_key6] = value;\n }\n }\n\n break;\n }\n\n case 'set_selection':\n {\n var {\n newProperties: _newProperties\n } = op;\n\n if (_newProperties == null) {\n selection = _newProperties;\n } else if (selection == null) {\n if (!Range.isRange(_newProperties)) {\n throw new Error(\"Cannot apply an incomplete \\\"set_selection\\\" operation properties \".concat(JSON.stringify(_newProperties), \" when there is no current selection.\"));\n }\n\n selection = _newProperties;\n } else {\n Object.assign(selection, _newProperties);\n }\n\n break;\n }\n\n case 'split_node':\n {\n var {\n path: _path7,\n position,\n properties\n } = op;\n\n if (_path7.length === 0) {\n throw new Error(\"Cannot apply a \\\"split_node\\\" operation at path [\".concat(_path7, \"] because the root node cannot be split.\"));\n }\n\n var _node6 = Node.get(editor, _path7);\n\n var _parent4 = Node.parent(editor, _path7);\n\n var _index4 = _path7[_path7.length - 1];\n var newNode;\n\n if (Text.isText(_node6)) {\n var _before2 = _node6.text.slice(0, position);\n\n var _after2 = _node6.text.slice(position);\n\n _node6.text = _before2;\n newNode = _objectSpread$5({}, _node6, {}, properties, {\n text: _after2\n });\n } else {\n var _before3 = _node6.children.slice(0, position);\n\n var _after3 = _node6.children.slice(position);\n\n _node6.children = _before3;\n newNode = _objectSpread$5({}, _node6, {}, properties, {\n children: _after3\n });\n }\n\n _parent4.children.splice(_index4 + 1, 0, newNode);\n\n if (selection) {\n for (var [_point6, _key7] of Range.points(selection)) {\n selection[_key7] = Point.transform(_point6, op);\n }\n }\n\n break;\n }\n }\n\n editor.children = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"b\" /* finishDraft */])(editor.children);\n\n if (selection) {\n editor.selection = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"c\" /* isDraft */])(selection) ? Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"b\" /* finishDraft */])(selection) : selection;\n } else {\n editor.selection = null;\n }\n }", "function Editor() { }", "function Editor() { }", "function IExposeCommandsEx() {}", "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "onCreated() {\n\t\tlet brackets = null,\n\t\t\tDocumentManager = null,\n\t\t\tdoc = null;\n\t\tthis.classList.add('closet-instant-editor');\n\t\t$(document.body).append(this);\n\t\tbrackets = utils.checkGlobalContext('brackets');\n\t\tDocumentManager = brackets.getModule('document/DocumentManager');\n\t\tdoc = DocumentManager.createUntitledDocument(1, '.html');\n\t\tthis._textEditor = new TextEditor(doc, false, this.$el);\n\t\tthis._$textEditorEl = this._textEditor.$el;\n\n\t\tthis._$textEditorEl.addClass('closet-instant-editor-item');\n\t\tthis._$textEditorEl.attr('tabindex', 0);\n\n\t\tthis._currentGrammar = null;\n\t\tthis._targetModel = null;\n\n\t\tthis._opened = false;\n\t\tthis._bindEvent();\n\t}", "function TableOperations(editor){this.editor=editor;var cfg=editor.config;var tt=TableOperations.I18N;var bl=TableOperations.btnList;var self=this;var toolbar=[\"linebreak\"];for(var i=0;i<bl.length;++i){var btn=bl[i];if(!btn){toolbar.push(\"separator\");}else{var id=\"TO-\"+btn[0];cfg.registerButton(id,tt[id],editor.imgURL(btn[0]+\".gif\",\"TableOperations\"),false,function(editor,id){self.buttonPress(editor,id);},btn[1]);toolbar.push(id);}}cfg.toolbar.push(toolbar);}", "function addExtensionMethods() {\n\t _addTracingExtensions();\n\n\t // Detect and automatically load specified integrations.\n\t if (isNodeEnv()) {\n\t _autoloadDatabaseIntegrations();\n\t }\n\n\t // If an error happens globally, we should make sure transaction status is set to error.\n\t registerErrorInstrumentation();\n\t}", "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "init() {\n Nova.$on(`ckeditor:media:${this.attribute}:write`, this.writeContent.bind(this))\n this.ui.componentFactory.add('mediaBrowser', this.createButton.bind(this))\n }", "addCommands() {\n this.disposables.add(atom.commands.add('atom-workspace', {\n 'project-viewer-plus:open-editor': () => {\n this.openEditor();\n },\n 'project-viewer-plus:read-file': async () => {\n const content = await this.readFile();\n console.log(content);\n _state2.default.initializeState(content, true);\n },\n 'project-viewer-plus:read-legacy-file': async () => {\n const content = await this.readLegacyFile();\n _state2.default.initializeState((0, _legacy.transformLegacyContent)(content.root), true);\n },\n 'project-viewer-plus:toggle-visibility': () => this.toggleMainVisibility(),\n 'project-viewer-plus:toggle-focus': () => this.toggleMainFocus(),\n 'project-viewer-plus:toggle-list': () => this.toggleSelectList()\n }), atom.commands.add(this.mainContainer.element, {\n 'core:move-up': function () {\n console.log('core:move-up');\n },\n 'core:move-down': function () {\n console.log('core:move-down');\n },\n 'core:move-left': function () {\n console.log('core:move-left');\n },\n 'core:move-right': function () {\n console.log('core:move-right');\n },\n 'core:confirm': function () {\n console.log('core:confirm');\n }\n }), atom.workspace.getLeftDock().onDidStopChangingActivePaneItem(item => console.log('left', item)), atom.workspace.getRightDock().onDidStopChangingActivePaneItem(item => console.log('right', item)), atom.config.onDidChange(`${_base.PLUGIN_NAME}.dock.position`, () => {\n this.mainContainer.destroyMainItem();\n this.addItemToDock();\n this.mainContainer.update();\n }));\n }", "transform(editor, op) {\n editor.children = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"a\" /* createDraft */])(editor.children);\n var selection = editor.selection && Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"a\" /* createDraft */])(editor.selection);\n\n switch (op.type) {\n case 'insert_node':\n {\n var {\n path,\n node\n } = op;\n var parent = Node.parent(editor, path);\n var index = path[path.length - 1];\n parent.children.splice(index, 0, node);\n\n if (selection) {\n for (var [point, key] of Range.points(selection)) {\n selection[key] = Point.transform(point, op);\n }\n }\n\n break;\n }\n\n case 'insert_text':\n {\n var {\n path: _path,\n offset,\n text\n } = op;\n\n var _node2 = Node.leaf(editor, _path);\n\n var before = _node2.text.slice(0, offset);\n\n var after = _node2.text.slice(offset);\n\n _node2.text = before + text + after;\n\n if (selection) {\n for (var [_point, _key] of Range.points(selection)) {\n selection[_key] = Point.transform(_point, op);\n }\n }\n\n break;\n }\n\n case 'merge_node':\n {\n var {\n path: _path2\n } = op;\n\n var _node3 = Node.get(editor, _path2);\n\n var prevPath = Path.previous(_path2);\n var prev = Node.get(editor, prevPath);\n\n var _parent = Node.parent(editor, _path2);\n\n var _index = _path2[_path2.length - 1];\n\n if (Text.isText(_node3) && Text.isText(prev)) {\n prev.text += _node3.text;\n } else if (!Text.isText(_node3) && !Text.isText(prev)) {\n prev.children.push(..._node3.children);\n } else {\n throw new Error(\"Cannot apply a \\\"merge_node\\\" operation at path [\".concat(_path2, \"] to nodes of different interaces: \").concat(_node3, \" \").concat(prev));\n }\n\n _parent.children.splice(_index, 1);\n\n if (selection) {\n for (var [_point2, _key2] of Range.points(selection)) {\n selection[_key2] = Point.transform(_point2, op);\n }\n }\n\n break;\n }\n\n case 'move_node':\n {\n var {\n path: _path3,\n newPath\n } = op;\n\n if (Path.isAncestor(_path3, newPath)) {\n throw new Error(\"Cannot move a path [\".concat(_path3, \"] to new path [\").concat(newPath, \"] because the destination is inside itself.\"));\n }\n\n var _node4 = Node.get(editor, _path3);\n\n var _parent2 = Node.parent(editor, _path3);\n\n var _index2 = _path3[_path3.length - 1]; // This is tricky, but since the `path` and `newPath` both refer to\n // the same snapshot in time, there's a mismatch. After either\n // removing the original position, the second step's path can be out\n // of date. So instead of using the `op.newPath` directly, we\n // transform `op.path` to ascertain what the `newPath` would be after\n // the operation was applied.\n\n _parent2.children.splice(_index2, 1);\n\n var truePath = Path.transform(_path3, op);\n var newParent = Node.get(editor, Path.parent(truePath));\n var newIndex = truePath[truePath.length - 1];\n newParent.children.splice(newIndex, 0, _node4);\n\n if (selection) {\n for (var [_point3, _key3] of Range.points(selection)) {\n selection[_key3] = Point.transform(_point3, op);\n }\n }\n\n break;\n }\n\n case 'remove_node':\n {\n var {\n path: _path4\n } = op;\n var _index3 = _path4[_path4.length - 1];\n\n var _parent3 = Node.parent(editor, _path4);\n\n _parent3.children.splice(_index3, 1); // Transform all of the points in the value, but if the point was in the\n // node that was removed we need to update the range or remove it.\n\n\n if (selection) {\n for (var [_point4, _key4] of Range.points(selection)) {\n var result = Point.transform(_point4, op);\n\n if (selection != null && result != null) {\n selection[_key4] = result;\n } else {\n var _prev = void 0;\n\n var next = void 0;\n\n for (var [n, p] of Node.texts(editor)) {\n if (Path.compare(p, _path4) === -1) {\n _prev = [n, p];\n } else {\n next = [n, p];\n break;\n }\n }\n\n if (_prev) {\n _point4.path = _prev[1];\n _point4.offset = _prev[0].text.length;\n } else if (next) {\n _point4.path = next[1];\n _point4.offset = 0;\n } else {\n selection = null;\n }\n }\n }\n }\n\n break;\n }\n\n case 'remove_text':\n {\n var {\n path: _path5,\n offset: _offset,\n text: _text2\n } = op;\n\n var _node5 = Node.leaf(editor, _path5);\n\n var _before = _node5.text.slice(0, _offset);\n\n var _after = _node5.text.slice(_offset + _text2.length);\n\n _node5.text = _before + _after;\n\n if (selection) {\n for (var [_point5, _key5] of Range.points(selection)) {\n selection[_key5] = Point.transform(_point5, op);\n }\n }\n\n break;\n }\n\n case 'set_node':\n {\n var {\n path: _path6,\n newProperties\n } = op;\n\n if (_path6.length === 0) {\n throw new Error(\"Cannot set properties on the root node!\");\n }\n\n var _node6 = Node.get(editor, _path6);\n\n for (var _key6 in newProperties) {\n if (_key6 === 'children' || _key6 === 'text') {\n throw new Error(\"Cannot set the \\\"\".concat(_key6, \"\\\" property of nodes!\"));\n }\n\n var value = newProperties[_key6];\n\n if (value == null) {\n delete _node6[_key6];\n } else {\n _node6[_key6] = value;\n }\n }\n\n break;\n }\n\n case 'set_selection':\n {\n var {\n newProperties: _newProperties\n } = op;\n\n if (_newProperties == null) {\n selection = _newProperties;\n } else if (selection == null) {\n if (!Range.isRange(_newProperties)) {\n throw new Error(\"Cannot apply an incomplete \\\"set_selection\\\" operation properties \".concat(JSON.stringify(_newProperties), \" when there is no current selection.\"));\n }\n\n selection = _newProperties;\n } else {\n Object.assign(selection, _newProperties);\n }\n\n break;\n }\n\n case 'split_node':\n {\n var {\n path: _path7,\n position,\n properties\n } = op;\n\n if (_path7.length === 0) {\n throw new Error(\"Cannot apply a \\\"split_node\\\" operation at path [\".concat(_path7, \"] because the root node cannot be split.\"));\n }\n\n var _node7 = Node.get(editor, _path7);\n\n var _parent4 = Node.parent(editor, _path7);\n\n var _index4 = _path7[_path7.length - 1];\n var newNode;\n\n if (Text.isText(_node7)) {\n var _before2 = _node7.text.slice(0, position);\n\n var _after2 = _node7.text.slice(position);\n\n _node7.text = _before2;\n newNode = _objectSpread({}, _node7, {}, properties, {\n text: _after2\n });\n } else {\n var _before3 = _node7.children.slice(0, position);\n\n var _after3 = _node7.children.slice(position);\n\n _node7.children = _before3;\n newNode = _objectSpread({}, _node7, {}, properties, {\n children: _after3\n });\n }\n\n _parent4.children.splice(_index4 + 1, 0, newNode);\n\n if (selection) {\n for (var [_point6, _key7] of Range.points(selection)) {\n selection[_key7] = Point.transform(_point6, op);\n }\n }\n\n break;\n }\n }\n\n editor.children = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"b\" /* finishDraft */])(editor.children);\n\n if (selection) {\n editor.selection = Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"c\" /* isDraft */])(selection) ? Object(__WEBPACK_IMPORTED_MODULE_1_immer__[\"b\" /* finishDraft */])(selection) : selection;\n } else {\n editor.selection = null;\n }\n }", "addSampleCommands() {\n this.addCommand(new sampleCommands.MagicEightBallCommand());\n this.addCommand(new sampleCommands.RollCommand());\n }" ]
[ "0.6234695", "0.61433893", "0.61433893", "0.611974", "0.611974", "0.611974", "0.611974", "0.611974", "0.611974", "0.611974", "0.611974", "0.611974", "0.61185527", "0.61185527", "0.61185527", "0.61185527", "0.61185527", "0.61185527", "0.6086015", "0.6070089", "0.6070089", "0.6021026", "0.5791874", "0.57329035", "0.5712957", "0.56805795", "0.55839705", "0.5483215", "0.54447424", "0.54447424", "0.54447424", "0.54447424", "0.54240865", "0.53494173", "0.53489476", "0.530795", "0.52888787", "0.52888787", "0.52888787", "0.52888787", "0.52574766", "0.5254361", "0.5243294", "0.5238688", "0.52183264", "0.5211491", "0.52081114", "0.52081114", "0.5194899", "0.51672435", "0.5166494", "0.51287913", "0.512648", "0.5109391", "0.5107265", "0.51040584", "0.50945735", "0.509114", "0.5088548", "0.5086233", "0.5086233", "0.5078821", "0.5077838", "0.50746256", "0.5065136", "0.5055779", "0.504645", "0.50419056", "0.50403935", "0.50169516", "0.50153756", "0.5001137", "0.49890563", "0.49847698", "0.4975806", "0.4971289", "0.4964433", "0.4955086", "0.49546105", "0.49306318", "0.4922469", "0.4922469", "0.4916031", "0.49131465", "0.49044892", "0.49044892", "0.49019256", "0.49007672", "0.49007672", "0.49007672", "0.48915935", "0.48915738", "0.48853168", "0.48832634", "0.48832634", "0.48807698", "0.48807698", "0.48798376", "0.48793688", "0.48768845", "0.4873648" ]
0.0
-1
Updates the display.view data structure for a given change to the document. From and to are in prechange coordinates. Lendiff is the amount of lines added or subtracted by the change. This is used for changes that span multiple lines, or change the way lines are divided into visual lines. regLineChange (below) registers singleline changes.
function regChange(cm, from, to, lendiff) { if (from == null) { from = cm.doc.first; } if (to == null) { to = cm.doc.first + cm.doc.size; } if (!lendiff) { lendiff = 0; } var display = cm.display; if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) { display.updateLineNumbers = from; } cm.curOp.viewChanged = true; if (from >= display.viewTo) { // Change after if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) { resetView(cm); } } else if (to <= display.viewFrom) { // Change before if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { resetView(cm); } else { display.viewFrom += lendiff; display.viewTo += lendiff; } } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap resetView(cm); } else if (from <= display.viewFrom) { // Top overlap var cut = viewCuttingPoint(cm, to, to + lendiff, 1); if (cut) { display.view = display.view.slice(cut.index); display.viewFrom = cut.lineN; display.viewTo += lendiff; } else { resetView(cm); } } else if (to >= display.viewTo) { // Bottom overlap var cut$1 = viewCuttingPoint(cm, from, from, -1); if (cut$1) { display.view = display.view.slice(0, cut$1.index); display.viewTo = cut$1.lineN; } else { resetView(cm); } } else { // Gap in the middle var cutTop = viewCuttingPoint(cm, from, from, -1); var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); if (cutTop && cutBot) { display.view = display.view.slice(0, cutTop.index) .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) .concat(display.view.slice(cutBot.index)); display.viewTo += lendiff; } else { resetView(cm); } } var ext = display.externalMeasured; if (ext) { if (to < ext.lineN) { ext.lineN += lendiff; } else if (from < ext.lineN + ext.size) { display.externalMeasured = null; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regChange(cm, from, to, lendiff) {\n if (from == null) {\n from = cm.doc.first;\n }\n\n if (to == null) {\n to = cm.doc.first + cm.doc.size;\n }\n\n if (!lendiff) {\n lendiff = 0;\n }\n\n var display = cm.display;\n\n if (lendiff && to < display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers > from)) {\n display.updateLineNumbers = from;\n }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) {\n // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) {\n resetView(cm);\n }\n } else if (to <= display.viewFrom) {\n // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) {\n // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) {\n // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) {\n // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else {\n // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index).concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)).concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n\n if (ext) {\n if (to < ext.lineN) {\n ext.lineN += lendiff;\n } else if (from < ext.lineN + ext.size) {\n display.externalMeasured = null;\n }\n }\n } // Register a change to a single line. Type must be one of \"text\",", "function regChange(cm, from, to, lendiff) {\n\t if (from == null) from = cm.doc.first;\n\t if (to == null) to = cm.doc.first + cm.doc.size;\n\t if (!lendiff) lendiff = 0;\n\t\n\t var display = cm.display;\n\t if (lendiff && to < display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers > from))\n\t display.updateLineNumbers = from;\n\t\n\t cm.curOp.viewChanged = true;\n\t\n\t if (from >= display.viewTo) { // Change after\n\t if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n\t resetView(cm);\n\t } else if (to <= display.viewFrom) { // Change before\n\t if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n\t resetView(cm);\n\t } else {\n\t display.viewFrom += lendiff;\n\t display.viewTo += lendiff;\n\t }\n\t } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n\t resetView(cm);\n\t } else if (from <= display.viewFrom) { // Top overlap\n\t var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cut) {\n\t display.view = display.view.slice(cut.index);\n\t display.viewFrom = cut.lineN;\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else if (to >= display.viewTo) { // Bottom overlap\n\t var cut = viewCuttingPoint(cm, from, from, -1);\n\t if (cut) {\n\t display.view = display.view.slice(0, cut.index);\n\t display.viewTo = cut.lineN;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else { // Gap in the middle\n\t var cutTop = viewCuttingPoint(cm, from, from, -1);\n\t var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cutTop && cutBot) {\n\t display.view = display.view.slice(0, cutTop.index)\n\t .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n\t .concat(display.view.slice(cutBot.index));\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t }\n\t\n\t var ext = display.externalMeasured;\n\t if (ext) {\n\t if (to < ext.lineN)\n\t ext.lineN += lendiff;\n\t else if (from < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\t }\n\t }", "function regChange(cm, from, to, lendiff) {\n\t if (from == null) from = cm.doc.first;\n\t if (to == null) to = cm.doc.first + cm.doc.size;\n\t if (!lendiff) lendiff = 0;\n\n\t var display = cm.display;\n\t if (lendiff && to < display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers > from))\n\t display.updateLineNumbers = from;\n\n\t cm.curOp.viewChanged = true;\n\n\t if (from >= display.viewTo) { // Change after\n\t if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n\t resetView(cm);\n\t } else if (to <= display.viewFrom) { // Change before\n\t if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n\t resetView(cm);\n\t } else {\n\t display.viewFrom += lendiff;\n\t display.viewTo += lendiff;\n\t }\n\t } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n\t resetView(cm);\n\t } else if (from <= display.viewFrom) { // Top overlap\n\t var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cut) {\n\t display.view = display.view.slice(cut.index);\n\t display.viewFrom = cut.lineN;\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else if (to >= display.viewTo) { // Bottom overlap\n\t var cut = viewCuttingPoint(cm, from, from, -1);\n\t if (cut) {\n\t display.view = display.view.slice(0, cut.index);\n\t display.viewTo = cut.lineN;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else { // Gap in the middle\n\t var cutTop = viewCuttingPoint(cm, from, from, -1);\n\t var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cutTop && cutBot) {\n\t display.view = display.view.slice(0, cutTop.index)\n\t .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n\t .concat(display.view.slice(cutBot.index));\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t }\n\n\t var ext = display.externalMeasured;\n\t if (ext) {\n\t if (to < ext.lineN)\n\t ext.lineN += lendiff;\n\t else if (from < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\t }\n\t }", "function regChange(cm, from, to, lendiff) {\n\t if (from == null) from = cm.doc.first;\n\t if (to == null) to = cm.doc.first + cm.doc.size;\n\t if (!lendiff) lendiff = 0;\n\n\t var display = cm.display;\n\t if (lendiff && to < display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers > from))\n\t display.updateLineNumbers = from;\n\n\t cm.curOp.viewChanged = true;\n\n\t if (from >= display.viewTo) { // Change after\n\t if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n\t resetView(cm);\n\t } else if (to <= display.viewFrom) { // Change before\n\t if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n\t resetView(cm);\n\t } else {\n\t display.viewFrom += lendiff;\n\t display.viewTo += lendiff;\n\t }\n\t } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n\t resetView(cm);\n\t } else if (from <= display.viewFrom) { // Top overlap\n\t var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cut) {\n\t display.view = display.view.slice(cut.index);\n\t display.viewFrom = cut.lineN;\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else if (to >= display.viewTo) { // Bottom overlap\n\t var cut = viewCuttingPoint(cm, from, from, -1);\n\t if (cut) {\n\t display.view = display.view.slice(0, cut.index);\n\t display.viewTo = cut.lineN;\n\t } else {\n\t resetView(cm);\n\t }\n\t } else { // Gap in the middle\n\t var cutTop = viewCuttingPoint(cm, from, from, -1);\n\t var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t if (cutTop && cutBot) {\n\t display.view = display.view.slice(0, cutTop.index)\n\t .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n\t .concat(display.view.slice(cutBot.index));\n\t display.viewTo += lendiff;\n\t } else {\n\t resetView(cm);\n\t }\n\t }\n\n\t var ext = display.externalMeasured;\n\t if (ext) {\n\t if (to < ext.lineN)\n\t ext.lineN += lendiff;\n\t else if (from < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\t }\n\t }", "function regChange(cm, from, to, lendiff) {\r\n if (from == null) from = cm.doc.first;\r\n if (to == null) to = cm.doc.first + cm.doc.size;\r\n if (!lendiff) lendiff = 0;\r\n\r\n var display = cm.display;\r\n if (lendiff && to < display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\r\n display.updateLineNumbers = from;\r\n\r\n cm.curOp.viewChanged = true;\r\n\r\n if (from >= display.viewTo) { // Change after\r\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\r\n resetView(cm);\r\n } else if (to <= display.viewFrom) { // Change before\r\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\r\n resetView(cm);\r\n } else {\r\n display.viewFrom += lendiff;\r\n display.viewTo += lendiff;\r\n }\r\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\r\n resetView(cm);\r\n } else if (from <= display.viewFrom) { // Top overlap\r\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\r\n if (cut) {\r\n display.view = display.view.slice(cut.index);\r\n display.viewFrom = cut.lineN;\r\n display.viewTo += lendiff;\r\n } else {\r\n resetView(cm);\r\n }\r\n } else if (to >= display.viewTo) { // Bottom overlap\r\n var cut = viewCuttingPoint(cm, from, from, -1);\r\n if (cut) {\r\n display.view = display.view.slice(0, cut.index);\r\n display.viewTo = cut.lineN;\r\n } else {\r\n resetView(cm);\r\n }\r\n } else { // Gap in the middle\r\n var cutTop = viewCuttingPoint(cm, from, from, -1);\r\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\r\n if (cutTop && cutBot) {\r\n display.view = display.view.slice(0, cutTop.index)\r\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\r\n .concat(display.view.slice(cutBot.index));\r\n display.viewTo += lendiff;\r\n } else {\r\n resetView(cm);\r\n }\r\n }\r\n\r\n var ext = display.externalMeasured;\r\n if (ext) {\r\n if (to < ext.lineN)\r\n ext.lineN += lendiff;\r\n else if (from < ext.lineN + ext.size)\r\n display.externalMeasured = null;\r\n }\r\n }", "function regChange(cm, from, to, lendiff) {\n\t\t if (from == null) from = cm.doc.first;\n\t\t if (to == null) to = cm.doc.first + cm.doc.size;\n\t\t if (!lendiff) lendiff = 0;\n\t\t\n\t\t var display = cm.display;\n\t\t if (lendiff && to < display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers > from))\n\t\t display.updateLineNumbers = from;\n\t\t\n\t\t cm.curOp.viewChanged = true;\n\t\t\n\t\t if (from >= display.viewTo) { // Change after\n\t\t if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n\t\t resetView(cm);\n\t\t } else if (to <= display.viewFrom) { // Change before\n\t\t if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n\t\t resetView(cm);\n\t\t } else {\n\t\t display.viewFrom += lendiff;\n\t\t display.viewTo += lendiff;\n\t\t }\n\t\t } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n\t\t resetView(cm);\n\t\t } else if (from <= display.viewFrom) { // Top overlap\n\t\t var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t\t if (cut) {\n\t\t display.view = display.view.slice(cut.index);\n\t\t display.viewFrom = cut.lineN;\n\t\t display.viewTo += lendiff;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t } else if (to >= display.viewTo) { // Bottom overlap\n\t\t var cut = viewCuttingPoint(cm, from, from, -1);\n\t\t if (cut) {\n\t\t display.view = display.view.slice(0, cut.index);\n\t\t display.viewTo = cut.lineN;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t } else { // Gap in the middle\n\t\t var cutTop = viewCuttingPoint(cm, from, from, -1);\n\t\t var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t\t if (cutTop && cutBot) {\n\t\t display.view = display.view.slice(0, cutTop.index)\n\t\t .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n\t\t .concat(display.view.slice(cutBot.index));\n\t\t display.viewTo += lendiff;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t }\n\t\t\n\t\t var ext = display.externalMeasured;\n\t\t if (ext) {\n\t\t if (to < ext.lineN)\n\t\t ext.lineN += lendiff;\n\t\t else if (from < ext.lineN + ext.size)\n\t\t display.externalMeasured = null;\n\t\t }\n\t\t }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n if (from == null) from = cm.doc.first;\n if (to == null) to = cm.doc.first + cm.doc.size;\n if (!lendiff) lendiff = 0;\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n display.updateLineNumbers = from;\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n resetView(cm);\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut = viewCuttingPoint(cm, from, from, -1);\n if (cut) {\n display.view = display.view.slice(0, cut.index);\n display.viewTo = cut.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n ext.lineN += lendiff;\n else if (from < ext.lineN + ext.size)\n display.externalMeasured = null;\n }\n }", "function regChange(cm, from, to, lendiff) {\n\t\t if (from == null) { from = cm.doc.first; }\n\t\t if (to == null) { to = cm.doc.first + cm.doc.size; }\n\t\t if (!lendiff) { lendiff = 0; }\n\n\t\t var display = cm.display;\n\t\t if (lendiff && to < display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers > from))\n\t\t { display.updateLineNumbers = from; }\n\n\t\t cm.curOp.viewChanged = true;\n\n\t\t if (from >= display.viewTo) { // Change after\n\t\t if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n\t\t { resetView(cm); }\n\t\t } else if (to <= display.viewFrom) { // Change before\n\t\t if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n\t\t resetView(cm);\n\t\t } else {\n\t\t display.viewFrom += lendiff;\n\t\t display.viewTo += lendiff;\n\t\t }\n\t\t } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n\t\t resetView(cm);\n\t\t } else if (from <= display.viewFrom) { // Top overlap\n\t\t var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t\t if (cut) {\n\t\t display.view = display.view.slice(cut.index);\n\t\t display.viewFrom = cut.lineN;\n\t\t display.viewTo += lendiff;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t } else if (to >= display.viewTo) { // Bottom overlap\n\t\t var cut$1 = viewCuttingPoint(cm, from, from, -1);\n\t\t if (cut$1) {\n\t\t display.view = display.view.slice(0, cut$1.index);\n\t\t display.viewTo = cut$1.lineN;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t } else { // Gap in the middle\n\t\t var cutTop = viewCuttingPoint(cm, from, from, -1);\n\t\t var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n\t\t if (cutTop && cutBot) {\n\t\t display.view = display.view.slice(0, cutTop.index)\n\t\t .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n\t\t .concat(display.view.slice(cutBot.index));\n\t\t display.viewTo += lendiff;\n\t\t } else {\n\t\t resetView(cm);\n\t\t }\n\t\t }\n\n\t\t var ext = display.externalMeasured;\n\t\t if (ext) {\n\t\t if (to < ext.lineN)\n\t\t { ext.lineN += lendiff; }\n\t\t else if (from < ext.lineN + ext.size)\n\t\t { display.externalMeasured = null; }\n\t\t }\n\t\t }", "function regChange(cm, from, to, lendiff) {\r\n if (from == null) { from = cm.doc.first; }\r\n if (to == null) { to = cm.doc.first + cm.doc.size; }\r\n if (!lendiff) { lendiff = 0; }\r\n\r\n var display = cm.display;\r\n if (lendiff && to < display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\r\n { display.updateLineNumbers = from; }\r\n\r\n cm.curOp.viewChanged = true;\r\n\r\n if (from >= display.viewTo) { // Change after\r\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\r\n { resetView(cm); }\r\n } else if (to <= display.viewFrom) { // Change before\r\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\r\n resetView(cm);\r\n } else {\r\n display.viewFrom += lendiff;\r\n display.viewTo += lendiff;\r\n }\r\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\r\n resetView(cm);\r\n } else if (from <= display.viewFrom) { // Top overlap\r\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\r\n if (cut) {\r\n display.view = display.view.slice(cut.index);\r\n display.viewFrom = cut.lineN;\r\n display.viewTo += lendiff;\r\n } else {\r\n resetView(cm);\r\n }\r\n } else if (to >= display.viewTo) { // Bottom overlap\r\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\r\n if (cut$1) {\r\n display.view = display.view.slice(0, cut$1.index);\r\n display.viewTo = cut$1.lineN;\r\n } else {\r\n resetView(cm);\r\n }\r\n } else { // Gap in the middle\r\n var cutTop = viewCuttingPoint(cm, from, from, -1);\r\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\r\n if (cutTop && cutBot) {\r\n display.view = display.view.slice(0, cutTop.index)\r\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\r\n .concat(display.view.slice(cutBot.index));\r\n display.viewTo += lendiff;\r\n } else {\r\n resetView(cm);\r\n }\r\n }\r\n\r\n var ext = display.externalMeasured;\r\n if (ext) {\r\n if (to < ext.lineN)\r\n { ext.lineN += lendiff; }\r\n else if (from < ext.lineN + ext.size)\r\n { display.externalMeasured = null; }\r\n }\r\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cut) {\n display.view = display.view.slice(cut.index)\n display.viewFrom = cut.lineN\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1)\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index)\n display.viewTo = cut$1.lineN\n } else {\n resetView(cm)\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1)\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index))\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n }\n\n var ext = display.externalMeasured\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null }\n }\n}", "function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first }\n if (to == null) { to = cm.doc.first + cm.doc.size }\n if (!lendiff) { lendiff = 0 }\n\n var display = cm.display\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from }\n\n cm.curOp.viewChanged = true\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm) }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm)\n } else {\n display.viewFrom += lendiff\n display.viewTo += lendiff\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm)\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cut) {\n display.view = display.view.slice(cut.index)\n display.viewFrom = cut.lineN\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1)\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index)\n display.viewTo = cut$1.lineN\n } else {\n resetView(cm)\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1)\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index))\n display.viewTo += lendiff\n } else {\n resetView(cm)\n }\n }\n\n var ext = display.externalMeasured\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null }\n }\n}", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart})\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n updateGutter();\n }\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart})\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n updateGutter();\n }\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart});\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n if (to - pos != domEnd - domPos) gutterDirty = true;\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n }\n if (different || gutterDirty) updateGutter();\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") { updateLineText(cm, lineView); }\n\t\t else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n\t\t else if (type == \"class\") { updateLineClasses(cm, lineView); }\n\t\t else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n\t\t }\n\t\t lineView.changes = null;\n\t\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") updateLineText(cm, lineView);\n\t\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t\t else if (type == \"class\") updateLineClasses(lineView);\n\t\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t\t }\n\t\t lineView.changes = null;\n\t\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t for (var j = 0; j < lineView.changes.length; j++) {\n\t var type = lineView.changes[j];\n\t if (type == \"text\") updateLineText(cm, lineView);\n\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t else if (type == \"class\") updateLineClasses(lineView);\n\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t }\n\t lineView.changes = null;\n\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\r\n for (var j = 0; j < lineView.changes.length; j++) {\r\n var type = lineView.changes[j];\r\n if (type == \"text\") updateLineText(cm, lineView);\r\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\r\n else if (type == \"class\") updateLineClasses(lineView);\r\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\r\n }\r\n lineView.changes = null;\r\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n\n if (type == \"text\") {\n updateLineText(cm, lineView);\n } else if (type == \"gutter\") {\n updateLineGutter(cm, lineView, lineN, dims);\n } else if (type == \"class\") {\n updateLineClasses(cm, lineView);\n } else if (type == \"widget\") {\n updateLineWidgets(cm, lineView, dims);\n }\n }\n\n lineView.changes = null;\n } // Lines with gutter elements, widgets or a background class need to", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(cm, lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\r\n for (var j = 0; j < lineView.changes.length; j++) {\r\n var type = lineView.changes[j];\r\n if (type == \"text\") { updateLineText(cm, lineView); }\r\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\r\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\r\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\r\n }\r\n lineView.changes = null;\r\n}", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t display.externalMeasured = null;\n\t\t\n\t\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) return;\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) arr.push(type);\n\t\t }", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t { display.externalMeasured = null; }\n\n\t\t if (line < display.viewFrom || line >= display.viewTo) { return }\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) { return }\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) { arr.push(type); }\n\t\t }", "function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\r\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\r\n function update(line, text, spans) {\r\n updateLine(line, text, spans, estimateHeight$$1);\r\n signalLater(line, \"change\", line, change);\r\n }\r\n function linesFor(start, end) {\r\n var result = [];\r\n for (var i = start; i < end; ++i)\r\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\r\n return result\r\n }\r\n\r\n var from = change.from, to = change.to, text = change.text;\r\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\r\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\r\n\r\n // Adjust the line structure\r\n if (change.full) {\r\n doc.insert(0, linesFor(0, text.length));\r\n doc.remove(text.length, doc.size - text.length);\r\n } else if (isWholeLineUpdate(doc, change)) {\r\n // This is a whole-line replace. Treated specially to make\r\n // sure line objects move the way they are supposed to.\r\n var added = linesFor(0, text.length - 1);\r\n update(lastLine, lastLine.text, lastSpans);\r\n if (nlines) { doc.remove(from.line, nlines); }\r\n if (added.length) { doc.insert(from.line, added); }\r\n } else if (firstLine == lastLine) {\r\n if (text.length == 1) {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\r\n } else {\r\n var added$1 = linesFor(1, text.length - 1);\r\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\r\n doc.insert(from.line + 1, added$1);\r\n }\r\n } else if (text.length == 1) {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\r\n doc.remove(from.line + 1, nlines);\r\n } else {\r\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\r\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\r\n var added$2 = linesFor(1, text.length - 1);\r\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\r\n doc.insert(from.line + 1, added$2);\r\n }\r\n\r\n signalLater(doc, \"change\", doc, change);\r\n}", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\t\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }" ]
[ "0.7041917", "0.70200956", "0.7002636", "0.7002636", "0.6970039", "0.6949149", "0.6944299", "0.6944299", "0.6944299", "0.6944299", "0.6944299", "0.6944299", "0.6944299", "0.6944299", "0.69192004", "0.6917124", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6862251", "0.6849632", "0.6849632", "0.66903925", "0.66903925", "0.66903836", "0.65971005", "0.6592595", "0.658283", "0.658283", "0.658283", "0.65077937", "0.65077937", "0.65077937", "0.65077937", "0.65077937", "0.65077937", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.64985406", "0.6495687", "0.6495687", "0.64936554", "0.6467422", "0.64310634", "0.64308363", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6392689", "0.6383231", "0.61842954", "0.617465", "0.6158833", "0.61354023", "0.61080253", "0.61080253" ]
0.6954716
21
Register a change to a single line. Type must be one of "text", "gutter", "class", "widget"
function regLineChange(cm, line, type) { cm.curOp.viewChanged = true; var display = cm.display, ext = cm.display.externalMeasured; if (ext && line >= ext.lineN && line < ext.lineN + ext.size) { display.externalMeasured = null; } if (line < display.viewFrom || line >= display.viewTo) { return } var lineView = display.view[findViewIndex(cm, line)]; if (lineView.node == null) { return } var arr = lineView.changes || (lineView.changes = []); if (indexOf(arr, type) == -1) { arr.push(type); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LineChange (type, text) {\n this.type = type // ADDED, REMOVED, UNMODIFIED\n this.text = text\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true\n var display = cm.display, ext = cm.display.externalMeasured\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)]\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = [])\n if (indexOf(arr, type) == -1) { arr.push(type) }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true\n var display = cm.display, ext = cm.display.externalMeasured\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)]\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = [])\n if (indexOf(arr, type) == -1) { arr.push(type) }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n}", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n display.externalMeasured = null;\n\n if (line < display.viewFrom || line >= display.viewTo) return;\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) return;\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) arr.push(type);\n }", "function regLineChange(cm, line, type) {\r\n cm.curOp.viewChanged = true;\r\n var display = cm.display, ext = cm.display.externalMeasured;\r\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\r\n { display.externalMeasured = null; }\r\n\r\n if (line < display.viewFrom || line >= display.viewTo) { return }\r\n var lineView = display.view[findViewIndex(cm, line)];\r\n if (lineView.node == null) { return }\r\n var arr = lineView.changes || (lineView.changes = []);\r\n if (indexOf(arr, type) == -1) { arr.push(type); }\r\n}", "function regLineChange(cm, line, type) {\r\n cm.curOp.viewChanged = true;\r\n var display = cm.display, ext = cm.display.externalMeasured;\r\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\r\n display.externalMeasured = null;\r\n\r\n if (line < display.viewFrom || line >= display.viewTo) return;\r\n var lineView = display.view[findViewIndex(cm, line)];\r\n if (lineView.node == null) return;\r\n var arr = lineView.changes || (lineView.changes = []);\r\n if (indexOf(arr, type) == -1) arr.push(type);\r\n }", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t { display.externalMeasured = null; }\n\n\t\t if (line < display.viewFrom || line >= display.viewTo) { return }\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) { return }\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) { arr.push(type); }\n\t\t }", "function regLineChange(cm, line, type) {\n\t\t cm.curOp.viewChanged = true;\n\t\t var display = cm.display, ext = cm.display.externalMeasured;\n\t\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t\t display.externalMeasured = null;\n\t\t\n\t\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t\t var lineView = display.view[findViewIndex(cm, line)];\n\t\t if (lineView.node == null) return;\n\t\t var arr = lineView.changes || (lineView.changes = []);\n\t\t if (indexOf(arr, type) == -1) arr.push(type);\n\t\t }", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }", "function regLineChange(cm, line, type) {\n\t cm.curOp.viewChanged = true;\n\t var display = cm.display, ext = cm.display.externalMeasured;\n\t if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n\t display.externalMeasured = null;\n\t\n\t if (line < display.viewFrom || line >= display.viewTo) return;\n\t var lineView = display.view[findViewIndex(cm, line)];\n\t if (lineView.node == null) return;\n\t var arr = lineView.changes || (lineView.changes = []);\n\t if (indexOf(arr, type) == -1) arr.push(type);\n\t }", "function onChangeLine(txt) {\n changeCurrMeme('line-txt', txt);\n renderCanvas();\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n\n if (type == \"text\") {\n updateLineText(cm, lineView);\n } else if (type == \"gutter\") {\n updateLineGutter(cm, lineView, lineN, dims);\n } else if (type == \"class\") {\n updateLineClasses(cm, lineView);\n } else if (type == \"widget\") {\n updateLineWidgets(cm, lineView, dims);\n }\n }\n\n lineView.changes = null;\n } // Lines with gutter elements, widgets or a background class need to", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)) }\n else { no = lineNo(handle) }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)) }\n else { no = lineNo(handle) }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n}", "function changeLine(doc, handle, changeType, op) {\r\n var no = handle, line = handle;\r\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\r\n else { no = lineNo(handle); }\r\n if (no == null) { return null }\r\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\r\n return line\r\n}", "function onAddLine() {\n createNewLine('');\n renderLineBoxs()\n}", "function changeLine(doc, handle, changeType, op) {\r\n var no = handle, line = handle;\r\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\r\n else no = lineNo(handle);\r\n if (no == null) return null;\r\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\r\n return line;\r\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n else no = lineNo(handle);\n if (no == null) return null;\n if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n return line;\n }", "function changeLine(doc, handle, changeType, op) {\n\t\t var no = handle, line = handle;\n\t\t if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n\t\t else { no = lineNo(handle); }\n\t\t if (no == null) { return null }\n\t\t if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n\t\t return line\n\t\t }", "function changeLine(doc, handle, changeType, op) {\n\t\t var no = handle, line = handle;\n\t\t if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n\t\t else no = lineNo(handle);\n\t\t if (no == null) return null;\n\t\t if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n\t\t return line;\n\t\t }", "function addLineClassToWraps(change) {\n var view = change.view;\n change.eachLine(function (info) {\n info.handles.all.forEach(function (handle) {\n view.addLineClass(handle, 'wrap', 'line');\n });\n });\n }", "function changeLine(doc, handle, changeType, op) {\n\t var no = handle, line = handle;\n\t if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n\t else no = lineNo(handle);\n\t if (no == null) return null;\n\t if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n\t return line;\n\t }", "function changeLine(doc, handle, changeType, op) {\n\t var no = handle, line = handle;\n\t if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n\t else no = lineNo(handle);\n\t if (no == null) return null;\n\t if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n\t return line;\n\t }", "function changeLine(doc, handle, changeType, op) {\n\t var no = handle, line = handle;\n\t if (typeof handle == \"number\") line = getLine(doc, clipLine(doc, handle));\n\t else no = lineNo(handle);\n\t if (no == null) return null;\n\t if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);\n\t return line;\n\t }", "function changeLine(doc, handle, changeType, op) {\n var no = handle,\n line = handle;\n\n if (typeof handle == \"number\") {\n line = getLine(doc, clipLine(doc, handle));\n } else {\n no = lineNo(handle);\n }\n\n if (no == null) {\n return null;\n }\n\n if (op(line, no) && doc.cm) {\n regLineChange(doc.cm, no, changeType);\n }\n\n return line;\n } // The document is represented as a BTree consisting of leaves, with", "function addComment(type, content, line) {\n this.addComments(type, [{\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content\n }]);\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(cm, lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j]\n if (type == \"text\") { updateLineText(cm, lineView) }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims) }\n else if (type == \"class\") { updateLineClasses(lineView) }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims) }\n }\n lineView.changes = null\n}", "function updateLineForChanges(cm, lineView, lineN, dims) {\n\t\t for (var j = 0; j < lineView.changes.length; j++) {\n\t\t var type = lineView.changes[j];\n\t\t if (type == \"text\") updateLineText(cm, lineView);\n\t\t else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n\t\t else if (type == \"class\") updateLineClasses(lineView);\n\t\t else if (type == \"widget\") updateLineWidgets(cm, lineView, dims);\n\t\t }\n\t\t lineView.changes = null;\n\t\t }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }", "function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") updateLineText(cm, lineView);\n else if (type == \"gutter\") updateLineGutter(cm, lineView, lineN, dims);\n else if (type == \"class\") updateLineClasses(lineView);\n else if (type == \"widget\") updateLineWidgets(lineView, dims);\n }\n lineView.changes = null;\n }" ]
[ "0.7580951", "0.71199375", "0.71199375", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.71013796", "0.70958996", "0.70958996", "0.70958996", "0.70958996", "0.70958996", "0.70958996", "0.70958996", "0.70958996", "0.70712984", "0.7067088", "0.70649636", "0.70489526", "0.70458823", "0.70458823", "0.70300514", "0.63837934", "0.6239712", "0.6217194", "0.6217194", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.6216417", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.61930937", "0.6190536", "0.6183602", "0.61552256", "0.615314", "0.615314", "0.615314", "0.615314", "0.615314", "0.615314", "0.615314", "0.61423707", "0.6120471", "0.6109254", "0.6107206", "0.6107206", "0.6107206", "0.60769546", "0.60508317", "0.60354143", "0.60319376", "0.6027703", "0.6025332", "0.6025332" ]
0.70882684
33
Force the view to cover a given range, adding empty view element or clipping off existing ones as needed.
function adjustView(cm, from, to) { var display = cm.display, view = display.view; if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { display.view = buildViewArray(cm, from, to); display.viewFrom = from; } else { if (display.viewFrom > from) { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } else if (display.viewFrom < from) { display.view = display.view.slice(findViewIndex(cm, from)); } display.viewFrom = from; if (display.viewTo < to) { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } else if (display.viewTo > to) { display.view = display.view.slice(0, findViewIndex(cm, to)); } } display.viewTo = to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(viewOf, qmin, qmax) {\n super(viewOf, (field, colLabel, colSchema, colData, df) =>\n _clipAnnoMatrix(field, colLabel, colSchema, colData, df, qmin, qmax)\n );\n this.isClipped = true;\n this.clipRange = [qmin, qmax];\n Object.seal(this);\n }", "setRenderedRange(range) {\n if (!rangesEqual(this._renderedRange, range)) {\n if (this.appendOnly) {\n range = {\n start: 0,\n end: Math.max(this._renderedRange.end, range.end)\n };\n }\n\n this._renderedRangeSubject.next(this._renderedRange = range);\n\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }", "function ensureVisibleEventRange(range) {\n\t\tvar allDay;\n\n\t\tif (!range.end) {\n\n\t\t\tallDay = range.allDay; // range might be more event-ish than we think\n\t\t\tif (allDay == null) {\n\t\t\t\tallDay = !range.start.hasTime();\n\t\t\t}\n\n\t\t\trange = $.extend({}, range); // make a copy, copying over other misc properties\n\t\t\trange.end = t.getDefaultEventEnd(allDay, range.start);\n\t\t}\n\t\treturn range;\n\t}", "SetRange() {\n\n }", "static forRange(view, className, range) {\n if (range.empty) {\n let pos = view.coordsAtPos(range.head, range.assoc || 1);\n if (!pos)\n return [];\n let base = getBase(view);\n return [new RectangleMarker(className, pos.left - base.left, pos.top - base.top, null, pos.bottom - pos.top)];\n }\n else {\n return rectanglesForRange(view, className, range);\n }\n }", "function setBounds() {\n let el = angular.element(canvas);\n\n //set initial style\n if ( scope.options.layout.height === \"inherit\" ) {\n let viewHeight = view.getHeight();\n el.css(\"height\", `${viewHeight}px`);\n el.attr(\"height\", `${viewHeight * view.scale}px`);\n } else {\n el.css(\"height\", `${scope.options.layout.height}px`);\n el.attr(\"height\", `${scope.options.layout.height * view.scale}px`);\n }\n //set initial style\n if ( scope.options.layout.width === \"inherit\" ) {\n let viewWidth = view.getWidth();\n el.css(\"width\", `${viewWidth}px`);\n el.attr(\"width\", `${viewWidth * view.scale}px`);\n } else {\n el.css(\"width\", `${scope.options.layout.width}px`);\n el.attr(\"width\", `${scope.options.layout.width * view.scale}px`);\n }\n }", "_setRangeDebouced() {\n var range;\n if(this.orientation === 'vertical') {\n var h = Math.max(this._height, 0);\n range = [h, 0];\n\n } else {\n var w = Math.max(this._width, 0);\n range = [0, w];\n }\n\n this._scale.range(range);\n\n // force a recalc\n this._scaleChanged = !this._scaleChanged;\n }", "function ensureVisibleEventRange(range) {\n var allDay;\n\n if (!range.end) {\n\n allDay = range.allDay; // range might be more event-ish than we think\n if (allDay == null) {\n allDay = !range.start.hasTime();\n }\n\n range = $.extend({}, range); // make a copy, copying over other misc properties\n range.end = t.getDefaultEventEnd(allDay, range.start);\n }\n return range;\n }", "constructor() {\n super();\n this.offset = -10;\n this.fitToVisibleBounds = true;\n }", "viewFull() {\n this.designSheet.visibleRect = this.designSheet.getFBPBoundingRect();\n this.onViewChange();\n }", "function prepareRanges($scope) {\n if (!$scope.hideCustomRange && $scope.ranges[$scope.ranges.length - 1].range !== CUSTOM)\n $scope.ranges.push({ label: 'Custom Range', range: CUSTOM });\n\n $scope.resetRangeClass();\n\n if (!$scope.hideCustomRange && $scope.ranges[$scope.ranges.length - 1].active)\n $scope.showCalendars = true;\n }", "function testRangeHighlightForZeroSizeSlider() {\n // Make sure range highlight spans whole slider before zeroing width.\n twoThumbSlider.setExtent(100);\n twoThumbSlider.getElement().style.width = 0;\n\n // The setVisible call is used to force a UI update.\n twoThumbSlider.setVisible(true);\n assertEquals(\n 'Range highlight size should be 0 when slider size is 0', 0,\n goog.dom.getElement('rangeHighlight').offsetWidth);\n}", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "function updateRangeSelection() {\n\td3.selectAll('#details div.range').style('display', function() {\n\t\treturn (d3.select(this).classed(sn.runtime.energyBarOverlapParameters.aggregate.toLowerCase()) ? 'block' : 'none');\n\t});\n}", "function supportRangeBounds() {\n var r, testElement, rangeBounds, rangeHeight, support = false;\n\n if (doc.createRange) {\n r = doc.createRange();\n if (r.getBoundingClientRect) {\n testElement = doc.createElement('boundtest');\n testElement.style.height = \"123px\";\n testElement.style.display = \"block\";\n doc.body.appendChild(testElement);\n\n r.selectNode(testElement);\n rangeBounds = r.getBoundingClientRect();\n rangeHeight = rangeBounds.height;\n\n if (rangeHeight === 123) {\n support = true;\n }\n doc.body.removeChild(testElement);\n }\n }\n\n return support;\n }", "function supportRangeBounds() {\n var r, testElement, rangeBounds, rangeHeight, support = false;\n\n if (doc.createRange) {\n r = doc.createRange();\n if (r.getBoundingClientRect) {\n testElement = doc.createElement('boundtest');\n testElement.style.height = \"123px\";\n testElement.style.display = \"block\";\n doc.body.appendChild(testElement);\n\n r.selectNode(testElement);\n rangeBounds = r.getBoundingClientRect();\n rangeHeight = rangeBounds.height;\n\n if (rangeHeight === 123) {\n support = true;\n }\n doc.body.removeChild(testElement);\n }\n }\n\n return support;\n }", "function supportRangeBounds() {\r\n var r, testElement, rangeBounds, rangeHeight, support = false;\r\n\r\n if (doc.createRange) {\r\n r = doc.createRange();\r\n if (r.getBoundingClientRect) {\r\n testElement = doc.createElement('boundtest');\r\n testElement.style.height = \"123px\";\r\n testElement.style.display = \"block\";\r\n doc.body.appendChild(testElement);\r\n\r\n r.selectNode(testElement);\r\n rangeBounds = r.getBoundingClientRect();\r\n rangeHeight = rangeBounds.height;\r\n\r\n if (rangeHeight === 123) {\r\n support = true;\r\n }\r\n doc.body.removeChild(testElement);\r\n }\r\n }\r\n\r\n return support;\r\n }", "function supportRangeBounds() {\r\n var r, testElement, rangeBounds, rangeHeight, support = false;\r\n\r\n if (doc.createRange) {\r\n r = doc.createRange();\r\n if (r.getBoundingClientRect) {\r\n testElement = doc.createElement('boundtest');\r\n testElement.style.height = \"123px\";\r\n testElement.style.display = \"block\";\r\n doc.body.appendChild(testElement);\r\n\r\n r.selectNode(testElement);\r\n rangeBounds = r.getBoundingClientRect();\r\n rangeHeight = rangeBounds.height;\r\n\r\n if (rangeHeight === 123) {\r\n support = true;\r\n }\r\n doc.body.removeChild(testElement);\r\n }\r\n }\r\n\r\n return support;\r\n }", "setRenderedRange(range) {\n if (!rangesEqual(this._renderedRange, range)) {\n this._renderedRangeSubject.next(this._renderedRange = range);\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }", "setRenderedRange(range) {\n if (!rangesEqual(this._renderedRange, range)) {\n this._renderedRangeSubject.next(this._renderedRange = range);\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }", "add(range) {\n return new SubRange(\n Math.min(this.low, range.low),\n Math.max(this.high, range.high)\n );\n }", "addDefaultRange() {\n this.addRange(this.defaultMin, this.defaultMax, this.defaultDups);\n }", "function keepInBounds(el){\n if(el.x + el.w >= canvas.width){\n el.x = canvas.width - el.w;\n }\n else if(el.x <= 0){\n el.x = 0;\n }\n if(el.y >= canvas.height - el.h){\n el.y = canvas.height - el.h;\n }\n else if(el.y <= 0){\n el.y = 0;\n }\n }", "_calculateBounds() {\n // FILL IN//\n }", "set bounds(value) {}", "touchesRange(from, to = from) {\n for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {\n let len = this.sections[i++], ins = this.sections[i++], end = pos + len;\n if (ins >= 0 && pos <= to && end >= from)\n return pos < from && end > to ? \"cover\" : true;\n pos = end;\n }\n return false;\n }", "set range(range) {\n this.topDate = range.topDate;\n this.bottomDate = range.bottomDate;\n this.refresh();\n }", "set localBounds(value) {}", "function updateRangeSelection() {\n\td3.selectAll('#details div.range').style('display', function() {\n\t\treturn (d3.select(this).classed(sn.runtime.powerIOAreaParameters.aggregate.toLowerCase()) ? 'block' : 'none');\n\t});\n}", "updateRange(start, end) {\n this.range.start = start\n this.range.end = end\n this.range.paddingTop = this.getPaddingTop()\n this.range.paddingBottom = this.getPaddingBottom()\n this.callUpdate(this.getRange())\n }", "extendToCover(min, max) {\r\n let x = this.min;\r\n while (min < x) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, -this.interval, this.unit);\r\n this.sequence.splice(0, 0, x);\r\n }\r\n this.min = x;\r\n x = this.max;\r\n while (x < max) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, this.interval, this.unit);\r\n this.sequence.push(x);\r\n }\r\n this.max = x;\r\n }", "function drawBounds() {\n noFill();\n stroke(75, 75, 75, 10);\n box(bounds.x, bounds.y, bounds.z)\n}", "add(range) {\n return new SubRange(Math.min((this || _global).low, range.low), Math.max((this || _global).high, range.high));\n }", "function Range() {\n\tthis._value = 0;\n\tthis._minimum = 0;\n\tthis._maximum = 100;\n\tthis._extent = 0;\n\t\n\tthis._isChanging = false;\n}", "set outerBounds(bounds) {\n this.floatingBounds = bounds;\n }", "function coverWin() {\n noStroke();\n fill(130, 206, 245);\n rect(0,0,190,85);\n}", "add(range) {\n this.list.push(range);\n this.addRangeToList();\n }", "setBounds() {\n let x = this.position.getX();\n let y = this.position.getY();\n let s = Game.Settings().UnitSize;\n let hs = s / 2;\n\n //generate Individual Bounds\n this.bounds = new Bounds(x - hs, y - hs, x + hs, y + hs);\n }", "RemoveRange() {\n\n }", "function createCoverNamedRange() {\n var d = DocumentApp.getActiveDocument();\n var rangeBuilder = d.newRange();\n var body = d.getBody();\n var startElem = body.findText(\"No\\.\").getElement();\n var endElem = body.findText(\"www.lookingglass.legal\").getElement();\n rangeBuilder.addElementsBetween(startElem, endElem);\n d.addNamedRange(\"cover\", rangeBuilder);\n}", "constrainTo(_rect) {\n if (this.x < _rect.left) {\n this.x = _rect.left;\n }\n if (this.y < _rect.top) {\n this.y = _rect.top;\n }\n if (this.x > _rect.right) {\n this.x = _rect.right;\n }\n if (this.y > _rect.bottom) {\n this.y = _rect.bottom;\n }\n return this;\n }", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "function resizeToTargetRange_(range1, range2) {\n var finalRange = range1\n var startHeight = finalRange.getNumRows()\n if (startHeight > range2.getNumRows()) {\n finalRange = finalRange.offset(0, 0, range2.getNumRows())\n finalRange.offset(range2.getNumRows() , 0, startHeight - range2.getNumRows()).clear()\n }\n var startWidth = finalRange.getNumColumns()\n if (startWidth > range2.getNumColumns()) {\n finalRange = finalRange.offset(0, 0, finalRange.getNumRows(), range2.getNumColumns())\n finalRange.offset(0 , range2.getNumColumns(),\n finalRange.getNumRows(), startWidth - range2.getNumColumns()\n ).clear()\n }\n return finalRange\n }", "function clearBounds() {\n latlngBounds = new google.maps.LatLngBounds();\n }", "function coverOn()\r\n{\r\n\r\n CoverRect.style(\"display\",\"block\")\r\n\r\n\r\n domElemG.setAttribute(\"pointer-events\",\"none\")\r\n\r\n\r\n}", "function clamp(pos){pos.top=Math.max(Math.min(pos.top,bounds.bottom-containerNode.offsetHeight),bounds.top);pos.left=Math.max(Math.min(pos.left,bounds.right-containerNode.offsetWidth),bounds.left);}", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "function clearAndSetViewportByController() {\r\n viewportBounds = new google.maps.LatLngBounds();\r\n setViewportByController();\r\n map.fitBounds(viewportBounds);\r\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "_setRange() {\n this.debounce('_setRange', function() {\n if(this._scale && this._width && this._height) {\n this._setRangeDebouced();\n }\n }, 10);\n }", "range(from, to = from) { return Range.create(from, to, this); }", "resetUserBounds() {\n if (this.__userBounds) {\n delete this.__userBounds;\n\n var parent = this.$$parent;\n if (parent) {\n parent.updateLayoutProperties();\n }\n\n qx.ui.core.queue.Layout.add(this);\n }\n }", "handleConstraints() {\n if (this.x < 0) {\n this.x = 0;\n }\n if (this.x > width - 1) {\n this.x = width - this.size;\n }\n if (this.y < 0) {\n this.y = 0;\n }\n if (this.y > height - 1) {\n this.y = height - this.size;\n }\n\n\n }", "show(){\n noFill();\n rect(this.boundary.x, this.boundary.y, this.boundary.w, this.boundary.h);\n if(this.isParent){\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n }", "function outBounds() {\r\n if (x + 60 >= canvas.width + 10 || x <= 10 || y + 30 >= canvas.height || y - 15 <= 40) {\r\n cancelAnimationFrame();\r\n }\r\n}", "setRange(startX, endX) {\n // swap the range if needed\n if (startX > endX) {\n let xbuf = startX;\n startX = endX;\n endX = xbuf;\n }\n\n // correct the range\n startX = Math.max(startX, this.timeRange.startTime);\n endX = Math.min(endX, this.timeRange.endTime);\n\n // apply the new range\n if (startX !== endX) {\n let isZoomed = startX > this.timeRange.startTime || endX < this.timeRange.endTime;\n this._xAxisTag.min = startX;\n this._xAxisTag.max = endX;\n this._xAxisTag.alignToGrid = isZoomed;\n this._zoomMode = isZoomed;\n this._calcAllYRanges();\n this.draw();\n }\n }", "function noRange(){\n if (isFirefox === false){\n foo.appendChild(element);\n }\n }", "updateBounds() {\n this.bounds = getBounds(this);\n }", "set boundsValue(value) {}", "adhereToRect(rect) {\n if (!util.containsPoint(rect, this)) {\n this.x = Math.min(Math.max(this.x, rect.x), rect.x + rect.width);\n this.y = Math.min(Math.max(this.y, rect.y), rect.y + rect.height);\n }\n return this;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view);\n else if (display.viewFrom < from)\n display.view = display.view.slice(findViewIndex(cm, from));\n display.viewFrom = from;\n if (display.viewTo < to)\n display.view = display.view.concat(buildViewArray(cm, display.viewTo, to));\n else if (display.viewTo > to)\n display.view = display.view.slice(0, findViewIndex(cm, to));\n }\n display.viewTo = to;\n }", "set overrideClip(value) {}", "stretchToParentBounds(_id, l, t, r, b) {\n if (this.isNullOrUndefined(l)) {\n [l, t, r, b] = [0, 0, 0, 0];\n }\n else if (this.isArray(l)) {\n [l, t, r, b] = l;\n }\n else if (this.isNullOrUndefined(t)) {\n [l, t, r, b] = [l, l, l, l];\n }\n this.setStyle(_id, 'position', 'absolute');\n this.setStyle(_id, 'display', 'block');\n this.setStyle(_id, 'left', `${l}px`);\n this.setStyle(_id, 'top', `${t}px`);\n this.setStyle(_id, 'width', 'auto');\n this.setStyle(_id, 'height', 'auto');\n this.setStyle(_id, 'right', `${r}px`);\n this.setStyle(_id, 'bottom', `${b}px`);\n }", "stretchToParentBounds(_id, l, t, r, b) {\n if (this.isNullOrUndefined(l)) {\n [l, t, r, b] = [0, 0, 0, 0];\n }\n else if (this.isArray(l)) {\n [l, t, r, b] = l;\n }\n else if (this.isNullOrUndefined(t)) {\n [l, t, r, b] = [l, l, l, l];\n }\n this.setStyle(_id, 'position', 'absolute');\n this.setStyle(_id, 'display', 'block');\n this.setStyle(_id, 'left', `${l}px`);\n this.setStyle(_id, 'top', `${t}px`);\n this.setStyle(_id, 'width', 'auto');\n this.setStyle(_id, 'height', 'auto');\n this.setStyle(_id, 'right', `${r}px`);\n this.setStyle(_id, 'bottom', `${b}px`);\n }", "_rangeDDSizer() {\n let txrec = this._text.getBoundingClientRect();\n let bdrec = document.body.getBoundingClientRect();\n let hddwn = bdrec.height - txrec.bottom - 20 + 'px';\n let wddwn = txrec.width + 'px';\n \n this._ddown.style.width = wddwn;\n this._ddown.style['max-height'] = hddwn;\n }", "function setThresholdClipAttributes() {\n \n var yMinMax = yScale.domain();\n var min = yMinMax[0];\n var max = yMinMax[1];\n if (typeof min == undefined|| typeof max == undefined) {\n // min/max is not set because there is no data for plottype\n return;\n }\n \n svg.select(\"#clip-good\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n // Bottom of plot\n y = yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n else {\n // Top of plot\n y = yScale(max); \n }\n return y; }) \n .attr(\"width\", WIDTH)\n .attr(\"height\", function(d) { \n var height = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n height = yScale(min) - yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n else {\n // Top of plot\n height = yScale(scope.thresholddata.marginalData[scope.plottype]) - yScale(max);\n }\n return height; });\n \n svg.select(\"#clip-marginal\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n y = yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n else {\n y = yScale(scope.thresholddata.marginalData[scope.plottype]);\n }\n return y;})\n .attr(\"width\", WIDTH)\n .attr(\"height\", Math.abs(yScale(scope.thresholddata.severeData[scope.plottype]) - yScale(scope.thresholddata.marginalData[scope.plottype])));\n\n svg.select(\"#clip-severe\").select(\"rect\")\n .transition().duration(DURATION)\n .attr(\"y\", function(d) { \n var y = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n // Top of plot\n y = yScale(max); \n }\n else {\n y = yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n return y;})\n .attr(\"width\", WIDTH)\n .attr(\"height\", function(d) { \n var height = 0;\n if (scope.thresholddata.severeData[scope.plottype] > scope.thresholddata.marginalData[scope.plottype]) {\n height = yScale(scope.thresholddata.severeData[scope.plottype]) - yScale(max);\n }\n else {\n // Bottom of plot\n height = yScale(min) - yScale(scope.thresholddata.severeData[scope.plottype]);\n }\n return height; });\n \n }", "function expandRangeToSurround(range) {\n if (range.canSurroundContents()) return;\n\n var common = range.commonAncestorContainer,\n start_depth = getDepth(common, range.startContainer),\n end_depth = getDepth(common, range.endContainer);\n\n while(!range.canSurroundContents()) {\n // In the following branches, we cannot just decrement the depth variables because the setStartBefore/setEndAfter may move the start or end of the range more than one level relative to ``common``. So we need to recompute the depth.\n if (start_depth > end_depth) {\n range.setStartBefore(range.startContainer);\n start_depth = getDepth(common, range.startContainer);\n }\n else {\n range.setEndAfter(range.endContainer);\n end_depth = getDepth(common, range.endContainer);\n }\n }\n }", "function expandRangeToSurround(range) {\n if (range.canSurroundContents()) return;\n\n var common = range.commonAncestorContainer,\n start_depth = getDepth(common, range.startContainer),\n end_depth = getDepth(common, range.endContainer);\n\n while(!range.canSurroundContents()) {\n // In the following branches, we cannot just decrement the depth variables because the setStartBefore/setEndAfter may move the start or end of the range more than one level relative to ``common``. So we need to recompute the depth.\n if (start_depth > end_depth) {\n range.setStartBefore(range.startContainer);\n start_depth = getDepth(common, range.startContainer);\n }\n else {\n range.setEndAfter(range.endContainer);\n end_depth = getDepth(common, range.endContainer);\n }\n }\n }", "function reset() {\n var bounds = d3.geo.bounds(collection),\n bottomLeft = project(bounds[0]),\n topRight = project(bounds[1]);\n \n bottomLeft[0] = bottomLeft[0]-50;\n bottomLeft[1] = bottomLeft[1]+50;\n topRight[0] = topRight[0]+50;\n topRight[1] = topRight[1]-50;\n \n svg .attr(\"width\", topRight[0] - bottomLeft[0]+100)\n .attr(\"height\", bottomLeft[1] - topRight[1]+100)\n .style(\"margin-left\", bottomLeft[0] + \"px\")\n .style(\"margin-top\", topRight[1] + \"px\");\n \n g .attr(\"transform\", \"translate(\" + -bottomLeft[0] + \",\" + -topRight[1] + \")\");\n \n feature.attr(\"d\", path);\n }", "function setupDefaultRange() {\n scope.threeLetterTimezoneLabel = service.browserTimezone();\n var timeResolution;\n // If it was initialized with a range, it will try to use it as a default setup\n if (scope.setRange && scope.setRange.label) {\n const option = _.find(scope.dictionary, { label: scope.setRange.label }) || scope.dictionary[0];\n timeResolution = TimeResolution.timeResolutionFromLocal(option);\n } else if (scope.setRange && scope.setRange.duration && scope.setRange.from) {\n const toHelper = moment(scope.setRange.from).add(scope.setRange.duration.value, scope.setRange.duration.unit);\n const helper = new TimeResolution(scope.setRange.from, toHelper.valueOf());\n const suggestion = helper.suggestedRange();\n timeResolution = new TimeResolution(suggestion.from, suggestion.to, helper.suggestedTimeUnit());\n } else if (scope.setRange && scope.setRange.duration) {\n const option = _.find(scope.dictionary, { duration: scope.setRange.duration });\n if (option) {\n timeResolution = TimeResolution.timeResolutionFromLocal(option);\n } else {\n timeResolution = TimeResolution.timeResolutionFromLocal({ duration: scope.setRange.duration }, scope.setRange.duration.unit);\n timeResolution.selectedRange = { label: 'Custom Range', custom: true };\n }\n } else if (scope.setRange && scope.mode == 'absolute' && scope.setRange.from && scope.setRange.to) {\n const from = moment(scope.setRange.from).seconds(0).milliseconds(0).valueOf();\n const to = moment(scope.setRange.to).seconds(0).milliseconds(0).valueOf();\n timeResolution = new TimeResolution(from, to);\n } else {\n timeResolution = TimeResolution.timeResolutionFromLocal(scope.dictionary[0]);\n }\n scope.internalRange = timeResolution;\n scope.observer.emit('dateTimePicker', timeResolution);\n buildRangeToSave();\n }", "function expandRangeToSurround(range) {\n if (range.canSurroundContents()) return;\n\n var common = range.commonAncestorContainer,\n start_depth = getDepth(common, range.startContainer),\n end_depth = getDepth(common, range.endContainer);\n\n while (!range.canSurroundContents()) {\n // In the following branches, we cannot just decrement the depth variables because the setStartBefore/setEndAfter may move the start or end of the range more than one level relative to ``common``. So we need to recompute the depth.\n if (start_depth > end_depth) {\n range.setStartBefore(range.startContainer);\n start_depth = getDepth(common, range.startContainer);\n }\n else {\n range.setEndAfter(range.endContainer);\n end_depth = getDepth(common, range.endContainer);\n }\n }\n }", "_setRange(range) {\n const min2Scale = this._toPixelScale(range.min);\n const max2Scale = this._toPixelScale(range.max);\n const minBounds = this._toPixelScale(this.props.min);\n const maxBounds = this._toPixelScale(this.props.max);\n if (min2Scale > max2Scale) {\n throw new Error(`Minimum slider value: ${range.min} is greater than max value: ${range.max}`);\n }\n if (min2Scale < minBounds || min2Scale > maxBounds) {\n throw new Error(`Minimum slider value: ${range.min} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n if (max2Scale < minBounds || max2Scale > maxBounds) {\n throw new Error(`Maximum slider value: ${range.max} exceeds bounds:\n ${this.props.min} - ${this.props.max}`);\n }\n this._range = {\n min: min2Scale || 0,\n max: max2Scale || 0,\n };\n return this._range;\n }", "reset() {\n\n // Set the initial crop to match any given fixed aspect ratio (or\n // default to a square crop 1:1).\n let aspectRatio = this._initialAspectRatio\n\n // Calculate the initial crop size such that it fits within the bounds\n let width = getWidth(this.bounds)\n let height = getWidth(this.bounds) / aspectRatio\n\n if (aspectRatio < width / getHeight(this.bounds)) {\n width = getHeight(this.bounds) * aspectRatio\n height = getHeight(this.bounds)\n }\n\n // Calculate the initial crop position to be central to the bounds\n const x = (getWidth(this.bounds) - width) / 2\n const y = (getHeight(this.bounds) - height) / 2\n\n // Set the region\n this.region = [\n [x, y],\n [x + width, y + height]\n ]\n }", "function fillLayer(fillLayer, bounds) {\r activeDocument.activeLayer = fillLayer;\r\r var a = [bounds[0], bounds[1]];\r var b = [bounds[2], bounds[1]];\r var c = [bounds[0], bounds[3]];\r var d = [bounds[2], bounds[3]];\r\r var fillColor = new SolidColor();\r fillColor.rgb.red = 255;\r fillColor.rgb.green = 0;\r fillColor.rgb.blue = 0;\r\r activeDocument.selection.select([c, d, b, a], SelectionType.REPLACE, 0, false);\r activeDocument.selection.expand('10 pixels');\r activeDocument.selection.fill(fillColor, ColorBlendMode.NORMAL, 80, false);\r}", "addRange(high, low, mid) {\n this.range.push({\n 'high': high,\n 'low': low,\n 'mid': mid,\n })\n //return this.range\n }" ]
[ "0.55567807", "0.5474355", "0.5386401", "0.5374076", "0.5352278", "0.5343625", "0.5327344", "0.53100234", "0.52657485", "0.5248539", "0.5234132", "0.52324057", "0.52298397", "0.5208257", "0.51977295", "0.51977295", "0.5189465", "0.5189465", "0.51854396", "0.51854396", "0.5160867", "0.51564133", "0.5155751", "0.51380444", "0.51367706", "0.5105759", "0.50734323", "0.50680315", "0.5064405", "0.50521225", "0.4938258", "0.49168172", "0.49143767", "0.4909505", "0.4895561", "0.4890634", "0.48867962", "0.48772258", "0.48661834", "0.4865568", "0.48625144", "0.48493323", "0.48458162", "0.48316297", "0.48263544", "0.4816707", "0.48076087", "0.4807422", "0.48032266", "0.48032266", "0.48032266", "0.47480023", "0.47433898", "0.4732351", "0.47216573", "0.47186086", "0.47094467", "0.46939832", "0.46882302", "0.46866086", "0.46856135", "0.46849543", "0.46796077", "0.46796077", "0.46796077", "0.46796077", "0.46796077", "0.46796077", "0.46796077", "0.46796077", "0.46718502", "0.46689725", "0.46689725", "0.46682665", "0.46599153", "0.46498278", "0.46498278", "0.46485493", "0.46478233", "0.4644912", "0.4641029", "0.46328458", "0.46266118", "0.4608807" ]
0.4687775
74
Count the number of lines in the view whose DOM representation is out of date (or nonexistent).
function countDirtyView(cm) { var view = cm.display.view, dirty = 0; for (var i = 0; i < view.length; i++) { var lineView = view[i]; if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } } return dirty }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countLines() {\n let page = document.getElementsByClassName(\"kix-zoomdocumentplugin-outer\")[0];\n if (page == null) {\n return (\"Element does not exist on the document.\")\n }\n let lineCount = 0;\n const pageText = page.innerText;\n\n for (let i = 0; i < pageText.length; i++) {\n if (pageText.charAt(i) == '\\n') {\n lineCount++;\n }\n }\n return lineCount;\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n }\n return dirty;\n }", "function countDirtyView(cm) {\r\n var view = cm.display.view, dirty = 0;\r\n for (var i = 0; i < view.length; i++) {\r\n var lineView = view[i];\r\n if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\r\n }\r\n return dirty;\r\n }", "function countDirtyView(cm) {\n var view = cm.display.view,\n dirty = 0;\n\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n\n if (!lineView.hidden && (!lineView.node || lineView.changes)) {\n ++dirty;\n }\n }\n\n return dirty;\n }", "function countDirtyView(cm) {\r\n var view = cm.display.view, dirty = 0;\r\n for (var i = 0; i < view.length; i++) {\r\n var lineView = view[i];\r\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\r\n }\r\n return dirty\r\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n}", "function countDirtyView(cm) {\n\t\t var view = cm.display.view, dirty = 0;\n\t\t for (var i = 0; i < view.length; i++) {\n\t\t var lineView = view[i];\n\t\t if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n\t\t }\n\t\t return dirty;\n\t\t }", "function countDirtyView(cm) {\n\t\t var view = cm.display.view, dirty = 0;\n\t\t for (var i = 0; i < view.length; i++) {\n\t\t var lineView = view[i];\n\t\t if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n\t\t }\n\t\t return dirty\n\t\t }", "function countDirtyView(cm) {\n\t var view = cm.display.view, dirty = 0;\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n\t }\n\t return dirty;\n\t }", "function countDirtyView(cm) {\n\t var view = cm.display.view, dirty = 0;\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n\t }\n\t return dirty;\n\t }", "function countDirtyView(cm) {\n\t var view = cm.display.view, dirty = 0;\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty;\n\t }\n\t return dirty;\n\t }", "function getNumLines(){\n if ($(\"#work_markup\").length !== 0){\n var num_lines = $(\"#work_markup\").val().split(/\\r\\n|\\r|\\n/).length;\n return num_lines;\n }\n return 0;\n}", "function Vi(t) {\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw y();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}", "get line_count() {\n const newlines = this.code.match(/\\n/g) || [];\n return newlines.length + 1;\n }", "function Zr(t) {\n if (!t) return 0;\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw C();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) return lineN;\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) return lineN;\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t line = merged.find(1, true).line;\n\t\t return lineNo(line) + 1;\n\t\t }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) { return lineN }\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) { return lineN }\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t { line = merged.find(1, true).line; }\n\t\t return lineNo(line) + 1\n\t\t }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "size() {\n return this.lines.length;\n }", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "function visualLineEndNo(doc, lineN) {\r\n if (lineN > doc.lastLine()) return lineN;\r\n var line = getLine(doc, lineN), merged;\r\n if (!lineIsHidden(doc, line)) return lineN;\r\n while (merged = collapsedSpanAtEnd(line))\r\n line = merged.find(1, true).line;\r\n return lineNo(line) + 1;\r\n }", "function visualLineEndNo(doc, lineN) {\r\n if (lineN > doc.lastLine()) { return lineN }\r\n var line = getLine(doc, lineN), merged;\r\n if (!lineIsHidden(doc, line)) { return lineN }\r\n while (merged = collapsedSpanAtEnd(line))\r\n { line = merged.find(1, true).line; }\r\n return lineNo(line) + 1\r\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n}", "function ii(t) {\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw A();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line }\n return lineNo(line) + 1\n}", "function ti(t) {\n if (!t) return 0;\n var e;\n if (t.document) e = t.document; else if (t.unknownDocument) e = t.unknownDocument; else {\n if (!t.noDocument) throw R();\n e = t.noDocument;\n }\n return JSON.stringify(e).length;\n}", "function fixOperaBug(e){return browser.opera?e.length-e.replace(/\\n*/g,\"\").length:0}", "function lineCount(value) {\n var count = 0;\n for (var _i = 0, value_1 = value; _i < value_1.length; _i++) {\n var char = value_1[_i];\n if (char === '\\n') {\n count++;\n }\n }\n return count;\n}" ]
[ "0.64810884", "0.6392919", "0.6392919", "0.6392919", "0.6392919", "0.6392919", "0.6392919", "0.6392919", "0.6392919", "0.63783896", "0.6369697", "0.6368045", "0.636577", "0.636577", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6359232", "0.6349889", "0.6346268", "0.6343875", "0.6343875", "0.6343875", "0.58482265", "0.57196224", "0.5658153", "0.5616343", "0.5591568", "0.55790085", "0.55790085", "0.55790085", "0.55790085", "0.55790085", "0.55790085", "0.55790085", "0.5566105", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5566006", "0.5561465", "0.5561465", "0.5561465", "0.55573845", "0.5553541", "0.5553071", "0.54972434", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5482359", "0.5444736", "0.5439922", "0.5439922", "0.5433891", "0.5370001", "0.5366996" ]
0.63936424
15
Does the actual updating of the line display. Bails out (returning false) when there is nothing to be done and forced is false.
function updateDisplayIfNeeded(cm, update) { var display = cm.display, doc = cm.doc; if (update.editorIsHidden) { resetView(cm); return false } // Bail out if the visible area is already rendered and nothing changed. if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) { return false } if (maybeUpdateLineNumberWidth(cm)) { resetView(cm); update.dims = getDimensions(cm); } // Compute a suitable new viewport (from & to) var end = doc.first + doc.size; var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); var to = Math.min(end, update.visible.to + cm.options.viewportMargin); if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } if (sawCollapsedSpans) { from = visualLineNo(cm.doc, from); to = visualLineEndNo(cm.doc, to); } var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; adjustView(cm, from, to); display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); // Position the mover div to align with the current scroll position cm.display.mover.style.top = display.viewOffset + "px"; var toUpdate = countDirtyView(cm); if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) { return false } // For big changes, we hide the enclosing element during the // update, since that speeds up the operations on most browsers. var selSnapshot = selectionSnapshot(cm); if (toUpdate > 4) { display.lineDiv.style.display = "none"; } patchDisplay(cm, display.updateLineNumbers, update.dims); if (toUpdate > 4) { display.lineDiv.style.display = ""; } display.renderedView = display.view; // There might have been a widget with a focused element that got // hidden or updated, if so re-focus it. restoreSelection(selSnapshot); // Prevent selection and cursors from interfering with the scroll // width and height. removeChildren(display.cursorDiv); removeChildren(display.selectionDiv); display.gutters.style.height = display.sizer.style.minHeight = 0; if (different) { display.lastWrapHeight = update.wrapperHeight; display.lastWrapWidth = update.wrapperWidth; startWorker(cm, 400); } display.updateLineNumbers = null; return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawUpdate( current ) {\n\n\t\tif ( previous.x !== current.x || previous.y !== current.y ) {\n\t\t\tmultiline( previous.x, previous.y, current.x, current.y, splits, lineSymmetryCtrl.checked );\n\t\t}\n\t}", "function checkLineChanged(currLine){\n if (currLine != prevLine){\n return true;\n }\n return false;\n}", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false\n\t\t }\n\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t { return false }\n\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n\t\t if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t { return false }\n\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var selSnapshot = selectionSnapshot(cm);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t restoreSelection(selSnapshot);\n\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\n\t\t display.updateLineNumbers = null;\n\n\t\t return true\n\t\t }", "function updateDisplayIfNeeded(cm, update) {\r\n var display = cm.display, doc = cm.doc;\r\n if (update.editorIsHidden) {\r\n resetView(cm);\r\n return false;\r\n }\r\n\r\n // Bail out if the visible area is already rendered and nothing changed.\r\n if (!update.force &&\r\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\r\n countDirtyView(cm) == 0)\r\n return false;\r\n\r\n if (maybeUpdateLineNumberWidth(cm)) {\r\n resetView(cm);\r\n update.dims = getDimensions(cm);\r\n }\r\n\r\n // Compute a suitable new viewport (from & to)\r\n var end = doc.first + doc.size;\r\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\r\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\r\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\r\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\r\n if (sawCollapsedSpans) {\r\n from = visualLineNo(cm.doc, from);\r\n to = visualLineEndNo(cm.doc, to);\r\n }\r\n\r\n var different = from != display.viewFrom || to != display.viewTo ||\r\n display.lastSizeC != update.wrapperHeight;\r\n adjustView(cm, from, to);\r\n\r\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\r\n // Position the mover div to align with the current scroll position\r\n cm.display.mover.style.top = display.viewOffset + \"px\";\r\n\r\n var toUpdate = countDirtyView(cm);\r\n if (!different && toUpdate == 0 && !update.force &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\r\n return false;\r\n\r\n // For big changes, we hide the enclosing element during the\r\n // update, since that speeds up the operations on most browsers.\r\n var focused = activeElt();\r\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\r\n patchDisplay(cm, display.updateLineNumbers, update.dims);\r\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\r\n // There might have been a widget with a focused element that got\r\n // hidden or updated, if so re-focus it.\r\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\r\n\r\n // Prevent selection and cursors from interfering with the scroll\r\n // width.\r\n removeChildren(display.cursorDiv);\r\n removeChildren(display.selectionDiv);\r\n\r\n if (different) {\r\n display.lastSizeC = update.wrapperHeight;\r\n startWorker(cm, 400);\r\n }\r\n\r\n display.updateLineNumbers = null;\r\n\r\n return true;\r\n }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t return false;\n\t\t\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\t\t\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\t\t\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\t\t\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\t\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t return false;\n\t\t\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var focused = activeElt();\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\t\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\t\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\t\t\n\t\t display.updateLineNumbers = null;\n\t\t\n\t\t return true;\n\t\t }", "function drawPointsChanged() {\n if (!drawPoints) {\n drawPoints = true\n } else {\n drawPoints = false\n };\n renderJob1.renderText();\n }", "_shouldDisplayLine(line) {\r\n return line.length > 0 && !this._ignoredLine;\r\n }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\t\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\t\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\t\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\t\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\t\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\t\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\t\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\t\n\t display.updateLineNumbers = null;\n\t\n\t return true;\n\t }", "forceUpdate() {\n this.updating = true;\n m.redraw();\n }", "function updateDisplay(cm, viewPort, forced) {\n var oldFrom = cm.display.viewFrom, oldTo = cm.display.viewTo, updated;\n var visible = visibleLines(cm.display, cm.doc, viewPort);\n for (var first = true;; first = false) {\n var oldWidth = cm.display.scroller.clientWidth;\n if (!updateDisplayInner(cm, visible, forced)) break;\n updated = true;\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n if (cm.display.maxLineChanged && !cm.options.lineWrapping)\n adjustContentWidth(cm);\n\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n setDocumentHeight(cm, barMeasure);\n updateScrollbars(cm, barMeasure);\n if (webkit && cm.options.lineWrapping)\n checkForWebkitWidthBug(cm, barMeasure); // (Issue #2420)\n if (webkit && barMeasure.scrollWidth > barMeasure.clientWidth &&\n barMeasure.scrollWidth < barMeasure.clientWidth + 1 &&\n !hScrollbarTakesSpace(cm))\n updateScrollbars(cm); // (Issue #2562)\n if (first && cm.options.lineWrapping && oldWidth != cm.display.scroller.clientWidth) {\n forced = true;\n continue;\n }\n forced = false;\n\n // Clip forced viewport to actual scrollable area.\n if (viewPort && viewPort.top != null)\n viewPort = {top: Math.min(barMeasure.docHeight - scrollerCutOff - barMeasure.clientHeight, viewPort.top)};\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n visible = visibleLines(cm.display, cm.doc, viewPort);\n if (visible.from >= cm.display.viewFrom && visible.to <= cm.display.viewTo)\n break;\n }\n\n cm.display.updateLineNumbers = null;\n if (updated) {\n signalLater(cm, \"update\", cm);\n if (cm.display.viewFrom != oldFrom || cm.display.viewTo != oldTo)\n signalLater(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n }\n return updated;\n }", "function updateDisplayIfNeeded(cm, update) {\r\n var display = cm.display, doc = cm.doc;\r\n\r\n if (update.editorIsHidden) {\r\n resetView(cm);\r\n return false\r\n }\r\n\r\n // Bail out if the visible area is already rendered and nothing changed.\r\n if (!update.force &&\r\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\r\n display.renderedView == display.view && countDirtyView(cm) == 0)\r\n { return false }\r\n\r\n if (maybeUpdateLineNumberWidth(cm)) {\r\n resetView(cm);\r\n update.dims = getDimensions(cm);\r\n }\r\n\r\n // Compute a suitable new viewport (from & to)\r\n var end = doc.first + doc.size;\r\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\r\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\r\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\r\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\r\n if (sawCollapsedSpans) {\r\n from = visualLineNo(cm.doc, from);\r\n to = visualLineEndNo(cm.doc, to);\r\n }\r\n\r\n var different = from != display.viewFrom || to != display.viewTo ||\r\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\r\n adjustView(cm, from, to);\r\n\r\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\r\n // Position the mover div to align with the current scroll position\r\n cm.display.mover.style.top = display.viewOffset + \"px\";\r\n\r\n var toUpdate = countDirtyView(cm);\r\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\r\n { return false }\r\n\r\n // For big changes, we hide the enclosing element during the\r\n // update, since that speeds up the operations on most browsers.\r\n var selSnapshot = selectionSnapshot(cm);\r\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\r\n patchDisplay(cm, display.updateLineNumbers, update.dims);\r\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\r\n display.renderedView = display.view;\r\n // There might have been a widget with a focused element that got\r\n // hidden or updated, if so re-focus it.\r\n restoreSelection(selSnapshot);\r\n\r\n // Prevent selection and cursors from interfering with the scroll\r\n // width and height.\r\n removeChildren(display.cursorDiv);\r\n removeChildren(display.selectionDiv);\r\n display.gutters.style.height = display.sizer.style.minHeight = 0;\r\n\r\n if (different) {\r\n display.lastWrapHeight = update.wrapperHeight;\r\n display.lastWrapWidth = update.wrapperWidth;\r\n startWorker(cm, 400);\r\n }\r\n\r\n display.updateLineNumbers = null;\r\n\r\n return true\r\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display,\n doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n } // Bail out if the visible area is already rendered and nothing changed.\n\n\n if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) {\n return false;\n }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n } // Compute a suitable new viewport (from & to)\n\n\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\n if (display.viewFrom < from && from - display.viewFrom < 20) {\n from = Math.max(doc.first, display.viewFrom);\n }\n\n if (display.viewTo > to && display.viewTo - to < 20) {\n to = Math.min(end, display.viewTo);\n }\n\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n display.viewOffset = _heightAtLine(getLine(cm.doc, display.viewFrom)); // Position the mover div to align with the current scroll position\n\n cm.display.mover.style.top = display.viewOffset + \"px\";\n var toUpdate = countDirtyView(cm);\n\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) {\n return false;\n } // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n\n\n var selSnapshot = selectionSnapshot(cm);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"none\";\n }\n\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"\";\n }\n\n display.renderedView = display.view; // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n\n restoreSelection(selSnapshot); // Prevent selection and cursors from interfering with the scroll\n // width and height.\n\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "update(redrawOnly = false) {\n this.graphics.clear();\n if (redrawOnly) {\n this.drawAppropriateLine();\n } else {\n this.draw(true);\n }\n }", "function checkVisibleLines () {\n\tif (allVisibleLinesJustified()) {\n\t\t$('#problemButton').show();\n\t\t$('#ruleInstructionsPartial').html('Correct! Click \\'Next Line\\' to continue.');\n\t}\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt()\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc\n\n if (update.editorIsHidden) {\n resetView(cm)\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm)\n update.dims = getDimensions(cm)\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin)\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from)\n to = visualLineEndNo(cm.doc, to)\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth\n adjustView(cm, from, to)\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\"\n\n var toUpdate = countDirtyView(cm)\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt()\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\" }\n patchDisplay(cm, display.updateLineNumbers, update.dims)\n if (toUpdate > 4) { display.lineDiv.style.display = \"\" }\n display.renderedView = display.view\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv)\n removeChildren(display.selectionDiv)\n display.gutters.style.height = display.sizer.style.minHeight = 0\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight\n display.lastWrapWidth = update.wrapperWidth\n startWorker(cm, 400)\n }\n\n display.updateLineNumbers = null\n\n return true\n}", "moveToNextLine() {\n if (this.currentLineNb >= this.lines.length - 1) {\n return false;\n }\n this.currentLine = this.lines[++this.currentLineNb];\n return true;\n }", "function update() {\n\t\t\tif (textarea.value == mirror) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar insertedChars = (textarea.value.length - mirror.length), newData;\n\n\t\t\tif (textarea.value.length < offset ||\n\t\t\t selection.start < offset ||\n\t\t\t\tdata.length + insertedChars > options.maxLength) {\n\t\t\t\tpopup.hide();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tnewData = textarea.value.slice(offset, offset + data.length + insertedChars);\n\n\t\t\tupdateCaret();\n\t\t\tif (newData == data) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tdata = newData;\n\t\t\tmirror = textarea.value;\n\t\t\treturn true;\n\t\t}", "function checkLines() {\n for (var y = 0; y < dimention[1]; y++) {\n var lineComplete = field[y].every(function(cell, x) {\n return field[y][x] === field[y][(x + 1) % dimention[0]];\n });\n // ..and if so, blow the line up\n if (lineComplete) {\n if (debug) { Render.drawState(field); debugger; }\n for (var x = 0; x < dimention[0]; x++) {\n field[y][x] = Render.isNeutral(x, y) ? 0 : -field[y][x];\n }\n if (debug) { Render.drawState(field); debugger; }\n // ..and make all top blocks fall\n if (dir === 1) { // ..down\n for (var row = y - 1; row >= 0; row--) {\n moveLineDown(row);\n }\n } else { // ..up\n for (var row = y + 1; row < dimention[1]; row++) {\n moveLineDown(row);\n }\n }\n if (debug) { Render.drawState(field); debugger; }\n }\n }\n }", "update() {\n if (!this.visible)\n\t return;\n }", "lineFeed() {\n // make buffer local for faster access\n const buffer = this._bufferService.buffer;\n this._dirtyRowService.markDirty(buffer.y);\n if (this._optionsService.options.convertEol) {\n buffer.x = 0;\n }\n buffer.y++;\n if (buffer.y === buffer.scrollBottom + 1) {\n buffer.y--;\n this._onRequestScroll.fire(this._eraseAttrData());\n }\n else if (buffer.y >= this._bufferService.rows) {\n buffer.y = this._bufferService.rows - 1;\n }\n // If the end of the line is hit, prevent this action from wrapping around to the next line.\n if (buffer.x >= this._bufferService.cols) {\n buffer.x--;\n }\n this._dirtyRowService.markDirty(buffer.y);\n this._onLineFeed.fire();\n return true;\n }", "function check_if_update(){\n if(total_results_past == total_results){\n read_speech(\"Here's a hint. You're supposed to say: \" + window.paragraph_list[window.curr_paragraph])\n } else{\n if(flip){\n if(conf_score == conf_score_past){\n read_speech(\"You seem lost. You're supposed to say: \" + window.paragraph_list[window.curr_paragraph])\n }\n conf_score_past = conf_score\n }\n }\n total_results_past = total_results\n flip = !flip;\n}", "function update(forced) {\n\t\t\t\t\t\n\t\t\t\t\t// Get curated content from the textarea.\n\t\t\t\t\tvar textareaContent = $textarea.val().replace(/&/g,'&amp;').replace(/ {2}/g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\\n/g, '<br />');\n\t\t\t\t\t\n\t\t\t\t\t// Compare curated content with curated twin.\n\t\t\t\t\tvar twinContent = $twin.html().replace(/<br>/ig,'<br />');\n\t\t\t\t\t\n\t\t\t\t\tif(forced || textareaContent+'&nbsp;' !== twinContent){\n\t\t\t\t\t\n\t\t\t\t\t\t// Add an extra white space so new rows are added when you are at the end of a row.\n\t\t\t\t\t\t$twin.html(textareaContent+'&nbsp;');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height\n\t\t\t\t\t\tif(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar goalheight = $twin.height()+lineHeight;\n\t\t\t\t\t\t\tif(goalheight >= maxheight) {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(maxheight,'auto');\n\t\t\t\t\t\t\t} else if(goalheight <= minheight) {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(minheight,'hidden');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(goalheight,'hidden');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "function update(forced) {\n\t\t\t\t\t\n\t\t\t\t\t// Get curated content from the textarea.\n\t\t\t\t\tvar textareaContent = $textarea.val().replace(/&/g,'&amp;').replace(/ {2}/g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\\n/g, '<br />');\n\t\t\t\t\t\n\t\t\t\t\t// Compare curated content with curated twin.\n\t\t\t\t\tvar twinContent = $twin.html().replace(/<br>/ig,'<br />');\n\t\t\t\t\t\n\t\t\t\t\tif(forced || textareaContent+'&nbsp;' !== twinContent){\n\t\t\t\t\t\n\t\t\t\t\t\t// Add an extra white space so new rows are added when you are at the end of a row.\n\t\t\t\t\t\t$twin.html(textareaContent+'&nbsp;');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height\n\t\t\t\t\t\tif(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar goalheight = $twin.height()+lineHeight;\n\t\t\t\t\t\t\tif(goalheight >= maxheight) {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(maxheight,'auto');\n\t\t\t\t\t\t\t} else if(goalheight <= minheight) {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(minheight,'hidden');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsetHeightAndOverflow(goalheight,'hidden');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "function updateOutput() {\n if (!curTrace) {\n return;\n }\n\n useJsPlumbRendering = !($(\"#classicModeCheckbox\").prop(\"checked\"));\n\n var curEntry = curTrace[curInstr];\n var hasError = false;\n\n // render VCR controls:\n var totalInstrs = curTrace.length;\n\n // to be user-friendly, if we're on the LAST instruction, print \"Program has terminated\"\n // and DON'T highlight any lines of code in the code display\n if (curInstr == (totalInstrs-1)) {\n if (instrLimitReached) {\n $(\"#vcrControls #curInstr\").html(\"Instruction limit reached\");\n }\n else {\n $(\"#vcrControls #curInstr\").html(\"Program has terminated\");\n }\n }\n else {\n $(\"#vcrControls #curInstr\").html(\"About to do step \" + (curInstr + 1) + \" of \" + (totalInstrs-1));\n }\n\n $(\"#vcrControls #jmpFirstInstr\").attr(\"disabled\", false);\n $(\"#vcrControls #jmpStepBack\").attr(\"disabled\", false);\n $(\"#vcrControls #jmpStepFwd\").attr(\"disabled\", false);\n $(\"#vcrControls #jmpLastInstr\").attr(\"disabled\", false);\n\n if (curInstr == 0) {\n $(\"#vcrControls #jmpFirstInstr\").attr(\"disabled\", true);\n $(\"#vcrControls #jmpStepBack\").attr(\"disabled\", true);\n }\n if (curInstr == (totalInstrs-1)) {\n $(\"#vcrControls #jmpLastInstr\").attr(\"disabled\", true);\n $(\"#vcrControls #jmpStepFwd\").attr(\"disabled\", true);\n }\n\n\n // render error (if applicable):\n if (curEntry.event == 'exception' ||\n curEntry.event == 'uncaught_exception') {\n assert(curEntry.exception_msg);\n\n if (curEntry.exception_msg == \"Unknown error\") {\n $(\"#errorOutput\").html('Unknown error: Please email a bug report to [email protected]');\n }\n else {\n $(\"#errorOutput\").html(htmlspecialchars(curEntry.exception_msg));\n }\n\n $(\"#errorOutput\").show();\n\n hasError = true;\n }\n else {\n if (!instrLimitReached) { // ugly, I know :/\n $(\"#errorOutput\").hide();\n }\n }\n\n\n // render code output:\n if (curEntry.line) {\n // calculate all lines that have been 'visited' \n // by execution up to (but NOT INCLUDING) curInstr:\n var visitedLinesSet = {}\n for (var i = 0; i < curInstr; i++) {\n if (curTrace[i].line) {\n visitedLinesSet[curTrace[i].line] = true;\n }\n }\n highlightCodeLine(curEntry.line, visitedLinesSet, hasError,\n /* if instrLimitReached, then treat like a normal non-terminating line */\n (!instrLimitReached && (curInstr == (totalInstrs-1))));\n }\n\n\n // render stdout:\n\n // keep original horizontal scroll level:\n var oldLeft = $(\"#pyStdout\").scrollLeft();\n $(\"#pyStdout\").val(curEntry.stdout);\n\n $(\"#pyStdout\").scrollLeft(oldLeft);\n // scroll to bottom, tho:\n $(\"#pyStdout\").scrollTop($(\"#pyStdout\").attr('scrollHeight'));\n\n\n // finally, render all the data structures!!!\n renderDataStructures(curEntry, \"#dataViz\");\n}", "requestRedraw () {\n this.redrawRequested = true;\n }", "forceUpdate() {\n if (this[_queuedUpdate]) {\n this[_dirty] = true;\n return;\n }\n\n this[_virtualRender]();\n this[_queuedUpdate] = true;\n\n TaskQueue.push(() => {\n if (this[_dirty] && !this.isDisposed) {\n this[_virtualRender]();\n this[_dirty] = false;\n }\n this[_queuedUpdate] = false;\n });\n }", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from >= showingFrom && visible.to <= showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = gutter.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n if (options.lineWrapping) {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {updateLineHeight(line, height); gutterDirty = true;}\n }\n curNode = curNode.nextSibling;\n });\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) updateGutter();\n updateCursor();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateState() {\n\n var isSeated = updatePoints();\n\n // var lastSignal = points.length - 1;\n // var isSeated = points[lastSignal][1] > 250;\n if (!error) {\n drawResult(isSeated);\n }\n}", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from && from == showingFrom && to == showingTo) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = gutter.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n if (scroller.clientHeight)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n function checkHeights() {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild, heightChanged = false;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {\n updateLineHeight(line, height);\n gutterDirty = heightChanged = true;\n }\n }\n curNode = curNode.nextSibling;\n });\n if (heightChanged)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n return heightChanged;\n }\n\n if (options.lineWrapping) {\n checkHeights();\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) {\n // If the gutter grew in size, re-check heights. If those changed, re-draw gutter.\n updateGutter() && options.lineWrapping && checkHeights() && updateGutter();\n }\n updateSelection();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from && from == showingFrom && to == showingTo) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = gutter.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n if (scroller.clientHeight)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n function checkHeights() {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild, heightChanged = false;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {\n updateLineHeight(line, height);\n gutterDirty = heightChanged = true;\n }\n }\n curNode = curNode.nextSibling;\n });\n if (heightChanged)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n return heightChanged;\n }\n\n if (options.lineWrapping) {\n checkHeights();\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) {\n // If the gutter grew in size, re-check heights. If those changed, re-draw gutter.\n updateGutter() && options.lineWrapping && checkHeights() && updateGutter();\n }\n updateSelection();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateDisplay(value){\n\tif(displayLength+1 < LIMIT){ \n\t\tif(value == '0' && prevValue == '/')\n\t\t\talert('You can\\'t divide by zero')\n\t\telse if(value >= '0' && value <= '9'){\n\t\t\tdisplayedContent.textContent += value;\n\t\t\tdisplayLength++;\n\t\t\tprevValue = value;\n\t\t}\n\t\telse if((prevValue >= '0' && prevValue <= '9') || (displayedContent.textContent=='' && value == '-')){\n\t\t\tif(value == '.'){\n\t\t\t\tdisplayedContent.textContent += value;\n\t\t\t\tdisplayLength++;\n\t\t\t\tprevValue = value;\n\t\t\t\tdocument.querySelector(\"#dot\").disabled = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayedContent.textContent += value;\n\t\t\t\tdisplayLength++;\n\t\t\t\tprevValue = value;\n\t\t\t\tdocument.querySelector(\"#dot\").disabled = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\talert ('You can\\'t input operator that way!');\n\t}\n\telse\n\t\talert('There is no space for that!');\n}", "function isWholeLineUpdate(doc, change) {\n\t\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n\t\t }", "function updatePromptDisplay(){\n var line = promptText;\n var html = '';\n if (column > 0 && line == ''){\n // When we have an empty line just display a cursor.\n html = cursor;\n } else if (column == promptText.length){\n // We're at the end of the line, so we need to display\n // the text *and* cursor.\n html = htmlEncode(line) + cursor;\n } else {\n // Grab the current character, if there is one, and\n // make it the current cursor.\n var before = line.substring(0, column);\n var current = line.substring(column,column+1);\n if (current){\n current = \n '<span class=\"jquery-console-cursor\">' +\n htmlEncode(current) +\n '</span>';\n }\n var after = line.substring(column+1);\n html = htmlEncode(before) + current + htmlEncode(after);\n }\n prompt.html(html);\n scrollToBottom();\n }", "function updateLine(line, fromX, fromY, toX, toY) {\n\n line.graphics.clear();\n line.graphics.alpha = 1.0;\n line.graphics.setStrokeStyle(1);\n line.graphics.beginStroke(color.GRAY);\n line.graphics.moveTo(fromX, fromY);\n line.graphics.lineTo(toX, toY);\n line.graphics.endStroke();\n}", "function checkLine () {\r\n let lineCount = 0;\r\n\r\n for ( let y = 0; y < FIELD_ROW; y++ ) {\r\n //Variable to see if a line is completed\r\n let isCompleted = true;\r\n\r\n //Check the completion\r\n for ( let x = 0; x < FIELD_COLUMN; x++ ) {\r\n //If NO block is found, it means the line is not completed yet\r\n if ( !field[y][x] ) {\r\n isCompleted = false;\r\n break;\r\n }\r\n }\r\n\r\n //Clear a completed line\r\n if ( isCompleted ) {\r\n lineCount++;\r\n\r\n for ( let newY = y; 0 < newY; newY-- ) {\r\n for ( let newX = 0; newX < FIELD_COLUMN; newX++ ) {\r\n //A new line will be updated as the upper line\r\n field[ newY ][ newX ] = field[ newY-1 ][ newX ];\r\n }\r\n }\r\n }\r\n }\r\n}", "_onUpdateDisplay() {}", "function update(position) {\n var len = storedLines.length;\n if(len==0) return;\n\n draw();\n ctx.fillStyle = \"yellow\";\n ctx.beginPath();\n ctx.arc(storedLines[0].x, storedLines[0].y, radius, 0, 2 * Math.PI, false);\n ctx.fill();\n\n ctx.strokeStyle = \"darkblue\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.moveTo(storedLines[0].x, storedLines[0].y);\n for(var i=1; i<len; ++i) {\n ctx.lineTo(storedLines[i].x, storedLines[i].y)\n }\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }", "function isWholeLineUpdate(doc, change) {\n\t\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n\t\t }", "function isWholeLineUpdate(doc, change) {\n\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n\t }", "function isWholeLineUpdate(doc, change) {\n\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n\t }", "function isWholeLineUpdate(doc, change) {\n\t return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n\t (!doc.cm || doc.cm.options.wholeLineUpdateBefore);\n\t }", "isDraw() {\n\tif(!this.isFinished()||this.getWinner()!==null)\n return false;\n else\n return true;\n }", "function updateLines(line) {\n\n\t\t \t// Make sure line is valid\n\t\t \tif(line[0] > 0 && line[1] > 0) {\n\t\t \t\tline[2] = false;\n\t\t \t}\n\n\t\t \t// Update line counts\n\t\t if(line[2] == true) {\n\t\t if(line[0] > 0) {\n\t\t player1Lines[line[0] - 1]++;\n\t\t }\n\t\t if(line[1] > 0) {\n\t\t player2Lines[line[1] - 1]++;\n\t\t }\n\t\t }\n\t\t }", "function updateLines(){\n showLines.innerHTML = ++lineCounter;\n nextLevel(); \n}", "function updateDrawingLineOfAPeer(oldLineObj, newLineObj) {\n oldLineObj.set({\n x2: (newLineObj.x1 < 0) ? newLineObj.left + newLineObj.width : newLineObj.left ,\n y2: (newLineObj.y1 < 0) ? newLineObj.top + newLineObj.height : newLineObj.top\n });\n}", "function validateLine(rowId) {\n\t// If not modified, don't validate\n\tif (cellValue(rowId, \"updated\") != \"true\") {\n\t\treturn true;\n\t}\n\telse {\n\t\tvar price = cellValue(rowId, \"defaultPrice\");\n\t\tif (price != null && price.length > 0 && !isFloat(price)) {\n\t\t\t// Select the row with the error and grab the cursor there as well\n\t\t\tmygrid.selectRowById(rowId, null, false, false);\n\t\t\tdocument.getElementById(\"defaultPrice\" + rowId).focus();\n\t\t\talert(messagesData.notFloat);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "forceUpdate() {\n return this._startUpdate();\n }", "function recalcLines() {\n if (verifyInterface(this._clientInterfaceObj) == true) {\n this._clientInterfaceObj.RecalcLines();\n }\n }", "update() {\r\n this.draw();\r\n inputChange();\r\n }", "function updateDisplay() {\n node\n .attr(\"r\", forceProperties.collide.radius)\n .attr(\"stroke\", forceProperties.charge.strength > 0 ? \"blue\" : \"red\")\n .attr(\"stroke-width\", forceProperties.charge.enabled == false ? 0 : Math.abs(forceProperties.charge.strength) / 15);\n\n \n link\n .attr(\"stroke-width\", forceProperties.link.enabled ? 3 : .5)\n .attr(\"opacity\", forceProperties.link.enabled ? 1 : 0);\n}", "function nextUpdate() {\n\tUPDATING = false;\n\trefreshTimeout = setTimeout(function(){ \n\t\tstartDrawingData(); \n\t}, UPDATE_INTERVAL * 1000);\n}", "function TreeViewItem_UpdateLine()\n{\n\t//have we got a valid html?\n\tif (!this.HTML)\n\t{\n\t\t//create a new line\n\t\tthis.HTML = this.TreeData.HTML.CONTENT.appendChild(document.createElement(\"div\"));\n\t\t//set its styles\n\t\tthis.HTML.style.cssText = \"position:absolute;width:100%;left:0px;overflow:visible;\";\n\t\tthis.HTML.style.height = this.TreeData.TreeLineHeight + (this.TreeData.SAPBelize ? -1 : 0) + \"px\";\n\t\tthis.HTML.style.top = this.Top + \"px\";\n\t\t//this belize look?\n\t\tif (this.TreeData.SAPBelize)\n\t\t{\n\t\t\t//switch background colour\n\t\t\tthis.HTML.style.backgroundColor = \"#ffffff\";\n\t\t\tthis.HTML.style.borderBottom = \"1px solid #E5E5E5\";\n\t\t}\n\t\t//add event\n\t\tBrowser_AddEvent(this.HTML, __BROWSER_EVENT_CLICK, TreeViewLine_MouseDown);\n\t\tBrowser_AddEvent(this.HTML, __BROWSER_EVENT_MOUSERIGHT, TreeViewLine_MouseDown);\n\t\tBrowser_AddEvent(this.HTML, __BROWSER_EVENT_DOUBLECLICK, TreeViewLine_MouseDown);\n\t\t//install the drag listener to the object\n\t\tBrowser_AddEvent(this.HTML, __BROWSER_EVENT_MOUSEDOWN, Dragging_DetectActionStart);\n\t\t//touch enabled?\n\t\tif (__BROWSER_IS_TOUCH_ENABLED)\n\t\t{\n\t\t\t//add double click listener\n\t\t\tBrowser_AddEvent(this.HTML, __BROWSER_EVENT_MOUSEDOWN, TreeViewLine_TouchDoubleClick);\n\t\t}\n\t}\n\t//first thing: update ourselves\n\tthis.HTML.Item = this;\n\t//and ensure our html line is visible\n\tthis.HTML.style.display = \"block\";\n\t//has html objects?\n\tif (!this.HTMLData[this.State])\n\t{\n\t\t//helpers\n\t\tvar buttonDiv, i, c;\n\t\t//position start\n\t\tvar nLeft = 0;\n\t\t//reset the line\n\t\tthis.HTML.innerHTML = \"\"; // SAFE\n\t\t//has lines?\n\t\tif (this.ShowLines)\n\t\t{\n\t\t\t//get parents\n\t\t\tvar parents = [];\n\t\t\tfor (var parent = this.Parent; parent != this.TreeData.Root; parent = parent.Parent)\n\t\t\t{\n\t\t\t\t//parent has sibling? and is showing lines\n\t\t\t\tif (parent.ParentIndex + 1 < parent.Parent.Children.length && parent.ShowLines)\n\t\t\t\t{\n\t\t\t\t\t//create the parent image\n\t\t\t\t\tbuttonDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t\t\t//set style and properties\n\t\t\t\t\tbuttonDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\t\t\tbuttonDiv.style.cssText = \"position:absolute;height:100%;width:16px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_treeviews.png');background-position:-96px center;\";\n\t\t\t\t\t//add to the array\n\t\t\t\t\tparents[parents.length] = buttonDiv;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//use null\n\t\t\t\t\tparents[parents.length] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//now loop through the parents in reverse order\n\t\t\tfor (i = parents.length - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\t//has image?\n\t\t\t\tif (parents[i] != null)\n\t\t\t\t{\n\t\t\t\t\t//set its left\n\t\t\t\t\tparents[i].style.left = nLeft + \"px\";\n\t\t\t\t}\n\t\t\t\t//increment the left\n\t\t\t\tnLeft += this.TreeData.DepthModifier;\n\t\t\t}\n\t\t\t//does this have siblings?\n\t\t\tvar bSiblings = this.ParentIndex + 1 < this.Parent.Children.length;\n\t\t\t//show button?\n\t\t\tif (this.HasButton())\n\t\t\t{\n\t\t\t\t//add the button\n\t\t\t\tbuttonDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t\t//set style and properties\n\t\t\t\tbuttonDiv.id = __TREEVIEW_ACTIONID_BUTTON;\n\t\t\t\tbuttonDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\t\tbuttonDiv.style.cssText = \"position:absolute;height:100%;width:16px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_treeviews.png');\";\n\t\t\t\t//opened?\n\t\t\t\tif (this.Opened)\n\t\t\t\t{\n\t\t\t\t\t//set position\n\t\t\t\t\tbuttonDiv.style.backgroundPosition = bSiblings ? \"-32px center\" : \"-48px center\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set position\n\t\t\t\t\tbuttonDiv.style.backgroundPosition = bSiblings ? \"0px center\" : \"-16px center\";\n\t\t\t\t}\n\t\t\t\t//set left\n\t\t\t\tbuttonDiv.style.left = nLeft + \"px\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//add the button\n\t\t\t\tbuttonDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t\t//set style and properties\n\t\t\t\tbuttonDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\t\tbuttonDiv.style.cssText = \"position:absolute;height:100%;width:16px;background-image:url('\" + __HOST_LESSON_RESOURCES + \"ais_theme_classic_treeviews.png');\";\n\t\t\t\t//set position\n\t\t\t\tbuttonDiv.style.backgroundPosition = bSiblings ? \"-64px center\" : \"-80px center\";\n\t\t\t\t//set left\n\t\t\t\tbuttonDiv.style.left = nLeft + \"px\";\n\t\t\t}\n\t\t\t//advance left for button (whether we display it or not)\n\t\t\tnLeft += this.TreeData.DepthModifier;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//advance depth\n\t\t\tnLeft = this.Depth * this.TreeData.DepthModifier;\n\t\t\t//show button?\n\t\t\tif (this.HasButton())\n\t\t\t{\n\t\t\t\t//add the button\n\t\t\t\tbuttonDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t\t//set style and properties\n\t\t\t\tbuttonDiv.id = __TREEVIEW_ACTIONID_BUTTON;\n\t\t\t\tbuttonDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\t\tbuttonDiv.style.cssText = this.Opened ? this.TreeData.TreeButtonCssOpen : this.TreeData.TreeButtonCssClose;\n\t\t\t\tbuttonDiv.style.left = nLeft + (this.Opened ? this.TreeData.TreeButtonCssOpenWidthModifier : this.TreeData.TreeButtonCssCloseWidthModifier) + \"px\";\n\t\t\t}\n\t\t\t//has leaf icon?\n\t\t\telse if (this.TreeData.TreeButtonCssLeafWidthModifier)\n\t\t\t{\n\t\t\t\t//add the button\n\t\t\t\tbuttonDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t\t//set style and properties\n\t\t\t\tbuttonDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\t\tbuttonDiv.style.cssText = this.TreeData.TreeButtonCssLeaf;\n\t\t\t\tbuttonDiv.style.left = nLeft + this.TreeData.TreeButtonCssLeafWidthModifier + \"px\";\n\t\t\t}\n\t\t\t//advance left for button (whether we display it or not)\n\t\t\tnLeft += this.TreeData.TreeButtonModifier;\n\t\t}\n\n\t\t//start of the selection\n\t\tvar nSelectionStart = nLeft;\n\t\t//has imagelist? and images?\n\t\tif (this.TreeData.ImageList && this.HasImages)\n\t\t{\n\t\t\t//create image for imagelist\n\t\t\tvar imgDiv = this.HTML.appendChild(document.createElement(\"img\"));\n\t\t\t//set style and properties\n\t\t\timgDiv.id = __TREEVIEW_ACTIONID_ITEM;\n\t\t\timgDiv.src = __NEMESIS_EMPTY_BG;\n\t\t\timgDiv.style.cssText = \"position:absolute;\";\n\t\t\tthis.TreeData.ImageList.SetImage(imgDiv, this.Opened ? this.BranchImageOpen : this.BranchImageClose);\n\t\t\timgDiv.style.width = this.TreeData.ImageList.ImageWidth + \"px\";\n\t\t\timgDiv.style.height = this.TreeData.ImageList.ImageHeight + \"px\";\n\t\t\timgDiv.style.left = nLeft + \"px\";\n\t\t\timgDiv.style.top = (this.TreeData.TreeLineHeight - this.TreeData.ImageList.ImageHeight) / 2 + \"px\";\n\t\t\t//advance left for button\n\t\t\tnLeft += this.TreeData.ImageList.ImageWidth;\n\t\t}\n\n\t\t//create the div text\n\t\tvar textDiv = this.HTML.appendChild(document.createElement(\"div\"));\n\t\ttextDiv.id = __TREEVIEW_ACTIONID_ITEM;\n\t\ttextDiv.style.cssText = \"position:absolute;overflow:hidden;padding-left:2px;padding-right:2px;white-space:nowrap;\" + Basic_GetFontStyle(this.TreeData.HTML.InterpreterObject.Properties[__NEMESIS_PROPERTY_FONT]);\n\t\ttextDiv.style.color = this.Selected ? this.FGColorHighlight : this.FGColor;\n\t\ttextDiv.style.backgroundColor = this.Selected ? \"transparent\" : this.BGColor;\n\t\ttextDiv.innerHTML = this.Text; // SAFE BY ENCODING\n\t\ttextDiv.style.left = nLeft + \"px\";\n\t\ttextDiv.style.top = (this.TreeData.TreeLineHeight - Browser_GetOffsetHeight(textDiv)) / 2 + \"px\";\n\n\t\t//has columns?\n\t\tif (this.Columns.length > 0)\n\t\t{\n\t\t\t//no positions?\n\t\t\tif (this.TreeData.ColumnPositions.length > 1)\n\t\t\t{\n\t\t\t\t//loop through the positions (skip first)\n\t\t\t\tfor (var iColPos = 1, cColPos = this.TreeData.ColumnPositions.length, nPreviousColLeft = 0; iColPos < cColPos; iColPos++)\n\t\t\t\t{\n\t\t\t\t\t//get this column's left\n\t\t\t\t\tvar nColLeft = Get_Number(this.TreeData.ColumnPositions[iColPos], 0);\n\t\t\t\t\t//first one?\n\t\t\t\t\tif (iColPos == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//correct the width of the main text\n\t\t\t\t\t\ttextDiv.style.width = nColLeft - nLeft - 2 + \"px\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//correct the width of the main text\n\t\t\t\t\t\tthis.HTML.lastChild.style.width = nColLeft - nPreviousColLeft - 2 + \"px\";\n\t\t\t\t\t}\n\t\t\t\t\t//amend last colLeft\n\t\t\t\t\tnPreviousColLeft = nColLeft;\n\t\t\t\t\t//create the div text\n\t\t\t\t\tvar colDiv = this.HTML.appendChild(document.createElement(\"div\"));\n\t\t\t\t\tcolDiv.id = __TREEVIEW_ACTIONID_ITEM;\n\t\t\t\t\t//set basic styles\n\t\t\t\t\tcolDiv.style.cssText = \"position:absolute;overflow:hidden;padding-left:2px;padding-right:2px;white-space:nowrap;\" + Basic_GetFontStyle(this.TreeData.HTML.InterpreterObject.Properties[__NEMESIS_PROPERTY_FONT]);\n\t\t\t\t\tcolDiv.style.color = this.Selected ? this.FGColorHighlight : this.FGColor;\n\t\t\t\t\tcolDiv.style.backgroundColor = this.Selected ? \"transparent\" : this.BGColor;\n\t\t\t\t\t//now prepare the text\n\t\t\t\t\tvar innerHTML = this.Columns[iColPos - 1]; // SAFE BY ENCODING\n\t\t\t\t\t//did we reach the end?\n\t\t\t\t\tif (iColPos + 1 >= cColPos)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ensure we concatenate all the text\n\t\t\t\t\t\tfor (i = iColPos, c = this.Columns.length; i < c; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//always add a separator, including if the text is bad\n\t\t\t\t\t\t\tinnerHTML += \"&nbsp;\" + this.Columns[i]; // SAFE BY ENCODING\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//and set the text\n\t\t\t\t\tcolDiv.innerHTML = innerHTML; // SAFE BY ENCODING\n\t\t\t\t\t//and its positions (need text to calculate)\n\t\t\t\t\tcolDiv.style.left = nColLeft + \"px\";\n\t\t\t\t\tcolDiv.style.top = (this.TreeData.TreeLineHeight - Browser_GetOffsetHeight(colDiv)) / 2 + \"px\";\n\t\t\t\t}\n\t\t\t\t//correct left\n\t\t\t\tnLeft = Browser_GetScrollWidth(this.HTML);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//just add to it\n\t\t\t\tfor (i = 0, c = this.Columns.length; i < c; i++)\n\t\t\t\t{\n\t\t\t\t\t//always add a separator, including if the text is bad\n\t\t\t\t\ttextDiv.innerHTML += \"&nbsp;\" + this.Columns[i]; // SAFE BY ENCODING\n\t\t\t\t}\n\t\t\t\t//advance left for text\n\t\t\t\tnLeft += Browser_GetOffsetWidth(textDiv);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//advance left for text\n\t\t\tnLeft += Browser_GetOffsetWidth(textDiv);\n\t\t}\n\t\t//create selection div\n\t\tvar selectionDiv = this.HTML.insertBefore(document.createElement(\"div\"), this.HTML.firstChild);\n\t\tselectionDiv.id = __TREEVIEW_ACTIONID_ITEM;\n\t\tselectionDiv.style.cssText = \"position:absolute;\";\n\t\tselectionDiv.style.backgroundColor = this.Selected ? this.BGColorHighlight : \"transparent\";\n\t\tselectionDiv.style.left = nSelectionStart + \"px\";\n\t\tselectionDiv.style.width = nLeft - nSelectionStart + \"px\";\n\t\tselectionDiv.style.height = Browser_GetClientHeight(this.HTML) - 3 + \"px\";\n\t\tselectionDiv.style.border = this.Selected ? this.HighlightBorder : \"none\";\n\t\t//memorise our html\n\t\tthis.HTMLData[this.State] = this.HTML.innerHTML; // SAFE\n\t\t//update the treedata max scrol width\n\t\tthis.TreeData.MaxScrollWidth = Math.max(this.TreeData.MaxScrollWidth, nLeft);\n\t}\n\telse\n\t{\n\t\t//set it directly\n\t\tthis.HTML.innerHTML = this.HTMLData[this.State]; // SAFE BY ENCODING\n\t}\n\t//we have updated\n\tthis.Update = false;\n}", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }", "function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }" ]
[ "0.6166953", "0.60704935", "0.60596794", "0.60596794", "0.6053346", "0.6019743", "0.60192144", "0.5998646", "0.5990659", "0.59882486", "0.59757817", "0.59637856", "0.59621394", "0.5947941", "0.5947941", "0.5947941", "0.5947941", "0.59250045", "0.5923247", "0.59215856", "0.59215856", "0.5903219", "0.59021616", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.5888839", "0.58749104", "0.58749104", "0.5848732", "0.57424474", "0.57207584", "0.5651128", "0.5599998", "0.5596209", "0.55922854", "0.55922854", "0.553551", "0.5523145", "0.5515984", "0.5496071", "0.54947656", "0.5489749", "0.5489749", "0.5478269", "0.54751027", "0.5473974", "0.54712343", "0.5464897", "0.5463334", "0.54575527", "0.54375565", "0.5424663", "0.5424663", "0.5424663", "0.5416138", "0.5403621", "0.5403473", "0.5400344", "0.5394224", "0.5391754", "0.53890646", "0.53810656", "0.5372715", "0.53707325", "0.5369656", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383", "0.5369383" ]
0.5917034
36
Sync the actual display DOM structure with display.view, removing nodes for lines that are no longer in view, and creating the ones that are not there yet, and updating the ones that are out of date.
function patchDisplay(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers; var container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; // Works around a throw-scroll bug in OS X Webkit if (webkit && mac && cm.display.currentWheelTarget == node) { node.style.display = "none"; } else { node.parentNode.removeChild(node); } return next } var view = display.view, lineN = display.viewFrom; // Loop over the elements in the view, syncing cur (the DOM nodes // in display.lineDiv) with the view as we go. for (var i = 0; i < view.length; i++) { var lineView = view[i]; if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet var node = buildLineElement(cm, lineView, lineN, dims); container.insertBefore(node, cur); } else { // Already drawn while (cur != lineView.node) { cur = rm(cur); } var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber; if (lineView.changes) { if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } updateLineForChanges(cm, lineView, lineN, dims); } if (updateNumber) { removeChildren(lineView.lineNumber); lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); } cur = lineView.node.nextSibling; } lineN += lineView.size; } while (cur) { cur = rm(cur); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t var container = display.lineDiv, cur = container.firstChild;\n\t\n\t function rm(node) {\n\t var next = node.nextSibling;\n\t // Works around a throw-scroll bug in OS X Webkit\n\t if (webkit && mac && cm.display.currentWheelTarget == node)\n\t node.style.display = \"none\";\n\t else\n\t node.parentNode.removeChild(node);\n\t return next;\n\t }\n\t\n\t var view = display.view, lineN = display.viewFrom;\n\t // Loop over the elements in the view, syncing cur (the DOM nodes\n\t // in display.lineDiv) with the view as we go.\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (lineView.hidden) {\n\t } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n\t var node = buildLineElement(cm, lineView, lineN, dims);\n\t container.insertBefore(node, cur);\n\t } else { // Already drawn\n\t while (cur != lineView.node) cur = rm(cur);\n\t var updateNumber = lineNumbers && updateNumbersFrom != null &&\n\t updateNumbersFrom <= lineN && lineView.lineNumber;\n\t if (lineView.changes) {\n\t if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n\t updateLineForChanges(cm, lineView, lineN, dims);\n\t }\n\t if (updateNumber) {\n\t removeChildren(lineView.lineNumber);\n\t lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n\t }\n\t cur = lineView.node.nextSibling;\n\t }\n\t lineN += lineView.size;\n\t }\n\t while (cur) cur = rm(cur);\n\t }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t var container = display.lineDiv, cur = container.firstChild;\n\n\t function rm(node) {\n\t var next = node.nextSibling;\n\t // Works around a throw-scroll bug in OS X Webkit\n\t if (webkit && mac && cm.display.currentWheelTarget == node)\n\t node.style.display = \"none\";\n\t else\n\t node.parentNode.removeChild(node);\n\t return next;\n\t }\n\n\t var view = display.view, lineN = display.viewFrom;\n\t // Loop over the elements in the view, syncing cur (the DOM nodes\n\t // in display.lineDiv) with the view as we go.\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (lineView.hidden) {\n\t } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n\t var node = buildLineElement(cm, lineView, lineN, dims);\n\t container.insertBefore(node, cur);\n\t } else { // Already drawn\n\t while (cur != lineView.node) cur = rm(cur);\n\t var updateNumber = lineNumbers && updateNumbersFrom != null &&\n\t updateNumbersFrom <= lineN && lineView.lineNumber;\n\t if (lineView.changes) {\n\t if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n\t updateLineForChanges(cm, lineView, lineN, dims);\n\t }\n\t if (updateNumber) {\n\t removeChildren(lineView.lineNumber);\n\t lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n\t }\n\t cur = lineView.node.nextSibling;\n\t }\n\t lineN += lineView.size;\n\t }\n\t while (cur) cur = rm(cur);\n\t }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t var container = display.lineDiv, cur = container.firstChild;\n\n\t function rm(node) {\n\t var next = node.nextSibling;\n\t // Works around a throw-scroll bug in OS X Webkit\n\t if (webkit && mac && cm.display.currentWheelTarget == node)\n\t node.style.display = \"none\";\n\t else\n\t node.parentNode.removeChild(node);\n\t return next;\n\t }\n\n\t var view = display.view, lineN = display.viewFrom;\n\t // Loop over the elements in the view, syncing cur (the DOM nodes\n\t // in display.lineDiv) with the view as we go.\n\t for (var i = 0; i < view.length; i++) {\n\t var lineView = view[i];\n\t if (lineView.hidden) {\n\t } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n\t var node = buildLineElement(cm, lineView, lineN, dims);\n\t container.insertBefore(node, cur);\n\t } else { // Already drawn\n\t while (cur != lineView.node) cur = rm(cur);\n\t var updateNumber = lineNumbers && updateNumbersFrom != null &&\n\t updateNumbersFrom <= lineN && lineView.lineNumber;\n\t if (lineView.changes) {\n\t if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n\t updateLineForChanges(cm, lineView, lineN, dims);\n\t }\n\t if (updateNumber) {\n\t removeChildren(lineView.lineNumber);\n\t lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n\t }\n\t cur = lineView.node.nextSibling;\n\t }\n\t lineN += lineView.size;\n\t }\n\t while (cur) cur = rm(cur);\n\t }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t\t var container = display.lineDiv, cur = container.firstChild;\n\t\t\n\t\t function rm(node) {\n\t\t var next = node.nextSibling;\n\t\t // Works around a throw-scroll bug in OS X Webkit\n\t\t if (webkit && mac && cm.display.currentWheelTarget == node)\n\t\t node.style.display = \"none\";\n\t\t else\n\t\t node.parentNode.removeChild(node);\n\t\t return next;\n\t\t }\n\t\t\n\t\t var view = display.view, lineN = display.viewFrom;\n\t\t // Loop over the elements in the view, syncing cur (the DOM nodes\n\t\t // in display.lineDiv) with the view as we go.\n\t\t for (var i = 0; i < view.length; i++) {\n\t\t var lineView = view[i];\n\t\t if (lineView.hidden) {\n\t\t } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n\t\t var node = buildLineElement(cm, lineView, lineN, dims);\n\t\t container.insertBefore(node, cur);\n\t\t } else { // Already drawn\n\t\t while (cur != lineView.node) cur = rm(cur);\n\t\t var updateNumber = lineNumbers && updateNumbersFrom != null &&\n\t\t updateNumbersFrom <= lineN && lineView.lineNumber;\n\t\t if (lineView.changes) {\n\t\t if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n\t\t updateLineForChanges(cm, lineView, lineN, dims);\n\t\t }\n\t\t if (updateNumber) {\n\t\t removeChildren(lineView.lineNumber);\n\t\t lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n\t\t }\n\t\t cur = lineView.node.nextSibling;\n\t\t }\n\t\t lineN += lineView.size;\n\t\t }\n\t\t while (cur) cur = rm(cur);\n\t\t }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display,\n lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv,\n cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling; // Works around a throw-scroll bug in OS X Webkit\n\n if (webkit && mac && cm.display.currentWheelTarget == node) {\n node.style.display = \"none\";\n } else {\n node.parentNode.removeChild(node);\n }\n\n return next;\n }\n\n var view = display.view,\n lineN = display.viewFrom; // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ;else if (!lineView.node || lineView.node.parentNode != container) {\n // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else {\n // Already drawn\n while (cur != lineView.node) {\n cur = rm(cur);\n }\n\n var updateNumber = lineNumbers && updateNumbersFrom != null && updateNumbersFrom <= lineN && lineView.lineNumber;\n\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) {\n updateNumber = false;\n }\n\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n\n while (cur) {\n cur = rm(cur);\n }\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n\t\t var display = cm.display, lineNumbers = cm.options.lineNumbers;\n\t\t var container = display.lineDiv, cur = container.firstChild;\n\n\t\t function rm(node) {\n\t\t var next = node.nextSibling;\n\t\t // Works around a throw-scroll bug in OS X Webkit\n\t\t if (webkit && mac && cm.display.currentWheelTarget == node)\n\t\t { node.style.display = \"none\"; }\n\t\t else\n\t\t { node.parentNode.removeChild(node); }\n\t\t return next\n\t\t }\n\n\t\t var view = display.view, lineN = display.viewFrom;\n\t\t // Loop over the elements in the view, syncing cur (the DOM nodes\n\t\t // in display.lineDiv) with the view as we go.\n\t\t for (var i = 0; i < view.length; i++) {\n\t\t var lineView = view[i];\n\t\t if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n\t\t var node = buildLineElement(cm, lineView, lineN, dims);\n\t\t container.insertBefore(node, cur);\n\t\t } else { // Already drawn\n\t\t while (cur != lineView.node) { cur = rm(cur); }\n\t\t var updateNumber = lineNumbers && updateNumbersFrom != null &&\n\t\t updateNumbersFrom <= lineN && lineView.lineNumber;\n\t\t if (lineView.changes) {\n\t\t if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n\t\t updateLineForChanges(cm, lineView, lineN, dims);\n\t\t }\n\t\t if (updateNumber) {\n\t\t removeChildren(lineView.lineNumber);\n\t\t lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n\t\t }\n\t\t cur = lineView.node.nextSibling;\n\t\t }\n\t\t lineN += lineView.size;\n\t\t }\n\t\t while (cur) { cur = rm(cur); }\n\t\t }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\";\n else\n node.parentNode.removeChild(node);\n return next;\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur);\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) cur = rm(cur);\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n let display = cm.display, lineNumbers = cm.options.lineNumbers\n let container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n let next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n node.style.display = \"none\"\n else\n node.parentNode.removeChild(node)\n return next\n }\n\n let view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (let i = 0; i < view.length; i++) {\n let lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n let node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) cur = rm(cur)\n let updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) cur = rm(cur)\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\r\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\r\n var container = display.lineDiv, cur = container.firstChild;\r\n\r\n function rm(node) {\r\n var next = node.nextSibling;\r\n // Works around a throw-scroll bug in OS X Webkit\r\n if (webkit && mac && cm.display.currentWheelTarget == node)\r\n node.style.display = \"none\";\r\n else\r\n node.parentNode.removeChild(node);\r\n return next;\r\n }\r\n\r\n var view = display.view, lineN = display.viewFrom;\r\n // Loop over the elements in the view, syncing cur (the DOM nodes\r\n // in display.lineDiv) with the view as we go.\r\n for (var i = 0; i < view.length; i++) {\r\n var lineView = view[i];\r\n if (lineView.hidden) {\r\n } else if (!lineView.node) { // Not drawn yet\r\n var node = buildLineElement(cm, lineView, lineN, dims);\r\n container.insertBefore(node, cur);\r\n } else { // Already drawn\r\n while (cur != lineView.node) cur = rm(cur);\r\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\r\n updateNumbersFrom <= lineN && lineView.lineNumber;\r\n if (lineView.changes) {\r\n if (indexOf(lineView.changes, \"gutter\") > -1) updateNumber = false;\r\n updateLineForChanges(cm, lineView, lineN, dims);\r\n }\r\n if (updateNumber) {\r\n removeChildren(lineView.lineNumber);\r\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\r\n }\r\n cur = lineView.node.nextSibling;\r\n }\r\n lineN += lineView.size;\r\n }\r\n while (cur) cur = rm(cur);\r\n }", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers\n var container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n var next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\" }\n else\n { node.parentNode.removeChild(node) }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur) }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false }\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) { cur = rm(cur) }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers\n var container = display.lineDiv, cur = container.firstChild\n\n function rm(node) {\n var next = node.nextSibling\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\" }\n else\n { node.parentNode.removeChild(node) }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i]\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims)\n container.insertBefore(node, cur)\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur) }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false }\n updateLineForChanges(cm, lineView, lineN, dims)\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber)\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))\n }\n cur = lineView.node.nextSibling\n }\n lineN += lineView.size\n }\n while (cur) { cur = rm(cur) }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) {\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n}", "function patchDisplay(cm, updateNumbersFrom, dims) {\r\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\r\n var container = display.lineDiv, cur = container.firstChild;\r\n\r\n function rm(node) {\r\n var next = node.nextSibling;\r\n // Works around a throw-scroll bug in OS X Webkit\r\n if (webkit && mac && cm.display.currentWheelTarget == node)\r\n { node.style.display = \"none\"; }\r\n else\r\n { node.parentNode.removeChild(node); }\r\n return next\r\n }\r\n\r\n var view = display.view, lineN = display.viewFrom;\r\n // Loop over the elements in the view, syncing cur (the DOM nodes\r\n // in display.lineDiv) with the view as we go.\r\n for (var i = 0; i < view.length; i++) {\r\n var lineView = view[i];\r\n if (lineView.hidden) {\r\n } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\r\n var node = buildLineElement(cm, lineView, lineN, dims);\r\n container.insertBefore(node, cur);\r\n } else { // Already drawn\r\n while (cur != lineView.node) { cur = rm(cur); }\r\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\r\n updateNumbersFrom <= lineN && lineView.lineNumber;\r\n if (lineView.changes) {\r\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\r\n updateLineForChanges(cm, lineView, lineN, dims);\r\n }\r\n if (updateNumber) {\r\n removeChildren(lineView.lineNumber);\r\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\r\n }\r\n cur = lineView.node.nextSibling;\r\n }\r\n lineN += lineView.size;\r\n }\r\n while (cur) { cur = rm(cur); }\r\n}", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from >= showingFrom && visible.to <= showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = gutter.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n if (options.lineWrapping) {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {updateLineHeight(line, height); gutterDirty = true;}\n }\n curNode = curNode.nextSibling;\n });\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) updateGutter();\n updateCursor();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart})\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n updateGutter();\n }\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart})\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n updateGutter();\n }\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function updateDisplay(changes) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = 0;\n return;\n }\n // First create a range of theoretically intact lines, and punch\n // holes in that using the change info.\n var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];\n for (var i = 0, l = changes.length || 0; i < l; ++i) {\n var change = changes[i], intact2 = [], diff = change.diff || 0;\n for (var j = 0, l2 = intact.length; j < l2; ++j) {\n var range = intact[j];\n if (change.to <= range.from)\n intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});\n else if (range.to <= change.from)\n intact2.push(range);\n else {\n if (change.from > range.from)\n intact2.push({from: range.from, to: change.from, domStart: range.domStart});\n if (change.to < range.to)\n intact2.push({from: change.to + diff, to: range.to + diff,\n domStart: range.domStart + (change.to - range.from)});\n }\n }\n intact = intact2;\n }\n\n // Then, determine which lines we'd want to see, and which\n // updates have to be made to get there.\n var visible = visibleLines();\n var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),\n to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),\n updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;\n\n for (var i = 0, l = intact.length; i < l; ++i) {\n var range = intact[i];\n if (range.to <= from) continue;\n if (range.from >= to) break;\n if (range.domStart > domPos || range.from > pos) {\n updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});\n changedLines += range.from - pos;\n }\n pos = range.to;\n domPos = range.domStart + (range.to - range.from);\n }\n if (domPos != domEnd || pos != to) {\n changedLines += Math.abs(to - pos);\n updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});\n if (to - pos != domEnd - domPos) gutterDirty = true;\n }\n\n if (!updates.length) return;\n lineDiv.style.display = \"none\";\n // If more than 30% of the screen needs update, just do a full\n // redraw (which is quicker than patching)\n if (changedLines > (visible.to - visible.from) * .3)\n refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));\n // Otherwise, only update the stuff that needs updating.\n else\n patchDisplay(updates);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;\n showingFrom = from; showingTo = to;\n mover.style.top = (from * lineHeight()) + \"px\";\n if (different) {\n lastHeight = scroller.clientHeight;\n code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + \"px\";\n }\n if (different || gutterDirty) updateGutter();\n\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(updates) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n updateCursor();\n }", "function Interpreter_UpdateDisplay()\n{\n\t//helpers\n\tvar uidObject, theObject;\n\t//loop through all of our iframes\n\tfor (uidObject in this.LoadedIFrames)\n\t{\n\t\t//get the object\n\t\ttheObject = this.LoadedIFrames[uidObject];\n\t\t//valid?\n\t\tif (theObject && theObject.HTML)\n\t\t{\n\t\t\t//purge all css data\n\t\t\tBrowser_RemoveCSSData_Purge(theObject.HTML.contentDocument);\n\t\t}\n\t}\n\t//purge all css data from main doc too\n\tBrowser_RemoveCSSData_Purge(document);\n\t//loop through all toplevel objects\n\tfor (uidObject in this.TopLevelObjects)\n\t{\n\t\t//get the object\n\t\ttheObject = this.TopLevelObjects[uidObject];\n\t\t//valid?\n\t\tif (theObject)\n\t\t{\n\t\t\t//update it with full recursion\n\t\t\ttheObject.UpdateDisplay(true);\n\t\t}\n\t}\n\t//rearrange the forms\n\tForm_RearrangeForms(this.FocusedFormId);\n\t//and reset this\n\tthis.FocusedFormId = [];\n\t//have we got a focused object id? (AND NOT IN DESIGNER)\n\tif (this.State && this.State.FocusedObjectId > 0)\n\t{\n\t\t//memorise it\n\t\tthis.FocusedObjectId = this.State.FocusedObjectId;\n\t}\n\t//we need to handle the tabs here\n\tthis.PreUpdatePostDisplay();\n}", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from && from == showingFrom && to == showingTo) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = gutter.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n if (scroller.clientHeight)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n function checkHeights() {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild, heightChanged = false;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {\n updateLineHeight(line, height);\n gutterDirty = heightChanged = true;\n }\n }\n curNode = curNode.nextSibling;\n });\n if (heightChanged)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n return heightChanged;\n }\n\n if (options.lineWrapping) {\n checkHeights();\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) {\n // If the gutter grew in size, re-check heights. If those changed, re-draw gutter.\n updateGutter() && options.lineWrapping && checkHeights() && updateGutter();\n }\n updateSelection();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from && from == showingFrom && to == showingTo) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = gutter.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n if (scroller.clientHeight)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n function checkHeights() {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild, heightChanged = false;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {\n updateLineHeight(line, height);\n gutterDirty = heightChanged = true;\n }\n }\n curNode = curNode.nextSibling;\n });\n if (heightChanged)\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n return heightChanged;\n }\n\n if (options.lineWrapping) {\n checkHeights();\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) {\n // If the gutter grew in size, re-check heights. If those changed, re-draw gutter.\n updateGutter() && options.lineWrapping && checkHeights() && updateGutter();\n }\n updateSelection();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateView(){\n\tmainContents = clearView();\n\tdocument.getElementById('main').innerHTML = mainContents;\n}", "function updateDOM() {\n\tvar newTree = render(data);\n\tvar patches = diff(tree, newTree);\n\trootNode = patch(rootNode, patches);\n\ttree = newTree;\n}", "function updateDisplayList() {\n\tvar topStart = initStart;\n\t\n\tif (commentVBox != null) {\n\t\tTi.API.info('updateDisplayList: Removing commentVBox ...');\n\t\twin.remove(commentVBox);\n\t}\n\n\t// list of comment components\t\n\tvar commentList = [];\n\t\n\tTi.API.info('updateDisplayList: counter: ' + msgEvent.commentCounter);\n\t\t\n\tif (msgEvent.commentCounter > 0) {\n\t\tfor (i=0; i<msgEvent.commentCounter; i++) {\n\t\t\tvar commentInst = msgEvent.comments[i];\n\t\t\tvar r = createExistingCommentRow(commentInst, i);\n\t\t\tcommentList.push(r);\n\t\t}\n\t}\n\t\n\t//\n\t// component for user to add new comments section\n\t//\n\tif (localFlag) {\n\t\tvar last = createNewCommentsSection(msgEvent);\n\t\tcommentList.push(last);\n\t}\n\t\n\tcommentVBox = Titanium.UI.createTableView({\n\t\tscrollable:true,\n\t\tmoving:false,\n\t\tselectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.GRAY,\n\t\tdata:commentList,\n\t\tseparatorColor:CSSMgr.color0,\n\t\ttop:topStart,\n\t\tleft:0,\n\t\theight:240,\n\t\tfilterAttribute:'filter'\n\t});\n\tcommentVBox.backgroundImage = '../images/Background.png';\n\twin.add(commentVBox);\n\t\n\tvar reportAbuseBtn = Titanium.UI.createButton({\n \t\ttitle:'Report Abuse',\n\t\tcolor:CSSMgr.color2,\n\t\tbackgroundColor:CSSMgr.color0,\n \t\tfont:{fontSize:12, fontFamily:model.myFont, fontWeight:'bold'},\n\t\tstyle:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,\n\t\twidth:100,\n \t\theight:30,\n\t\tbottom:0,\n\t\tright:0\n\t});\n\treportAbuseBtn.addEventListener('click', function(e) {\n\t\tvar w = Titanium.UI.createWindow({\n\t\t\turl:'reportAbuseList.js',\n\t\t\tmodel:win.model,\n\t\t\tmsgEvent:msgEvent,\n\t\t\tbackgroundColor:CSSMgr.color0,\n \t\t\tbarColor:CSSMgr.color0,\n\t\t\tbarImage: '../images/Header.png'\n\t\t});\n\t\tTitanium.UI.currentTab.open(w, {animated:true});\n\t});\n\twin.add(reportAbuseBtn);\n}", "function updateDisplayInner(cm, changes, visible, forced) {\n var display = cm.display, doc = cm.doc;\n if (!display.wrapper.clientWidth) {\n display.showingFrom = display.showingTo = doc.first;\n display.viewOffset = 0;\n return;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!forced && changes.length == 0 &&\n visible.from > display.showingFrom && visible.to < display.showingTo)\n return;\n\n if (maybeUpdateLineNumberWidth(cm))\n changes = [{from: doc.first, to: doc.first + doc.size}];\n var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n // Used to determine which lines need their line numbers updated\n var positionsChangedFrom = Infinity;\n if (cm.options.lineNumbers)\n for (var i = 0; i < changes.length; ++i)\n if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }\n\n var end = doc.first + doc.size;\n var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, visible.to + cm.options.viewportMargin);\n if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);\n if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);\n if (sawCollapsedSpans) {\n from = lineNo(visualLine(doc, getLine(doc, from)));\n while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;\n }\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = [{from: Math.max(display.showingFrom, doc.first),\n to: Math.min(display.showingTo, end)}];\n if (intact[0].from >= intact[0].to) intact = [];\n else intact = computeIntact(intact, changes);\n // When merged lines are present, we might have to reduce the\n // intact ranges because changes in continued fragments of the\n // intact lines do require the lines to be redrawn.\n if (sawCollapsedSpans)\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i], merged;\n while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {\n var newTo = merged.find().from.line;\n if (newTo > range.from) range.to = newTo;\n else { intact.splice(i--, 1); break; }\n }\n }\n\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) range.from = from;\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {\n updateViewOffset(cm);\n return;\n }\n intact.sort(function(a, b) {return a.from - b.from;});\n\n // Avoid crashing on IE's \"unspecified error\" when in iframes\n try {\n var focused = document.activeElement;\n } catch(e) {}\n if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, from, to, intact, positionsChangedFrom);\n display.lineDiv.style.display = \"\";\n if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n var different = from != display.showingFrom || to != display.showingTo ||\n display.lastSizeC != display.wrapper.clientHeight;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) {\n display.lastSizeC = display.wrapper.clientHeight;\n startWorker(cm, 400);\n }\n display.showingFrom = from; display.showingTo = to;\n\n updateHeightsInViewport(cm);\n updateViewOffset(cm);\n\n return true;\n }", "function updateDisplayInner(cm, changes, visible, forced) {\n var display = cm.display, doc = cm.doc;\n if (!display.wrapper.clientWidth) {\n display.showingFrom = display.showingTo = doc.first;\n display.viewOffset = 0;\n return;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!forced && changes.length == 0 &&\n visible.from > display.showingFrom && visible.to < display.showingTo)\n return;\n\n if (maybeUpdateLineNumberWidth(cm))\n changes = [{from: doc.first, to: doc.first + doc.size}];\n var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n // Used to determine which lines need their line numbers updated\n var positionsChangedFrom = Infinity;\n if (cm.options.lineNumbers)\n for (var i = 0; i < changes.length; ++i)\n if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }\n\n var end = doc.first + doc.size;\n var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, visible.to + cm.options.viewportMargin);\n if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);\n if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);\n if (sawCollapsedSpans) {\n from = lineNo(visualLine(doc, getLine(doc, from)));\n while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;\n }\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = [{from: Math.max(display.showingFrom, doc.first),\n to: Math.min(display.showingTo, end)}];\n if (intact[0].from >= intact[0].to) intact = [];\n else intact = computeIntact(intact, changes);\n // When merged lines are present, we might have to reduce the\n // intact ranges because changes in continued fragments of the\n // intact lines do require the lines to be redrawn.\n if (sawCollapsedSpans)\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i], merged;\n while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {\n var newTo = merged.find().from.line;\n if (newTo > range.from) range.to = newTo;\n else { intact.splice(i--, 1); break; }\n }\n }\n\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) range.from = from;\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {\n updateViewOffset(cm);\n return;\n }\n intact.sort(function(a, b) {return a.from - b.from;});\n\n // Avoid crashing on IE's \"unspecified error\" when in iframes\n try {\n var focused = document.activeElement;\n } catch(e) {}\n if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, from, to, intact, positionsChangedFrom);\n display.lineDiv.style.display = \"\";\n if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n var different = from != display.showingFrom || to != display.showingTo ||\n display.lastSizeC != display.wrapper.clientHeight;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) {\n display.lastSizeC = display.wrapper.clientHeight;\n startWorker(cm, 400);\n }\n display.showingFrom = from; display.showingTo = to;\n\n updateHeightsInViewport(cm);\n updateViewOffset(cm);\n\n return true;\n }", "function updateDisplayInner(cm, changes, visible, forced) {\n var display = cm.display, doc = cm.doc;\n if (!display.wrapper.clientWidth) {\n display.showingFrom = display.showingTo = doc.first;\n display.viewOffset = 0;\n return;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!forced && changes.length == 0 &&\n visible.from > display.showingFrom && visible.to < display.showingTo)\n return;\n\n if (maybeUpdateLineNumberWidth(cm))\n changes = [{from: doc.first, to: doc.first + doc.size}];\n var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n // Used to determine which lines need their line numbers updated\n var positionsChangedFrom = Infinity;\n if (cm.options.lineNumbers)\n for (var i = 0; i < changes.length; ++i)\n if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; }\n\n var end = doc.first + doc.size;\n var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, visible.to + cm.options.viewportMargin);\n if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);\n if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);\n if (sawCollapsedSpans) {\n from = lineNo(visualLine(doc, getLine(doc, from)));\n while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;\n }\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = [{from: Math.max(display.showingFrom, doc.first),\n to: Math.min(display.showingTo, end)}];\n if (intact[0].from >= intact[0].to) intact = [];\n else intact = computeIntact(intact, changes);\n // When merged lines are present, we might have to reduce the\n // intact ranges because changes in continued fragments of the\n // intact lines do require the lines to be redrawn.\n if (sawCollapsedSpans)\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i], merged;\n while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {\n var newTo = merged.find().from.line;\n if (newTo > range.from) range.to = newTo;\n else { intact.splice(i--, 1); break; }\n }\n }\n\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) range.from = from;\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {\n updateViewOffset(cm);\n return;\n }\n intact.sort(function(a, b) {return a.from - b.from;});\n\n // Avoid crashing on IE's \"unspecified error\" when in iframes\n try {\n var focused = document.activeElement;\n } catch(e) {}\n if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, from, to, intact, positionsChangedFrom);\n display.lineDiv.style.display = \"\";\n if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n var different = from != display.showingFrom || to != display.showingTo ||\n display.lastSizeC != display.wrapper.clientHeight;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) {\n display.lastSizeC = display.wrapper.clientHeight;\n startWorker(cm, 400);\n }\n display.showingFrom = from; display.showingTo = to;\n\n updateHeightsInViewport(cm);\n updateViewOffset(cm);\n\n return true;\n }", "function refreshDisplay() {\r\n\r\n if (useOfflineSync) {\r\n syncLocalTable().then(displayItems);\r\n } else {\r\n displayItems();\r\n }\r\n }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false\n\t\t }\n\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t { return false }\n\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n\t\t if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t { return false }\n\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var selSnapshot = selectionSnapshot(cm);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t restoreSelection(selSnapshot);\n\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\n\t\t display.updateLineNumbers = null;\n\n\t\t return true\n\t\t }", "function updateDisplayInner(cm, changes, visible, forced) {\n var display = cm.display, doc = cm.doc;\n if (!display.wrapper.offsetWidth) {\n display.showingFrom = display.showingTo = doc.first;\n display.viewOffset = 0;\n return;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!forced && changes.length == 0 &&\n visible.from > display.showingFrom && visible.to < display.showingTo)\n return;\n\n if (maybeUpdateLineNumberWidth(cm))\n changes = [{from: doc.first, to: doc.first + doc.size}];\n var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + \"px\";\n display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : \"0\";\n\n // Used to determine which lines need their line numbers updated\n var positionsChangedFrom = Infinity;\n if (cm.options.lineNumbers)\n for (var i = 0; i < changes.length; ++i)\n if (changes[i].diff && changes[i].from < positionsChangedFrom) { positionsChangedFrom = changes[i].from; }\n\n var end = doc.first + doc.size;\n var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, visible.to + cm.options.viewportMargin);\n if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);\n if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);\n if (sawCollapsedSpans) {\n from = lineNo(visualLine(doc, getLine(doc, from)));\n while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;\n }\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = [{from: Math.max(display.showingFrom, doc.first),\n to: Math.min(display.showingTo, end)}];\n if (intact[0].from >= intact[0].to) intact = [];\n else intact = computeIntact(intact, changes);\n // When merged lines are present, we might have to reduce the\n // intact ranges because changes in continued fragments of the\n // intact lines do require the lines to be redrawn.\n if (sawCollapsedSpans)\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i], merged;\n while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {\n var newTo = merged.find().from.line;\n if (newTo > range.from) range.to = newTo;\n else { intact.splice(i--, 1); break; }\n }\n }\n\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) range.from = from;\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (!forced && intactLines == to - from && from == display.showingFrom && to == display.showingTo) {\n updateViewOffset(cm);\n return;\n }\n intact.sort(function(a, b) {return a.from - b.from;});\n\n // Avoid crashing on IE's \"unspecified error\" when in iframes\n try {\n var focused = document.activeElement;\n } catch(e) {}\n if (intactLines < (to - from) * .7) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, from, to, intact, positionsChangedFrom);\n display.lineDiv.style.display = \"\";\n if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();\n\n var different = from != display.showingFrom || to != display.showingTo ||\n display.lastSizeC != display.wrapper.clientHeight;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) {\n display.lastSizeC = display.wrapper.clientHeight;\n startWorker(cm, 400);\n }\n display.showingFrom = from; display.showingTo = to;\n\n display.gutters.style.height = \"\";\n updateHeightsInViewport(cm);\n updateViewOffset(cm);\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\t\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\t\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\t\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\t\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\t\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\t\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\t\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\t\n\t display.updateLineNumbers = null;\n\t\n\t return true;\n\t }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\n\t display.updateLineNumbers = null;\n\n\t return true;\n\t }", "function update() {\n\n\t\tif (root == null) {\n\t\t\treturn\n\t\t}\n\n\t\tlet bounds = element.bounds()\n\t\tlet fontSize = element.css('font-size')\n\t\tlet fontWeight = element.css('font-weight')\n\n\t\tif (measuredWidth == bounds.width &&\n\t\t\tmeasuredHeight == bounds.height &&\n\t\t\tmeasuredFontSize == fontSize &&\n\t\t\tmeasuredFontWeight == fontWeight) {\n\n\t\t\t/*\n\t\t\t * The area did not change thus the lines should remain\n\t\t\t * the same.\n\t\t\t */\n\n\t\t\treturn\n\t\t}\n\n\t\tmeasuredWidth = bounds.width\n\t\tmeasuredHeight = bounds.height\n\t\tmeasuredFontSize = fontSize\n\t\tmeasuredFontWeight = fontWeight\n\n\t\troot.innerHTML = html\n\n\t\telement.toggleClass('multiline', false)\n\n\t\tlet fragment = document.createDocumentFragment()\n\n\t\tbreakNode(root, fragment)\n\t\temptyNode(root)\n\n\t\troot.appendChild(fragment)\n\n\t\telement.toggleClass('multiline', true)\n\n\t\telement.find('.line').each((i, line) => {\n\n\t\t\tline = $(line)\n\t\t\tline.attr('data-nth-line', i + 1);\n\n\t\t\tline.attr('data-text', line.text())\n\n\t\t\tlet others = line.find(':not(.word)')\n\t\t\tline.toggleClass('plain', others.length == 0)\n\t\t\tline.toggleClass('mixed', others.length != 0)\n\n\t\t})\n\n\t\tif (options &&\n\t\t\toptions.onComplete) {\n\t\t\toptions.onComplete(element)\n\t\t}\n\n\t\telement.emit('breaklines/complete', element)\n\t}", "function update() {\n\n // calculate the x,y coordinates of the currentRoot\n tree(currentRoot);\n\n // create KV for simple access\n var currentRootKV = currentRoot.descendants().reduce(function(kv, el) {kv[el.data.id] = el; return kv},{});\n\n // the currentRoot contains the correct XY positions for all the nodes\n // minus the ones that need to be hidden. We don't want to limit the\n // number of nodes for our data elements, since that causes text and lines to\n // `jump` around. So we need to make sure we have the same amount of elements\n // and hide rendering the hidden ones.\n var toRender = root.descendants().map(function(el) {\n if (currentRootKV[el.data.id]) {\n var newNode = currentRootKV[el.data.id];\n return newNode;\n } else {\n // if the child is not in the KV map, it is hidden. We\n // now need to set its position to the calculated position of\n // the first visible parent. In other words, the first one\n // which is in the currentRootKV map.\n var fromRoot = _.cloneDeep(el);\n var parent = fromRoot.parent;\n while (!currentRootKV[parent.data.id]) {\n parent = parent.parent;\n }\n var newParent = currentRootKV[parent.data.id];\n\n fromRoot.hidden = true;\n fromRoot.x = newParent.x;\n fromRoot.y = newParent.y;\n\n // we also set the parents x,y since the lines need to\n // be drawn from this position.\n fromRoot.parent.x = newParent.x;\n fromRoot.parent.y = newParent.y;\n\n return fromRoot;\n }\n });\n\n // now that we have to correct data, create the links\n var links = chart.selectAll(\".link\")\n .data(toRender.slice(1));\n\n var linksEnter = links.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", diagonal({x:0, y:0, parent: {x:0, y:0}}))\n .style(\"stroke\", function(d) {return colorScale(d.data.group)});\n\n links.merge(linksEnter)\n .transition().duration(2000).attr(\"d\", diagonal);\n\n // create the groups that hold the circle and the text elements\n var nodes = chart.selectAll(\".node\").data(toRender);\n\n var nodesEnter = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"click\", click)\n\n nodesEnter.append(\"circle\")\n .attr(\"r\", 2.5)\n .style(\"fill\", function(d) {return colorScale(d.data.group)});\n\n nodesEnter.append(\"text\")\n .attr(\"dy\", \".31em\")\n\n // combine the updated and new nodes\n var nodesUpdate = nodes.merge(nodesEnter);\n\n // transition the nodes (circles & text)\n nodesUpdate.transition().duration(2000)\n .attr(\"transform\", function(d) { return \"translate(\" + project(d.x, d.y) + \")\"; })\n .style(\"opacity\", function(d) { return !d.hidden ? 1 : 0} )\n .on(\"end\", function(d) {d.hidden ? d3.select(this).attr(\"display\", \"none\"): \"\"})\n .on(\"start\", function(d) {!d.hidden ? d3.select(this).attr(\"display\", \"\"): \"\"});\n\n nodesUpdate.select(\"text\")\n .attr(\"x\", function(d) { return d.x < 180 === !d.children ? 6 : -6; })\n .text(function(d) {return d.data.name; })\n // we could also tween the anchor see chapter 2\n .style(\"text-anchor\", function(d) {\n // for the right side\n if (d.x < 180 && d.children) return \"end\"\n else if (d.x < 180 && !d.children) return \"start\"\n // for the left side\n else if (d.x >= 180 && !d.children) return \"end\"\n else if (d.x >= 180 && d.children) return \"start\"\n })\n .transition().duration(2000)\n .attr(\"transform\", function(d) {\n // called once to determine the target value, and tween the values\n return \"rotate(\" + (d.x < 180 ? d.x - 90 : d.x + 90) + \")\";\n })\n }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t return false;\n\t\t\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\t\t\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\t\t\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\t\t\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\t\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t return false;\n\t\t\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var focused = activeElt();\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\t\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\t\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\t\t\n\t\t display.updateLineNumbers = null;\n\t\t\n\t\t return true;\n\t\t }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display,\n doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n } // Bail out if the visible area is already rendered and nothing changed.\n\n\n if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && countDirtyView(cm) == 0) {\n return false;\n }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n } // Compute a suitable new viewport (from & to)\n\n\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\n if (display.viewFrom < from && from - display.viewFrom < 20) {\n from = Math.max(doc.first, display.viewFrom);\n }\n\n if (display.viewTo > to && display.viewTo - to < 20) {\n to = Math.min(end, display.viewTo);\n }\n\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n display.viewOffset = _heightAtLine(getLine(cm.doc, display.viewFrom)); // Position the mover div to align with the current scroll position\n\n cm.display.mover.style.top = display.viewOffset + \"px\";\n var toUpdate = countDirtyView(cm);\n\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) {\n return false;\n } // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n\n\n var selSnapshot = selectionSnapshot(cm);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"none\";\n }\n\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n\n if (toUpdate > 4) {\n display.lineDiv.style.display = \"\";\n }\n\n display.renderedView = display.view; // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n\n restoreSelection(selSnapshot); // Prevent selection and cursors from interfering with the scroll\n // width and height.\n\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n return true;\n }", "function updateDisplay(changes, suppressCallback, scrollTop) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n // If scrollTop is specified, use that to determine which lines\n // to render instead of the current scrollbar position.\n var visible = visibleLines(scrollTop);\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) {\n updateVerticalScroll(scrollTop);\n return;\n }\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from && from == showingFrom && to == showingTo) {\n updateVerticalScroll(scrollTop);\n return;\n }\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = gutter.style.display = \"\";\n\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n function checkHeights() {\n var curNode = lineDiv.firstChild, heightChanged = false;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {\n updateLineHeight(line, height);\n gutterDirty = heightChanged = true;\n }\n }\n curNode = curNode.nextSibling;\n });\n return heightChanged;\n }\n\n if (options.lineWrapping) {\n // Guess whether we're going to need the scrollbar, so that we don't end up changing the linewrapping\n // after the scrollbar appears (during updateVerticalScroll()). Only do this if the scrollbar is\n // appearing (if it's disappearing, we don't have to worry about the scroll position, and there are\n // issues on IE7 if we turn it off too early).\n var virtualHeight = Math.floor(doc.height * th + 2 * paddingTop()), scrollbarHeight = scroller.clientHeight;\n if (virtualHeight > scrollbarHeight) scrollbar.style.display = \"block\";\n checkHeights();\n }\n\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) {\n // If the gutter grew in size, re-check heights. If those changed, re-draw gutter.\n updateGutter() && options.lineWrapping && checkHeights() && updateGutter();\n }\n updateSelection();\n updateVerticalScroll(scrollTop);\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function updateDisplay() {\n\n crawlerModel.user = _useVenueData ? _venueData.messages : _deviceData.messages;\n $scope.mode = ( _useVenueData ? _venueData.mode : _deviceData.mode ) || 'full-size';\n $scope.mode = 'full-size';\n\n getTVGrid();\n\n ogAds.getCurrentAd()\n .then( function ( currentAd ) {\n crawlerModel.ads = currentAd.textAds || [];\n } )\n .then( reloadTweets )\n .then( function () {\n\n $log.debug( \"Rebuilding hz scroller feed\" );\n var tempArr = [];\n crawlerModel.user.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ffffff' } } )\n } );\n\n crawlerModel.twitter.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#87CEEB' } } )\n } );\n\n crawlerModel.ads.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ccf936' } } )\n } );\n\n tempArr = tempArr.filter( function ( x ) {\n return (x !== (undefined || !x.message));\n } );\n\n $scope.crawlerMessages = _.shuffle( tempArr );\n } );\n\n }", "function clearDisplay() {\n hideContainers();\n resetCopyNotes();\n resetClipboardNote();\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "update() {\n\n\t\tconst depth = (this.octree !== null) ? this.octree.getDepth() : -1;\n\n\t\tlet level = 0;\n\t\tlet result;\n\n\t\t// Remove existing geometry.\n\t\tthis.dispose();\n\n\t\twhile(level <= depth) {\n\n\t\t\tresult = this.octree.findNodesByLevel(level);\n\n\t\t\tthis.createLineSegments(\n\t\t\t\tresult[Symbol.iterator](),\n\t\t\t\t(typeof result.size === \"number\") ? result.size : result.length\n\t\t\t);\n\n\t\t\t++level;\n\n\t\t}\n\n\t}", "function updateDisplayIfNeeded(cm, update) {\r\n var display = cm.display, doc = cm.doc;\r\n if (update.editorIsHidden) {\r\n resetView(cm);\r\n return false;\r\n }\r\n\r\n // Bail out if the visible area is already rendered and nothing changed.\r\n if (!update.force &&\r\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\r\n countDirtyView(cm) == 0)\r\n return false;\r\n\r\n if (maybeUpdateLineNumberWidth(cm)) {\r\n resetView(cm);\r\n update.dims = getDimensions(cm);\r\n }\r\n\r\n // Compute a suitable new viewport (from & to)\r\n var end = doc.first + doc.size;\r\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\r\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\r\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\r\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\r\n if (sawCollapsedSpans) {\r\n from = visualLineNo(cm.doc, from);\r\n to = visualLineEndNo(cm.doc, to);\r\n }\r\n\r\n var different = from != display.viewFrom || to != display.viewTo ||\r\n display.lastSizeC != update.wrapperHeight;\r\n adjustView(cm, from, to);\r\n\r\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\r\n // Position the mover div to align with the current scroll position\r\n cm.display.mover.style.top = display.viewOffset + \"px\";\r\n\r\n var toUpdate = countDirtyView(cm);\r\n if (!different && toUpdate == 0 && !update.force &&\r\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\r\n return false;\r\n\r\n // For big changes, we hide the enclosing element during the\r\n // update, since that speeds up the operations on most browsers.\r\n var focused = activeElt();\r\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\r\n patchDisplay(cm, display.updateLineNumbers, update.dims);\r\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\r\n // There might have been a widget with a focused element that got\r\n // hidden or updated, if so re-focus it.\r\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\r\n\r\n // Prevent selection and cursors from interfering with the scroll\r\n // width.\r\n removeChildren(display.cursorDiv);\r\n removeChildren(display.selectionDiv);\r\n\r\n if (different) {\r\n display.lastSizeC = update.wrapperHeight;\r\n startWorker(cm, 400);\r\n }\r\n\r\n display.updateLineNumbers = null;\r\n\r\n return true;\r\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function resetLineDisplay() {\n var tempLineDisplay = [];\n for (var i = 0; i < Trends.MaxLineNumber; i++) {\n tempLineDisplay[i] = true;\n }\n DataViz.mainApp.Configuration.set(DataViz.Config.Trends.wellKnownKeys.lineDisplay, tempLineDisplay);\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n if (update.editorIsHidden) {\n resetView(cm);\n return false;\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n countDirtyView(cm) == 0)\n return false;\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastSizeC != update.wrapperHeight;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n return false;\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var focused = activeElt();\n if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) display.lineDiv.style.display = \"\";\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\n // Prevent selection and cursors from interfering with the scroll\n // width.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n\n if (different) {\n display.lastSizeC = update.wrapperHeight;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true;\n }", "refresh() {\n this.viewDiv.node().style.top = this._position.y + \"px\";\n this.viewDiv.node().style.left = this._position.x + \"px\";\n }" ]
[ "0.6637351", "0.6637324", "0.6637324", "0.66368717", "0.6625399", "0.66146237", "0.6563916", "0.6563916", "0.65549666", "0.65549666", "0.65549666", "0.65549666", "0.65549666", "0.65549666", "0.65312445", "0.65091825", "0.6507638", "0.6507638", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6468993", "0.6449599", "0.606065", "0.60318017", "0.60318017", "0.6029521", "0.602352", "0.5999308", "0.5999308", "0.59939975", "0.59852314", "0.59840673", "0.5923414", "0.5923414", "0.59204614", "0.5918644", "0.5875602", "0.587416", "0.58735025", "0.5866306", "0.5866306", "0.58489686", "0.5829455", "0.58089757", "0.57959217", "0.5773594", "0.5772942", "0.5750296", "0.57487583", "0.57397336", "0.5736856", "0.5731915", "0.5731915", "0.5731915", "0.5731915", "0.57298654", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.57215136", "0.5715514", "0.5715514", "0.570537" ]
0.65698385
18
Rebuild the gutter elements, ensure the margin to the left of the code matches their width.
function updateGutters(cm) { var gutters = cm.display.gutters, specs = cm.options.gutters; removeChildren(gutters); var i = 0; for (; i < specs.length; ++i) { var gutterClass = specs[i]; var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); if (gutterClass == "CodeMirror-linenumbers") { cm.display.lineGutter = gElt; gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; } } gutters.style.display = i ? "" : "none"; updateGutterSpace(cm); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}", "function adjustMargins() {\n detectSpacesIn(body);\n} //Initiate recursion:", "function marginsDefine() {\n for (let i = -17; i < 0; i++) {\n t0p = i;\n marginsTopNBot.push(t0p);\n }\n for (let i = 305; i > 288; i--) {\n bottom = i;\n marginsTopNBot.push(bottom);\n }\n for (let i = 0; i < 18; i++) {\n left = i * 17;\n right = i * 17 - 1;\n marginLeft.push(left);\n marginRight.push(right);\n }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }", "function Ga(e){var t=e.display,a=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,f=n+\"px\",o=0;o<a.length;o++)if(!a[o].hidden){e.options.fixedGutter&&(a[o].gutter&&(a[o].gutter.style.left=f),a[o].gutterBackground&&(a[o].gutterBackground.style.left=f));var i=a[o].alignable;if(i)for(var s=0;s<i.length;s++)i[s].style.left=f}e.options.fixedGutter&&(t.gutters.style.left=n+r+\"px\")}}", "function fullWidthLeftRightSpacing() { \n // Padding for full width blocks\n \n if(vW > 991) {\n var widthDifference = (vW - $('.dummy div').outerWidth()) / 2;\n } else {\n var widthDifference = (vW - $('.dummy div').width()) / 2;\n }\n $('.container-fluid-container-pad-right').css('padding-right', widthDifference);\n $('.container-fluid-container-pad-left').css('padding-left', widthDifference);\n }", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\r\n if (cm.options.fixedGutter) {\r\n if (view[i].gutter)\r\n { view[i].gutter.style.left = left; }\r\n if (view[i].gutterBackground)\r\n { view[i].gutterBackground.style.left = left; }\r\n }\r\n var align = view[i].alignable;\r\n if (align) { for (var j = 0; j < align.length; j++)\r\n { align[j].style.left = left; } }\r\n } }\r\n if (cm.options.fixedGutter)\r\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\r\n}", "function get_left_margin(){\n\tvar wrapper=lhs=fave_buttons=upload=log=greet=0;\n\t//get the width of all elements on the right side and remove the px suffix\n\twrapper = $(\"#wrapper\").css(\"width\").replace(/[^0-9]/g, '');\n\tupload = $(\"#select_upload\").css(\"width\").replace(/[^0-9]/g, '');\n\tfave_buttons = $(\"#fave_buttons\").css(\"width\").replace(/[^0-9]/g, '');\n\tif(document.getElementById(\"select_logout\"))\n\t\tlog = $(\"#select_logout\").css(\"width\").replace(/[^0-9]/g, '');\n\telse\n\t\tlog = $(\"#select_login\").css(\"width\").replace(/[^0-9]/g, '');\n\tif(document.getElementById(\"functions_greeting\"))\n\t\tgreet =$(\".functions_greeting\").css(\"width\").replace(/[^0-9]/g,'');\n\tlhs = $(\"#left_hand\").css(\"width\").replace(/[^0-9]/g, '');\n\treturn wrapper - lhs - fave_buttons - upload - log - greet-30;\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n}", "function toRowGuttersCss(gutter) {\n return 'margin-left: -' + gutter / 2 + 'px; margin-right: -' + gutter / 2 + 'px;';\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n view[i].gutter.style.left = left;\n if (view[i].gutterBackground)\n view[i].gutterBackground.style.left = left;\n }\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t { view[i].gutter.style.left = left; }\n\t\t if (view[i].gutterBackground)\n\t\t { view[i].gutterBackground.style.left = left; }\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) { for (var j = 0; j < align.length; j++)\n\t\t { align[j].style.left = left; } }\n\t\t } }\n\t\t if (cm.options.fixedGutter)\n\t\t { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n\t\t }", "updateContentMargins() {\n // 1. For drawers in `over` mode, they don't affect the content.\n // 2. For drawers in `side` mode they should shrink the content. We do this by adding to the\n // left margin (for left drawer) or right margin (for right the drawer).\n // 3. For drawers in `push` mode the should shift the content without resizing it. We do this by\n // adding to the left or right margin and simultaneously subtracting the same amount of\n // margin from the other side.\n let left = 0;\n let right = 0;\n if (this._left && this._left.opened) {\n if (this._left.mode == 'side') {\n left += this._left._getWidth();\n }\n else if (this._left.mode == 'push') {\n const width = this._left._getWidth();\n left += width;\n right -= width;\n }\n }\n if (this._right && this._right.opened) {\n if (this._right.mode == 'side') {\n right += this._right._getWidth();\n }\n else if (this._right.mode == 'push') {\n const width = this._right._getWidth();\n right += width;\n left -= width;\n }\n }\n // If either `right` or `left` is zero, don't set a style to the element. This\n // allows users to specify a custom size via CSS class in SSR scenarios where the\n // measured widths will always be zero. Note that we reset to `null` here, rather\n // than below, in order to ensure that the types in the `if` below are consistent.\n left = left || null;\n right = right || null;\n if (left !== this._contentMargins.left || right !== this._contentMargins.right) {\n this._contentMargins = { left, right };\n // Pull back into the NgZone since in some cases we could be outside. We need to be careful\n // to do it only when something changed, otherwise we can end up hitting the zone too often.\n this._ngZone.run(() => this._contentMarginChanges.next(this._contentMargins));\n }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\"\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left }\n }\n var align = view[i].alignable\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\" }\n}", "updateContentMargins() {\n // 1. For drawers in `over` mode, they don't affect the content.\n // 2. For drawers in `side` mode they should shrink the content. We do this by adding to the\n // left margin (for left drawer) or right margin (for right the drawer).\n // 3. For drawers in `push` mode the should shift the content without resizing it. We do this by\n // adding to the left or right margin and simultaneously subtracting the same amount of\n // margin from the other side.\n let left = 0;\n let right = 0;\n if (this._left && this._left.opened) {\n if (this._left.mode === 'side') {\n left += this._left._getWidth();\n }\n else if (this._left.mode === 'push') {\n const width = this._left._getWidth();\n left += width;\n right -= width;\n }\n }\n if (this._right && this._right.opened) {\n if (this._right.mode === 'side') {\n right += this._right._getWidth();\n }\n else if (this._right.mode === 'push') {\n const width = this._right._getWidth();\n right += width;\n left -= width;\n }\n }\n // If either `right` or `left` is zero, don't set a style to the element. This\n // allows users to specify a custom size via CSS class in SSR scenarios where the\n // measured widths will always be zero. Note that we reset to `null` here, rather\n // than below, in order to ensure that the types in the `if` below are consistent.\n left = left || null;\n right = right || null;\n if (left !== this._contentMargins.left || right !== this._contentMargins.right) {\n this._contentMargins = { left, right };\n // Pull back into the NgZone since in some cases we could be outside. We need to be careful\n // to do it only when something changed, otherwise we can end up hitting the zone too often.\n this._ngZone.run(() => this._contentMarginChanges.next(this._contentMargins));\n }\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n if (cm.options.fixedGutter && view[i].gutter)\n view[i].gutter.style.left = left;\n var align = view[i].alignable;\n if (align) for (var j = 0; j < align.length; j++)\n align[j].style.left = left;\n }\n if (cm.options.fixedGutter)\n display.gutters.style.left = (comp + gutterW) + \"px\";\n }", "function marginPushersAgain() {\n if(JSON.stringify(fullLayout._size) === oldmargins) return;\n\n return Lib.syncOrAsync([\n marginPushers,\n subroutines.layoutStyles\n ], gd);\n }", "function marginPushersAgain() {\n if(JSON.stringify(fullLayout._size) === oldmargins) return;\n\n return Lib.syncOrAsync([\n marginPushers,\n subroutines.layoutStyles\n ], gd);\n }", "function Rn(e){var a=e.display.gutters,r=e.options.gutters;t(a);for(var f=0;f<r.length;++f){var o=r[f],i=a.appendChild(n(\"div\",null,\"CodeMirror-gutter \"+o));\"CodeMirror-linenumbers\"==o&&(e.display.lineGutter=i,i.style.width=(e.display.lineNumWidth||1)+\"px\")}a.style.display=f?\"\":\"none\",In(e)}", "function alignHorizontally(cm) {\n\t\t var display = cm.display, view = display.view;\n\t\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t\t if (cm.options.fixedGutter) {\n\t\t if (view[i].gutter)\n\t\t view[i].gutter.style.left = left;\n\t\t if (view[i].gutterBackground)\n\t\t view[i].gutterBackground.style.left = left;\n\t\t }\n\t\t var align = view[i].alignable;\n\t\t if (align) for (var j = 0; j < align.length; j++)\n\t\t align[j].style.left = left;\n\t\t }\n\t\t if (cm.options.fixedGutter)\n\t\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t\t }", "function alignHorizontally(cm) {\r\n var display = cm.display, view = display.view;\r\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\r\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\r\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\r\n for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\r\n if (cm.options.fixedGutter && view[i].gutter)\r\n view[i].gutter.style.left = left;\r\n var align = view[i].alignable;\r\n if (align) for (var j = 0; j < align.length; j++)\r\n align[j].style.left = left;\r\n }\r\n if (cm.options.fixedGutter)\r\n display.gutters.style.left = (comp + gutterW) + \"px\";\r\n }", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter) {\n\t if (view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t if (view[i].gutterBackground)\n\t view[i].gutterBackground.style.left = left;\n\t }\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function royalGalleryGutter() {\n\n\t\troyalGallery.css({\n\t\t\t'margin-right' \t: gallery_default_gutter_horz +'px',\n\t\t\t'margin-bottom' : gallery_default_gutter_vert +'px'\n\t\t});\n\n\t\t$('.gallery-columns-2 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 1)) / 2)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 1)) / 2)'\n\t\t});\n\t\t$('.gallery-columns-3 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 2)) / 3)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 2)) / 3)'\n\t\t});\n\t\t$('.gallery-columns-4 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 3)) / 4)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 3)) / 4)'\n\t\t});\n\t\t$('.gallery-columns-5 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 4)) / 5)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 4)) / 5)'\n\t\t});\n\t\t$('.gallery-columns-6 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 5)) / 6)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 5)) / 6)'\n\t\t});\n\t\t$('.gallery-columns-7 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 6)) / 7)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 6)) / 7)'\n\t\t});\n\t\t$('.gallery-columns-8 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 7)) / 8)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 7)) / 8)'\n\t\t});\n\t\t$('.gallery-columns-9 .gallery-item').css({\n\t\t\t'width' : '-webkit-calc((100% - ('+ gallery_default_gutter_horz +'px * 8)) / 9)',\n\t\t\t'width' : 'calc((100% - ('+ gallery_default_gutter_horz +'px * 8)) / 9)'\n\t\t});\n\n\t}", "function changePadding(){\n //get margin size and check for need here\n //var pl = document.getElementById('grid-container').style.paddingLeft;\n //document.getElementById(\"display\").innerHTML = pl;\n \n var pads = 0;\n var id3 = setInterval(frame, 30);\n function frame() {\n if (pads == 30){ clearInterval(id3); }\n else {\n pads++;\n document.getElementById(\"grid-container\").style.paddingLeft = 30-pads + \"vw\";\n document.getElementById(\"grid-container\").style.paddingRight = 30-pads + \"vw\";\n }\n }\n}", "_justify() {\n let hIx = 0;\n let left = 0;\n let minx = 0;\n let maxx = 0;\n let lvl = 0;\n let maxwidth = 0;\n let runningWidth = 0;\n let runningHeight = 0;\n if (!this.inlineBlocks.length) {\n return;\n }\n minx = this.inlineBlocks[0].text.startX;\n // We justify relative to first block x/y.\n const initialX = this.inlineBlocks[0].text.startX;\n const initialY = this.inlineBlocks[0].text.startY;\n const vert = {};\n this.inlineBlocks.forEach((inlineBlock) => {\n const block = inlineBlock.text;\n const blockBox = block.getLogicalBox();\n // If this is a horizontal positioning, reset to first blokc position\n //\n if (hIx > 0) {\n block.startX = initialX;\n block.startY = initialY;\n }\n minx = block.startX < minx ? block.startX : minx;\n maxx = (block.startX + blockBox.width) > maxx ? block.startX + blockBox.width : maxx;\n\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.ABOVE ? lvl + 1 : lvl;\n lvl = inlineBlock.position === SmoTextGroup.relativePositions.BELOW ? lvl - 1 : lvl;\n if (inlineBlock.position === SmoTextGroup.relativePositions.RIGHT) {\n block.startX += runningWidth;\n if (hIx > 0) {\n block.startX += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.LEFT) {\n if (hIx > 0) {\n block.startX = minx - blockBox.width;\n minx = block.startX;\n block.startX -= this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.BELOW) {\n block.startY += runningHeight;\n if (hIx > 0) {\n block.startY += this.spacing;\n }\n }\n if (inlineBlock.position === SmoTextGroup.relativePositions.ABOVE) {\n block.startY -= runningHeight;\n if (hIx > 0) {\n block.startY -= this.spacing;\n }\n }\n if (!vert[lvl]) {\n vert[lvl] = {};\n vert[lvl].blocks = [block];\n vert[lvl].minx = block.startX;\n vert[lvl].maxx = block.startX + blockBox.width;\n maxwidth = vert[lvl].width = blockBox.width;\n } else {\n vert[lvl].blocks.push(block);\n vert[lvl].minx = vert[lvl].minx < block.startX ? vert[lvl].minx : block.startX;\n vert[lvl].maxx = vert[lvl].maxx > (block.startX + blockBox.width) ?\n vert[lvl].maxx : (block.startX + blockBox.width);\n vert[lvl].width += blockBox.width;\n maxwidth = maxwidth > vert[lvl].width ? maxwidth : vert[lvl].width;\n }\n runningWidth += blockBox.width;\n runningHeight += blockBox.height;\n hIx += 1;\n block.updatedMetrics = false;\n });\n\n const levels = Object.keys(vert);\n\n // Horizontal justify the vertical blocks\n levels.forEach((level) => {\n const vobj = vert[level];\n if (this.justification === SmoTextGroup.justifications.LEFT) {\n left = minx - vobj.minx;\n } else if (this.justification === SmoTextGroup.justifications.RIGHT) {\n left = maxx - vobj.maxx;\n } else {\n left = (maxwidth / 2) - (vobj.width / 2);\n left += minx - vobj.minx;\n }\n vobj.blocks.forEach((block) => {\n block.offsetStartX(left);\n });\n });\n }", "updateChildWidgetLeft(left) {\n // TODO: Cell spacing calculation.\n let spacing = 0;\n if (this.ownerTable.tableFormat.cellSpacing > 0) {\n spacing = this.ownerTable.tableFormat.cellSpacing;\n }\n for (let i = 0; i < this.childWidgets.length; i++) {\n let cellWidget = this.childWidgets[i];\n left += spacing + cellWidget.margin.left;\n cellWidget.x = left;\n cellWidget.updateChildWidgetLeft(cellWidget.x);\n left += cellWidget.width + cellWidget.margin.right;\n }\n }", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter && view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function alignHorizontally(cm) {\n\t var display = cm.display, view = display.view;\n\t if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;\n\t var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n\t var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n\t for (var i = 0; i < view.length; i++) if (!view[i].hidden) {\n\t if (cm.options.fixedGutter && view[i].gutter)\n\t view[i].gutter.style.left = left;\n\t var align = view[i].alignable;\n\t if (align) for (var j = 0; j < align.length; j++)\n\t align[j].style.left = left;\n\t }\n\t if (cm.options.fixedGutter)\n\t display.gutters.style.left = (comp + gutterW) + \"px\";\n\t }", "function marginPushers() {\n // First reset the list of things that are allowed to change the margins\n // So any deleted traces or components will be wiped out of the\n // automargin calculation.\n // This means *every* margin pusher must be listed here, even if it\n // doesn't actually try to push the margins until later.\n Plots.clearAutoMarginIds(gd);\n subroutines.drawMarginPushers(gd);\n Axes.allowAutoMargin(gd);\n if (gd._fullLayout.title.text && gd._fullLayout.title.automargin) Plots.allowAutoMargin(gd, 'title.automargin');\n\n // TODO can this be moved elsewhere?\n if (fullLayout._has('pie')) {\n var fullData = gd._fullData;\n for (var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if (trace.type === 'pie' && trace.automargin) {\n Plots.allowAutoMargin(gd, 'pie.' + trace.uid + '.automargin');\n }\n }\n }\n Plots.doAutoMargin(gd);\n return Plots.previousPromises(gd);\n }", "function computeHolderMargin(width) {\n var margin = 3;\n var imgWidth = width + (2 * margin);\n\n var totalWidth = $(\"#partial\").width();\n\n var numberOfPhotosAcross = Math.floor(totalWidth / imgWidth);\n\n // corrects for when there are less photos than can fit on screen\n var usedWidth = Math.min(numberOfPhotosAcross, totalPhotoCount) * imgWidth;\n var remainder = totalWidth - usedWidth;\n\n $(\"#ul-holder\").css(\"margin-left\", (remainder / 2) + \"px\");\n}", "checkSpaceLeft() {\n const { theme } = this.props;\n const middleContainer = document.getElementById('middle_container');\n if (middleContainer) {\n const middleWidth = middleContainer.offsetWidth;\n const nextColumnWidth = parseInt(theme.column.width, 10);\n return Math.floor(middleWidth / nextColumnWidth);\n }\n return 1;\n }", "function outputPaddingAdjuster() {\n if (!tutorialSettings.libraries.turtle && !tutorialSettings.libraries.DOM && !tutorialSettings.libraries.csv && !tutorialSettings.libraries.csvAndTurtle) {\n outputBlock.style.paddingLeft = \"40px\";\n } \n else {\n if($(window).width() < 1183){\n outputBlock.style.paddingLeft = \"40px\";\n }\n }\n}", "function setOuterWidth() {\n outerWidth = wrap.offsetWidth;\n dragBarPos = calcDragBarPosFromCss() || Math.floor(outerWidth / 2) - 5;\n }", "function widen() {\n var minWidth = 685;\n\n //prepare array of magics\n var std_buttons = document.getElementById(\"std_buttons\");\n var magic = document.getElementById(\"magic\");\n var magic2 = document.getElementById(\"magic2\");\n var magic3 = document.getElementById(\"magic3\");\n var magic4 = document.getElementById(\"magic4\");\n var magic5 = document.getElementById(\"magic5\");\n var magic_array = [];\n\n if (magic) magic_array.push(magic);\n if (magic2) magic_array.push(magic2);\n if (magic3) magic_array.push(magic3);\n if (magic4) magic_array.push(magic4);\n if (magic5) magic_array.push(magic5);\n\n //sort by length desc\n magic_array.sort(function (a, b) {\n return b.offsetWidth - a.offsetWidth;\n });\n\n var defWidth = std_buttons.offsetWidth;\n var fixedWidth = 100;\n\n var stdWidth = fixedWidth + std_buttons.offsetWidth;\n console.log(\"standard width=\" + stdWidth);\n\n var newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n\n if (newWidth > 795) {\n //console.log(\"width calculated to\"+newWidth+\". shortening labels\");\n document.getElementById(\"query\").innerText = \"Que\";\n document.getElementById(\"project_list\").innerText = \"Lst\";\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n }\n if (newWidth > 795) {\n //console.log(\"width calculated to\"+newWidth+\". shortening labels\");\n document.getElementById(\"validate\").innerText = \"Val\";\n document.getElementById(\"project\").innerText = \"Prj\";\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n }\n if (newWidth > 795) {\n //console.log(\"width calculated to\"+newWidth+\". shortening labels\");\n document.getElementById(\"model\").innerText = \"LD\";\n document.getElementById(\"model2\").innerText = \"LB\";\n document.getElementById(\"model3\").innerText = \"WB\";\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n }\n if (newWidth > 795) {\n //console.log(\"width calculated to\"+newWidth+\". shortening labels\");\n document.getElementById(\"explain\").innerText = \"E\";\n document.getElementById(\"schedules_gp\").innerText = \"G\";\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n }\n if (newWidth > 795) {\n //console.log(\"width calculated to\"+newWidth+\". shortening labels\");\n document.getElementById(\"md_export\").innerText = \"M\";\n document.getElementById(\"md_import\").innerText = \"M\";\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n }\n\n var x = 0; //to avoid infinite cycle\n for (\n var i = 0;\n i < magic_array.length && newWidth > 795 && x < 20;\n magic_array.sort(function (a, b) {\n return b.offsetWidth - a.offsetWidth;\n })\n ) {\n //console.log(\"width calculated to\"+newWidth+\". shortening longest magic label \"+magic_array[i].innerText );\n magic_array[i].innerText = magic_array[i].innerText.substring(\n 0,\n magic_array[i].innerText.length - 1\n );\n newWidth =\n fixedWidth +\n std_buttons.offsetWidth +\n (magic ? magic.offsetWidth : 0) +\n (magic2 ? magic2.offsetWidth : 0) +\n (magic3 ? magic3.offsetWidth : 0) +\n (magic4 ? magic4.offsetWidth : 0) +\n (magic5 ? magic5.offsetWidth : 0);\n x++;\n }\n\n var newWidthCss = newWidth + \"px\";\n\n var body = document.getElementsByTagName(\"body\")[0];\n var html = document.getElementsByTagName(\"html\")[0];\n body.setAttribute(\"width\", newWidth);\n body.style.setProperty(\"width\", newWidthCss, \"\");\n html.setAttribute(\"width\", newWidth);\n html.style.setProperty(\"width\", newWidthCss, \"\");\n}", "function setWidth(){\n var width = 500/(columnCounter + 1);\n\n for(var i=0; i<=columnCounter; i++){\n for(var j=0; j<columns[i].length; j++) {\n columns[i][j].style.width = (width - 3) + 'px';\n columns[i][j].style.marginLeft = width * i + 'px';\n }\n }\n }", "calcMarginLeft() {\n const { width } = this.getWindowDimensions();\n const dotPatternSize = this.getDotPatternSize();\n // const marginLeft = ((dotPatternSize - ((width % dotPatternSize) / 2)) - dotPatternSize) * -1\n let marginLeft = (width % dotPatternSize) / 2;\n const indicator = (width / dotPatternSize) % 2;\n if (indicator < 1) {\n marginLeft = marginLeft - dotPatternSize / 2;\n }\n this.setState({ marginLeft });\n return marginLeft;\n }", "function fixLeftMargin(){\r\n\tvar marginLeft = Math.ceil(parseFloat($(\"#div-body-first\").css(\"margin-left\"))/2);\r\n\t$(\"#div-body-first\").css(\"margin-left\", marginLeft);\r\n}", "_precalculateContentWidths() {\n let cellPadding = 0;\n\n if (!this.$el.hasClass('diff-error') && this._$revisionRow.length > 0) {\n const containerExtents = this.$el.getExtents('p', 'lr');\n\n /* Calculate the widths and state of the diff columns. */\n let $cells = $(this._$revisionRow[0].cells);\n cellPadding = $(this.el.querySelector('pre'))\n .parent().addBack()\n .getExtents('p', 'lr');\n\n this._colReservedWidths = $cells.eq(0).outerWidth() + cellPadding +\n containerExtents;\n this._numColumns = $cells.length;\n\n if (this._numColumns === 4) {\n /* There's a left-hand side and a right-hand side. */\n this._colReservedWidths += $cells.eq(2).outerWidth() +\n cellPadding;\n }\n\n /* Calculate the widths and state of the filename columns. */\n $cells = $(this._$filenameRow[0].cells);\n this._numFilenameColumns = $cells.length;\n this._filenameReservedWidths = containerExtents +\n 2 * this._numFilenameColumns;\n } else {\n this._colReservedWidths = 0;\n this._filenameReservedWidths = 0;\n this._numColumns = 0;\n this._numFilenameColumns = 0;\n }\n }", "_addItemsSpacing() {\n // Not last child.\n for (let item = 0; item < this._items.length - 1; item++) {\n const sliderItemWrap = this._items[item].parentElement;\n sliderItemWrap.style.marginRight = this._settings.slidesSpacing + 'px';\n }\n }", "function stretchCheckerboard() {\n\t\ty = $('.main-section .wrapper').outerWidth();\t\t\n\t\t$('.main-section header h3').each(function() {\n\t\t\tw = $(this).outerWidth();\n\t\t\t$(this).css({ marginRight: (y-w)%40 });\n\t\t});\n\t\t\n\t}", "function generateStylePush(nGridUnit, nColumnWidth, nColumnGutter, nColumns)\n{\n\t//Declare return string.\n\tvar sStylePush = '';\n\n\tfor (i = 0, j = Math.round(nColumns / 2); i < j; i++)\n\t{\n\t\tvar nDistance = i * nGridUnit * (nColumnWidth + nColumnGutter);\n\t\tsStylePush += '\\n.push-' + i + '{margin-left:' + nDistance + 'px;}';\n\t}\n\t\n\treturn sStylePush;\n}", "function reflowContent() {\n var showing = $scrollContent.width() + parseInt($scrollContent.css(\"margin-left\"), 10);\n var gap = $scrollPane.width() - showing;\n if (gap > 0) {\n $scrollContent.css(\"margin-left\", parseInt($scrollContent.css(\"margin-left\"), 10) + gap);\n }\n }", "function reflowContent(){\n\t\tvar showing = scrollContent.width() + parseInt( scrollContent.css('margin-left') );\n\t\tvar gap = scrollPane.width() - showing;\n\t\tif(gap > 0){\n\t\t\tscrollContent.css('margin-left', parseInt( scrollContent.css('margin-left') ) + gap);\n\t\t}\n}", "function marginPushersAgain() {\n\t var seq = JSON.stringify(fullLayout._size) === oldmargins ?\n\t [] :\n\t [marginPushers, subroutines.layoutStyles];\n\t\n\t // re-initialize cartesian interaction,\n\t // which are sometimes cleared during marginPushers\n\t seq = seq.concat(Fx.init);\n\t\n\t return Lib.syncOrAsync(seq, gd);\n\t }", "function gutter(config) {\n return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults), config))];\n}", "function marginPushers() {\n\t var calcdata = gd.calcdata;\n\t var i, cd, trace;\n\t\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t\n\t for(i = 0; i < calcdata.length; i++) {\n\t cd = calcdata[i];\n\t trace = cd[0].trace;\n\t if(trace.visible !== true || !trace._module.colorbar) {\n\t Plots.autoMargin(gd, 'cb' + trace.uid);\n\t }\n\t else trace._module.colorbar(gd, cd);\n\t }\n\t\n\t Plots.doAutoMargin(gd);\n\t return Plots.previousPromises(gd);\n\t }", "function removeFixedWidths() {\n $(\".footer--content\").css({ 'margin' : '0', 'padding-left': '60px' });\n }", "function FixGridWidth()\n{\n\tlet q = document.querySelectorAll(\".grid\");\n\tq.forEach(e => {\n\t\te.style.width = `${e.clientHeight}px`;\n\t});\n}", "function pack() {\n var boxes = config.boardView.querySelectorAll(\".box\"),\n boxesPerRow = calculateBoxesPerRow(boxes.length),\n margin = parseInt(window.getComputedStyle(boxes[0]).marginTop.replace(\"px\", \"\")),\n boardWidth = boxesPerRow * (boxes[0].offsetWidth + 2 * margin);\n\n if (boxesPerRow === 1) {\n boxesPerRow = boxes.length;\n }\n\n config.boardView.style.width = boardWidth + \"px\";\n }", "function refreshWidths() {\n slideWidth = $slideshow.width();\n\n // ...pulling currSlide from global :/\n var left = slideLeftPos( currSlide );\n $slideReel.css(\"left\", left);\n }", "function marginPushers() {\n var calcdata = gd.calcdata;\n var i, cd, trace;\n\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\n for(i = 0; i < calcdata.length; i++) {\n cd = calcdata[i];\n trace = cd[0].trace;\n if(trace.visible !== true || !trace._module.colorbar) {\n Plots.autoMargin(gd, 'cb' + trace.uid);\n }\n else trace._module.colorbar(gd, cd);\n }\n\n Plots.doAutoMargin(gd);\n return Plots.previousPromises(gd);\n }", "function marginPushers() {\n var calcdata = gd.calcdata;\n var i, cd, trace;\n\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\n for(i = 0; i < calcdata.length; i++) {\n cd = calcdata[i];\n trace = cd[0].trace;\n if(trace.visible !== true || !trace._module.colorbar) {\n Plots.autoMargin(gd, 'cb' + trace.uid);\n }\n else trace._module.colorbar(gd, cd);\n }\n\n Plots.doAutoMargin(gd);\n return Plots.previousPromises(gd);\n }", "function makeLeftTemplate() {\n var startX = width;\n var jogLeft = startX - parenWidth;\n var nearLeft = -(width * nearFactor);\n var farLeft = -(width * farFactor);\n\n return makeSVGTemplate(width, height,\n [['M', [startX, top]],\n ['L', [jogLeft, top]],\n // Draw the far edge.\n ['Q', [farLeft, midY, jogLeft, bottom]],\n ['M', [jogLeft, bottom]],\n ['L', [startX, bottom]],\n // Draw the near edge.\n ['Q', [nearLeft, midY, startX, top]]]);\n }", "function setBoxWidths() {\n var leftWidth = dragBarPos - 2,\n rightWidth = outerWidth - dragBarPos - 12;\n\n left.css('width', '' + toPercent(leftWidth) + '%');\n right.css('width', '' + toPercent(rightWidth) + '%');\n }", "function goLeft() {\n leftMargin = $(\".inner-liner\").css(\"margin-left\").replace(\"px\", \"\") * 1;\n newLeftMargin = (leftMargin + 650);\n $(\".inner-liner\").animate({ marginLeft: newLeftMargin }, 500);\n }", "enterParagraphLeftMarginValue(ctx) {\n\t}", "function b(){h.style.cssText=\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%\",h.innerHTML=\"\",$a.appendChild(g);var b=a.getComputedStyle(h);c=\"1%\"!==b.top,f=\"2px\"===b.marginLeft,d=\"4px\"===b.width,h.style.marginRight=\"50%\",e=\"4px\"===b.marginRight,$a.removeChild(g)}", "function marginPushersAgain() {\n if (!Plots.didMarginChange(oldMargins, fullLayout._size)) return;\n return Lib.syncOrAsync([marginPushers, subroutines.layoutStyles], gd);\n }", "function tw_stretch() {\n var i = $(window).width();\n $(\".row .tw-stretch-element-inside-column\").each(function () {\n var $this = $(this),\n row = $this.closest(\".row\"),\n cols = $this.closest('[class^=\"col-\"]'),\n colsheight = $this.closest('[class^=\"col-\"]').height(),\n rect = this.getBoundingClientRect(),\n l = row[0].getBoundingClientRect(),\n s = cols[0].getBoundingClientRect(),\n r = rect.left,\n d = i - rect.right,\n c = l.left + (parseFloat(row.css(\"padding-left\")) || 0),\n u = i - l.right + (parseFloat(row.css(\"padding-right\")) || 0),\n p = s.left,\n f = i - s.right,\n styles = {\n \"margin-left\": 0,\n \"margin-right\": 0\n };\n if (Math.round(c) === Math.round(p)) {\n var h = parseFloat($this.css(\"margin-left\") || 0);\n styles[\"margin-left\"] = h - r;\n }\n if (Math.round(u) === Math.round(f)) {\n var w = parseFloat($this.css(\"margin-right\") || 0);\n styles[\"margin-right\"] = w - d;\n }\n $this.css(styles);\n });\n }", "function ajustarAPantalla(){\n let containerWidth = $itemsContainer.clientWidth-1;\n\n for (let n=0; n < divItemsArray.length; n++){\n if (divItemsArray[n].clientWidth === 0){\n LastItemVisible=n;\n break;\n }\n }\n\n const widthImg = 100;\n let spareWidth = containerWidth-LastItemVisible*widthImg;\n let marginInitial = spareWidth/(LastItemVisible*2);\n let marginAcumulado=marginInitial;\n //let movimiento= marginInitial*2 + widthImg;\n \n for (let n=0; n < LastItemVisible; n++){\n arrayPositionValues[n]=marginAcumulado;\n $divItems[n].style.left = marginAcumulado + 'px';\n marginAcumulado=marginAcumulado+marginInitial*2+widthImg;\n }\n \n}", "function leftAlign(){\n\tvar baseX = 999999;\n\tfor(var i=0; i<currentShapes.length; i++){\n\t\tif(baseX>currentShapes[i].getX()){\n\t\t\tbaseX = currentShapes[i].getX();\n\t\t}\n\t}\n\tfor(var k=0; k<currentShapes.length; k++){\n\t\tcurrentShapes[k].setX(baseX);\n\t}\n\tlayer.draw();\n\thatioGroupRevised();\n}", "function offsetSpaces (offset) {\n var res = '' , i;\n for (i = 0; i < offset; i += 1) { res += spacer; }\n return res;\n}", "function calcWrapperParts() {\n\tif ($('.page-description-block').width() == 256 && (windowObj.width() > 768))\n\t{\n\t\t$aboutCompanySH.css({ left: '512px' }).width(windowObj.width() - 512);\n\t\t$('.about-page-description-block').css({ left: '256px' });\n\t\t$('.can-fade').css({ left: '256px' });\t\t\n\t\tif( $('.can-fade').is(':visible')){\n\t\t\t$simplePageSlideshow.width(windowObj.width() - 512).css({ left: '512px' });\n\t\t}\n\t\t$('.contacts-map').width(windowObj.width() - 512);\n\t}\n\telse if( $pageDescriptionBlock.width() == 340 && ($(window).width() > 768)) \n\t{\n\t\t$aboutCompanySH.css({ left: '680px' }).width(windowObj.width() - 680);\n\t\t$('.about-page-description-block').css({ left: '340px' });\n\t\t$('.can-fade').css({ left: '340px' });\t\t\t\n\t\tif( $('.can-fade').is(':visible')){\n\t\t\t$simplePageSlideshow.width(windowObj.width() - 680).css({ left: '680px' });\n\t\t}\n\t\t$('.contacts-map').width(windowObj.width() - 679);\n\t}\t\n\telse if ($(window).width() > 768)\n\t{\n\t\t$aboutCompanySH.css({ left: '40%' }).width(windowObj.width() * 0.6);\n\t\t$('.about-page-description-block').css({ left: '20%' });\n\t\t$('.can-fade').css({ left: '20%' });\n\t\tif( $('.can-fade').is(':visible')){\n\t\t\t$simplePageSlideshow.width(windowObj.width() * 0.6).css({ left: '40%' });\n\t\t}\n\t\t$('.contacts-map').width(windowObj.width() * 0.6);\n\t};\n}", "function getContentMargin() {\n var margin = options.jq.contentWell.css('margin-left');\n contentMargin = (margin === options.params.closedNavMargin) ? contentMargin : margin;\n }", "relayoutEditorsCore() {\n this.debug(\"relayoutEditorsCore()\");\n const editors = VSCodeDom.getEditorSplitViews();\n const rightMostEditors = {};\n // Determine the right-most editors for each editor row. Rows are\n // determined by editors having a common `top` value.\n // The right most editor on a per row basis needs its width reduced\n // by 300px.\n for (let editor of editors) {\n const top = editor.style.top;\n const left = editor.style.left\n ? parseInt(editor.style.left, 10)\n : 0;\n const existing = rightMostEditors[top];\n if (existing && left < existing.left)\n continue;\n rightMostEditors[top] = {\n el: editor,\n left: left\n };\n }\n for (let key in rightMostEditors) {\n const rightMost = rightMostEditors[key];\n // Panels that do not explicity set a width use an inherited\n // width of 100%.\n if (!rightMost.el.style.width) {\n rightMost.el.style.width = `calc(100% - ${this.sideTabSize})`;\n }\n else {\n Dom.updateStyle(rightMost.el, \"width\", -this.sideTabSizePx);\n }\n // Some of the children elements also must be dynamically\n // resized.\n // .overlayWidgets is the container that holds the quick search.\n // .zone-widge belongs to the code peek view. Even though it's a\n // child of overlayWidgets it has its own width calculated.\n const children = rightMost.el.querySelectorAll(\".overlayWidgets, .zone-widget\");\n for (let i = 0; i < children.length; ++i) {\n const el = children[i];\n Dom.updateStyle(el, \"width\", -this.sideTabSizePx);\n }\n const scrollables = rightMost.el.querySelectorAll(\".editor-scrollable, .overflow-guard\");\n for (let i = 0; i < scrollables.length; ++i) {\n const el = scrollables[i];\n // If the element is inline, then its sizing is based\n // relative to its parent already. The `peek` preview\n // behaves this way.\n if (Dom.hasParent(el, \"inline\"))\n continue;\n Dom.updateStyle(el, \"width\", -this.sideTabSizePx);\n }\n const needParentChanges = document.querySelectorAll(\".welcomePageContainer\");\n for (let i = 0; i < needParentChanges.length; ++i) {\n Dom.updateStyle(needParentChanges[i].parentElement, \"width\", -this.sideTabSizePx);\n }\n }\n // If this is ever needed to work with variable side docking,\n // the placement of the dock can be determined by a class on the\n // id'd child.\n const sidebar = VSCodeDom.getSideBarSplitView();\n Dom.updateStyle(sidebar.activitybar, \"left\", -this.sideTabSizePx);\n Dom.updateStyle(sidebar.sidebar, \"left\", -this.sideTabSizePx);\n // The sashes for non-subcontainered elements must also be adjusted for.\n const sashContainer = Dom.getChild(this.newContainerDest, \"sash-container\");\n Dom.visitChildren(sashContainer, el => {\n if (Dom.hasClass(el, \"monaco-sash\")) {\n Dom.updateStyle(el, \"left\", -this.sideTabSizePx);\n }\n });\n }", "function marginPushers() {\n\t var calcdata = gd.calcdata;\n\t var i, cd, trace;\n\t\n\t Legend.draw(gd);\n\t RangeSelector.draw(gd);\n\t\n\t for(i = 0; i < calcdata.length; i++) {\n\t cd = calcdata[i];\n\t trace = cd[0].trace;\n\t if(trace.visible !== true || !trace._module.colorbar) {\n\t Plots.autoMargin(gd, 'cb' + trace.uid);\n\t }\n\t else trace._module.colorbar(gd, cd);\n\t }\n\t\n\t Plots.doAutoMargin(gd);\n\t return Plots.previousPromises(gd);\n\t }", "function rebuild() {\n\t\tcalcWidth();\n\t\tcheck();\n\t}", "clearOldTintsAndMargins(){\n\n let gridsContainer = document.querySelector('.container');\n let gridsConChildren = Array.from(gridsContainer.children);\n\n this.clearOldTints(gridsConChildren);\n\n this.clearOldMargins(gridsConChildren);\n\n //update state\n this.currentThreadId = this.props.commentThreadDoc._id;\n this.hasNewComment = false;\n }" ]
[ "0.66278213", "0.6137225", "0.5910252", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5873189", "0.5805878", "0.5793412", "0.5783511", "0.5753073", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5749347", "0.5745757", "0.5729875", "0.5715221", "0.57095295", "0.56943375", "0.56943375", "0.5688866", "0.5619417", "0.5619417", "0.5619417", "0.5619417", "0.5619417", "0.5619417", "0.5619417", "0.56179476", "0.56179476", "0.5617397", "0.56013393", "0.5595779", "0.5573803", "0.55440444", "0.55377746", "0.5511662", "0.5473198", "0.54727423", "0.54727423", "0.54676324", "0.54547596", "0.54520166", "0.54181045", "0.54107183", "0.53779083", "0.5370221", "0.53684694", "0.53451383", "0.53127193", "0.5311555", "0.52418333", "0.52403516", "0.52355504", "0.5234341", "0.5233473", "0.52239263", "0.5217379", "0.52105105", "0.51992637", "0.5196899", "0.5177517", "0.5168749", "0.5168749", "0.5162008", "0.51613057", "0.5157789", "0.51551926", "0.51524967", "0.5135902", "0.5126167", "0.512259", "0.5109674", "0.50937015", "0.50870764", "0.508661", "0.5083068", "0.5077839", "0.50675076", "0.50664335" ]
0.0
-1
Make sure the gutters options contains the element "CodeMirrorlinenumbers" when the lineNumbers option is true.
function setGuttersForLineNumbers(options) { var found = indexOf(options.gutters, "CodeMirror-linenumbers"); if (found == -1 && options.lineNumbers) { options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); } else if (found > -1 && !options.lineNumbers) { options.gutters = options.gutters.slice(0); options.gutters.splice(found, 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGuttersForLineNumbers(options) {\n var found = false;\n for (var i = 0; i < options.gutters.length; ++i) {\n if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n if (options.lineNumbers) found = true;\n else options.gutters.splice(i--, 1);\n }\n }\n if (!found && options.lineNumbers)\n options.gutters.push(\"CodeMirror-linenumbers\");\n }", "function setGuttersForLineNumbers(options) {\n var found = false;\n for (var i = 0; i < options.gutters.length; ++i) {\n if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n if (options.lineNumbers) found = true;\n else options.gutters.splice(i--, 1);\n }\n }\n if (!found && options.lineNumbers)\n options.gutters.push(\"CodeMirror-linenumbers\");\n }", "function setGuttersForLineNumbers(options) {\n var found = false;\n for (var i = 0; i < options.gutters.length; ++i) {\n if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n if (options.lineNumbers) found = true;\n else options.gutters.splice(i--, 1);\n }\n }\n if (!found && options.lineNumbers)\n options.gutters.push(\"CodeMirror-linenumbers\");\n }", "function setGuttersForLineNumbers(options) {\n var found = false;\n for (var i = 0; i < options.gutters.length; ++i) {\n if (options.gutters[i] == \"CodeMirror-linenumbers\") {\n if (options.lineNumbers) found = true;\n else options.gutters.splice(i--, 1);\n }\n }\n if (!found && options.lineNumbers)\n options.gutters.push(\"CodeMirror-linenumbers\");\n }", "function setGuttersForLineNumbers(options) {\n\t\t var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n\t\t if (found == -1 && options.lineNumbers) {\n\t\t options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n\t\t } else if (found > -1 && !options.lineNumbers) {\n\t\t options.gutters = options.gutters.slice(0);\n\t\t options.gutters.splice(found, 1);\n\t\t }\n\t\t }", "function setGuttersForLineNumbers(options) {\n\t var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n\t if (found == -1 && options.lineNumbers) {\n\t options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n\t } else if (found > -1 && !options.lineNumbers) {\n\t options.gutters = options.gutters.slice(0);\n\t options.gutters.splice(found, 1);\n\t }\n\t }", "function setGuttersForLineNumbers(options) {\n\t var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n\t if (found == -1 && options.lineNumbers) {\n\t options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n\t } else if (found > -1 && !options.lineNumbers) {\n\t options.gutters = options.gutters.slice(0);\n\t options.gutters.splice(found, 1);\n\t }\n\t }", "function setGuttersForLineNumbers(options) {\n\t var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n\t if (found == -1 && options.lineNumbers) {\n\t options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n\t } else if (found > -1 && !options.lineNumbers) {\n\t options.gutters = options.gutters.slice(0);\n\t options.gutters.splice(found, 1);\n\t }\n\t }", "function setGuttersForLineNumbers(options) {\r\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\r\n if (found == -1 && options.lineNumbers) {\r\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\r\n } else if (found > -1 && !options.lineNumbers) {\r\n options.gutters = options.gutters.slice(0);\r\n options.gutters.splice(found, 1);\r\n }\r\n }", "function setGuttersForLineNumbers(options) {\r\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\r\n if (found == -1 && options.lineNumbers) {\r\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\r\n } else if (found > -1 && !options.lineNumbers) {\r\n options.gutters = options.gutters.slice(0);\r\n options.gutters.splice(found, 1);\r\n }\r\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\")\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"])\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0)\n options.gutters.splice(found, 1)\n }\n}", "function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\")\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"])\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0)\n options.gutters.splice(found, 1)\n }\n}", "function Pn(e){var t=d(e.gutters,\"CodeMirror-linenumbers\");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat([\"CodeMirror-linenumbers\"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}", "function Rn(e){var a=e.display.gutters,r=e.options.gutters;t(a);for(var f=0;f<r.length;++f){var o=r[f],i=a.appendChild(n(\"div\",null,\"CodeMirror-gutter \"+o));\"CodeMirror-linenumbers\"==o&&(e.display.lineGutter=i,i.style.width=(e.display.lineNumWidth||1)+\"px\")}a.style.display=f?\"\":\"none\",In(e)}", "function za(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=L(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var f=r.measure.appendChild(n(\"div\",[n(\"div\",a)],\"CodeMirror-linenumber CodeMirror-gutter-elt\")),o=f.firstChild.offsetWidth,i=f.offsetWidth-o;return r.lineGutter.style.width=\"\",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+\"px\",In(e),!0}return!1}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) {\n return false;\n }\n\n var doc = cm.doc,\n last = lineNumberFor(cm.options, doc.first + doc.size - 1),\n display = cm.display;\n\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)], \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth,\n padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true;\n }\n\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) return false;\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true;\r\n }\r\n return false;\r\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\r\n if (!cm.options.lineNumbers) { return false }\r\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\r\n if (last.length != display.lineNumChars) {\r\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\r\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\r\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\r\n display.lineGutter.style.width = \"\";\r\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\r\n display.lineNumWidth = display.lineNumInnerWidth + padding;\r\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\r\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\r\n updateGutterSpace(cm);\r\n return true\r\n }\r\n return false\r\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) return false;\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true;\n }\n return false;\n }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) { return false }\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm.display);\n\t\t return true\n\t\t }\n\t\t return false\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t\t if (!cm.options.lineNumbers) return false;\n\t\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t\t if (last.length != display.lineNumChars) {\n\t\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t\t display.lineGutter.style.width = \"\";\n\t\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t\t updateGutterSpace(cm);\n\t\t return true;\n\t\t }\n\t\t return false;\n\t\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n\t if (!cm.options.lineNumbers) return false;\n\t var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n\t if (last.length != display.lineNumChars) {\n\t var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n\t \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n\t var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n\t display.lineGutter.style.width = \"\";\n\t display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n\t display.lineNumWidth = display.lineNumInnerWidth + padding;\n\t display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n\t display.lineGutter.style.width = display.lineNumWidth + \"px\";\n\t updateGutterSpace(cm);\n\t return true;\n\t }\n\t return false;\n\t }", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"))\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW\n display.lineGutter.style.width = \"\"\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1\n display.lineNumWidth = display.lineNumInnerWidth + padding\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1\n display.lineGutter.style.width = display.lineNumWidth + \"px\"\n updateGutterSpace(cm)\n return true\n }\n return false\n}", "function withLineNumbers(renderer) {\n renderer.renderer.rules.paragraph_open\n = renderer.renderer.rules.heading_open\n = renderer.renderer.rules.ordered_list_open\n = renderer.renderer.rules.bullet_list_open\n = renderer.renderer.rules.blockquote_open\n = renderer.renderer.rules.dl_open\n = injectLineNumbers;\n renderer.renderer.rules.html_block = html_block_injectLineNumbers;\n renderer.renderer.rules.code_block\n // = renderer.renderer.rules.fence\n = code_block_injectLineNumbers;\n return renderer;\n}", "_createLineNumbers(editor) {\n const {\n changes,\n newStart: initialOffset\n } = this.props.hunk;\n const changeCount = changes.length;\n const maxDisplayLineNumber = initialOffset + changeCount - 1; // The maximum required gutter width for this hunk, in characters:\n\n const gutterWidth = String(maxDisplayLineNumber).length;\n let deletedLinesInSection = 0;\n let deletedLines = 0; // use a generator to avoid having to precalculate and store an array of\n // line numbers\n\n function* lineNumberGenerator() {\n for (let line = 0; line < changeCount; line++) {\n if (changes[line].type === 'del') {\n deletedLinesInSection++;\n } else {\n deletedLines += deletedLinesInSection;\n deletedLinesInSection = 0;\n }\n\n yield line + initialOffset - deletedLines;\n }\n }\n\n const gutter = createCustomLineNumberGutter(editor, lineNumberGenerator(), gutterWidth, {\n onClick: this.props.onClickLine\n });\n\n this._disposables.add(() => {\n gutter.destroy();\n });\n }", "function createCustomLineNumberGutter(editor, lineNumbers, gutterWidth, options = {}) {\n const {\n extraName,\n onClick\n } = options; // 'nuclide-ui-file-changes-line-number-gutter-wX' makes a gutter Xem wide.\n // 'nuclide-ui-file-changes-line-number-gutter' makes a gutter 5em wide\n\n const suffix = gutterWidth > 0 && gutterWidth < MAX_GUTTER_WIDTH ? `-w${gutterWidth}` : '';\n let name = `nuclide-ui-file-changes-line-number-gutter${suffix}`;\n\n if (extraName != null) {\n name += ` ${extraName}`;\n }\n\n const gutter = editor.addGutter({\n name\n });\n let index = -1;\n\n for (const lineNumber of lineNumbers) {\n index++;\n\n if (lineNumber == null) {\n continue;\n }\n\n const marker = editor.markBufferPosition([index, 0], {\n invalidate: 'touch'\n });\n const item = createGutterItem(lineNumber, gutterWidth, onClick);\n gutter.decorateMarker(marker, {\n type: 'gutter',\n item\n });\n gutter.onDidDestroy(() => {\n marker.destroy();\n\n _reactDom.default.unmountComponentAtNode(item);\n });\n }\n\n return gutter;\n}", "function changeLineComment(option, state, ranges = state.selection.ranges) {\n let lines = [];\n let prevLine = -1;\n for (let { from, to } of ranges) {\n let startI = lines.length, minIndent = 1e9;\n let token = getConfig(state, from).line;\n if (!token)\n continue;\n for (let pos = from; pos <= to;) {\n let line = state.doc.lineAt(pos);\n if (line.from > prevLine && (from == to || to > line.from)) {\n prevLine = line.from;\n let indent = /^\\s*/.exec(line.text)[0].length;\n let empty = indent == line.length;\n let comment = line.text.slice(indent, indent + token.length) == token ? indent : -1;\n if (indent < line.text.length && indent < minIndent)\n minIndent = indent;\n lines.push({ line, comment, token, indent, empty, single: false });\n }\n pos = line.to + 1;\n }\n if (minIndent < 1e9)\n for (let i = startI; i < lines.length; i++)\n if (lines[i].indent < lines[i].line.text.length)\n lines[i].indent = minIndent;\n if (lines.length == startI + 1)\n lines[startI].single = true;\n }\n if (option != 2 /* CommentOption.Uncomment */ && lines.some(l => l.comment < 0 && (!l.empty || l.single))) {\n let changes = [];\n for (let { line, token, indent, empty, single } of lines)\n if (single || !empty)\n changes.push({ from: line.from + indent, insert: token + \" \" });\n let changeSet = state.changes(changes);\n return { changes: changeSet, selection: state.selection.map(changeSet, 1) };\n }\n else if (option != 1 /* CommentOption.Comment */ && lines.some(l => l.comment >= 0)) {\n let changes = [];\n for (let { line, comment, token } of lines)\n if (comment >= 0) {\n let from = line.from + comment, to = from + token.length;\n if (line.text[to - line.from] == \" \")\n to++;\n changes.push({ from, to });\n }\n return { changes };\n }\n return null;\n}", "function updateGutters(cm) {\r\n var gutters = cm.display.gutters, specs = cm.options.gutters;\r\n removeChildren(gutters);\r\n var i = 0;\r\n for (; i < specs.length; ++i) {\r\n var gutterClass = specs[i];\r\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\r\n if (gutterClass == \"CodeMirror-linenumbers\") {\r\n cm.display.lineGutter = gElt;\r\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\r\n }\r\n }\r\n gutters.style.display = i ? \"\" : \"none\";\r\n updateGutterSpace(cm);\r\n}", "function lineNumbers(config = {}) {\n return [\n lineNumberConfig.of(config),\n gutters(),\n lineNumberGutter\n ];\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters\n removeChildren(gutters)\n var i = 0\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i]\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass))\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\"\n }\n }\n gutters.style.display = i ? \"\" : \"none\"\n updateGutterSpace(cm)\n}", "get showLineNumbers() {\n return this.hasAttribute('show-line-numbers');\n }", "function updateGutters(cm) {\r\n var gutters = cm.display.gutters, specs = cm.options.gutters;\r\n removeChildren(gutters);\r\n for (var i = 0; i < specs.length; ++i) {\r\n var gutterClass = specs[i];\r\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\r\n if (gutterClass == \"CodeMirror-linenumbers\") {\r\n cm.display.lineGutter = gElt;\r\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\r\n }\r\n }\r\n gutters.style.display = i ? \"\" : \"none\";\r\n updateGutterSpace(cm);\r\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }", "function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }" ]
[ "0.8162627", "0.8162627", "0.8162627", "0.8162627", "0.8098978", "0.8058674", "0.8058674", "0.8058674", "0.8045018", "0.79794276", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7910028", "0.7898422", "0.7898422", "0.7328001", "0.66514325", "0.64476264", "0.64045095", "0.6397624", "0.6397624", "0.6397624", "0.6397624", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.63911194", "0.6382709", "0.6382431", "0.6382431", "0.6382431", "0.6382431", "0.6382431", "0.6382431", "0.6381716", "0.63813555", "0.63813555", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.637864", "0.63760686", "0.63691324", "0.63652056", "0.63652056", "0.63652056", "0.6341514", "0.6341514", "0.58275056", "0.5816536", "0.566265", "0.5630676", "0.55436295", "0.55331117", "0.5527748", "0.5527748", "0.5496879", "0.54701596", "0.5453576", "0.5453576", "0.5453576", "0.5453576" ]
0.8009682
17