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 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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.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.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function handleCharBinding(cm, e, ch) {
return dispatchKey(cm, "'" + ch + "'", e,
function(b) { return doHandleBinding(cm, b, true); });
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | handleCharBinding | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onKeyDown(e) {
var cm = this;
cm.curOp.focus = activeElt();
if (signalDOMEvent(cm, e)) return;
// IE does strange things with escape.
if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false;
var code = e.keyCode;
cm.display.shift = code == 16 || e.shiftKey;
var handl... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onKeyDown | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function showCrossHair(cm) {
var lineDiv = cm.display.lineDiv;
addClass(lineDiv, "CodeMirror-crosshair");
function up(e) {
if (e.keyCode == 18 || !e.altKey) {
rmClass(lineDiv, "CodeMirror-crosshair");
off(document, "keyup", up);
off(document, "mouseover", up);
}
}
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | showCrossHair | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function up(e) {
if (e.keyCode == 18 || !e.altKey) {
rmClass(lineDiv, "CodeMirror-crosshair");
off(document, "keyup", up);
off(document, "mouseover", up);
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | up | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onKeyUp(e) {
if (e.keyCode == 16) this.doc.sel.shift = false;
signalDOMEvent(this, e);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onKeyUp | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onKeyPress(e) {
var cm = this;
if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return;
var keyCode = e.keyCode, charCode = e.charCode;
if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
if (... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onKeyPress | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function delayBlurEvent(cm) {
cm.state.delayingBlurEvent = true;
setTimeout(function() {
if (cm.state.delayingBlurEvent) {
cm.state.delayingBlurEvent = false;
onBlur(cm);
}
}, 100);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | delayBlurEvent | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onFocus(cm) {
if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false;
if (cm.options.readOnly == "nocursor") return;
if (!cm.state.focused) {
signal(cm, "focus", cm);
cm.state.focused = true;
addClass(cm.display.wrapper, "CodeMirror-focused");
// This test preve... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onFocus | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onBlur(cm) {
if (cm.state.delayingBlurEvent) return;
if (cm.state.focused) {
signal(cm, "blur", cm);
cm.state.focused = false;
rmClass(cm.display.wrapper, "CodeMirror-focused");
}
clearInterval(cm.display.blinker);
setTimeout(function() {if (!cm.state.focused) cm.display.... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onBlur | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function onContextMenu(cm, e) {
if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;
if (signalDOMEvent(cm, e, "contextmenu")) return;
cm.display.input.onContextMenu(e);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | onContextMenu | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function contextMenuInGutter(cm, e) {
if (!hasHandler(cm, "gutterContextMenu")) return false;
return gutterEvent(cm, e, "gutterContextMenu", false);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | contextMenuInGutter | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function adjustForChange(pos, change) {
if (cmp(pos, change.from) < 0) return pos;
if (cmp(pos, change.to) <= 0) return changeEnd(change);
var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
if (pos.line == change.to.line) ch += changeEnd(change).ch - change... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | adjustForChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function computeSelAfterChange(doc, change) {
var out = [];
for (var i = 0; i < doc.sel.ranges.length; i++) {
var range = doc.sel.ranges[i];
out.push(new Range(adjustForChange(range.anchor, change),
adjustForChange(range.head, change)));
}
return normalizeSelection(o... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | computeSelAfterChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function offsetPos(pos, old, nw) {
if (pos.line == old.line)
return Pos(nw.line, pos.ch - old.ch + nw.ch);
else
return Pos(nw.line + (pos.line - old.line), pos.ch);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | offsetPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function computeReplacedSel(doc, changes, hint) {
var out = [];
var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;
for (var i = 0; i < changes.length; i++) {
var change = changes[i];
var from = offsetPos(change.from, oldPrev, newPrev);
var to = offsetPos(changeEnd(change), oldPrev, newPre... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | computeReplacedSel | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function filterChange(doc, change, update) {
var obj = {
canceled: false,
from: change.from,
to: change.to,
text: change.text,
origin: change.origin,
cancel: function() { this.canceled = true; }
};
if (update) obj.update = function(from, to, text, origin) {
if (from... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | filterChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function makeChange(doc, change, ignoreReadOnly) {
if (doc.cm) {
if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly);
if (doc.cm.state.suppressEdits) return;
}
if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
change = ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | makeChange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function makeChangeInner(doc, change) {
if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return;
var selAfter = computeSelAfterChange(doc, change);
addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
makeChangeSingleDoc(doc, change, selAfte... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | makeChangeInner | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function makeChangeFromHistory(doc, type, allowSelectionOnly) {
if (doc.cm && doc.cm.state.suppressEdits) return;
var hist = doc.history, event, selAfter = doc.sel;
var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;
// Verify that there is a useable... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | makeChangeFromHistory | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function shiftDoc(doc, distance) {
if (distance == 0) return;
doc.first += distance;
doc.sel = new Selection(map(doc.sel.ranges, function(range) {
return new Range(Pos(range.anchor.line + distance, range.anchor.ch),
Pos(range.head.line + distance, range.head.ch));
}), doc.se... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | shiftDoc | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function makeChangeSingleDoc(doc, change, selAfter, spans) {
if (doc.cm && !doc.cm.curOp)
return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);
if (change.to.line < doc.first) {
shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
return;
}
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | makeChangeSingleDoc | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function makeChangeSingleDocInEditor(cm, change, spans) {
var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
var recomputeMaxLength = false, checkWidthStart = from.line;
if (!cm.options.lineWrapping) {
checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));
doc.i... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | makeChangeSingleDocInEditor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function replaceRange(doc, code, from, to, origin) {
if (!to) to = from;
if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }
if (typeof code == "string") code = doc.splitLines(code);
makeChange(doc, {from: from, to: to, text: code, origin: origin});
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | replaceRange | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function maybeScrollWindow(cm, coords) {
if (signalDOMEvent(cm, "scrollCursorIntoView")) return;
var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
if (coords.top + box.top < 0) doScroll = true;
else if (coords.bottom + box.top > (window.innerHeight || document.docu... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | maybeScrollWindow | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function scrollPosIntoView(cm, pos, end, margin) {
if (margin == null) margin = 0;
for (var limit = 0; limit < 5; limit++) {
var changed = false, coords = cursorCoords(cm, pos);
var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
var scrollPos = calculateScrollPos(cm, Math.min... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | scrollPosIntoView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function scrollIntoView(cm, x1, y1, x2, y2) {
var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);
if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);
if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | scrollIntoView | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function calculateScrollPos(cm, x1, y1, x2, y2) {
var display = cm.display, snapMargin = textHeight(cm.display);
if (y1 < 0) y1 = 0;
var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
var screen = displayHeight(cm), result = {};
if (y2 - y1 > sc... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | calculateScrollPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function addToScrollPos(cm, left, top) {
if (left != null || top != null) resolveScrollToPos(cm);
if (left != null)
cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;
if (top != null)
cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scr... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | addToScrollPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function ensureCursorVisible(cm) {
resolveScrollToPos(cm);
var cur = cm.getCursor(), from = cur, to = cur;
if (!cm.options.lineWrapping) {
from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur;
to = Pos(cur.line, cur.ch + 1);
}
cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cur... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | ensureCursorVisible | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function resolveScrollToPos(cm) {
var range = cm.curOp.scrollToPos;
if (range) {
cm.curOp.scrollToPos = null;
var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);
var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
Math.m... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | resolveScrollToPos | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function indentLine(cm, n, how, aggressive) {
var doc = cm.doc, state;
if (how == null) how = "add";
if (how == "smart") {
// Fall back to "prev" when the mode doesn't have an indentation
// method.
if (!doc.mode.indent) how = "prev";
else state = getStateBefore(cm, n);
}
va... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | indentLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function changeLine(doc, handle, changeType, op) {
var no = handle, line = handle;
if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle));
else no = lineNo(handle);
if (no == null) return null;
if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType);
return line;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | changeLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function deleteNearSelection(cm, compute) {
var ranges = cm.doc.sel.ranges, kill = [];
// Build up a set of ranges to kill first, merging overlapping
// ranges.
for (var i = 0; i < ranges.length; i++) {
var toKill = compute(ranges[i]);
while (kill.length && cmp(toKill.from, lst(kill).to) <= ... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | deleteNearSelection | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function findPosH(doc, pos, dir, unit, visually) {
var line = pos.line, ch = pos.ch, origDir = dir;
var lineObj = getLine(doc, line);
function findNextLine() {
var l = line + dir;
if (l < doc.first || l >= doc.first + doc.size) return false
line = l;
return lineObj = getLine(doc, l);... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findPosH | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function findNextLine() {
var l = line + dir;
if (l < doc.first || l >= doc.first + doc.size) return false
line = l;
return lineObj = getLine(doc, l);
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findNextLine | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function moveOnce(boundToLine) {
var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);
if (next == null) {
if (!boundToLine && findNextLine()) {
if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
else ch = dir < 0 ? lineObj.text.length : 0;
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | moveOnce | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function findPosV(cm, pos, dir, unit) {
var doc = cm.doc, x = pos.left, y;
if (unit == "page") {
var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findPosV | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function interpret(val) {
return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | interpret | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function option(name, deflt, handle, notOnInit) {
CodeMirror.defaults[name] = deflt;
if (handle) optionHandlers[name] =
notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | option | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function normalizeKeyName(name) {
var parts = name.split(/-(?!$)/), name = parts[parts.length - 1];
var alt, ctrl, shift, cmd;
for (var i = 0; i < parts.length - 1; i++) {
var mod = parts[i];
if (/^(cmd|meta|m)$/i.test(mod)) cmd = true;
else if (/^a(lt)?$/i.test(mod)) alt = true;
els... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | normalizeKeyName | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getKeyMap(val) {
return typeof val == "string" ? keyMap[val] : val;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getKeyMap | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function markText(doc, from, to, options, type) {
// Shared markers (across linked documents) are handled separately
// (markTextShared will call out to this again, once per
// document).
if (options && options.shared) return markTextShared(doc, from, to, options, type);
// Ensure we are in an opera... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | markText | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function markTextShared(doc, from, to, options, type) {
options = copyObj(options);
options.shared = false;
var markers = [markText(doc, from, to, options, type)], primary = markers[0];
var widget = options.widgetNode;
linkedDocs(doc, function(doc) {
if (widget) options.widgetNode = widget.clo... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | markTextShared | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function findSharedMarkers(doc) {
return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())),
function(m) { return m.parent; });
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | findSharedMarkers | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function copySharedMarkers(doc, markers) {
for (var i = 0; i < markers.length; i++) {
var marker = markers[i], pos = marker.find();
var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);
if (cmp(mFrom, mTo)) {
var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.ty... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | copySharedMarkers | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function detachSharedMarkers(markers) {
for (var i = 0; i < markers.length; i++) {
var marker = markers[i], linked = [marker.primary.doc];;
linkedDocs(marker.primary.doc, function(d) { linked.push(d); });
for (var j = 0; j < marker.markers.length; j++) {
var subMarker = marker.markers[j];
... | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | detachSharedMarkers | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function MarkedSpan(marker, from, to) {
this.marker = marker;
this.from = from; this.to = to;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | MarkedSpan | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function getMarkedSpanFor(spans, marker) {
if (spans) for (var i = 0; i < spans.length; ++i) {
var span = spans[i];
if (span.marker == marker) return span;
}
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | getMarkedSpanFor | javascript | sparksuite/simplemde-markdown-editor | debug/simplemde.js | https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.js | MIT |
function removeMarkedSpan(spans, span) {
for (var r, i = 0; i < spans.length; ++i)
if (spans[i] != span) (r || (r = [])).push(spans[i]);
return r;
} | Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. | removeMarkedSpan | 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.