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 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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function fireCallbacksForOps(group) {
// Calls delayed callbacks and cursorActivity handlers until no
// new ones appear
var callbacks = group.delayedCallbacks, i = 0;
do {
for (; i < callbacks.length; i++)
callbacks[i].call(null);
for (var j = 0; j < group.ops.length; j++) {
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | fireCallbacksForOps | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation(cm) {
var op = cm.curOp, group = op.ownsGroup;
if (!group) return;
try { fireCallbacksForOps(group); }
finally {
operationGroup = null;
for (var i = 0; i < group.ops.length; i++)
group.ops[i].cm.curOp = null;
endOperations(group);
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperations(group) {
var ops = group.ops;
for (var i = 0; i < ops.length; i++) // Read DOM
endOperation_R1(ops[i]);
for (var i = 0; i < ops.length; i++) // Write DOM (maybe)
endOperation_W1(ops[i]);
for (var i = 0; i < ops.length; i++) // Read DOM
endOperation_R2(ops[i]);
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperations | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation_R1(op) {
var cm = op.cm, display = cm.display;
maybeClipScrollbars(cm);
if (op.updateMaxLine) findMaxLine(cm);
op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation_R1 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation_W1(op) {
op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation_W1 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation_R2(op) {
var cm = op.cm, display = cm.display;
if (op.updatedDisplay) updateHeightsInViewport(cm);
op.barMeasure = measureForScrollbars(cm);
// If the max line changed since it was last measured, measure it,
// and ensure the document's width matches it.
// updateDisplay_... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation_R2 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation_W2(op) {
var cm = op.cm;
if (op.adjustWidthTo != null) {
cm.display.sizer.style.minWidth = op.adjustWidthTo + "px";
if (op.maxScrollLeft < cm.doc.scrollLeft)
setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true);
cm.display.maxLineCh... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation_W2 | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function endOperation_finish(op) {
var cm = op.cm, display = cm.display, doc = cm.doc;
if (op.updatedDisplay) postUpdateDisplay(cm, op.update);
// Abort mouse wheel delta measurement, when scrolling explicitly
if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scro... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | endOperation_finish | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function runInOp(cm, f) {
if (cm.curOp) return f();
startOperation(cm);
try { return f(); }
finally { endOperation(cm); }
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | runInOp | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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); }
};
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | operation | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function methodOp(f) {
return function() {
if (this.curOp) return f.apply(this, arguments);
startOperation(this);
try { return f.apply(this, arguments); }
finally { endOperation(this); }
};
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | methodOp | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function docMethodOp(f) {
return function() {
var cm = this.cm;
if (!cm || cm.curOp) return f.apply(this, arguments);
startOperation(cm);
try { return f.apply(this, arguments); }
finally { endOperation(cm); }
};
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | docMethodOp | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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;
thi... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | LineView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | buildViewArray | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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 > fr... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | regChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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 l... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | regLineChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function resetView(cm) {
cm.display.viewFrom = cm.display.viewTo = cm.doc.first;
cm.display.view = [];
cm.display.viewOffset = 0;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | resetView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findViewIndex | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function viewCuttingPoint(cm, oldN, newN, dir) {
var index = findViewIndex(cm, oldN), diff, view = cm.display.view;
if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
return {index: index, lineN: newN};
for (var i = 0, n = cm.display.viewFrom; i < index; i++)
n += view[i].size;
if... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | viewCuttingPoint | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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 = ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | adjustView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | countDirtyView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function registerEventHandlers(cm) {
var d = cm.display;
on(d.scroller, "mousedown", operation(cm, onMouseDown));
// Older IE's will not fire a second mousedown for a double click
if (ie && ie_version < 11)
on(d.scroller, "dblclick", operation(cm, function(e) {
if (signalDOMEvent(cm, e)) r... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | registerEventHandlers | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function finishTouch() {
if (d.activeTouch) {
touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000);
prevTouch = d.activeTouch;
prevTouch.end = +new Date;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | finishTouch | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function isMouseLikeTouchEvent(e) {
if (e.touches.length != 1) return false;
var touch = e.touches[0];
return touch.radiusX <= 1 && touch.radiusY <= 1;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | isMouseLikeTouchEvent | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function farAway(touch, other) {
if (other.left == null) return true;
var dx = other.left - touch.left, dy = other.top - touch.top;
return dx * dx + dy * dy > 20 * 20;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | farAway | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function dragDropChanged(cm, value, old) {
var wasOn = old && old != CodeMirror.Init;
if (!value != !wasOn) {
var funcs = cm.display.dragFunctions;
var toggle = value ? on : off;
toggle(cm.display.scroller, "dragstart", funcs.start);
toggle(cm.display.scroller, "dragenter", funcs.enter);... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | dragDropChanged | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onResize(cm) {
var d = cm.display;
if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
return;
// Might be a text scaling operation, clear size caches.
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
d.scrollbarsClipped = false... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onResize | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | eventInWidget | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
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 =... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | posFromMouse | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onMouseDown(e) {
var cm = this, display = cm.display;
if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;
display.shift = e.shiftKey;
if (eventInWidget(display, e)) {
if (!webkit) {
// Briefly turn off draggability, to allow widgets to do
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onMouseDown | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function leftButtonDown(cm, e, start) {
if (ie) setTimeout(bind(ensureFocus, cm), 0);
else cm.curOp.focus = activeElt();
var now = +new Date, type;
if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
type = "triple";
} else if (lastClick && lastC... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | leftButtonDown | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function leftButtonStartDrag(cm, e, start, modifier) {
var display = cm.display, startTime = +new Date;
var dragEnd = operation(cm, function(e2) {
if (webkit) display.scroller.draggable = false;
cm.state.draggingText = false;
off(document, "mouseup", dragEnd);
off(display.scroller, "drop... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | leftButtonStartDrag | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function leftButtonSelect(cm, e, start, type, addNew) {
var display = cm.display, doc = cm.doc;
e_preventDefault(e);
var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
if (addNew && !e.shiftKey) {
ourIndex = doc.sel.contains(start);
if (ourIndex > -1)
ourRange = r... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | leftButtonSelect | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function extendTo(pos) {
if (cmp(lastPos, pos) == 0) return;
lastPos = pos;
if (type == "rect") {
var ranges = [], tabSize = cm.options.tabSize;
var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
var posCol = countColumn(getLine(doc, pos.line).text, ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | extendTo | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function extend(e) {
var curCount = ++counter;
var cur = posFromMouse(cm, e, true, type == "rect");
if (!cur) return;
if (cmp(cur, lastPos) != 0) {
cm.curOp.focus = activeElt();
extendTo(cur);
var visible = visibleLines(display, doc);
if (cur.line >= visible.to ||... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | extend | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function done(e) {
cm.state.selectingText = false;
counter = Infinity;
e_preventDefault(e);
display.input.focus();
off(document, "mousemove", move);
off(document, "mouseup", up);
doc.history.lastSelOrigin = null;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | done | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function gutterEvent(cm, e, type, prevent) {
try { var mX = e.clientX, mY = e.clientY; }
catch(e) { return false; }
if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;
if (prevent) e_preventDefault(e);
var display = cm.display;
var lineBox = display.lineDiv.get... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | gutterEvent | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function clickInGutter(cm, e) {
return gutterEvent(cm, e, "gutterClick", true);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clickInGutter | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onDrop(e) {
var cm = this;
clearDragCursor(cm);
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
return;
e_preventDefault(e);
if (ie) lastDrop = +new Date;
var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
if (!pos || cm.isReadOnly()) return;
// ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onDrop | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
loadFile = function(file, i) {
if (cm.options.allowDropFileTypes &&
indexOf(cm.options.allowDropFileTypes, file.type) == -1)
return;
var reader = new FileReader;
reader.onload = operation(cm, function() {
var content = reader.result;
if (/[\x00-\x08\x0e... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | loadFile | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onDragStart(cm, e) {
if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
e.dataTransfer.setData("Text", cm.getSelection());
e.dataTransfer.effectAllowed = "copyMove"
// Use dummy image ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onDragStart | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onDragOver(cm, e) {
var pos = posFromMouse(cm, e);
if (!pos) return;
var frag = document.createDocumentFragment();
drawSelectionCursor(cm, pos, frag);
if (!cm.display.dragCursor) {
cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors");
cm.display.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onDragOver | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function clearDragCursor(cm) {
if (cm.display.dragCursor) {
cm.display.lineSpace.removeChild(cm.display.dragCursor);
cm.display.dragCursor = null;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | clearDragCursor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function setScrollTop(cm, val) {
if (Math.abs(cm.doc.scrollTop - val) < 2) return;
cm.doc.scrollTop = val;
if (!gecko) updateDisplaySimple(cm, {top: val});
if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
cm.display.scrollbars.setScrollTop(val);
if (gecko) updateDis... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setScrollTop | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function setScrollLeft(cm, val, isScroller) {
if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
cm.doc.scrollLeft = val;
alignHorizontally(cm);
if (cm.display.scroller.scr... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | setScrollLeft | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
wheelEventDelta = function(e) {
var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
else if (dy == null) dy = e.wheelDelta;
return {x: dx, y: dy};
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | wheelEventDelta | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function onScrollWheel(cm, e) {
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
var display = cm.display, scroll = display.scroller;
// Quit if there's nothing to scroll here
var canScrollX = scroll.scrollWidth > scroll.clientWidth;
var canScrollY = scroll.scrollHeight > scroll.clientHe... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onScrollWheel | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function doHandleBinding(cm, bound, dropShift) {
if (typeof bound == "string") {
bound = commands[bound];
if (!bound) return false;
}
// Ensure previous input has been read, so that the handler sees a
// consistent view of the document
cm.display.input.ensurePolled();
var prevShift =... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | doHandleBinding | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function lookupKeyForEditor(cm, name, handle) {
for (var i = 0; i < cm.state.keyMaps.length; i++) {
var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);
if (result) return result;
}
return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
|| lookupKey(na... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | lookupKeyForEditor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function dispatchKey(cm, name, e, handle) {
var seq = cm.state.keySeq;
if (seq) {
if (isModifierKey(name)) return "handled";
stopSeq.set(50, function() {
if (cm.state.keySeq == seq) {
cm.state.keySeq = null;
cm.display.input.reset();
}
});
name = seq +... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | dispatchKey | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
function handleKeyBinding(cm, e) {
var name = keyName(e, true);
if (!name) return false;
if (e.shiftKey && !cm.state.keySeq) {
// First try to resolve full name (including 'Shift-'). Failing
// that, see if there is a cursor-motion command (starting with
// 'go') bound to the keyname with... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | handleKeyBinding | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.debug.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.