mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
ckeditor 5.60.0
This commit is contained in:
16
libraries/codemirror/mode/shell/shell.js
vendored
16
libraries/codemirror/mode/shell/shell.js
vendored
@@ -70,6 +70,14 @@ CodeMirror.defineMode('shell', function() {
|
||||
stream.eatWhile(/\w/);
|
||||
return 'attribute';
|
||||
}
|
||||
if (ch == "<") {
|
||||
if (stream.match("<<")) return "operator"
|
||||
var heredoc = stream.match(/^<-?\s*['"]?([^'"]*)['"]?/)
|
||||
if (heredoc) {
|
||||
state.tokens.unshift(tokenHeredoc(heredoc[1]))
|
||||
return 'string-2'
|
||||
}
|
||||
}
|
||||
if (/\d/.test(ch)) {
|
||||
stream.eatWhile(/\d/);
|
||||
if(stream.eol() || !/\w/.test(stream.peek())) {
|
||||
@@ -129,6 +137,14 @@ CodeMirror.defineMode('shell', function() {
|
||||
return 'def';
|
||||
};
|
||||
|
||||
function tokenHeredoc(delim) {
|
||||
return function(stream, state) {
|
||||
if (stream.sol() && stream.string == delim) state.tokens.shift()
|
||||
stream.skipToEnd()
|
||||
return "string-2"
|
||||
}
|
||||
}
|
||||
|
||||
function tokenize(stream, state) {
|
||||
return (state.tokens[0] || tokenBase) (stream, state);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user