code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
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 &... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | patchDisplay | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | rm | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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") u... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineForChanges | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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 (... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ensureLineWrapped | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateLineBackground(lineView) {
var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
if (cls) cls += " CodeMirror-linebackground";
if (lineView.background) {
if (cls) lineView.background.className = cls;
else { lineView.background... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineBackground | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getLineContent | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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 != lin... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineText | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateLineClasses(lineView) {
updateLineBackground(lineView);
if (lineView.line.wrapClass)
ensureLineWrapped(lineView).className = lineView.line.wrapClass;
else if (lineView.node != lineView.text)
lineView.node.className = "";
var textClass = lineView.textClass ? lineView.textClass ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineClasses | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateLineGutter(cm, lineView, lineN, dims) {
if (lineView.gutter) {
lineView.node.removeChild(lineView.gutter);
lineView.gutter = null;
}
if (lineView.gutterBackground) {
lineView.node.removeChild(lineView.gutterBackground);
lineView.gutterBackground = null;
}
if (l... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineGutter | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function updateLineWidgets(cm, lineView, dims) {
if (lineView.alignable) lineView.alignable = null;
for (var node = lineView.node.firstChild, next; node; node = next) {
var next = node.nextSibling;
if (node.className == "CodeMirror-linewidget")
lineView.node.removeChild(node);
}
inse... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateLineWidgets | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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(lineView);
updateLineGutt... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | buildLineElement | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | insertLineWidgets | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
if (!line.widgets) return;
var wrap = ensureLineWrapped(lineView);
for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
if (!widget.handleMouse... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | insertLineWidgetsFor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function positionLineWidget(widget, node, lineView, dims) {
if (widget.noHScroll) {
(lineView.alignable || (lineView.alignable = [])).push(node);
var width = dims.wrapperWidth;
node.style.left = dims.fixedPos + "px";
if (!widget.coverGutter) {
width -= dims.gutterTotalWidth;
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | positionLineWidget | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function ensureFocus(cm) {
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ensureFocus | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function applyTextInput(cm, inserted, deleted, sel, origin) {
var doc = cm.doc;
cm.display.shift = false;
if (!sel) sel = doc.sel;
var paste = cm.state.pasteIncoming || origin == "paste";
var textLines = doc.splitLines(inserted), multiPaste = null
// When pasing N lines into N selections, inser... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | applyTextInput | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function handlePaste(e, cm) {
var pasted = e.clipboardData && e.clipboardData.getData("text/plain");
if (pasted) {
e.preventDefault();
if (!cm.isReadOnly() && !cm.options.disableInput)
runInOp(cm, function() { applyTextInput(cm, pasted, 0, null, "paste"); });
return true;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | handlePaste | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function triggerElectric(cm, inserted) {
// When an 'electric' character is inserted, immediately trigger a reindent
if (!cm.options.electricChars || !cm.options.smartIndent) return;
var sel = cm.doc.sel;
for (var i = sel.ranges.length - 1; i >= 0; i--) {
var range = sel.ranges[i];
if (rang... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | triggerElectric | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function copyableRanges(cm) {
var text = [], ranges = [];
for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
var line = cm.doc.sel.ranges[i].head.line;
var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
ranges.push(lineRange);
text.push(cm.getRange(lineRange.anchor, lineRa... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | copyableRanges | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function disableBrowserMagic(field) {
field.setAttribute("autocorrect", "off");
field.setAttribute("autocapitalize", "off");
field.setAttribute("spellcheck", "false");
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | disableBrowserMagic | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function TextareaInput(cm) {
this.cm = cm;
// See input.poll and input.reset
this.prevInput = "";
// Flag that indicates whether we expect input to appear real soon
// now (after some event like 'keypress' or 'input') and are
// polling intensively.
this.pollingFast = false;
// Self-res... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | TextareaInput | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function hiddenTextarea() {
var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
// The textarea is kept positioned near the cursor to prevent the
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | hiddenTextarea | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function prepareCopyCut(e) {
if (signalDOMEvent(cm, e)) return
if (cm.somethingSelected()) {
lastCopied = {lineWise: false, text: cm.getSelections()};
if (input.inaccurateSelection) {
input.prevInput = "";
input.inaccurateSelection = false;
te.valu... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | prepareCopyCut | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function p() {
var changed = input.poll();
if (!changed && !missed) {missed = true; input.polling.set(60, p);}
else {input.pollingFast = false; input.slowPoll();}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | p | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function prepareSelectAllHack() {
if (te.selectionStart != null) {
var selected = cm.somethingSelected();
var extval = "\u200b" + (selected ? te.value : "");
te.value = "\u21da"; // Used to catch context-menu undo
te.value = extval;
input.prevInput = selected ? ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | prepareSelectAllHack | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function rehide() {
input.contextMenuPending = false;
input.wrapper.style.cssText = oldWrapperCSS
te.style.cssText = oldCSS;
if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos);
// Try to detect the user choosing select-all
i... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | rehide | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
poll = function() {
if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
te.selectionEnd > 0 && input.prevInput == "\u200b")
operation(cm, commands.selectAll)(cm);
else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | poll | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
mouseup = function() {
off(window, "mouseup", mouseup);
setTimeout(rehide, 20);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | mouseup | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function ContentEditableInput(cm) {
this.cm = cm;
this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;
this.polling = new Delayed();
this.gracePeriod = false;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ContentEditableInput | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onCopyCut(e) {
if (signalDOMEvent(cm, e)) return
if (cm.somethingSelected()) {
lastCopied = {lineWise: false, text: cm.getSelections()};
if (e.type == "cut") cm.replaceSelection("", null, "cut");
} else if (!cm.options.lineWiseCopyCut) {
return;
} e... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onCopyCut | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function poll() {
if (input.cm.state.focused) {
input.pollSelection();
input.polling.set(input.cm.options.pollInterval, poll);
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | poll | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function posToDOM(cm, pos) {
var view = findViewForLine(cm, pos.line);
if (!view || view.hidden) return null;
var line = getLine(cm.doc, pos.line);
var info = mapFromLineView(view, line, pos.line);
var order = getOrder(line), side = "left";
if (order) {
var partPos = getBidiPartAt(order, ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | posToDOM | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function domToPos(cm, node, offset) {
var lineNode;
if (node == cm.display.lineDiv) {
lineNode = cm.display.lineDiv.childNodes[offset];
if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true);
node = null; offset = 0;
} else {
for (lineNode = node;; lineNode = line... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | domToPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function locateNodeInLineView(lineView, node, offset) {
var wrapper = lineView.text.firstChild, bad = false;
if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true);
if (node == wrapper) {
bad = true;
node = wrapper.childNodes[offset];
offset = 0;
if... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | locateNodeInLineView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function find(textNode, topNode, offset) {
for (var i = -1; i < (maps ? maps.length : 0); i++) {
var map = i < 0 ? measure.map : maps[i];
for (var j = 0; j < map.length; j += 3) {
var curNode = map[j + 2];
if (curNode == textNode || curNode == topNode) {
var line = ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | find | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function domTextBetween(cm, from, to, fromLine, toLine) {
var text = "", closing = false, lineSep = cm.doc.lineSeparator();
function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }
function walk(node) {
if (node.nodeType == 1) {
var cmText = node.getAttribute("cm-t... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | domTextBetween | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function walk(node) {
if (node.nodeType == 1) {
var cmText = node.getAttribute("cm-text");
if (cmText != null) {
if (cmText == "") cmText = node.textContent.replace(/\u200b/g, "");
text += cmText;
return;
}
var markerID = node.getAttribute("cm-marker")... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | walk | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function Selection(ranges, primIndex) {
this.ranges = ranges;
this.primIndex = primIndex;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | Selection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function Range(anchor, head) {
this.anchor = anchor; this.head = head;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | Range | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function normalizeSelection(ranges, primIndex) {
var prim = ranges[primIndex];
ranges.sort(function(a, b) { return cmp(a.from(), b.from()); });
primIndex = indexOf(ranges, prim);
for (var i = 1; i < ranges.length; i++) {
var cur = ranges[i], prev = ranges[i - 1];
if (cmp(prev.to(), cur.from(... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | normalizeSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function simpleSelection(anchor, head) {
return new Selection([new Range(anchor, head || anchor)], 0);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | simpleSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clipPos(doc, pos) {
if (pos.line < doc.first) return Pos(doc.first, 0);
var last = doc.first + doc.size - 1;
if (pos.line > last) return Pos(last, getLine(doc, last).text.length);
return clipToLen(pos, getLine(doc, pos.line).text.length);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clipPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clipToLen(pos, linelen) {
var ch = pos.ch;
if (ch == null || ch > linelen) return Pos(pos.line, linelen);
else if (ch < 0) return Pos(pos.line, 0);
else return pos;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clipToLen | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clipPosArray(doc, array) {
for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]);
return out;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clipPosArray | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function extendRange(doc, range, head, other) {
if (doc.cm && doc.cm.display.shift || doc.extend) {
var anchor = range.anchor;
if (other) {
var posBefore = cmp(head, anchor) < 0;
if (posBefore != (cmp(other, anchor) < 0)) {
anchor = head;
head = other;
} else ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | extendRange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function extendSelection(doc, head, other, options) {
setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | extendSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function extendSelections(doc, heads, options) {
for (var out = [], i = 0; i < doc.sel.ranges.length; i++)
out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null);
var newSel = normalizeSelection(out, doc.sel.primIndex);
setSelection(doc, newSel, options);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | extendSelections | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function replaceOneSelection(doc, i, range, options) {
var ranges = doc.sel.ranges.slice(0);
ranges[i] = range;
setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | replaceOneSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setSimpleSelection(doc, anchor, head, options) {
setSelection(doc, simpleSelection(anchor, head), options);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setSimpleSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function filterSelectionChange(doc, sel, options) {
var obj = {
ranges: sel.ranges,
update: function(ranges) {
this.ranges = [];
for (var i = 0; i < ranges.length; i++)
this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
clipPos(doc, ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | filterSelectionChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setSelectionReplaceHistory(doc, sel, options) {
var done = doc.history.done, last = lst(done);
if (last && last.ranges) {
done[done.length - 1] = sel;
setSelectionNoUndo(doc, sel, options);
} else {
setSelection(doc, sel, options);
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setSelectionReplaceHistory | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setSelection(doc, sel, options) {
setSelectionNoUndo(doc, sel, options);
addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setSelectionNoUndo(doc, sel, options) {
if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
sel = filterSelectionChange(doc, sel, options);
var bias = options && options.bias ||
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setSelectionNoUndo | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function setSelectionInner(doc, sel) {
if (sel.equals(doc.sel)) return;
doc.sel = sel;
if (doc.cm) {
doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true;
signalCursorActivity(doc.cm);
}
signalLater(doc, "cursorActivity", doc);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setSelectionInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function reCheckSelection(doc) {
setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | reCheckSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function skipAtomicInSelection(doc, sel, bias, mayClear) {
var out;
for (var i = 0; i < sel.ranges.length; i++) {
var range = sel.ranges[i];
var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClea... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | skipAtomicInSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
var line = getLine(doc, pos.line);
if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
var sp = line.markedSpans[i], m = sp.marker;
if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | skipAtomicInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function skipAtomic(doc, pos, oldPos, bias, mayClear) {
var dir = bias || 1;
var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
(!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
(!mayClear && skipAtomicInner(d... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | skipAtomic | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function movePos(doc, pos, dir, line) {
if (dir < 0 && pos.ch == 0) {
if (pos.line > doc.first) return clipPos(doc, Pos(pos.line - 1));
else return null;
} else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
if (pos.line < doc.first + doc.size - 1) return Pos(pos.line... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | movePos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function prepareSelection(cm, primary) {
var doc = cm.doc, result = {};
var curFragment = result.cursors = document.createDocumentFragment();
var selFragment = result.selection = document.createDocumentFragment();
for (var i = 0; i < doc.sel.ranges.length; i++) {
if (primary === false && i == doc... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | prepareSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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.sty... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | drawSelectionCursor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function drawSelectionRange(cm, range, 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.righ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | drawSelectionRange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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; top: " + top + "px; width: " + (width == null ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | add | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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);
}
iterateBidiSections(getOrder(lineObj), fromArg || 0, to... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | drawForLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function coords(ch, bias) {
return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | coords | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function restartBlink(cm) {
if (!cm.state.focused) return;
var display = cm.display;
clearInterval(display.blinker);
var on = true;
display.cursorDiv.style.visibility = "";
if (cm.options.cursorBlinkRate > 0)
display.blinker = setInterval(function() {
display.cursorDiv.style.visibi... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | restartBlink | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function startWorker(cm, time) {
if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
cm.state.highlight.set(time, bind(highlightWorker, cm));
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | startWorker | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function highlightWorker(cm) {
var doc = cm.doc;
if (doc.frontier < doc.first) doc.frontier = doc.first;
if (doc.frontier >= cm.display.viewTo) return;
var end = +new Date + cm.options.workTime;
var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
var changedLines = [];
doc.it... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | highlightWorker | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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);
if (line.stateAft... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findStartLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getStateBefore(cm, n, precise) {
var doc = cm.doc, display = cm.display;
if (!doc.mode.startState) return true;
var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
if (!state) state = startState(doc.mode);
else state = copyState(doc.mode, stat... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getStateBefore | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function paddingH(display) {
if (display.cachedPaddingH) return display.cachedPaddingH;
var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));
var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
var data = {left: parseInt(style.paddingLeft), right: parseInt(style.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | paddingH | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function displayWidth(cm) {
return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | displayWidth | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function displayHeight(cm) {
return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | displayHeight | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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.m... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ensureLineHeights | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | mapFromLineView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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(c... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | updateExternalMeasurement | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function measureChar(cm, line, ch, bias) {
return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | measureChar | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findViewForLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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 (!vi... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | prepareMeasureForLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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.getBoundingClient... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | measureCharPrepared | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function nodeAndOffsetInLineMap(map, ch, bias) {
var node, start, end, collapse;
// First, search the line map for the text node corresponding to,
// or closest to, the target character.
for (var i = 0; i < map.length; i += 3) {
var mStart = map[i], mEnd = map[i + 1];
if (ch < mStart) {
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | nodeAndOffsetInLineMap | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function measureCharInner(cm, prepared, ch, bias) {
var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);
var node = place.node, start = place.start, end = place.end, collapse = place.collapse;
var rect;
if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | measureCharInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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;... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | maybeUpdateRectForZooming | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clearLineMeasurementCacheFor(lineView) {
if (lineView.measure) {
lineView.measure.cache = {};
lineView.measure.heights = null;
if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)
lineView.measure.caches[i] = {};
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clearLineMeasurementCacheFor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clearLineMeasurementCache(cm) {
cm.display.externalMeasure = null;
removeChildren(cm.display.lineMeasure);
for (var i = 0; i < cm.display.view.length; i++)
clearLineMeasurementCacheFor(cm.display.view[i]);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clearLineMeasurementCache | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function clearCaches(cm) {
clearLineMeasurementCache(cm);
cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;
if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
cm.display.lineNumChars = null;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clearCaches | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function intoCoordSystem(cm, lineObj, rect, context) {
if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
var size = widgetHeight(lineObj.widgets[i]);
rect.top += size; rect.bottom += size;
}
if (context == "line") return rect;
if (!context)... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | intoCoordSystem | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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) {
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fromCoordSystem | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function charCoords(cm, pos, context, lineObj, bias) {
if (!lineObj) lineObj = getLine(cm.doc, pos.line);
return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | charCoords | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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" : "l... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | cursorCoords | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | get | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getBidi(ch, partPos) {
var part = order[partPos], right = part.level % 2;
if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
part = order[--partPos];
ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
right = true;
} else if (ch == bidiRight(... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getBidi | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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 ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | estimateCoords | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function PosWithInfo(line, ch, outside, xRel) {
var pos = Pos(line, ch);
pos.xRel = xRel;
if (outside) pos.outside = true;
return pos;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | PosWithInfo | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function coordsChar(cm, x, y) {
var doc = cm.doc;
y += cm.display.viewOffset;
if (y < 0) return PosWithInfo(doc.first, 0, 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,... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | coordsChar | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function coordsCharInner(cm, lineObj, lineNo, x, y) {
var innerOff = y - heightAtLine(lineObj);
var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
var preparedMeasure = prepareMeasureForLine(cm, lineObj);
function getX(ch) {
var sp = cursorCoords(cm, Pos(lineNo, ch), "line", line... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | coordsCharInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getX(ch) {
var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure);
wrongLine = true;
if (innerOff > sp.bottom) return sp.left - adjust;
else if (innerOff < sp.top) return sp.left + adjust;
else wrongLine = false;
return sp.left;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getX | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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.appe... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | textHeight | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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;
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | charWidth | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
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, // W... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | startOperation | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.