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 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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.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.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function addMarkedSpan(line, span) { line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; span.marker.attachLine(line); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addMarkedSpan
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function markedSpansBefore(old, startCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); if (startsBefore || span.from == startCh &&...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
markedSpansBefore
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function markedSpansAfter(old, endCh, isInsert) { if (old) for (var i = 0, nw; i < old.length; ++i) { var span = old[i], marker = span.marker; var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); if (endsAfter || span.from == endCh && marker.type == "boo...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
markedSpansAfter
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function stretchSpansOverChange(doc, change) { if (change.full) return null; var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; if (!oldFirst && !oldLast) return null; var...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
stretchSpansOverChange
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function clearEmptySpans(spans) { for (var i = 0; i < spans.length; ++i) { var span = spans[i]; if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) spans.splice(i--, 1); } if (!spans.length) return null; return spans; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
clearEmptySpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function mergeOldSpans(doc, change) { var old = getOldSpans(doc, change); var stretched = stretchSpansOverChange(doc, change); if (!old) return stretched; if (!stretched) return old; for (var i = 0; i < old.length; ++i) { var oldCur = old[i], stretchCur = stretched[i]; if (oldCur && str...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
mergeOldSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function removeReadOnlyRanges(doc, from, to) { var markers = null; doc.iter(from.line, to.line + 1, function(line) { if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { var mark = line.markedSpans[i].marker; if (mark.readOnly && (!markers || indexOf(markers, mark) == ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
removeReadOnlyRanges
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function detachMarkedSpans(line) { var spans = line.markedSpans; if (!spans) return; for (var i = 0; i < spans.length; ++i) spans[i].marker.detachLine(line); line.markedSpans = null; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
detachMarkedSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function attachMarkedSpans(line, spans) { if (!spans) return; for (var i = 0; i < spans.length; ++i) spans[i].marker.attachLine(line); line.markedSpans = spans; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
attachMarkedSpans
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function compareCollapsedMarkers(a, b) { var lenDiff = a.lines.length - b.lines.length; if (lenDiff != 0) return lenDiff; var aPos = a.find(), bPos = b.find(); var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); if (fromCmp) return -fromCmp; var toCmp = cmp(aPos.to, bPos.to) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
compareCollapsedMarkers
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function collapsedSpanAtSide(line, start) { var sps = sawCollapsedSpans && line.markedSpans, found; if (sps) for (var sp, i = 0; i < sps.length; ++i) { sp = sps[i]; if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && (!found || compareCollapsedMarkers(found, sp.marker) < 0)) ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
collapsedSpanAtSide
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function conflictingCollapsedRange(doc, lineNo, from, to, marker) { var line = getLine(doc, lineNo); var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var i = 0; i < sps.length; ++i) { var sp = sps[i]; if (!sp.marker.collapsed) continue; var found = sp.marker.find(0); va...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
conflictingCollapsedRange
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function visualLine(line) { var merged; while (merged = collapsedSpanAtStart(line)) line = merged.find(-1, true).line; return line; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function visualLineContinued(line) { var merged, lines; while (merged = collapsedSpanAtEnd(line)) { line = merged.find(1, true).line; (lines || (lines = [])).push(line); } return lines; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineContinued
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function visualLineNo(doc, lineN) { var line = getLine(doc, lineN), vis = visualLine(line); if (line == vis) return lineN; return lineNo(vis); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineNo
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function visualLineEndNo(doc, lineN) { if (lineN > doc.lastLine()) return lineN; var line = getLine(doc, lineN), merged; if (!lineIsHidden(doc, line)) return lineN; while (merged = collapsedSpanAtEnd(line)) line = merged.find(1, true).line; return lineNo(line) + 1; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
visualLineEndNo
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function lineIsHidden(doc, line) { var sps = sawCollapsedSpans && line.markedSpans; if (sps) for (var sp, i = 0; i < sps.length; ++i) { sp = sps[i]; if (!sp.marker.collapsed) continue; if (sp.from == null) return true; if (sp.marker.widgetNode) continue; if (sp.from == 0 && sp.mark...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineIsHidden
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function lineIsHiddenInner(doc, line, span) { if (span.to == null) { var end = span.marker.find(1, true); return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); } if (span.marker.inclusiveRight && span.to == line.text.length) return true; for (var...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
lineIsHiddenInner
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function adjustScrollWhenAboveVisible(cm, line, diff) { if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) addToScrollPos(cm, null, diff); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
adjustScrollWhenAboveVisible
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function widgetHeight(widget) { if (widget.height != null) return widget.height; var cm = widget.doc.cm; if (!cm) return 0; if (!contains(document.body, widget.node)) { var parentStyle = "position: relative;"; if (widget.coverGutter) parentStyle += "margin-left: -" + cm.display.gutte...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
widgetHeight
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function addLineWidget(doc, handle, node, options) { var widget = new LineWidget(doc, node, options); var cm = doc.cm; if (cm && widget.noHScroll) cm.display.alignWidgets = true; changeLine(doc, handle, "widget", function(line) { var widgets = line.widgets || (line.widgets = []); if (widget....
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
addLineWidget
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function updateLine(line, text, markedSpans, estimateHeight) { line.text = text; if (line.stateAfter) line.stateAfter = null; if (line.styles) line.styles = null; if (line.order != null) line.order = null; detachMarkedSpans(line); attachMarkedSpans(line, markedSpans); var estHeight = estimat...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
updateLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function cleanUpLine(line) { line.parent = null; detachMarkedSpans(line); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
cleanUpLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function extractLineClasses(type, output) { if (type) for (;;) { var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); if (!lineClass) break; type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); var prop = lineClass[1] ? "bgClass" : "textClass...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
extractLineClasses
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function callBlankLine(mode, state) { if (mode.blankLine) return mode.blankLine(state); if (!mode.innerMode) return; var inner = CodeMirror.innerMode(mode, state); if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
callBlankLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function readToken(mode, stream, state, inner) { for (var i = 0; i < 10; i++) { if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; var style = mode.token(stream, state); if (stream.pos > stream.start) return style; } throw new Error("Mode " + mode.name + " failed to advance stre...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
readToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function takeToken(cm, pos, precise, asArray) { function getObj(copy) { return {start: stream.start, end: stream.pos, string: stream.current(), type: style || null, state: copy ? copyState(doc.mode, state) : state}; } var doc = cm.doc, mode = doc.mode, style;...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
takeToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function getObj(copy) { return {start: stream.start, end: stream.pos, string: stream.current(), type: style || null, state: copy ? copyState(doc.mode, state) : state}; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getObj
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { var flattenSpans = mode.flattenSpans; if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; var curStart = 0, curStyle = null; var stream = new StringStream(text, cm.options.tabSize), style; var inner = cm.options.addM...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
runMode
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function highlightLine(cm, line, state, forceToEnd) { // A styles array always starts with a number identifying the // mode/overlays that it is based on (for easy invalidation). var st = [cm.state.modeGen], lineClasses = {}; // Compute the base array of styles runMode(cm, line.text, cm.doc.mode, sta...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
highlightLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function getLineStyles(cm, line, updateFrontier) { if (!line.styles || line.styles[0] != cm.state.modeGen) { var state = getStateBefore(cm, lineNo(line)); var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state); line.stateAfter...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getLineStyles
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function processLine(cm, text, state, startAt) { var mode = cm.doc.mode; var stream = new StringStream(text, cm.options.tabSize); stream.start = stream.pos = startAt || 0; if (text == "") callBlankLine(mode, state); while (!stream.eol()) { readToken(mode, stream, state); stream.start = s...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
processLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function interpretTokenStyle(style, options) { if (!style || /^\s*$/.test(style)) return null; var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; return cache[style] || (cache[style] = style.replace(/\S+/g, "cm-$&")); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
interpretTokenStyle
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function buildLineContent(cm, lineView) { // The padding-right forces the element to have a 'border', which // is needed on Webkit to be able to get line-level bounding // rectangles for it (in measureChar). var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); var builder = ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildLineContent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function defaultSpecialCharPlaceholder(ch) { var token = elt("span", "\u2022", "cm-invalidchar"); token.title = "\\u" + ch.charCodeAt(0).toString(16); token.setAttribute("aria-label", token.title); return token; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
defaultSpecialCharPlaceholder
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function buildToken(builder, text, style, startStyle, endStyle, title, css) { if (!text) return; var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; var special = builder.cm.state.specialChars, mustWrap = false; if (!special.test(text)) { builder.col += text.length;...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildToken
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function splitSpaces(old) { var out = " "; for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; out += " "; return out; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
splitSpaces
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function buildTokenBadBidi(inner, order) { return function(builder, text, style, startStyle, endStyle, title, css) { style = style ? style + " cm-force-border" : "cm-force-border"; var start = builder.pos, end = start + text.length; for (;;) { // Find the part that overlaps with the start ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildTokenBadBidi
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function buildCollapsedSpan(builder, size, marker, ignoreWidget) { var widget = !ignoreWidget && marker.widgetNode; if (widget) builder.map.push(builder.pos, builder.pos + size, widget); if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { if (!widget) widget = builder.conten...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
buildCollapsedSpan
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function insertLineContent(line, builder, styles) { var spans = line.markedSpans, allText = line.text, at = 0; if (!spans) { for (var i = 1; i < styles.length; i+=2) builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); return; ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
insertLineContent
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function isWholeLineUpdate(doc, change) { return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && (!doc.cm || doc.cm.options.wholeLineUpdateBefore); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
isWholeLineUpdate
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function updateDoc(doc, change, markedSpans, estimateHeight) { function spansFor(n) {return markedSpans ? markedSpans[n] : null;} function update(line, text, spans) { updateLine(line, text, spans, estimateHeight); signalLater(line, "change", line, change); } function linesFor(start, end) { ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
updateDoc
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function update(line, text, spans) { updateLine(line, text, spans, estimateHeight); signalLater(line, "change", line, change); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
update
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function linesFor(start, end) { for (var i = start, result = []; i < end; ++i) result.push(new Line(text[i], spansFor(i), estimateHeight)); return result; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
linesFor
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function LeafChunk(lines) { this.lines = lines; this.parent = null; for (var i = 0, height = 0; i < lines.length; ++i) { lines[i].parent = this; height += lines[i].height; } this.height = height; }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
LeafChunk
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function BranchChunk(children) { this.children = children; var size = 0, height = 0; for (var i = 0; i < children.length; ++i) { var ch = children[i]; size += ch.chunkSize(); height += ch.height; ch.parent = this; } this.size = size; this.height = height; this.parent = null...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
BranchChunk
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function linkedDocs(doc, f, sharedHistOnly) { function propagate(doc, skip, sharedHist) { if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { var rel = doc.linked[i]; if (rel.doc == skip) continue; var shared = sharedHist && rel.sharedHist; if (sharedHistOnly && !shar...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
linkedDocs
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function propagate(doc, skip, sharedHist) { if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { var rel = doc.linked[i]; if (rel.doc == skip) continue; var shared = sharedHist && rel.sharedHist; if (sharedHistOnly && !shared) continue; f(rel.doc, shared); ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
propagate
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function attachDoc(cm, doc) { if (doc.cm) throw new Error("This document is already in use."); cm.doc = doc; doc.cm = cm; estimateLineHeights(cm); loadMode(cm); if (!cm.options.lineWrapping) findMaxLine(cm); cm.options.mode = doc.modeOption; regChange(cm); }
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
attachDoc
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function getLine(doc, n) { n -= doc.first; if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); for (var chunk = doc; !chunk.lines;) { for (var i = 0;; ++i) { var child = chunk.children[i], sz = child.chunkSize(); if (n < sz) { chunk...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getLine
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT
function getBetween(doc, start, end) { var out = [], n = start.line; doc.iter(start.line, end.line + 1, function(line) { var text = line.text; if (n == end.line) text = text.slice(0, end.ch); if (n == start.line) text = text.slice(start.ch); out.push(text); ++n; }); return ...
Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
getBetween
javascript
sparksuite/simplemde-markdown-editor
debug/simplemde.debug.js
https://github.com/sparksuite/simplemde-markdown-editor/blob/master/debug/simplemde.debug.js
MIT