summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode/django/django.js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-01-17 14:28:04 -0600
committerWu Cheng-Han2016-01-17 14:28:04 -0600
commiteaa8ccaccb1091820d0a8d1223996a6dd057347d (patch)
tree6b4aaa3b3d1a2fed68147510142663222533775a /public/vendor/codemirror/mode/django/django.js
parentce65e58096d57ace02723d11a125673f9d48c293 (diff)
Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
Diffstat (limited to 'public/vendor/codemirror/mode/django/django.js')
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/django/django.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js
index 2f08b063..eb8d6591 100755..100644
--- a/public/vendor/codemirror/mode/django/django.js
+++ b/public/vendor/codemirror/mode/django/django.js
@@ -14,14 +14,14 @@
"use strict";
CodeMirror.defineMode("django:inner", function() {
- var keywords = ["block", "endblock", "for", "endfor", "true", "false",
- "loop", "none", "self", "super", "if", "endif", "as",
- "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
- "ifnotequal", "endifnotequal", "extends", "include", "load", "comment",
- "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup",
- "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token",
- "autoescape", "endautoescape", "spaceless", "ssi", "templatetag",
- "verbatim", "endverbatim", "widthratio"],
+ var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
+ "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
+ "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
+ "endifnotequal", "extends", "include", "load", "comment", "endcomment",
+ "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
+ "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
+ "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
+ "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
"default", "default_if_none", "dictsort",
"dictsortreversed", "divisibleby", "escape", "escapejs",
@@ -35,11 +35,13 @@
"truncatechars_html", "truncatewords", "truncatewords_html",
"unordered_list", "upper", "urlencode", "urlize",
"urlizetrunc", "wordcount", "wordwrap", "yesno"],
- operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"];
+ operators = ["==", "!=", "<", ">", "<=", ">="],
+ wordOperators = ["in", "not", "or", "and"];
keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b");
filters = new RegExp("^\\b(" + filters.join("|") + ")\\b");
operators = new RegExp("^\\b(" + operators.join("|") + ")\\b");
+ wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b");
// We have to return "null" instead of null, in order to avoid string
// styling as the default, when using Django templates inside HTML
@@ -270,6 +272,11 @@
return "operator";
}
+ // Attempt to match a word operator
+ if (stream.match(wordOperators)) {
+ return "keyword";
+ }
+
// Attempt to match a keyword
var keywordMatch = stream.match(keywords);
if (keywordMatch) {