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 updateMark(cm, vim, markName, pos) { if (!inArray(markName, validMarks)) { return; } if (vim.marks[markName]) { vim.marks[markName].clear(); } vim.marks[markName] = cm.setBookmark(pos); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
updateMark
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function charIdxInLine(start, line, character, forward, includeChar) { // Search for char in line. // motion_options: {forward, includeChar} // If includeChar = true, include it too. // If forward = true, search forward, else search backwards. // If char is not found on this line, do nothi...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
charIdxInLine
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findParagraph(cm, head, repeat, dir, inclusive) { var line = head.line; var min = cm.firstLine(); var max = cm.lastLine(); var start, end, i = line; function isEmpty(i) { return !cm.getLine(i); } function isBoundary(i, dir, any) { if (an...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
findParagraph
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function isEmpty(i) { return !cm.getLine(i); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
isEmpty
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function isBoundary(i, dir, any) { if (any) { return isEmpty(i) != isEmpty(i + dir); } return !isEmpty(i) && isEmpty(i + dir); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
isBoundary
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findSentence(cm, cur, repeat, dir) { /* Takes an index object { line: the line string, ln: line number, pos: index in line, dir: direction of traversal (-1 or 1) } and modifies the line, ln, and pos members to represent the n...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
findSentence
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function nextChar(cm, idx) { if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) { idx.ln += idx.dir; if (!isLine(cm, idx.ln)) { idx.line = null; idx.ln = null; idx.pos = null; return; } idx.line = cm.getLine(...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
nextChar
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function forward(cm, ln, pos, dir) { var line = cm.getLine(ln); var stop = line === ''; var curr = { line: line, ln: ln, pos: pos, dir: dir, }; var last_valid = { ln: curr.ln, pos: curr.pos, }; var ski...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
forward
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function reverse(cm, ln, pos, dir) { var line = cm.getLine(ln); var curr = { line: line, ln: ln, pos: pos, dir: dir, }; var last_valid = { ln: curr.ln, pos: null, }; var skip_empty_lines = curr.line === ''; ...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
reverse
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function selectCompanionObject(cm, head, symb, inclusive) { var cur = head, start, end; var bracketRegexp = { '(': /[()]/, ')': /[()]/, '[': /[[\]]/, ']': /[[\]]/, '{': /[{}]/, '}': /[{}]/, '<': /[<>]/, '>': /[<>]/, }[sym...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
selectCompanionObject
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findBeginningAndEnd(cm, head, symb, inclusive) { var cur = copyCursor(head); var line = cm.getLine(cur.line); var chars = line.split(''); var start, end, i, len; var firstIndex = chars.indexOf(symb); // the decision tree is to always look backwards for the beginning first, ...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
findBeginningAndEnd
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function getSearchState(cm) { var vim = cm.state.vim; return vim.searchState_ || (vim.searchState_ = new SearchState()); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
getSearchState
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function splitBySlash(argString) { return splitBySeparator(argString, '/'); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
splitBySlash
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findUnescapedSlashes(argString) { return findUnescapedSeparators(argString, '/'); }
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
findUnescapedSlashes
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function splitBySeparator(argString, separator) { var slashes = findUnescapedSeparators(argString, separator) || []; if (!slashes.length) return []; var tokens = []; // in case of strings like foo/bar if (slashes[0] !== 0) return; for (var i = 0; i < slashes.length; i++) { if...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
splitBySeparator
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findUnescapedSeparators(str, separator) { if (!separator) separator = '/'; var escapeNextChar = false; var slashes = []; for (var i = 0; i < str.length; i++) { var c = str.charAt(i); if (!escapeNextChar && c == separator) { slashes.push(i); } e...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
findUnescapedSeparators
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function translateRegex(str) { // When these match, add a '\' if unescaped or remove one if escaped. var specials = '|(){'; // Remove, but never add, a '\' for these. var unescape = '}'; var escapeNextChar = false; var out = []; for (var i = -1; i < str.length; i++) { v...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
translateRegex
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function translateRegexReplace(str) { var escapeNextChar = false; var out = []; for (var i = -1; i < str.length; i++) { var c = str.charAt(i) || ''; var n = str.charAt(i + 1) || ''; if (charUnescapes[c + n]) { out.push(charUnescapes[c + n]); i++; } e...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
translateRegexReplace
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function unescapeRegexReplace(str) { var stream = new CodeMirror.StringStream(str); var output = []; while (!stream.eol()) { // Search for \. while (stream.peek() && stream.peek() != '\\') { output.push(stream.next()); } var matched = false; for (var m...
@param {CodeMirror} cm CodeMirror object. @param {Pos} cur The position to start from. @param {int} repeat Number of words to move past. @param {boolean} forward True to search forward. False to search backward. @param {boolean} wordEnd True to move to end of word. False to move to beginning of word. @param {bo...
unescapeRegexReplace
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function parseQuery(query, ignoreCase, smartCase) { // First update the last search register var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); lastSearchRegister.setText(query); // Check if the query is already a regex. if (query instanceof RegExp) { retu...
Extract the regular expression from the query and return a Regexp object. Returns null if the query is blank. If ignoreCase is passed in, the Regexp object will have the 'i' flag set. If smartCase is passed in, and the query contains upper case letters, then ignoreCase is overridden, and the 'i' flag will not be set....
parseQuery
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function dom(n) { if (typeof n === 'string') n = document.createElement(n); for (var a, i = 1; i < arguments.length; i++) { if (!(a = arguments[i])) continue; if (typeof a !== 'object') a = document.createTextNode(a); if (a.nodeType) n.appendChild(a); else for (var ...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
dom
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function showConfirm(cm, template) { var pre = dom('pre', { $color: 'red' }, template); if (cm.openNotification) { cm.openNotification(pre, { bottom: true, duration: 5000 }); } else { alert(pre.innerText); } }
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
showConfirm
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function makePrompt(prefix, desc) { return dom( document.createDocumentFragment(), dom( 'span', { $fontFamily: 'monospace', $whiteSpace: 'pre' }, prefix, dom('input', { type: 'text', autocorrect: 'off', autocapitalize: 'off', spellcheck: 'false' }) )...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
makePrompt
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function showPrompt(cm, options) { var shortText = (options.prefix || '') + ' ' + (options.desc || ''); var template = makePrompt(options.prefix, options.desc); if (cm.openDialog) { cm.openDialog(template, options.onClose, { onKeyDown: options.onKeyDown, onKeyUp: options.on...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
showPrompt
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function regexEqual(r1, r2) { if (r1 instanceof RegExp && r2 instanceof RegExp) { var props = ['global', 'multiline', 'ignoreCase', 'source']; for (var i = 0; i < props.length; i++) { var prop = props[i]; if (r1[prop] !== r2[prop]) { return false; } ...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
regexEqual
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { if (!rawQuery) { return; } var state = getSearchState(cm); var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); if (!query) { return; } highlightSearchMatches(cm, query); if (regexEq...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
updateSearchQuery
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function searchOverlay(query) { if (query.source.charAt(0) == '^') { var matchSol = true; } return { token: function (stream) { if (matchSol && !stream.sol()) { stream.skipToEnd(); return; } var match = stream.match(query, false); ...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
searchOverlay
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function highlightSearchMatches(cm, query) { clearTimeout(highlightTimeout); highlightTimeout = setTimeout(function () { var searchState = getSearchState(cm); var overlay = searchState.getOverlay(); if (!overlay || query != overlay.query) { if (overlay) { cm.rem...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
highlightSearchMatches
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findNext(cm, prev, query, repeat) { if (repeat === undefined) { repeat = 1; } return cm.operation(function () { var pos = cm.getCursor(); var cursor = cm.getSearchCursor(query, pos); for (var i = 0; i < repeat; i++) { var found = cursor.find(prev); ...
dom - Document Object Manipulator Usage: dom('<tag>'|<node>[, ...{<attributes>|<$styles>}|<child-node>|'<text>']) Examples: dom('div', {id:'xyz'}, dom('p', 'CM rocks!', {$color:'red'})) dom(document.head, dom('script', 'alert("hello!")')) Not supported: dom('p', ['arrays are objects'], Error('objects specify at...
findNext
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function findNextFromAndToInclusive(cm, prev, query, repeat, vim) { if (repeat === undefined) { repeat = 1; } return cm.operation(function () { var pos = cm.getCursor(); var cursor = cm.getSearchCursor(query, pos); // Go back one result to ensure that if the cursor is ...
Pretty much the same as `findNext`, except for the following differences: 1. Before starting the search, move to the previous search. This way if our cursor is already inside a match, we should return the current match. 2. Rather than only returning the cursor's from, we return the cursor's from and to as a tuple.
findNextFromAndToInclusive
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function clearSearchHighlight(cm) { var state = getSearchState(cm); cm.removeOverlay(getSearchState(cm).getOverlay()); state.setOverlay(null); if (state.getScrollbarAnnotate()) { state.getScrollbarAnnotate().clear(); state.setScrollbarAnnotate(null); } }
Pretty much the same as `findNext`, except for the following differences: 1. Before starting the search, move to the previous search. This way if our cursor is already inside a match, we should return the current match. 2. Rather than only returning the cursor's from, we return the cursor's from and to as a tuple.
clearSearchHighlight
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function isInRange(pos, start, end) { if (typeof pos != 'number') { // Assume it is a cursor position. Get the line number. pos = pos.line; } if (start instanceof Array) { return inArray(pos, start); } else { if (typeof end == 'number') { return pos >= s...
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
isInRange
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function getUserVisibleLines(cm) { var scrollInfo = cm.getScrollInfo(); var occludeToleranceTop = 6; var occludeToleranceBottom = 10; var from = cm.coordsChar({ left: 0, top: occludeToleranceTop + scrollInfo.top }, 'local'); var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + ...
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
getUserVisibleLines
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function getMarkPos(cm, vim, markName) { if (markName == "'" || markName == '`') { return vimGlobalState.jumpList.find(cm, -1) || Pos(0, 0); } else if (markName == '.') { return getLastEditPos(cm); } var mark = vim.marks[markName]; return mark && mark.find(); }
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
getMarkPos
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function getLastEditPos(cm) { var done = cm.doc.history.done; for (var i = done.length; i--; ) { if (done[i].changes) { return copyCursor(done[i].changes[0].to); } } }
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
getLastEditPos
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function parseArgs() { if (params.argString) { var args = new CodeMirror.StringStream(params.argString); if (args.eat('!')) { reverse = true; } if (args.eol()) { return; } if (!args.eatSpace()) { ...
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
parseArgs
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function compareFn(a, b) { if (reverse) { var tmp; tmp = a; a = b; b = tmp; } if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } var anum = number && numberRegex.exec(a); var bn...
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
compareFn
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function comparePatternFn(a, b) { if (reverse) { var tmp; tmp = a; a = b; b = tmp; } if (ignoreCase) { a[0] = a[0].toLowerCase(); b[0] = b[0].toLowerCase(); } return a[0] < b[0] ? -1 : 1; }
Check if pos is in the specified range, INCLUSIVE. Range can be specified with 1 or 2 arguments. If the first range argument is an array, treat it as an array of line numbers. Match pos against any of the lines. If the first range argument is a number, if there is only 1 range argument, check if pos has the same line...
comparePatternFn
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, replaceWith, callback) { // Set up all the functions. cm.state.vim.exMode = true; var done = false; var lastPos, modifiedLineNumber, joined; function replaceAll() { cm.operation(function () { ...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
doReplace
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function replaceAll() { cm.operation(function () { while (!done) { replace(); next(); } stop(); }); }
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
replaceAll
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function replace() { var text = cm.getRange(searchCursor.from(), searchCursor.to()); var newText = text.replace(query, replaceWith); var unmodifiedLineNumber = searchCursor.to().line; searchCursor.replace(newText); modifiedLineNumber = searchCursor.to().line; lineEnd += m...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
replace
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function next() { // The below only loops to skip over multiple occurrences on the same // line when 'global' is not true. while (searchCursor.findNext() && isInRange(searchCursor.from(), lineStart, lineEnd)) { if (!global && searchCursor.from().line == modifiedLineNumber && !joined) {...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
next
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function stop(close) { if (close) { close(); } cm.focus(); if (lastPos) { cm.setCursor(lastPos); var vim = cm.state.vim; vim.exMode = false; vim.lastHPos = vim.lastHSPos = lastPos.ch; } if (callback) { callback()...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
stop
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function onPromptKeyDown(e, _value, close) { // Swallow all keys. CodeMirror.e_stop(e); var keyName = CodeMirror.keyName(e); switch (keyName) { case 'Y': replace(); next(); break; case 'N': next(); break; ...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
onPromptKeyDown
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function exitInsertMode(cm) { var vim = cm.state.vim; var macroModeState = vimGlobalState.macroModeState; var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); var isPlaying = macroModeState.isPlaying; var lastChange = macroModeState.lastInsertModeChanges; ...
@param {CodeMirror} cm CodeMirror instance we are in. @param {boolean} confirm Whether to confirm each replace. @param {Cursor} lineStart Line to start replacing from. @param {Cursor} lineEnd Line to stop replacing at. @param {RegExp} query Query for performing matches with. @param {string} replaceWith Text to replace ...
exitInsertMode
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function onChange(cm, changeObj) { var macroModeState = vimGlobalState.macroModeState; var lastChange = macroModeState.lastInsertModeChanges; if (!macroModeState.isPlaying) { while (changeObj) { lastChange.expectCursorActivityForChange = true; if (lastChange.ignoreCount > 1...
Listens for changes made in insert mode. Should only be active in insert mode.
onChange
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function onCursorActivity(cm) { var vim = cm.state.vim; if (vim.insertMode) { // Tracking cursor activity in insert mode (for macro support). var macroModeState = vimGlobalState.macroModeState; if (macroModeState.isPlaying) { return; } var lastChange = macro...
Listens for any kind of cursor activity on CodeMirror.
onCursorActivity
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function updateFakeCursor(cm) { var className = 'cm-animate-fat-cursor'; var vim = cm.state.vim; var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); var to = offsetCursor(from, 0, 1); clearFakeCursor(vim); // In visual mode, the cursor may be positioned over EOL. if (...
Keeps track of a fake cursor to support visual mode cursor behavior.
updateFakeCursor
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function clearFakeCursor(vim) { if (vim.fakeCursor) { vim.fakeCursor.clear(); vim.fakeCursor = null; } if (vim.fakeCursorBookmark) { vim.fakeCursorBookmark.clear(); vim.fakeCursorBookmark = null; } }
Keeps track of a fake cursor to support visual mode cursor behavior.
clearFakeCursor
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function handleExternalSelection(cm, vim) { var anchor = cm.getCursor('anchor'); var head = cm.getCursor('head'); // Enter or exit visual mode to match mouse selection. if (vim.visualMode && !cm.somethingSelected()) { exitVisualMode(cm, false); } else if (!vim.visualMode && !vim.in...
Keeps track of a fake cursor to support visual mode cursor behavior.
handleExternalSelection
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function InsertModeKey(keyName) { this.keyName = keyName; }
Wrapper for special keys pressed in insert mode
InsertModeKey
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function onKeyEventTargetKeyDown(e) { var macroModeState = vimGlobalState.macroModeState; var lastChange = macroModeState.lastInsertModeChanges; var keyName = CodeMirror.keyName(e); if (!keyName) { return; } function onKeyFound() { if (lastChange.maybeReset) { ...
Handles raw key down events from the text area. - Should only be active in insert mode. - For recording deletes in insert mode.
onKeyEventTargetKeyDown
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function onKeyFound() { if (lastChange.maybeReset) { lastChange.changes = []; lastChange.maybeReset = false; } lastChange.changes.push(new InsertModeKey(keyName)); return true; }
Handles raw key down events from the text area. - Should only be active in insert mode. - For recording deletes in insert mode.
onKeyFound
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function repeatLastEdit(cm, vim, repeat, repeatForInsert) { var macroModeState = vimGlobalState.macroModeState; macroModeState.isPlaying = true; var isAction = !!vim.lastEditActionCommand; var cachedInputState = vim.inputState; function repeatCommand() { if (isAction) { c...
Repeats the last edit, which includes exactly 1 command and at most 1 insert. Operator and motion commands are read from lastEditInputState, while action commands are read from lastEditActionCommand. If repeatForInsert is true, then the function was called by exitInsertMode to repeat the insert mode changes the user j...
repeatLastEdit
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function repeatCommand() { if (isAction) { commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); } else { commandDispatcher.evalInput(cm, vim); } }
Repeats the last edit, which includes exactly 1 command and at most 1 insert. Operator and motion commands are read from lastEditInputState, while action commands are read from lastEditActionCommand. If repeatForInsert is true, then the function was called by exitInsertMode to repeat the insert mode changes the user j...
repeatCommand
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function repeatInsert(repeat) { if (macroModeState.lastInsertModeChanges.changes.length > 0) { // For some reason, repeat cw in desktop VIM does not repeat // insert mode changes. Will conform to that behavior. repeat = !vim.lastEditActionCommand ? 1 : repeat; var changeO...
Repeats the last edit, which includes exactly 1 command and at most 1 insert. Operator and motion commands are read from lastEditInputState, while action commands are read from lastEditActionCommand. If repeatForInsert is true, then the function was called by exitInsertMode to repeat the insert mode changes the user j...
repeatInsert
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function repeatInsertModeChanges(cm, changes, repeat) { function keyHandler(binding) { if (typeof binding == 'string') { CodeMirror.commands[binding](cm); } else { binding(cm); } return true; } var head = cm.getCursor('head'); var visualBlock =...
Repeats the last edit, which includes exactly 1 command and at most 1 insert. Operator and motion commands are read from lastEditInputState, while action commands are read from lastEditActionCommand. If repeatForInsert is true, then the function was called by exitInsertMode to repeat the insert mode changes the user j...
repeatInsertModeChanges
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function keyHandler(binding) { if (typeof binding == 'string') { CodeMirror.commands[binding](cm); } else { binding(cm); } return true; }
Repeats the last edit, which includes exactly 1 command and at most 1 insert. Operator and motion commands are read from lastEditInputState, while action commands are read from lastEditActionCommand. If repeatForInsert is true, then the function was called by exitInsertMode to repeat the insert mode changes the user j...
keyHandler
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/keymap/vim.js
MIT
function makeKeywords(str) { var obj = {}, words = str.split(' '); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; }
Author: Gautam Mehta Branched from CodeMirror's Scheme mode
makeKeywords
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/cobol/cobol.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/cobol/cobol.js
MIT
function isNumber(ch, stream) { // hex if (ch === '0' && stream.eat(/x/i)) { stream.eatWhile(tests.hex); return true; } // leading sign if ((ch == '+' || ch == '-') && tests.digit.test(stream.peek())) { stream.eat(tests.sign); ch = stream.next(); } ...
Author: Gautam Mehta Branched from CodeMirror's Scheme mode
isNumber
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/cobol/cobol.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/cobol/cobol.js
MIT
function wordRegexp(words) { return new RegExp('^((' + words.join(')|(') + '))\\b'); }
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
wordRegexp
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function tokenBase(stream, state) { // Handle scope changes if (stream.sol()) { if (state.scope.align === null) state.scope.align = false; var scopeOffset = state.scope.offset; if (stream.eatSpace()) { var lineOffset = stream.indentation(); if (lineOffset > scopeO...
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
tokenBase
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function tokenFactory(delimiter, singleline, outclass) { return function (stream, state) { while (!stream.eol()) { stream.eatWhile(/[^'"\/\\]/); if (stream.eat('\\')) { stream.next(); if (singleline && stream.eol()) { return outclass; }...
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
tokenFactory
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function longComment(stream, state) { while (!stream.eol()) { stream.eatWhile(/[^#]/); if (stream.match('###')) { state.tokenize = tokenBase; break; } stream.eatWhile('#'); } return 'comment'; }
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
longComment
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function indent(stream, state, type) { type = type || 'coffee'; var offset = 0, align = false, alignOffset = null; for (var scope = state.scope; scope; scope = scope.prev) { if (scope.type === 'coffee' || scope.type == '}') { offset = scope.offset + conf.indentUnit; ...
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
indent
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function dedent(stream, state) { if (!state.scope.prev) return; if (state.scope.type === 'coffee') { var _indent = stream.indentation(); var matched = false; for (var scope = state.scope; scope; scope = scope.prev) { if (_indent === scope.offset) { matched = tru...
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
dedent
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
function tokenLexer(stream, state) { var style = state.tokenize(stream, state); var current = stream.current(); // Handle scope changes. if (current === 'return') { state.dedent = true; } if (((current === '->' || current === '=>') && stream.eol()) || style === 'indent') { ...
Link to the project's GitHub page: https://github.com/pickhardt/coffeescript-codemirror-mode
tokenLexer
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/coffeescript/coffeescript.js
MIT
tokenBase = function (stream, state) { var next_rule = state.next || 'start'; if (next_rule) { state.next = state.next; var nr = Rules[next_rule]; if (nr.splice) { for (var i$ = 0; i$ < nr.length; ++i$) { var r = nr[i$]; if (r.regex && stream.match(r...
Link to the project's GitHub page: https://github.com/duralog/CodeMirror
tokenBase
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/livescript/livescript.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/livescript/livescript.js
MIT
function tokenCComment(stream, state) { var maybeEnd = false, ch; while ((ch = stream.next()) != null) { if (maybeEnd && ch == '/') { state.tokenize = tokenBase; break; } maybeEnd = ch == '*'; } return ret('comment', 'comment'); }
/ var ch = stream.next(); if (ch == '@') { stream.eatWhile(/[\w\\\-]/); return ret('meta', stream.current()); } else if (ch == '/' && stream.eat('*')) { state.tokenize = tokenCComment; return tokenCComment(stream, state); } else if (ch == '<' && stream.eat('!')) ...
tokenCComment
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
MIT
function tokenSGMLComment(stream, state) { var dashes = 0, ch; while ((ch = stream.next()) != null) { if (dashes >= 2 && ch == '>') { state.tokenize = tokenBase; break; } dashes = ch == '-' ? dashes + 1 : 0; } return ret('comment', 'comment'); ...
/ var ch = stream.next(); if (ch == '@') { stream.eatWhile(/[\w\\\-]/); return ret('meta', stream.current()); } else if (ch == '/' && stream.eat('*')) { state.tokenize = tokenCComment; return tokenCComment(stream, state); } else if (ch == '<' && stream.eat('!')) ...
tokenSGMLComment
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
MIT
function tokenString(quote) { return function (stream, state) { var escaped = false, ch; while ((ch = stream.next()) != null) { if (ch == quote && !escaped) break; escaped = !escaped && ch == '\\'; } if (!escaped) state.tokenize = tokenBase; re...
/ var ch = stream.next(); if (ch == '@') { stream.eatWhile(/[\w\\\-]/); return ret('meta', stream.current()); } else if (ch == '/' && stream.eat('*')) { state.tokenize = tokenCComment; return tokenCComment(stream, state); } else if (ch == '<' && stream.eat('!')) ...
tokenString
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/nginx/nginx.js
MIT
function transitState(currState, c) { var currLocation = currState.location; var ret; // Opening. if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; else if (currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; else i...
******************************************************* This script provides syntax highlighting support for the N-Triples format. N-Triples format specification: https://www.w3.org/TR/n-triples/ *********************************************************
transitState
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/ntriples/ntriples.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/ntriples/ntriples.js
MIT
function nextToken(stream, state) { var tok = innerMode(stream, state) || restOfLine(stream, state) || interpolationContinued(stream, state) || includeFilteredContinued(stream, state) || eachContinued(stream, state) || attrsContinued(stream, state) || ...
Get the next token in the stream @param {Stream} stream @param {State} state
nextToken
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/pug/pug.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/pug/pug.js
MIT
function makeKeywords(str) { var obj = {}, words = str.split(' '); for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
makeKeywords
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function stateStack(indent, type, prev) { // represents a state stack object this.indent = indent; this.type = type; this.prev = prev; }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
stateStack
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function pushStack(state, indent, type) { state.indentStack = new stateStack(indent, type, state.indentStack); }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
pushStack
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function popStack(state) { state.indentStack = state.indentStack.prev; }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
popStack
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function isBinaryNumber(stream) { return stream.match(binaryMatcher); }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
isBinaryNumber
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function isOctalNumber(stream) { return stream.match(octalMatcher); }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
isOctalNumber
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function isDecimalNumber(stream, backup) { if (backup === true) { stream.backUp(1); } return stream.match(decimalMatcher); }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
isDecimalNumber
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function isHexNumber(stream) { return stream.match(hexMatcher); }
Author: Koh Zi Han, based on implementation by Koh Zi Chun
isHexNumber
javascript
cabloy/cabloy
src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-codemirror/dist/staticBackend/lib/codemirror/mode/scheme/scheme.js
MIT
function slideToLoop(index, speed, runCallbacks, internal) { if (index === void 0) { index = 0; } if (speed === void 0) { speed = this.params.speed; } if (runCallbacks === void 0) { runCallbacks = true; } if (typeof index === 'string') { /** * The `index` argument converted from `s...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slideToLoop
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function slideNext(speed, runCallbacks, internal) { if (speed === void 0) { speed = this.params.speed; } if (runCallbacks === void 0) { runCallbacks = true; } const swiper = this; const { animating, enabled, params } = swiper; if (!enabled) return swiper; let perGroup = params.sl...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slideNext
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function slidePrev(speed, runCallbacks, internal) { if (speed === void 0) { speed = this.params.speed; } if (runCallbacks === void 0) { runCallbacks = true; } const swiper = this; const { params, animating, snapGrid, slidesGrid, rtlTranslate, enabled } = swiper; if (!en...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slidePrev
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function normalize(val) { if (val < 0) return -Math.floor(Math.abs(val)); return Math.floor(val); }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
normalize
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function slideReset(speed, runCallbacks, internal) { if (speed === void 0) { speed = this.params.speed; } if (runCallbacks === void 0) { runCallbacks = true; } const swiper = this; return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slideReset
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function slideToClosest(speed, runCallbacks, internal, threshold) { if (speed === void 0) { speed = this.params.speed; } if (runCallbacks === void 0) { runCallbacks = true; } if (threshold === void 0) { threshold = 0.5; } const swiper = this; let index = swiper.activeIndex; const skip =...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slideToClosest
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function slideToClickedSlide() { const swiper = this; const { params, $wrapperEl } = swiper; const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; let slideToIndex = swiper.clickedIndex; let realIndex; if (params.loop) { if (swiper.anima...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
slideToClickedSlide
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function loopCreate() { const swiper = this; const document = getDocument(); const { params, $wrapperEl } = swiper; // Remove duplicated slides const $selector = $wrapperEl.children().length > 0 ? $($wrapperEl.children()[0].parentNode) : $wrapperEl; $selector.children(`.${params.slideClass}.${param...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
loopCreate
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function loopFix() { const swiper = this; swiper.emit('beforeLoopFix'); const { activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext, snapGrid, rtlTranslate: rtl } = swiper; let newIndex; swiper.allowSlidePrev = true; swiper.allowSlideNext = true; const snapTrans...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
loopFix
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function loopDestroy() { const swiper = this; const { $wrapperEl, params, slides } = swiper; $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove(); slides.removeAttr('data-swiper-slide-index'); }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
loopDestroy
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function setGrabCursor(moving) { const swiper = this; if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; el.style.cursor = 'move'; ...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
setGrabCursor
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function unsetGrabCursor() { const swiper = this; if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { return; } swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
unsetGrabCursor
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function closestElement(selector, base) { if (base === void 0) { base = this; } function __closestFrom(el) { if (!el || el === getDocument() || el === getWindow()) return null; if (el.assignedSlot) el = el.assignedSlot; const found = el.closest(selector); if (!found && !el.getRootNode) { ...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
closestElement
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function __closestFrom(el) { if (!el || el === getDocument() || el === getWindow()) return null; if (el.assignedSlot) el = el.assignedSlot; const found = el.closest(selector); if (!found && !el.getRootNode) { return null; } return found || __closestFrom(el.getRootNode().host); }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
__closestFrom
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function onTouchStart(event) { const swiper = this; const document = getDocument(); const window = getWindow(); const data = swiper.touchEventsData; const { params, touches, enabled } = swiper; if (!enabled) return; if (swiper.animating && params.preventInteractionOnTransition) { return...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
onTouchStart
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function onTouchMove(event) { const document = getDocument(); const swiper = this; const data = swiper.touchEventsData; const { params, touches, rtlTranslate: rtl, enabled } = swiper; if (!enabled) return; let e = event; if (e.originalEvent) e = e.originalEvent; if (!data.isTouched) {...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
onTouchMove
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function onTouchEnd(event) { const swiper = this; const data = swiper.touchEventsData; const { params, touches, rtlTranslate: rtl, slidesGrid, enabled } = swiper; if (!enabled) return; let e = event; if (e.originalEvent) e = e.originalEvent; if (data.allowTouchCallbacks) { swipe...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
onTouchEnd
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function onResize() { const swiper = this; const { params, el } = swiper; if (el && el.offsetWidth === 0) return; // Breakpoints if (params.breakpoints) { swiper.setBreakpoint(); } // Save locks const { allowSlideNext, allowSlidePrev, snapGrid } = swiper; // Disable locks on r...
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
onResize
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT
function onClick(e) { const swiper = this; if (!swiper.enabled) return; if (!swiper.allowClick) { if (swiper.params.preventClicks) e.preventDefault(); if (swiper.params.preventClicksPropagation && swiper.animating) { e.stopPropagation(); e.stopImmediatePropagation(); } } }
Determines whether the `index` argument is a valid `number` after being converted from the `string` type. @type {boolean}
onClick
javascript
cabloy/cabloy
src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
https://github.com/cabloy/cabloy/blob/master/src/module-system/a-swiper/backend/static/vendor/swiper/8.4.5/swiper-bundle.esm.browser.js
MIT