update codemirror plugin files
This commit is contained in:
19
plugins/codemirror/addon/display/placeholder.js
vendored
19
plugins/codemirror/addon/display/placeholder.js
vendored
@@ -15,7 +15,7 @@
|
||||
cm.on("blur", onBlur);
|
||||
cm.on("change", onChange);
|
||||
cm.on("swapDoc", onChange);
|
||||
CodeMirror.on(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose = () => onComposition(cm))
|
||||
CodeMirror.on(cm.getInputField(), "compositionupdate", cm.state.placeholderCompose = function() { onComposition(cm) })
|
||||
onChange(cm);
|
||||
} else if (!val && prev) {
|
||||
cm.off("blur", onBlur);
|
||||
@@ -49,13 +49,16 @@
|
||||
}
|
||||
|
||||
function onComposition(cm) {
|
||||
var empty = true, input = cm.getInputField()
|
||||
if (input.nodeName == "TEXTAREA")
|
||||
empty = !input.value
|
||||
else if (cm.lineCount() == 1)
|
||||
empty = !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
|
||||
if (empty) clearPlaceholder(cm)
|
||||
else setPlaceholder(cm)
|
||||
setTimeout(function() {
|
||||
var empty = false
|
||||
if (cm.lineCount() == 1) {
|
||||
var input = cm.getInputField()
|
||||
empty = input.nodeName == "TEXTAREA" ? !cm.getLine(0).length
|
||||
: !/[^\u200b]/.test(input.querySelector(".CodeMirror-line").textContent)
|
||||
}
|
||||
if (empty) setPlaceholder(cm)
|
||||
else clearPlaceholder(cm)
|
||||
}, 20)
|
||||
}
|
||||
|
||||
function onBlur(cm) {
|
||||
|
||||
5
plugins/codemirror/addon/edit/closetag.js
vendored
5
plugins/codemirror/addon/edit/closetag.js
vendored
@@ -128,9 +128,10 @@
|
||||
replacement = head + "style";
|
||||
} else {
|
||||
var context = inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state)
|
||||
if (!context || (context.length && closingTagExists(cm, context, context[context.length - 1], pos)))
|
||||
var top = context.length ? context[context.length - 1] : ""
|
||||
if (!context || (context.length && closingTagExists(cm, context, top, pos)))
|
||||
return CodeMirror.Pass;
|
||||
replacement = head + context[context.length - 1]
|
||||
replacement = head + top
|
||||
}
|
||||
if (cm.getLine(pos.line).charAt(tok.end) != ">") replacement += ">";
|
||||
replacements[i] = replacement;
|
||||
|
||||
1
plugins/codemirror/addon/hint/html-hint.js
vendored
1
plugins/codemirror/addon/hint/html-hint.js
vendored
@@ -98,6 +98,7 @@
|
||||
dfn: s,
|
||||
dir: s,
|
||||
div: s,
|
||||
dialog: { attrs: { open: null } },
|
||||
dl: s,
|
||||
dt: s,
|
||||
em: s,
|
||||
|
||||
2
plugins/codemirror/addon/hint/sql-hint.js
vendored
2
plugins/codemirror/addon/hint/sql-hint.js
vendored
@@ -187,7 +187,7 @@
|
||||
function eachWord(lineText, f) {
|
||||
var words = lineText.split(/\s+/)
|
||||
for (var i = 0; i < words.length; i++)
|
||||
if (words[i]) f(words[i].replace(/[,;]/g, ''))
|
||||
if (words[i]) f(words[i].replace(/[`,;]/g, ''))
|
||||
}
|
||||
|
||||
function findTableByAlias(alias, editor) {
|
||||
|
||||
4
plugins/codemirror/addon/hint/xml-hint.js
vendored
4
plugins/codemirror/addon/hint/xml-hint.js
vendored
@@ -101,12 +101,12 @@
|
||||
}
|
||||
replaceToken = true;
|
||||
}
|
||||
function returnHintsFromAtValues(atValues) {
|
||||
var returnHintsFromAtValues = function(atValues) {
|
||||
if (atValues)
|
||||
for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))
|
||||
result.push(quote + atValues[i] + quote);
|
||||
return returnHints();
|
||||
}
|
||||
};
|
||||
if (atValues && atValues.then) return atValues.then(returnHintsFromAtValues);
|
||||
return returnHintsFromAtValues(atValues);
|
||||
} else { // An attribute name
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
||||
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
||||
|
||||
// Depends on jshint.js from https://github.com/jshint/jshint
|
||||
|
||||
(function(mod) {
|
||||
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
||||
mod(require("../../lib/codemirror"));
|
||||
|
||||
Reference in New Issue
Block a user