From eaa8ccaccb1091820d0a8d1223996a6dd057347d Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 17 Jan 2016 14:28:04 -0600 Subject: Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor --- public/vendor/codemirror/mode/django/django.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) mode change 100755 => 100644 public/vendor/codemirror/mode/django/django.js (limited to 'public/vendor/codemirror/mode/django/django.js') diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js old mode 100755 new mode 100644 index 2f08b063..eb8d6591 --- 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) { -- cgit v1.2.3