CodeMirror 5.27.4
This commit is contained in:
parent
b4f2dffca0
commit
160dd95b4c
30
codemirror/addon/edit/matchbrackets.js
vendored
30
codemirror/addon/edit/matchbrackets.js
vendored
|
@ -16,12 +16,21 @@
|
|||
|
||||
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
||||
|
||||
function findMatchingBracket(cm, where, strict, config) {
|
||||
function findMatchingBracket(cm, where, config) {
|
||||
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
||||
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
||||
var afterCursor = config && config.afterCursor
|
||||
if (afterCursor == null)
|
||||
afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
|
||||
|
||||
// A cursor is defined as between two characters, but in in vim command mode
|
||||
// (i.e. not insert mode), the cursor is visually represented as a
|
||||
// highlighted box on top of the 2nd character. Otherwise, we allow matches
|
||||
// from before or after the cursor.
|
||||
var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
|
||||
matching[line.text.charAt(++pos)];
|
||||
if (!match) return null;
|
||||
var dir = match.charAt(1) == ">" ? 1 : -1;
|
||||
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
||||
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
|
||||
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
||||
|
||||
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
||||
|
@ -69,7 +78,7 @@
|
|||
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
||||
var marks = [], ranges = cm.listSelections();
|
||||
for (var i = 0; i < ranges.length; i++) {
|
||||
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
||||
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
|
||||
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
||||
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
||||
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
||||
|
@ -113,8 +122,17 @@
|
|||
});
|
||||
|
||||
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
||||
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
||||
return findMatchingBracket(this, pos, strict, config);
|
||||
CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
|
||||
// Backwards-compatibility kludge
|
||||
if (oldConfig || typeof config == "boolean") {
|
||||
if (!oldConfig) {
|
||||
config = config ? {strict: true} : null
|
||||
} else {
|
||||
oldConfig.strict = config
|
||||
config = oldConfig
|
||||
}
|
||||
}
|
||||
return findMatchingBracket(this, pos, config)
|
||||
});
|
||||
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
||||
return scanForBracket(this, pos, dir, style, config);
|
||||
|
|
1
codemirror/addon/lint/lint.js
vendored
1
codemirror/addon/lint/lint.js
vendored
|
@ -141,6 +141,7 @@
|
|||
lintAsync(cm, getAnnotations, passOptions)
|
||||
} else {
|
||||
var annotations = getAnnotations(cm.getValue(), passOptions, cm);
|
||||
if (!annotations) return;
|
||||
if (annotations.then) annotations.then(function(issues) {
|
||||
updateLinting(cm, issues);
|
||||
});
|
||||
|
|
10
codemirror/addon/search/search.js
vendored
10
codemirror/addon/search/search.js
vendored
|
@ -54,7 +54,7 @@
|
|||
|
||||
function getSearchCursor(cm, query, pos) {
|
||||
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
||||
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
|
||||
return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});
|
||||
}
|
||||
|
||||
function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
|
||||
|
@ -99,7 +99,7 @@
|
|||
}
|
||||
|
||||
var queryDialog =
|
||||
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
||||
'<span class="CodeMirror-search-label">Search:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
||||
|
||||
function startSearch(cm, state, query) {
|
||||
state.queryText = query;
|
||||
|
@ -188,8 +188,8 @@
|
|||
|
||||
var replaceQueryDialog =
|
||||
' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
||||
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
||||
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";
|
||||
var replacementQueryDialog = '<span class="CodeMirror-search-label">With:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
||||
var doReplaceConfirm = '<span class="CodeMirror-search-label">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>';
|
||||
|
||||
function replaceAll(cm, query, text) {
|
||||
cm.operation(function() {
|
||||
|
@ -205,7 +205,7 @@
|
|||
function replace(cm, all) {
|
||||
if (cm.getOption("readOnly")) return;
|
||||
var query = cm.getSelection() || getSearchState(cm).lastQuery;
|
||||
var dialogText = all ? "Replace all:" : "Replace:"
|
||||
var dialogText = '<span class="CodeMirror-search-label">' + (all ? 'Replace all:' : 'Replace:') + '</span>';
|
||||
dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) {
|
||||
if (!query) return;
|
||||
query = parseQuery(query);
|
||||
|
|
380
codemirror/addon/search/searchcursor.js
vendored
380
codemirror/addon/search/searchcursor.js
vendored
|
@ -3,187 +3,285 @@
|
|||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
mod(require("../../lib/codemirror"))
|
||||
else if (typeof define == "function" && define.amd) // AMD
|
||||
define(["../../lib/codemirror"], mod);
|
||||
define(["../../lib/codemirror"], mod)
|
||||
else // Plain browser env
|
||||
mod(CodeMirror);
|
||||
mod(CodeMirror)
|
||||
})(function(CodeMirror) {
|
||||
"use strict";
|
||||
var Pos = CodeMirror.Pos;
|
||||
"use strict"
|
||||
var Pos = CodeMirror.Pos
|
||||
|
||||
function SearchCursor(doc, query, pos, caseFold) {
|
||||
this.atOccurrence = false; this.doc = doc;
|
||||
if (caseFold == null && typeof query == "string") caseFold = false;
|
||||
function regexpFlags(regexp) {
|
||||
var flags = regexp.flags
|
||||
return flags != null ? flags : (regexp.ignoreCase ? "i" : "")
|
||||
+ (regexp.global ? "g" : "")
|
||||
+ (regexp.multiline ? "m" : "")
|
||||
}
|
||||
|
||||
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
||||
this.pos = {from: pos, to: pos};
|
||||
function ensureGlobal(regexp) {
|
||||
return regexp.global ? regexp : new RegExp(regexp.source, regexpFlags(regexp) + "g")
|
||||
}
|
||||
|
||||
// The matches method is filled in based on the type of query.
|
||||
// It takes a position and a direction, and returns an object
|
||||
// describing the next occurrence of the query, or null if no
|
||||
// more matches were found.
|
||||
if (typeof query != "string") { // Regexp match
|
||||
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
||||
this.matches = function(reverse, pos) {
|
||||
if (reverse) {
|
||||
query.lastIndex = 0;
|
||||
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
||||
function maybeMultiline(regexp) {
|
||||
return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source)
|
||||
}
|
||||
|
||||
function searchRegexpForward(doc, regexp, start) {
|
||||
regexp = ensureGlobal(regexp)
|
||||
for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {
|
||||
regexp.lastIndex = ch
|
||||
var string = doc.getLine(line), match = regexp.exec(string)
|
||||
if (match)
|
||||
return {from: Pos(line, match.index),
|
||||
to: Pos(line, match.index + match[0].length),
|
||||
match: match}
|
||||
}
|
||||
}
|
||||
|
||||
function searchRegexpForwardMultiline(doc, regexp, start) {
|
||||
if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)
|
||||
|
||||
regexp = ensureGlobal(regexp)
|
||||
var string, chunk = 1
|
||||
for (var line = start.line, last = doc.lastLine(); line <= last;) {
|
||||
// This grows the search buffer in exponentially-sized chunks
|
||||
// between matches, so that nearby matches are fast and don't
|
||||
// require concatenating the whole document (in case we're
|
||||
// searching for something that has tons of matches), but at the
|
||||
// same time, the amount of retries is limited.
|
||||
for (var i = 0; i < chunk; i++) {
|
||||
var curLine = doc.getLine(line++)
|
||||
string = string == null ? curLine : string + "\n" + curLine
|
||||
}
|
||||
chunk = chunk * 2
|
||||
regexp.lastIndex = start.ch
|
||||
var match = regexp.exec(string)
|
||||
if (match) {
|
||||
var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n")
|
||||
var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length
|
||||
return {from: Pos(startLine, startCh),
|
||||
to: Pos(startLine + inside.length - 1,
|
||||
inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),
|
||||
match: match}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lastMatchIn(string, regexp) {
|
||||
var cutOff = 0, match
|
||||
for (;;) {
|
||||
query.lastIndex = cutOff;
|
||||
var newMatch = query.exec(line);
|
||||
if (!newMatch) break;
|
||||
match = newMatch;
|
||||
start = match.index;
|
||||
cutOff = match.index + (match[0].length || 1);
|
||||
if (cutOff == line.length) break;
|
||||
}
|
||||
var matchLen = (match && match[0].length) || 0;
|
||||
if (!matchLen) {
|
||||
if (start == 0 && line.length == 0) {match = undefined;}
|
||||
else if (start != doc.getLine(pos.line).length) {
|
||||
matchLen++;
|
||||
regexp.lastIndex = cutOff
|
||||
var newMatch = regexp.exec(string)
|
||||
if (!newMatch) return match
|
||||
match = newMatch
|
||||
cutOff = match.index + (match[0].length || 1)
|
||||
if (cutOff == string.length) return match
|
||||
}
|
||||
}
|
||||
|
||||
function searchRegexpBackward(doc, regexp, start) {
|
||||
regexp = ensureGlobal(regexp)
|
||||
for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {
|
||||
var string = doc.getLine(line)
|
||||
if (ch > -1) string = string.slice(0, ch)
|
||||
var match = lastMatchIn(string, regexp)
|
||||
if (match)
|
||||
return {from: Pos(line, match.index),
|
||||
to: Pos(line, match.index + match[0].length),
|
||||
match: match}
|
||||
}
|
||||
}
|
||||
|
||||
function searchRegexpBackwardMultiline(doc, regexp, start) {
|
||||
regexp = ensureGlobal(regexp)
|
||||
var string, chunk = 1
|
||||
for (var line = start.line, first = doc.firstLine(); line >= first;) {
|
||||
for (var i = 0; i < chunk; i++) {
|
||||
var curLine = doc.getLine(line--)
|
||||
string = string == null ? curLine.slice(0, start.ch) : curLine + "\n" + string
|
||||
}
|
||||
chunk *= 2
|
||||
|
||||
var match = lastMatchIn(string, regexp)
|
||||
if (match) {
|
||||
var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n")
|
||||
var startLine = line + before.length, startCh = before[before.length - 1].length
|
||||
return {from: Pos(startLine, startCh),
|
||||
to: Pos(startLine + inside.length - 1,
|
||||
inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),
|
||||
match: match}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var doFold, noFold
|
||||
if (String.prototype.normalize) {
|
||||
doFold = function(str) { return str.normalize("NFD").toLowerCase() }
|
||||
noFold = function(str) { return str.normalize("NFD") }
|
||||
} else {
|
||||
query.lastIndex = pos.ch;
|
||||
var line = doc.getLine(pos.line), match = query.exec(line);
|
||||
var matchLen = (match && match[0].length) || 0;
|
||||
var start = match && match.index;
|
||||
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
||||
doFold = function(str) { return str.toLowerCase() }
|
||||
noFold = function(str) { return str }
|
||||
}
|
||||
if (match && matchLen)
|
||||
return {from: Pos(pos.line, start),
|
||||
to: Pos(pos.line, start + matchLen),
|
||||
match: match};
|
||||
};
|
||||
} else { // String query
|
||||
var origQuery = query;
|
||||
if (caseFold) query = query.toLowerCase();
|
||||
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
||||
var target = query.split("\n");
|
||||
// Different methods for single-line and multi-line queries
|
||||
if (target.length == 1) {
|
||||
if (!query.length) {
|
||||
// Empty string would match anything and never progress, so
|
||||
// we define it to match nothing instead.
|
||||
this.matches = function() {};
|
||||
|
||||
// Maps a position in a case-folded line back to a position in the original line
|
||||
// (compensating for codepoints increasing in number during folding)
|
||||
function adjustPos(orig, folded, pos, foldFunc) {
|
||||
if (orig.length == folded.length) return pos
|
||||
for (var pos1 = Math.min(pos, orig.length);;) {
|
||||
var len1 = foldFunc(orig.slice(0, pos1)).length
|
||||
if (len1 < pos) ++pos1
|
||||
else if (len1 > pos) --pos1
|
||||
else return pos1
|
||||
}
|
||||
}
|
||||
|
||||
function searchStringForward(doc, query, start, caseFold) {
|
||||
// Empty string would match anything and never progress, so we
|
||||
// define it to match nothing instead.
|
||||
if (!query.length) return null
|
||||
var fold = caseFold ? doFold : noFold
|
||||
var lines = fold(query).split(/\r|\n\r?/)
|
||||
|
||||
search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {
|
||||
var orig = doc.getLine(line).slice(ch), string = fold(orig)
|
||||
if (lines.length == 1) {
|
||||
var found = string.indexOf(lines[0])
|
||||
if (found == -1) continue search
|
||||
var start = adjustPos(orig, string, found, fold) + ch
|
||||
return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),
|
||||
to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}
|
||||
} else {
|
||||
var cutFrom = string.length - lines[0].length
|
||||
if (string.slice(cutFrom) != lines[0]) continue search
|
||||
for (var i = 1; i < lines.length - 1; i++)
|
||||
if (fold(doc.getLine(line + i)) != lines[i]) continue search
|
||||
var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]
|
||||
if (end.slice(0, lastLine.length) != lastLine) continue search
|
||||
return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),
|
||||
to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function searchStringBackward(doc, query, start, caseFold) {
|
||||
if (!query.length) return null
|
||||
var fold = caseFold ? doFold : noFold
|
||||
var lines = fold(query).split(/\r|\n\r?/)
|
||||
|
||||
search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {
|
||||
var orig = doc.getLine(line)
|
||||
if (ch > -1) orig = orig.slice(0, ch)
|
||||
var string = fold(orig)
|
||||
if (lines.length == 1) {
|
||||
var found = string.lastIndexOf(lines[0])
|
||||
if (found == -1) continue search
|
||||
return {from: Pos(line, adjustPos(orig, string, found, fold)),
|
||||
to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}
|
||||
} else {
|
||||
var lastLine = lines[lines.length - 1]
|
||||
if (string.slice(0, lastLine.length) != lastLine) continue search
|
||||
for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)
|
||||
if (fold(doc.getLine(start + i)) != lines[i]) continue search
|
||||
var top = doc.getLine(line + 1 - lines.length), topString = fold(top)
|
||||
if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search
|
||||
return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),
|
||||
to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SearchCursor(doc, query, pos, options) {
|
||||
this.atOccurrence = false
|
||||
this.doc = doc
|
||||
pos = pos ? doc.clipPos(pos) : Pos(0, 0)
|
||||
this.pos = {from: pos, to: pos}
|
||||
|
||||
var caseFold
|
||||
if (typeof options == "object") {
|
||||
caseFold = options.caseFold
|
||||
} else { // Backwards compat for when caseFold was the 4th argument
|
||||
caseFold = options
|
||||
options = null
|
||||
}
|
||||
|
||||
if (typeof query == "string") {
|
||||
if (caseFold == null) caseFold = false
|
||||
this.matches = function(reverse, pos) {
|
||||
if (reverse) {
|
||||
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
|
||||
var match = line.lastIndexOf(query);
|
||||
if (match > -1) {
|
||||
match = adjustPos(orig, line, match);
|
||||
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
||||
return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)
|
||||
}
|
||||
} else {
|
||||
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
|
||||
var match = line.indexOf(query);
|
||||
if (match > -1) {
|
||||
match = adjustPos(orig, line, match) + pos.ch;
|
||||
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
var origTarget = origQuery.split("\n");
|
||||
query = ensureGlobal(query)
|
||||
if (!options || options.multiline !== false)
|
||||
this.matches = function(reverse, pos) {
|
||||
var last = target.length - 1;
|
||||
if (reverse) {
|
||||
if (pos.line - (target.length - 1) < doc.firstLine()) return;
|
||||
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
|
||||
var to = Pos(pos.line, origTarget[last].length);
|
||||
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
|
||||
if (target[i] != fold(doc.getLine(ln))) return;
|
||||
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
|
||||
if (fold(line.slice(cut)) != target[0]) return;
|
||||
return {from: Pos(ln, cut), to: to};
|
||||
} else {
|
||||
if (pos.line + (target.length - 1) > doc.lastLine()) return;
|
||||
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
|
||||
if (fold(line.slice(cut)) != target[0]) return;
|
||||
var from = Pos(pos.line, cut);
|
||||
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
|
||||
if (target[i] != fold(doc.getLine(ln))) return;
|
||||
if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
|
||||
return {from: from, to: Pos(ln, origTarget[last].length)};
|
||||
return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)
|
||||
}
|
||||
};
|
||||
else
|
||||
this.matches = function(reverse, pos) {
|
||||
return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SearchCursor.prototype = {
|
||||
findNext: function() {return this.find(false);},
|
||||
findPrevious: function() {return this.find(true);},
|
||||
findNext: function() {return this.find(false)},
|
||||
findPrevious: function() {return this.find(true)},
|
||||
|
||||
find: function(reverse) {
|
||||
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
||||
function savePosAndFail(line) {
|
||||
var pos = Pos(line, 0);
|
||||
self.pos = {from: pos, to: pos};
|
||||
self.atOccurrence = false;
|
||||
return false;
|
||||
var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to))
|
||||
|
||||
// Implements weird auto-growing behavior on null-matches for
|
||||
// backwards-compatiblity with the vim code (unfortunately)
|
||||
while (result && CodeMirror.cmpPos(result.from, result.to) == 0) {
|
||||
if (reverse) {
|
||||
if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1)
|
||||
else if (result.from.line == this.doc.firstLine()) result = null
|
||||
else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1)))
|
||||
} else {
|
||||
if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1)
|
||||
else if (result.to.line == this.doc.lastLine()) result = null
|
||||
else result = this.matches(reverse, Pos(result.to.line + 1, 0))
|
||||
}
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (this.pos = this.matches(reverse, pos)) {
|
||||
this.atOccurrence = true;
|
||||
return this.pos.match || true;
|
||||
}
|
||||
if (reverse) {
|
||||
if (!pos.line) return savePosAndFail(0);
|
||||
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
||||
}
|
||||
else {
|
||||
var maxLine = this.doc.lineCount();
|
||||
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
||||
pos = Pos(pos.line + 1, 0);
|
||||
}
|
||||
if (result) {
|
||||
this.pos = result
|
||||
this.atOccurrence = true
|
||||
return this.pos.match || true
|
||||
} else {
|
||||
var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)
|
||||
this.pos = {from: end, to: end}
|
||||
return this.atOccurrence = false
|
||||
}
|
||||
},
|
||||
|
||||
from: function() {if (this.atOccurrence) return this.pos.from;},
|
||||
to: function() {if (this.atOccurrence) return this.pos.to;},
|
||||
from: function() {if (this.atOccurrence) return this.pos.from},
|
||||
to: function() {if (this.atOccurrence) return this.pos.to},
|
||||
|
||||
replace: function(newText, origin) {
|
||||
if (!this.atOccurrence) return;
|
||||
var lines = CodeMirror.splitLines(newText);
|
||||
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
|
||||
if (!this.atOccurrence) return
|
||||
var lines = CodeMirror.splitLines(newText)
|
||||
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)
|
||||
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
||||
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
||||
}
|
||||
};
|
||||
|
||||
// Maps a position in a case-folded line back to a position in the original line
|
||||
// (compensating for codepoints increasing in number during folding)
|
||||
function adjustPos(orig, folded, pos) {
|
||||
if (orig.length == folded.length) return pos;
|
||||
for (var pos1 = Math.min(pos, orig.length);;) {
|
||||
var len1 = orig.slice(0, pos1).toLowerCase().length;
|
||||
if (len1 < pos) ++pos1;
|
||||
else if (len1 > pos) --pos1;
|
||||
else return pos1;
|
||||
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))
|
||||
}
|
||||
}
|
||||
|
||||
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||
return new SearchCursor(this.doc, query, pos, caseFold);
|
||||
});
|
||||
return new SearchCursor(this.doc, query, pos, caseFold)
|
||||
})
|
||||
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
||||
return new SearchCursor(this, query, pos, caseFold);
|
||||
});
|
||||
return new SearchCursor(this, query, pos, caseFold)
|
||||
})
|
||||
|
||||
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
|
||||
var ranges = [];
|
||||
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
|
||||
var ranges = []
|
||||
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold)
|
||||
while (cur.findNext()) {
|
||||
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
|
||||
ranges.push({anchor: cur.from(), head: cur.to()});
|
||||
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break
|
||||
ranges.push({anchor: cur.from(), head: cur.to()})
|
||||
}
|
||||
if (ranges.length)
|
||||
this.setSelections(ranges, 0);
|
||||
});
|
||||
this.setSelections(ranges, 0)
|
||||
})
|
||||
});
|
||||
|
|
2
codemirror/keymap/emacs.js
vendored
2
codemirror/keymap/emacs.js
vendored
|
@ -97,7 +97,7 @@
|
|||
|
||||
function byExpr(cm, pos, dir) {
|
||||
var wrap;
|
||||
if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
|
||||
if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, {strict: true}))
|
||||
&& wrap.match && (wrap.forward ? 1 : -1) == dir)
|
||||
return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
|
||||
|
||||
|
|
87
codemirror/keymap/vim.js
vendored
87
codemirror/keymap/vim.js
vendored
|
@ -259,7 +259,7 @@
|
|||
CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
|
||||
|
||||
if (!next || next.attach != attachVimMap)
|
||||
leaveVimMode(cm, false);
|
||||
leaveVimMode(cm);
|
||||
}
|
||||
function attachVimMap(cm, prev) {
|
||||
if (this == CodeMirror.keyMap.vim)
|
||||
|
@ -411,11 +411,11 @@
|
|||
cfg = cfg || {};
|
||||
var scope = cfg.scope;
|
||||
if (!option) {
|
||||
throw Error('Unknown option: ' + name);
|
||||
return new Error('Unknown option: ' + name);
|
||||
}
|
||||
if (option.type == 'boolean') {
|
||||
if (value && value !== true) {
|
||||
throw Error('Invalid argument: ' + name + '=' + value);
|
||||
return new Error('Invalid argument: ' + name + '=' + value);
|
||||
} else if (value !== false) {
|
||||
// Boolean options are set to true if value is not defined.
|
||||
value = true;
|
||||
|
@ -443,7 +443,7 @@
|
|||
cfg = cfg || {};
|
||||
var scope = cfg.scope;
|
||||
if (!option) {
|
||||
throw Error('Unknown option: ' + name);
|
||||
return new Error('Unknown option: ' + name);
|
||||
}
|
||||
if (option.callback) {
|
||||
var local = cm && option.callback(undefined, cm);
|
||||
|
@ -649,9 +649,9 @@
|
|||
lastCharacterSearch: {increment:0, forward:true, selectedCharacter:''},
|
||||
registerController: new RegisterController({}),
|
||||
// search history buffer
|
||||
searchHistoryController: new HistoryController({}),
|
||||
searchHistoryController: new HistoryController(),
|
||||
// ex Command history buffer
|
||||
exCommandHistoryController : new HistoryController({})
|
||||
exCommandHistoryController : new HistoryController()
|
||||
};
|
||||
for (var optionName in options) {
|
||||
var option = options[optionName];
|
||||
|
@ -958,7 +958,7 @@
|
|||
* for a reference implementation.
|
||||
*/
|
||||
function defineRegister(name, register) {
|
||||
var registers = vimGlobalState.registerController.registers[name];
|
||||
var registers = vimGlobalState.registerController.registers;
|
||||
if (!name || name.length != 1) {
|
||||
throw Error('Register name must be 1 character');
|
||||
}
|
||||
|
@ -986,9 +986,6 @@
|
|||
}
|
||||
RegisterController.prototype = {
|
||||
pushText: function(registerName, operator, text, linewise, blockwise) {
|
||||
if (linewise && text.charAt(0) == '\n') {
|
||||
text = text.slice(1) + '\n';
|
||||
}
|
||||
if (linewise && text.charAt(text.length - 1) !== '\n'){
|
||||
text += '\n';
|
||||
}
|
||||
|
@ -1110,7 +1107,9 @@
|
|||
}
|
||||
}
|
||||
if (bestMatch.keys.slice(-11) == '<character>') {
|
||||
inputState.selectedCharacter = lastChar(keys);
|
||||
var character = lastChar(keys);
|
||||
if (!character) return {type: 'none'};
|
||||
inputState.selectedCharacter = character;
|
||||
}
|
||||
return {type: 'full', command: bestMatch};
|
||||
},
|
||||
|
@ -1836,16 +1835,16 @@
|
|||
var ch = cursor.ch;
|
||||
var lineText = cm.getLine(line);
|
||||
var symbol;
|
||||
do {
|
||||
symbol = lineText.charAt(ch++);
|
||||
for (; ch < lineText.length; ch++) {
|
||||
symbol = lineText.charAt(ch);
|
||||
if (symbol && isMatchableSymbol(symbol)) {
|
||||
var style = cm.getTokenTypeAt(Pos(line, ch));
|
||||
var style = cm.getTokenTypeAt(Pos(line, ch + 1));
|
||||
if (style !== "string" && style !== "comment") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (symbol);
|
||||
if (symbol) {
|
||||
}
|
||||
if (ch < lineText.length) {
|
||||
var matched = cm.findMatchingBracket(Pos(line, ch));
|
||||
return matched.to;
|
||||
} else {
|
||||
|
@ -2186,7 +2185,9 @@
|
|||
enterMacroRecordMode: function(cm, actionArgs) {
|
||||
var macroModeState = vimGlobalState.macroModeState;
|
||||
var registerName = actionArgs.selectedCharacter;
|
||||
if (vimGlobalState.registerController.isValidRegister(registerName)) {
|
||||
macroModeState.enterMacroRecordMode(cm, registerName);
|
||||
}
|
||||
},
|
||||
toggleOverwrite: function(cm) {
|
||||
if (!cm.state.overwrite) {
|
||||
|
@ -2704,7 +2705,7 @@
|
|||
}
|
||||
}
|
||||
function lastChar(keys) {
|
||||
var match = /^.*(<[\w\-]+>)$/.exec(keys);
|
||||
var match = /^.*(<[^>]+>)$/.exec(keys);
|
||||
var selectedCharacter = match ? match[1] : keys.slice(-1);
|
||||
if (selectedCharacter.length > 1){
|
||||
switch(selectedCharacter){
|
||||
|
@ -2715,6 +2716,7 @@
|
|||
selectedCharacter=' ';
|
||||
break;
|
||||
default:
|
||||
selectedCharacter='';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2815,7 +2817,6 @@
|
|||
var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)};
|
||||
selections.push(range);
|
||||
}
|
||||
primIndex = head.line == lastLine ? selections.length - 1 : 0;
|
||||
cm.setSelections(selections);
|
||||
selectionEnd.ch = headCh;
|
||||
base.ch = baseCh;
|
||||
|
@ -4083,23 +4084,42 @@
|
|||
parseLineSpec_: function(cm, inputStream) {
|
||||
var numberMatch = inputStream.match(/^(\d+)/);
|
||||
if (numberMatch) {
|
||||
// Absolute line number plus offset (N+M or N-M) is probably a typo,
|
||||
// not something the user actually wanted. (NB: vim does allow this.)
|
||||
return parseInt(numberMatch[1], 10) - 1;
|
||||
}
|
||||
switch (inputStream.next()) {
|
||||
case '.':
|
||||
return cm.getCursor().line;
|
||||
return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
|
||||
case '$':
|
||||
return cm.lastLine();
|
||||
return this.parseLineSpecOffset_(inputStream, cm.lastLine());
|
||||
case '\'':
|
||||
var markName = inputStream.next();
|
||||
var markPos = getMarkPos(cm, cm.state.vim, markName);
|
||||
if (!markPos) throw new Error('Mark not set');
|
||||
return markPos.line;
|
||||
return this.parseLineSpecOffset_(inputStream, markPos.line);
|
||||
case '-':
|
||||
case '+':
|
||||
inputStream.backUp(1);
|
||||
// Offset is relative to current line if not otherwise specified.
|
||||
return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
|
||||
default:
|
||||
inputStream.backUp(1);
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
parseLineSpecOffset_: function(inputStream, line) {
|
||||
var offsetMatch = inputStream.match(/^([+-])?(\d+)/);
|
||||
if (offsetMatch) {
|
||||
var offset = parseInt(offsetMatch[2], 10);
|
||||
if (offsetMatch[1] == "-") {
|
||||
line -= offset;
|
||||
} else {
|
||||
line += offset;
|
||||
}
|
||||
}
|
||||
return line;
|
||||
},
|
||||
parseCommandArgs_: function(inputStream, params, command) {
|
||||
if (inputStream.eol()) {
|
||||
return;
|
||||
|
@ -4279,13 +4299,18 @@
|
|||
// If no value is provided, then we assume this is a get.
|
||||
if (!optionIsBoolean && value === undefined || forceGet) {
|
||||
var oldValue = getOption(optionName, cm, setCfg);
|
||||
if (oldValue === true || oldValue === false) {
|
||||
if (oldValue instanceof Error) {
|
||||
showConfirm(cm, oldValue.message);
|
||||
} else if (oldValue === true || oldValue === false) {
|
||||
showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
|
||||
} else {
|
||||
showConfirm(cm, ' ' + optionName + '=' + oldValue);
|
||||
}
|
||||
} else {
|
||||
setOption(optionName, value, cm, setCfg);
|
||||
var setOptionReturn = setOption(optionName, value, cm, setCfg);
|
||||
if (setOptionReturn instanceof Error) {
|
||||
showConfirm(cm, setOptionReturn.message);
|
||||
}
|
||||
}
|
||||
},
|
||||
setlocal: function (cm, params) {
|
||||
|
@ -4484,6 +4509,10 @@
|
|||
if (tokens.length) {
|
||||
regexPart = tokens[0];
|
||||
replacePart = tokens[1];
|
||||
if (regexPart && regexPart[regexPart.length - 1] === '$') {
|
||||
regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
|
||||
replacePart = replacePart ? replacePart + '\n' : '\n';
|
||||
}
|
||||
if (replacePart !== undefined) {
|
||||
if (getOption('pcre')) {
|
||||
replacePart = unescapeRegexReplace(replacePart);
|
||||
|
@ -4903,7 +4932,7 @@
|
|||
* Listens for changes made in insert mode.
|
||||
* Should only be active in insert mode.
|
||||
*/
|
||||
function onChange(_cm, changeObj) {
|
||||
function onChange(cm, changeObj) {
|
||||
var macroModeState = vimGlobalState.macroModeState;
|
||||
var lastChange = macroModeState.lastInsertModeChanges;
|
||||
if (!macroModeState.isPlaying) {
|
||||
|
@ -4916,8 +4945,12 @@
|
|||
lastChange.changes = [];
|
||||
lastChange.maybeReset = false;
|
||||
}
|
||||
if (cm.state.overwrite && !/\n/.test(text)) {
|
||||
lastChange.changes.push([text]);
|
||||
} else {
|
||||
lastChange.changes.push(text);
|
||||
}
|
||||
}
|
||||
// Change objects may be chained with next.
|
||||
changeObj = changeObj.next;
|
||||
}
|
||||
|
@ -5098,9 +5131,13 @@
|
|||
var change = changes[j];
|
||||
if (change instanceof InsertModeKey) {
|
||||
CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
|
||||
} else {
|
||||
} else if (typeof change == "string") {
|
||||
var cur = cm.getCursor();
|
||||
cm.replaceRange(change, cur, cur);
|
||||
} else {
|
||||
var start = cm.getCursor();
|
||||
var end = offsetCursor(start, 0, change[0].length);
|
||||
cm.replaceRange(change[0], start, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
codemirror/lib/codemirror.css
vendored
2
codemirror/lib/codemirror.css
vendored
|
@ -119,7 +119,7 @@
|
|||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3 {color: #085;}
|
||||
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
|
|
15
codemirror/mode/css/css.js
vendored
15
codemirror/mode/css/css.js
vendored
|
@ -401,7 +401,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
|
||||
// Dedent relative to current context.
|
||||
indent = Math.max(0, cx.indent - indentUnit);
|
||||
cx = cx.prev;
|
||||
}
|
||||
}
|
||||
return indent;
|
||||
|
@ -472,7 +471,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
||||
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
||||
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
||||
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
||||
"caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
|
||||
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
||||
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
||||
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
||||
|
@ -493,7 +492,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
"grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
|
||||
"grid-template-rows", "hanging-punctuation", "height", "hyphens",
|
||||
"icon", "image-orientation", "image-rendering", "image-resolution",
|
||||
"inline-box-align", "justify-content", "left", "letter-spacing",
|
||||
"inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
|
||||
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
||||
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
||||
"list-style-image", "list-style-position", "list-style-type", "margin",
|
||||
|
@ -508,7 +507,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
||||
"page", "page-break-after", "page-break-before", "page-break-inside",
|
||||
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
||||
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
||||
"perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
|
||||
"presentation-level", "punctuation-trim", "quotes", "region-break-after",
|
||||
"region-break-before", "region-break-inside", "region-fragment",
|
||||
"rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
|
||||
|
@ -659,13 +658,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
"s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
|
||||
"scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
|
||||
"searchfield-cancel-button", "searchfield-decoration",
|
||||
"searchfield-results-button", "searchfield-results-decoration",
|
||||
"searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
|
||||
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
||||
"simp-chinese-formal", "simp-chinese-informal", "single",
|
||||
"skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
|
||||
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
||||
"small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
|
||||
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
|
||||
"source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
|
||||
"square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
|
||||
"subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
|
||||
"table-caption", "table-cell", "table-column", "table-column-group",
|
||||
|
@ -748,8 +747,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
|
|||
}
|
||||
},
|
||||
":": function(stream) {
|
||||
if (stream.match(/\s*\{/))
|
||||
return [null, "{"];
|
||||
if (stream.match(/\s*\{/, false))
|
||||
return [null, null]
|
||||
return false;
|
||||
},
|
||||
"$": function(stream) {
|
||||
|
|
2
codemirror/theme/abcdef.css
vendored
2
codemirror/theme/abcdef.css
vendored
|
@ -14,7 +14,7 @@
|
|||
.cm-s-abcdef span.cm-def { color: #fffabc; }
|
||||
.cm-s-abcdef span.cm-variable { color: #abcdef; }
|
||||
.cm-s-abcdef span.cm-variable-2 { color: #cacbcc; }
|
||||
.cm-s-abcdef span.cm-variable-3 { color: #def; }
|
||||
.cm-s-abcdef span.cm-variable-3, .cm-s-abcdef span.cm-type { color: #def; }
|
||||
.cm-s-abcdef span.cm-property { color: #fedcba; }
|
||||
.cm-s-abcdef span.cm-operator { color: #ff0; }
|
||||
.cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;}
|
||||
|
|
2
codemirror/theme/ambiance.css
vendored
2
codemirror/theme/ambiance.css
vendored
|
@ -11,7 +11,7 @@
|
|||
.cm-s-ambiance .cm-def { color: #aac6e3; }
|
||||
.cm-s-ambiance .cm-variable { color: #ffb795; }
|
||||
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
|
||||
.cm-s-ambiance .cm-variable-3 { color: #faded3; }
|
||||
.cm-s-ambiance .cm-variable-3, .cm-s-ambiance .cm-type { color: #faded3; }
|
||||
.cm-s-ambiance .cm-property { color: #eed1b3; }
|
||||
.cm-s-ambiance .cm-operator { color: #fa8d6a; }
|
||||
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
|
||||
|
|
2
codemirror/theme/cobalt.css
vendored
2
codemirror/theme/cobalt.css
vendored
|
@ -15,7 +15,7 @@
|
|||
.cm-s-cobalt span.cm-string { color: #3ad900; }
|
||||
.cm-s-cobalt span.cm-meta { color: #ff9d00; }
|
||||
.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
|
||||
.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
|
||||
.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def, .cm-s-cobalt .cm-type { color: white; }
|
||||
.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
|
||||
.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
|
||||
.cm-s-cobalt span.cm-link { color: #845dc4; }
|
||||
|
|
2
codemirror/theme/colorforth.css
vendored
2
codemirror/theme/colorforth.css
vendored
|
@ -15,7 +15,7 @@
|
|||
.cm-s-colorforth span.cm-atom { color: #606060; }
|
||||
|
||||
.cm-s-colorforth span.cm-variable-2 { color: #EEE; }
|
||||
.cm-s-colorforth span.cm-variable-3 { color: #DDD; }
|
||||
.cm-s-colorforth span.cm-variable-3, .cm-s-colorforth span.cm-type { color: #DDD; }
|
||||
.cm-s-colorforth span.cm-property {}
|
||||
.cm-s-colorforth span.cm-operator {}
|
||||
|
||||
|
|
2
codemirror/theme/dracula.css
vendored
2
codemirror/theme/dracula.css
vendored
|
@ -34,7 +34,7 @@
|
|||
.cm-s-dracula span.cm-qualifier { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-property { color: #66d9ef; }
|
||||
.cm-s-dracula span.cm-builtin { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-variable-3 { color: #ffb86c; }
|
||||
.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }
|
||||
|
||||
.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }
|
||||
.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
|
||||
|
|
2
codemirror/theme/duotone-dark.css
vendored
2
codemirror/theme/duotone-dark.css
vendored
|
@ -24,7 +24,7 @@ CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bra
|
|||
.cm-s-duotone-dark span.cm-operator { color: #ffad5c; }
|
||||
.cm-s-duotone-dark span.cm-positive { color: #6a51e6; }
|
||||
|
||||
.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; }
|
||||
.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-type, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; }
|
||||
.cm-s-duotone-dark span.cm-def, .cm-s-duotone-dark span.cm-tag, .cm-s-duotone-dark span.cm-builtin, .cm-s-duotone-dark span.cm-qualifier, .cm-s-duotone-dark span.cm-header, .cm-s-duotone-dark span.cm-em { color: #eeebff; }
|
||||
.cm-s-duotone-dark span.cm-bracket, .cm-s-duotone-dark span.cm-comment { color: #6c6783; }
|
||||
|
||||
|
|
2
codemirror/theme/duotone-light.css
vendored
2
codemirror/theme/duotone-light.css
vendored
|
@ -23,7 +23,7 @@ CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bra
|
|||
.cm-s-duotone-light span.cm-string, .cm-s-duotone-light span.cm-operator { color: #1659df; }
|
||||
.cm-s-duotone-light span.cm-positive { color: #896724; }
|
||||
|
||||
.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
|
||||
.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-type, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
|
||||
.cm-s-duotone-light span.cm-def, .cm-s-duotone-light span.cm-tag, .cm-s-duotone-light span.cm-builtin, .cm-s-duotone-light span.cm-qualifier, .cm-s-duotone-light span.cm-header, .cm-s-duotone-light span.cm-em { color: #2d2006; }
|
||||
.cm-s-duotone-light span.cm-bracket, .cm-s-duotone-light span.cm-comment { color: #b6ad9a; }
|
||||
|
||||
|
|
2
codemirror/theme/eclipse.css
vendored
2
codemirror/theme/eclipse.css
vendored
|
@ -5,7 +5,7 @@
|
|||
.cm-s-eclipse span.cm-def { color: #00f; }
|
||||
.cm-s-eclipse span.cm-variable { color: black; }
|
||||
.cm-s-eclipse span.cm-variable-2 { color: #0000C0; }
|
||||
.cm-s-eclipse span.cm-variable-3 { color: #0000C0; }
|
||||
.cm-s-eclipse span.cm-variable-3, .cm-s-eclipse span.cm-type { color: #0000C0; }
|
||||
.cm-s-eclipse span.cm-property { color: black; }
|
||||
.cm-s-eclipse span.cm-operator { color: black; }
|
||||
.cm-s-eclipse span.cm-comment { color: #3F7F5F; }
|
||||
|
|
2
codemirror/theme/erlang-dark.css
vendored
2
codemirror/theme/erlang-dark.css
vendored
|
@ -27,7 +27,7 @@
|
|||
.cm-s-erlang-dark span.cm-tag { color: #9effff; }
|
||||
.cm-s-erlang-dark span.cm-variable { color: #50fe50; }
|
||||
.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }
|
||||
.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; }
|
||||
.cm-s-erlang-dark span.cm-variable-3, .cm-s-erlang-dark span.cm-type { color: #ccc; }
|
||||
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
||||
|
||||
.cm-s-erlang-dark .CodeMirror-activeline-background { background: #013461; }
|
||||
|
|
2
codemirror/theme/icecoder.css
vendored
2
codemirror/theme/icecoder.css
vendored
|
@ -11,7 +11,7 @@ ICEcoder default theme by Matt Pass, used in code editor available at https://ic
|
|||
|
||||
.cm-s-icecoder span.cm-variable { color: #6cb5d9; } /* blue */
|
||||
.cm-s-icecoder span.cm-variable-2 { color: #cc1e5c; } /* pink */
|
||||
.cm-s-icecoder span.cm-variable-3 { color: #f9602c; } /* orange */
|
||||
.cm-s-icecoder span.cm-variable-3, .cm-s-icecoder span.cm-type { color: #f9602c; } /* orange */
|
||||
|
||||
.cm-s-icecoder span.cm-property { color: #eee; } /* off-white 1 */
|
||||
.cm-s-icecoder span.cm-operator { color: #9179bb; } /* purple */
|
||||
|
|
2
codemirror/theme/lesser-dark.css
vendored
2
codemirror/theme/lesser-dark.css
vendored
|
@ -27,7 +27,7 @@ Ported to CodeMirror by Peter Kroon
|
|||
.cm-s-lesser-dark span.cm-def { color: white; }
|
||||
.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }
|
||||
.cm-s-lesser-dark span.cm-variable-2 { color: #669199; }
|
||||
.cm-s-lesser-dark span.cm-variable-3 { color: white; }
|
||||
.cm-s-lesser-dark span.cm-variable-3, .cm-s-lesser-dark span.cm-type { color: white; }
|
||||
.cm-s-lesser-dark span.cm-property { color: #92A75C; }
|
||||
.cm-s-lesser-dark span.cm-operator { color: #92A75C; }
|
||||
.cm-s-lesser-dark span.cm-comment { color: #666; }
|
||||
|
|
6
codemirror/theme/liquibyte.css
vendored
6
codemirror/theme/liquibyte.css
vendored
|
@ -36,7 +36,7 @@
|
|||
.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; }
|
||||
|
||||
.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; }
|
||||
.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; }
|
||||
.cm-s-liquibyte span.cm-variable-3, .cm-s-liquibyte span.cm-type { color: #c080ff; font-weight: bold; }
|
||||
.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; }
|
||||
.cm-s-liquibyte span.cm-operator { color: #fff; }
|
||||
|
||||
|
@ -59,10 +59,10 @@
|
|||
.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); }
|
||||
/* Scrollbars */
|
||||
/* Simple */
|
||||
.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover {
|
||||
.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, .cm-s-liquibyte div.CodeMirror-simplescroll-vertical div:hover {
|
||||
background-color: rgba(80, 80, 80, .7);
|
||||
}
|
||||
.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div {
|
||||
.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, .cm-s-liquibyte div.CodeMirror-simplescroll-vertical div {
|
||||
background-color: rgba(80, 80, 80, .3);
|
||||
border: 1px solid #404040;
|
||||
border-radius: 5px;
|
||||
|
|
4
codemirror/theme/material.css
vendored
4
codemirror/theme/material.css
vendored
|
@ -27,7 +27,7 @@
|
|||
.cm-s-material .cm-keyword { color: rgba(199, 146, 234, 1); }
|
||||
.cm-s-material .cm-operator { color: rgba(233, 237, 237, 1); }
|
||||
.cm-s-material .cm-variable-2 { color: #80CBC4; }
|
||||
.cm-s-material .cm-variable-3 { color: #82B1FF; }
|
||||
.cm-s-material .cm-variable-3, .cm-s-material .cm-type { color: #82B1FF; }
|
||||
.cm-s-material .cm-builtin { color: #DECB6B; }
|
||||
.cm-s-material .cm-atom { color: #F77669; }
|
||||
.cm-s-material .cm-number { color: #F77669; }
|
||||
|
@ -41,7 +41,7 @@
|
|||
.cm-s-material .cm-attribute { color: #FFCB6B; }
|
||||
.cm-s-material .cm-property { color: #80CBAE; }
|
||||
.cm-s-material .cm-qualifier { color: #DECB6B; }
|
||||
.cm-s-material .cm-variable-3 { color: #DECB6B; }
|
||||
.cm-s-material .cm-variable-3, .cm-s-material .cm-type { color: #DECB6B; }
|
||||
.cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); }
|
||||
.cm-s-material .cm-error {
|
||||
color: rgba(255, 255, 255, 1.0);
|
||||
|
|
2
codemirror/theme/mdn-like.css
vendored
2
codemirror/theme/mdn-like.css
vendored
|
@ -21,7 +21,7 @@
|
|||
.cm-s-mdn-like .cm-number { color: #ca7841; }
|
||||
.cm-s-mdn-like .cm-def { color: #8DA6CE; }
|
||||
.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; }
|
||||
.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; }
|
||||
.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def, .cm-s-mdn-like span.cm-type { color: #07a; }
|
||||
|
||||
.cm-s-mdn-like .cm-variable { color: #07a; }
|
||||
.cm-s-mdn-like .cm-property { color: #905; }
|
||||
|
|
2
codemirror/theme/monokai.css
vendored
2
codemirror/theme/monokai.css
vendored
|
@ -21,7 +21,7 @@
|
|||
|
||||
.cm-s-monokai span.cm-variable { color: #f8f8f2; }
|
||||
.cm-s-monokai span.cm-variable-2 { color: #9effff; }
|
||||
.cm-s-monokai span.cm-variable-3 { color: #66d9ef; }
|
||||
.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #66d9ef; }
|
||||
.cm-s-monokai span.cm-def { color: #fd971f; }
|
||||
.cm-s-monokai span.cm-bracket { color: #f8f8f2; }
|
||||
.cm-s-monokai span.cm-tag { color: #f92672; }
|
||||
|
|
2
codemirror/theme/night.css
vendored
2
codemirror/theme/night.css
vendored
|
@ -17,7 +17,7 @@
|
|||
.cm-s-night span.cm-string { color: #37f14a; }
|
||||
.cm-s-night span.cm-meta { color: #7678e2; }
|
||||
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def, .cm-s-night span.cm-type { color: white; }
|
||||
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
||||
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
||||
.cm-s-night span.cm-link { color: #845dc4; }
|
||||
|
|
2
codemirror/theme/panda-syntax.css
vendored
2
codemirror/theme/panda-syntax.css
vendored
|
@ -52,7 +52,7 @@
|
|||
.cm-s-panda-syntax .cm-variable-2 {
|
||||
color: #ff9ac1;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-variable-3 {
|
||||
.cm-s-panda-syntax .cm-variable-3, .cm-s-panda-syntax .cm-type {
|
||||
color: #ff9ac1;
|
||||
}
|
||||
|
||||
|
|
2
codemirror/theme/pastel-on-dark.css
vendored
2
codemirror/theme/pastel-on-dark.css
vendored
|
@ -34,7 +34,7 @@
|
|||
.cm-s-pastel-on-dark span.cm-string { color: #66A968; }
|
||||
.cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; }
|
||||
.cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; }
|
||||
.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; }
|
||||
.cm-s-pastel-on-dark span.cm-variable-3, .cm-s-pastel-on-dark span.cm-type { color: #DE8E30; }
|
||||
.cm-s-pastel-on-dark span.cm-def { color: #757aD8; }
|
||||
.cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; }
|
||||
.cm-s-pastel-on-dark span.cm-tag { color: #C1C144; }
|
||||
|
|
2
codemirror/theme/rubyblue.css
vendored
2
codemirror/theme/rubyblue.css
vendored
|
@ -15,7 +15,7 @@
|
|||
.cm-s-rubyblue span.cm-string { color: #F08047; }
|
||||
.cm-s-rubyblue span.cm-meta { color: #F0F; }
|
||||
.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
|
||||
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
|
||||
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def, .cm-s-rubyblue span.cm-type { color: white; }
|
||||
.cm-s-rubyblue span.cm-bracket { color: #F0F; }
|
||||
.cm-s-rubyblue span.cm-link { color: #F4C20B; }
|
||||
.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
|
||||
|
|
2
codemirror/theme/seti.css
vendored
2
codemirror/theme/seti.css
vendored
|
@ -38,7 +38,7 @@
|
|||
.cm-s-seti span.cm-attribute { color: #9fca56; }
|
||||
.cm-s-seti span.cm-qualifier { color: #9fca56; }
|
||||
.cm-s-seti span.cm-property { color: #a074c4; }
|
||||
.cm-s-seti span.cm-variable-3 { color: #9fca56; }
|
||||
.cm-s-seti span.cm-variable-3, .cm-s-seti span.cm-type { color: #9fca56; }
|
||||
.cm-s-seti span.cm-builtin { color: #9fca56; }
|
||||
.cm-s-seti .CodeMirror-activeline-background { background: #101213; }
|
||||
.cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
|
||||
|
|
2
codemirror/theme/solarized.css
vendored
2
codemirror/theme/solarized.css
vendored
|
@ -57,7 +57,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
|||
|
||||
.cm-s-solarized .cm-variable { color: #839496; }
|
||||
.cm-s-solarized .cm-variable-2 { color: #b58900; }
|
||||
.cm-s-solarized .cm-variable-3 { color: #6c71c4; }
|
||||
.cm-s-solarized .cm-variable-3, .cm-s-solarized .cm-type { color: #6c71c4; }
|
||||
|
||||
.cm-s-solarized .cm-property { color: #2aa198; }
|
||||
.cm-s-solarized .cm-operator { color: #6c71c4; }
|
||||
|
|
2
codemirror/theme/the-matrix.css
vendored
2
codemirror/theme/the-matrix.css
vendored
|
@ -14,7 +14,7 @@
|
|||
.cm-s-the-matrix span.cm-def { color: #99C; }
|
||||
.cm-s-the-matrix span.cm-variable { color: #F6C; }
|
||||
.cm-s-the-matrix span.cm-variable-2 { color: #C6F; }
|
||||
.cm-s-the-matrix span.cm-variable-3 { color: #96F; }
|
||||
.cm-s-the-matrix span.cm-variable-3, .cm-s-the-matrix span.cm-type { color: #96F; }
|
||||
.cm-s-the-matrix span.cm-property { color: #62FFA0; }
|
||||
.cm-s-the-matrix span.cm-operator { color: #999; }
|
||||
.cm-s-the-matrix span.cm-comment { color: #CCCCCC; }
|
||||
|
|
2
codemirror/theme/ttcn.css
vendored
2
codemirror/theme/ttcn.css
vendored
|
@ -29,7 +29,7 @@
|
|||
.cm-s-ttcn .cm-tag { color: #170; }
|
||||
.cm-s-ttcn .cm-variable { color: #8B2252; }
|
||||
.cm-s-ttcn .cm-variable-2 { color: #05a; }
|
||||
.cm-s-ttcn .cm-variable-3 { color: #085; }
|
||||
.cm-s-ttcn .cm-variable-3, .cm-s-ttcn .cm-type { color: #085; }
|
||||
|
||||
.cm-s-ttcn .cm-invalidchar { color: #f00; }
|
||||
|
||||
|
|
2
codemirror/theme/twilight.css
vendored
2
codemirror/theme/twilight.css
vendored
|
@ -14,7 +14,7 @@
|
|||
.cm-s-twilight .cm-number { color: #ca7841; } /**/
|
||||
.cm-s-twilight .cm-def { color: #8DA6CE; }
|
||||
.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
|
||||
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
|
||||
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def, .cm-s-twilight span.cm-type { color: #607392; } /**/
|
||||
.cm-s-twilight .cm-operator { color: #cda869; } /**/
|
||||
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
|
||||
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
|
||||
|
|
2
codemirror/theme/vibrant-ink.css
vendored
2
codemirror/theme/vibrant-ink.css
vendored
|
@ -16,7 +16,7 @@
|
|||
.cm-s-vibrant-ink .cm-number { color: #FFEE98; }
|
||||
.cm-s-vibrant-ink .cm-def { color: #8DA6CE; }
|
||||
.cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D; }
|
||||
.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D; }
|
||||
.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def, .cm-s-vibrant span.cm-type { color: #FFC66D; }
|
||||
.cm-s-vibrant-ink .cm-operator { color: #888; }
|
||||
.cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }
|
||||
.cm-s-vibrant-ink .cm-string { color: #A5C25C; }
|
||||
|
|
2
codemirror/theme/xq-dark.css
vendored
2
codemirror/theme/xq-dark.css
vendored
|
@ -36,7 +36,7 @@ THE SOFTWARE.
|
|||
.cm-s-xq-dark span.cm-def { color: #FFF; text-decoration:underline; }
|
||||
.cm-s-xq-dark span.cm-variable { color: #FFF; }
|
||||
.cm-s-xq-dark span.cm-variable-2 { color: #EEE; }
|
||||
.cm-s-xq-dark span.cm-variable-3 { color: #DDD; }
|
||||
.cm-s-xq-dark span.cm-variable-3, .cm-s-xq-dark span.cm-type { color: #DDD; }
|
||||
.cm-s-xq-dark span.cm-property {}
|
||||
.cm-s-xq-dark span.cm-operator {}
|
||||
.cm-s-xq-dark span.cm-comment { color: gray; }
|
||||
|
|
2
codemirror/theme/xq-light.css
vendored
2
codemirror/theme/xq-light.css
vendored
|
@ -26,7 +26,7 @@ THE SOFTWARE.
|
|||
.cm-s-xq-light span.cm-def { text-decoration:underline; }
|
||||
.cm-s-xq-light span.cm-variable { color: black; }
|
||||
.cm-s-xq-light span.cm-variable-2 { color:black; }
|
||||
.cm-s-xq-light span.cm-variable-3 { color: black; }
|
||||
.cm-s-xq-light span.cm-variable-3, .cm-s-xq-light span.cm-type { color: black; }
|
||||
.cm-s-xq-light span.cm-property {}
|
||||
.cm-s-xq-light span.cm-operator {}
|
||||
.cm-s-xq-light span.cm-comment { color: #0080FF; font-style: italic; }
|
||||
|
|
2
codemirror/theme/yeti.css
vendored
2
codemirror/theme/yeti.css
vendored
|
@ -39,6 +39,6 @@
|
|||
.cm-s-yeti span.cm-qualifier { color: #96c0d8; }
|
||||
.cm-s-yeti span.cm-property { color: #a074c4; }
|
||||
.cm-s-yeti span.cm-builtin { color: #a074c4; }
|
||||
.cm-s-yeti span.cm-variable-3 { color: #96c0d8; }
|
||||
.cm-s-yeti span.cm-variable-3, .cm-s-yeti span.cm-type { color: #96c0d8; }
|
||||
.cm-s-yeti .CodeMirror-activeline-background { background: #E7E4E0; }
|
||||
.cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline; }
|
||||
|
|
Loading…
Reference in New Issue
Block a user