codemirror-rails 2.32 → 2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/codemirror-rails.gemspec +1 -1
- data/lib/codemirror/rails/version.rb +2 -2
- data/vendor/assets/javascripts/codemirror.js +355 -349
- data/vendor/assets/javascripts/codemirror/keymaps/vim.js +6 -5
- data/vendor/assets/javascripts/codemirror/modes/clike.js +6 -2
- data/vendor/assets/javascripts/codemirror/modes/clojure.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/css.js +52 -2
- data/vendor/assets/javascripts/codemirror/modes/ecl.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/gfm.js +4 -3
- data/vendor/assets/javascripts/codemirror/modes/go.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/groovy.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/haskell.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/haxe.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/htmlembedded.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/javascript.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/less.js +94 -60
- data/vendor/assets/javascripts/codemirror/modes/markdown.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/ntriples.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/ocaml.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/pascal.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/perl.js +71 -71
- data/vendor/assets/javascripts/codemirror/modes/php.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/pig.js +3 -3
- data/vendor/assets/javascripts/codemirror/modes/python.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/scheme.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/shell.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/sieve.js +156 -0
- data/vendor/assets/javascripts/codemirror/modes/smalltalk.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/smarty.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/stex.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/tiki.js +4 -4
- data/vendor/assets/javascripts/codemirror/modes/velocity.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/verilog.js +1 -1
- data/vendor/assets/javascripts/codemirror/modes/xml.js +2 -2
- data/vendor/assets/javascripts/codemirror/modes/xquery.js +7 -4
- data/vendor/assets/javascripts/codemirror/utils/dialog.js +4 -1
- data/vendor/assets/javascripts/codemirror/utils/formatting.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/javascript-hint.js +3 -3
- data/vendor/assets/javascripts/codemirror/utils/loadmode.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/multiplex.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/pig-hint.js +1 -1
- data/vendor/assets/javascripts/codemirror/utils/runmode.js +8 -4
- data/vendor/assets/javascripts/codemirror/utils/search.js +4 -4
- data/vendor/assets/javascripts/codemirror/utils/searchcursor.js +13 -11
- data/vendor/assets/javascripts/codemirror/utils/simple-hint.js +89 -68
- data/vendor/assets/javascripts/codemirror/utils/xml-hint.js +8 -8
- data/vendor/assets/stylesheets/codemirror.css +15 -11
- metadata +13 -13
| @@ -70,7 +70,7 @@ | |
| 70 70 | 
             
                for (var prop in o) if (o.hasOwnProperty(prop)) f(prop, o[prop]);
         | 
| 71 71 | 
             
              }
         | 
| 72 72 | 
             
              function iterList(l, f) {
         | 
| 73 | 
            -
                for (var i  | 
| 73 | 
            +
                for (var i = 0; i < l.length; ++i) f(l[i]);
         | 
| 74 74 | 
             
              }
         | 
| 75 75 | 
             
              function toLetter(ch) {
         | 
| 76 76 | 
             
                // T -> t, Shift-T -> T, '*' -> *, "Space" -> " "
         | 
| @@ -229,7 +229,8 @@ | |
| 229 229 | 
             
                else f(prompt(shortText, ""));
         | 
| 230 230 | 
             
              }
         | 
| 231 231 | 
             
              function showAlert(cm, text) {
         | 
| 232 | 
            -
                 | 
| 232 | 
            +
                var esc = text.replace(/[<&]/, function(ch) { return ch == "<" ? "<" : "&"; });
         | 
| 233 | 
            +
                if (cm.openDialog) cm.openDialog(esc + " <button type=button>OK</button>");
         | 
| 233 234 | 
             
                else alert(text);
         | 
| 234 235 | 
             
              }
         | 
| 235 236 |  | 
| @@ -502,9 +503,9 @@ | |
| 502 503 | 
             
                setupPrefixBindingForKey(toCombo(ch));
         | 
| 503 504 | 
             
                setupPrefixBindingForKey(toCombo(ch.toLowerCase()));
         | 
| 504 505 | 
             
              }
         | 
| 505 | 
            -
               | 
| 506 | 
            -
                setupPrefixBindingForKey(toCombo( | 
| 507 | 
            -
              } | 
| 506 | 
            +
              for (var i = 0; i < SPECIAL_SYMBOLS.length; ++i) {
         | 
| 507 | 
            +
                setupPrefixBindingForKey(toCombo(SPECIAL_SYMBOLS.charAt(i)));
         | 
| 508 | 
            +
              }
         | 
| 508 509 | 
             
              setupPrefixBindingForKey("Space");
         | 
| 509 510 |  | 
| 510 511 | 
             
              CodeMirror.keyMap["vim-prefix-y"] = {
         | 
| @@ -181,14 +181,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { | |
| 181 181 | 
             
                return "string";
         | 
| 182 182 | 
             
              }
         | 
| 183 183 |  | 
| 184 | 
            -
               | 
| 184 | 
            +
              function mimes(ms, mode) {
         | 
| 185 | 
            +
                for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode);
         | 
| 186 | 
            +
              }
         | 
| 187 | 
            +
             | 
| 188 | 
            +
              mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], {
         | 
| 185 189 | 
             
                name: "clike",
         | 
| 186 190 | 
             
                keywords: words(cKeywords),
         | 
| 187 191 | 
             
                blockKeywords: words("case do else for if switch while struct"),
         | 
| 188 192 | 
             
                atoms: words("null"),
         | 
| 189 193 | 
             
                hooks: {"#": cppHook}
         | 
| 190 194 | 
             
              });
         | 
| 191 | 
            -
               | 
| 195 | 
            +
              mimes(["text/x-c++src", "text/x-c++hdr"], {
         | 
| 192 196 | 
             
                name: "clike",
         | 
| 193 197 | 
             
                keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
         | 
| 194 198 | 
             
                                "static_cast typeid catch operator template typename class friend private " +
         | 
| @@ -145,7 +145,7 @@ CodeMirror.defineMode("clojure", function (config, mode) { | |
| 145 145 | 
             
                                } else if (isNumber(ch,stream)){
         | 
| 146 146 | 
             
                                    returnType = NUMBER;
         | 
| 147 147 | 
             
                                } else if (ch == "(" || ch == "[") {
         | 
| 148 | 
            -
                                    var keyWord = '' | 
| 148 | 
            +
                                    var keyWord = '', indentTemp = stream.column(), letter;
         | 
| 149 149 | 
             
                                    /**
         | 
| 150 150 | 
             
                                    Either
         | 
| 151 151 | 
             
                                    (indent-word ..
         | 
| @@ -187,7 +187,7 @@ CodeMirror.defineMode('coffeescript', function(conf) { | |
| 187 187 | 
             
                        }
         | 
| 188 188 | 
             
                        if (singleline) {
         | 
| 189 189 | 
             
                            if (conf.mode.singleLineStringErrors) {
         | 
| 190 | 
            -
                                outclass = ERRORCLASS
         | 
| 190 | 
            +
                                outclass = ERRORCLASS;
         | 
| 191 191 | 
             
                            } else {
         | 
| 192 192 | 
             
                                state.tokenize = tokenBase;
         | 
| 193 193 | 
             
                            }
         | 
| @@ -205,7 +205,7 @@ CodeMirror.defineMode('coffeescript', function(conf) { | |
| 205 205 | 
             
                        }
         | 
| 206 206 | 
             
                        stream.eatWhile("#");
         | 
| 207 207 | 
             
                    }
         | 
| 208 | 
            -
                    return "comment"
         | 
| 208 | 
            +
                    return "comment";
         | 
| 209 209 | 
             
                }
         | 
| 210 210 |  | 
| 211 211 | 
             
                function indent(stream, state, type) {
         | 
| @@ -244,7 +244,7 @@ CodeMirror.defineMode('coffeescript', function(conf) { | |
| 244 244 | 
             
                        while (state.scopes[0].offset !== _indent) {
         | 
| 245 245 | 
             
                            state.scopes.shift();
         | 
| 246 246 | 
             
                        }
         | 
| 247 | 
            -
                        return false
         | 
| 247 | 
            +
                        return false;
         | 
| 248 248 | 
             
                    } else {
         | 
| 249 249 | 
             
                        state.scopes.shift();
         | 
| 250 250 | 
             
                        return false;
         | 
| @@ -1,5 +1,55 @@ | |
| 1 1 | 
             
            CodeMirror.defineMode("css", function(config) {
         | 
| 2 2 | 
             
              var indentUnit = config.indentUnit, type;
         | 
| 3 | 
            +
             | 
| 4 | 
            +
              var keywords = keySet(["above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll",
         | 
| 5 | 
            +
                "alternate", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", "arabic-indic", "armenian", "asterisks",
         | 
| 6 | 
            +
                "auto", "avoid", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "blink",
         | 
| 7 | 
            +
                "block", "block-axis", "bold", "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button",
         | 
| 8 | 
            +
                "button-bevel", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", "capitalize", "caps-lock-indicator",
         | 
| 9 | 
            +
                "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic",
         | 
| 10 | 
            +
                "clear", "clip", "close-quote", "col-resize", "collapse", "compact", "condensed", "contain", "content", "content-box", "context-menu",
         | 
| 11 | 
            +
                "continuous", "copy", "cover", "crop", "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", "decimal-leading-zero", "default",
         | 
| 12 | 
            +
                "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", "disc", "discard", "document",
         | 
| 13 | 
            +
                "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element",
         | 
| 14 | 
            +
                "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez",
         | 
| 15 | 
            +
                "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et",
         | 
| 16 | 
            +
                "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et",
         | 
| 17 | 
            +
                "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded",
         | 
| 18 | 
            +
                "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", "forwards", "from", "geometricPrecision",
         | 
| 19 | 
            +
                "georgian", "graytext", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help",
         | 
| 20 | 
            +
                "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
         | 
| 21 | 
            +
                "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline",
         | 
| 22 | 
            +
                "inline-axis", "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "justify", "kannada", "katakana",
         | 
| 23 | 
            +
                "katakana-iroha", "khmer", "landscape", "lao", "large", "larger", "left", "level", "lighter", "line-through", "linear", "lines",
         | 
| 24 | 
            +
                "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek",
         | 
| 25 | 
            +
                "lower-hexadecimal", "lower-latin", "lower-norwegian", "lower-roman", "lowercase", "ltr", "malayalam", "match", "media-controls-background",
         | 
| 26 | 
            +
                "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button",
         | 
| 27 | 
            +
                "media-rewind-button", "media-seek-back-button", "media-seek-forward-button", "media-slider", "media-sliderthumb", "media-time-remaining-display",
         | 
| 28 | 
            +
                "media-volume-slider", "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button",
         | 
| 29 | 
            +
                "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", "mix", "mongolian", "monospace", "move", "multiple",
         | 
| 30 | 
            +
                "myanmar", "n-resize", "narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none",
         | 
| 31 | 
            +
                "normal", "not-allowed", "nowrap", "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", "optimizeLegibility",
         | 
| 32 | 
            +
                "optimizeSpeed", "oriya", "oromo", "outset", "outside", "overlay", "overline", "padding", "padding-box", "painted", "paused",
         | 
| 33 | 
            +
                "persian", "plus-darker", "plus-lighter", "pointer", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress",
         | 
| 34 | 
            +
                "push-button", "radio", "read-only", "read-write", "read-write-plaintext-only", "relative", "repeat", "repeat-x",
         | 
| 35 | 
            +
                "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", "s-resize", "sans-serif",
         | 
| 36 | 
            +
                "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
         | 
| 37 | 
            +
                "searchfield-results-decoration", "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", "single",
         | 
| 38 | 
            +
                "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
         | 
| 39 | 
            +
                "small", "small-caps", "small-caption", "smaller", "solid", "somali", "source-atop", "source-in", "source-out", "source-over",
         | 
| 40 | 
            +
                "space", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super",
         | 
| 41 | 
            +
                "sw-resize", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group",
         | 
| 42 | 
            +
                "table-row", "table-row-group", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin",
         | 
| 43 | 
            +
                "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede",
         | 
| 44 | 
            +
                "tigrinya-et", "tigrinya-et-abegede", "to", "top", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-armenian",
         | 
| 45 | 
            +
                "upper-greek", "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "vertical", "vertical-text", "visible",
         | 
| 46 | 
            +
                "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext",
         | 
| 47 | 
            +
                "x-large", "x-small", "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle",
         | 
| 48 | 
            +
                "-webkit-body", "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing",
         | 
| 49 | 
            +
                "-webkit-gradient", "-webkit-inline-box", "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-pictograph",
         | 
| 50 | 
            +
                "-webkit-right", "-webkit-small-control", "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out"]);
         | 
| 51 | 
            +
             | 
| 52 | 
            +
              function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) keys[array[i]] = true; return keys; }
         | 
| 3 53 | 
             
              function ret(style, tp) {type = tp; return style;}
         | 
| 4 54 |  | 
| 5 55 | 
             
              function tokenBase(stream, state) {
         | 
| @@ -34,7 +84,7 @@ CodeMirror.defineMode("css", function(config) { | |
| 34 84 | 
             
                else if (/[,.+>*\/]/.test(ch)) {
         | 
| 35 85 | 
             
                  return ret(null, "select-op");
         | 
| 36 86 | 
             
                }
         | 
| 37 | 
            -
                else if (/[;{}:\[\]]/.test(ch)) {
         | 
| 87 | 
            +
                else if (/[;{}:\[\]\(\)]/.test(ch)) {
         | 
| 38 88 | 
             
                  return ret(null, ch);
         | 
| 39 89 | 
             
                }
         | 
| 40 90 | 
             
                else {
         | 
| @@ -94,7 +144,7 @@ CodeMirror.defineMode("css", function(config) { | |
| 94 144 | 
             
                  var context = state.stack[state.stack.length-1];
         | 
| 95 145 | 
             
                  if (type == "hash" && context != "rule") style = "string-2";
         | 
| 96 146 | 
             
                  else if (style == "variable") {
         | 
| 97 | 
            -
                    if (context == "rule") style = "number";
         | 
| 147 | 
            +
                    if (context == "rule") style = keywords[stream.current()] ? "keyword" : "number";
         | 
| 98 148 | 
             
                    else if (!context || context == "@media{") style = "tag";
         | 
| 99 149 | 
             
                  }
         | 
| 100 150 |  | 
| @@ -32,14 +32,14 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) { | |
| 32 32 |  | 
| 33 33 | 
             
                return function (lang) {
         | 
| 34 34 | 
             
                  return modes[lang] ? CodeMirror.getMode(config, modes[lang]) : null;
         | 
| 35 | 
            -
                }
         | 
| 35 | 
            +
                };
         | 
| 36 36 | 
             
              }());
         | 
| 37 37 |  | 
| 38 38 | 
             
              function markdown(stream, state) {
         | 
| 39 39 | 
             
                // intercept fenced code blocks
         | 
| 40 40 | 
             
                if (stream.sol() && stream.match(/^```([\w+#]*)/)) {
         | 
| 41 41 | 
             
                  // try switching mode
         | 
| 42 | 
            -
                  state.localMode = getMode(RegExp.$1)
         | 
| 42 | 
            +
                  state.localMode = getMode(RegExp.$1);
         | 
| 43 43 | 
             
                  if (state.localMode)
         | 
| 44 44 | 
             
                    state.localState = state.localMode.startState();
         | 
| 45 45 |  | 
| @@ -103,6 +103,7 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) { | |
| 103 103 |  | 
| 104 104 | 
             
                token: function(stream, state) {
         | 
| 105 105 | 
             
                    /* Parse GFM double bracket links */
         | 
| 106 | 
            +
                    var ch;
         | 
| 106 107 | 
             
                    if ((ch = stream.peek()) != undefined && ch == '[') {
         | 
| 107 108 | 
             
                        stream.next(); // Advance the stream
         | 
| 108 109 |  | 
| @@ -140,5 +141,5 @@ CodeMirror.defineMode("gfm", function(config, parserConfig) { | |
| 140 141 |  | 
| 141 142 | 
             
                    return state.token(stream, state);
         | 
| 142 143 | 
             
                }
         | 
| 143 | 
            -
              }
         | 
| 144 | 
            +
              };
         | 
| 144 145 | 
             
            }, "markdown");
         | 
| @@ -47,7 +47,7 @@ CodeMirror.defineMode("go", function(config, parserConfig) { | |
| 47 47 | 
             
                }
         | 
| 48 48 | 
             
                if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
         | 
| 49 49 | 
             
                  curPunc = ch;
         | 
| 50 | 
            -
                  return null
         | 
| 50 | 
            +
                  return null;
         | 
| 51 51 | 
             
                }
         | 
| 52 52 | 
             
                if (ch == "/") {
         | 
| 53 53 | 
             
                  if (stream.eat("*")) {
         | 
| @@ -144,7 +144,7 @@ CodeMirror.defineMode("go", function(config, parserConfig) { | |
| 144 144 | 
             
                  if (curPunc == "{") pushContext(state, stream.column(), "}");
         | 
| 145 145 | 
             
                  else if (curPunc == "[") pushContext(state, stream.column(), "]");
         | 
| 146 146 | 
             
                  else if (curPunc == "(") pushContext(state, stream.column(), ")");
         | 
| 147 | 
            -
                  else if (curPunc == "case") ctx.type = "case"
         | 
| 147 | 
            +
                  else if (curPunc == "case") ctx.type = "case";
         | 
| 148 148 | 
             
                  else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
         | 
| 149 149 | 
             
                  else if (curPunc == ctx.type) popContext(state);
         | 
| 150 150 | 
             
                  state.startOfLine = false;
         | 
| @@ -128,7 +128,7 @@ CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { | |
| 128 128 | 
             
                  }
         | 
| 129 129 | 
             
                  setState(ncomment(type, currNest));
         | 
| 130 130 | 
             
                  return type;
         | 
| 131 | 
            -
                }
         | 
| 131 | 
            +
                };
         | 
| 132 132 | 
             
              }
         | 
| 133 133 |  | 
| 134 134 | 
             
              function stringLiteral(source, setState) {
         | 
| @@ -170,7 +170,7 @@ CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { | |
| 170 170 | 
             
                  return function () {
         | 
| 171 171 | 
             
                    for (var i = 0; i < arguments.length; i++)
         | 
| 172 172 | 
             
                      wkw[arguments[i]] = t;
         | 
| 173 | 
            -
                  }
         | 
| 173 | 
            +
                  };
         | 
| 174 174 | 
             
                }
         | 
| 175 175 |  | 
| 176 176 | 
             
                setType("keyword")(
         | 
| @@ -6,7 +6,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { | |
| 6 6 | 
             
              var keywords = function(){
         | 
| 7 7 | 
             
                function kw(type) {return {type: type, style: "keyword"};}
         | 
| 8 8 | 
             
                var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
         | 
| 9 | 
            -
                var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}
         | 
| 9 | 
            +
                var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
         | 
| 10 10 | 
             
              var type = kw("typedef");
         | 
| 11 11 | 
             
                return {
         | 
| 12 12 | 
             
                  "if": A, "while": A, "else": B, "do": B, "try": B,
         | 
| @@ -219,7 +219,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { | |
| 219 219 | 
             
              function pushlex(type, info) {
         | 
| 220 220 | 
             
                var result = function() {
         | 
| 221 221 | 
             
                  var state = cx.state;
         | 
| 222 | 
            -
                  state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info)
         | 
| 222 | 
            +
                  state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
         | 
| 223 223 | 
             
                };
         | 
| 224 224 | 
             
                result.lex = true;
         | 
| 225 225 | 
             
                return result;
         | 
| @@ -243,7 +243,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { | |
| 243 243 | 
             
              }
         | 
| 244 244 |  | 
| 245 245 | 
             
              function statement(type) {
         | 
| 246 | 
            -
                if (type == "@") return cont(metadef)
         | 
| 246 | 
            +
                if (type == "@") return cont(metadef);
         | 
| 247 247 | 
             
                if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
         | 
| 248 248 | 
             
                if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
         | 
| 249 249 | 
             
                if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
         | 
| @@ -297,7 +297,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { | |
| 297 297 | 
             
              function metadef(type, value) {
         | 
| 298 298 | 
             
                if(type == ":") return cont(metadef);
         | 
| 299 299 | 
             
                if(type == "variable") return cont(metadef);
         | 
| 300 | 
            -
                if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement)
         | 
| 300 | 
            +
                if(type == "(") return cont(pushlex(")"), comasep(metaargs, ")"), poplex, statement);
         | 
| 301 301 | 
             
              }
         | 
| 302 302 | 
             
              function metaargs(type, value) {
         | 
| 303 303 | 
             
                if(typ == "variable") return cont();
         | 
| @@ -36,7 +36,7 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { | |
| 36 36 | 
             
                      token :  parserConfig.startOpen ? scriptingDispatch : htmlDispatch,
         | 
| 37 37 | 
             
                      htmlState : htmlMixedMode.startState(),
         | 
| 38 38 | 
             
                      scriptState : scriptingMode.startState()
         | 
| 39 | 
            -
             | 
| 39 | 
            +
                  };
         | 
| 40 40 | 
             
                },
         | 
| 41 41 |  | 
| 42 42 | 
             
                token: function(stream, state) {
         | 
| @@ -55,12 +55,12 @@ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { | |
| 55 55 | 
             
                   token : state.token,
         | 
| 56 56 | 
             
                   htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState),
         | 
| 57 57 | 
             
                   scriptState : CodeMirror.copyState(scriptingMode, state.scriptState)
         | 
| 58 | 
            -
             | 
| 58 | 
            +
                  };
         | 
| 59 59 | 
             
                },
         | 
| 60 60 |  | 
| 61 61 |  | 
| 62 62 | 
             
                electricChars: "/{}:"
         | 
| 63 | 
            -
              }
         | 
| 63 | 
            +
              };
         | 
| 64 64 | 
             
            }, "htmlmixed");
         | 
| 65 65 |  | 
| 66 66 | 
             
            CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"});
         | 
| @@ -185,7 +185,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { | |
| 185 185 | 
             
              function pushlex(type, info) {
         | 
| 186 186 | 
             
                var result = function() {
         | 
| 187 187 | 
             
                  var state = cx.state;
         | 
| 188 | 
            -
                  state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info)
         | 
| 188 | 
            +
                  state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
         | 
| 189 189 | 
             
                };
         | 
| 190 190 | 
             
                result.lex = true;
         | 
| 191 191 | 
             
                return result;
         | 
| @@ -243,7 +243,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { | |
| 243 243 |  | 
| 244 244 | 
             
              function maybeoperator(type, value) {
         | 
| 245 245 | 
             
                if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
         | 
| 246 | 
            -
                if (type == "operator"  | 
| 246 | 
            +
                if (type == "operator" && value == "?") return cont(expression, expect(":"), expression);
         | 
| 247 247 | 
             
                if (type == ";") return;
         | 
| 248 248 | 
             
                if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
         | 
| 249 249 | 
             
                if (type == ".") return cont(property, maybeoperator);
         | 
| @@ -1,25 +1,24 @@ | |
| 1 1 | 
             
            /*
         | 
| 2 2 | 
             
              LESS mode - http://www.lesscss.org/
         | 
| 3 | 
            -
              Ported to CodeMirror by Peter Kroon
         | 
| 3 | 
            +
              Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
         | 
| 4 | 
            +
              Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues  GitHub: @peterkroon
         | 
| 4 5 | 
             
            */
         | 
| 5 6 |  | 
| 6 7 | 
             
            CodeMirror.defineMode("less", function(config) {
         | 
| 7 8 | 
             
              var indentUnit = config.indentUnit, type;
         | 
| 8 9 | 
             
              function ret(style, tp) {type = tp; return style;}
         | 
| 9 | 
            -
              // | 
| 10 | 
            -
              var tags =  | 
| 10 | 
            +
              //html tags
         | 
| 11 | 
            +
              var tags = "a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption cite code col colgroup command datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins keygen kbd label legend li link map mark menu meta meter nav noframes noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr".split(' ');
         | 
| 11 12 |  | 
| 12 13 | 
             
              function inTagsArray(val){
         | 
| 13 | 
            -
                for(var i=0; i<tags.length; i++) | 
| 14 | 
            -
                  if(val === tags[i]){
         | 
| 15 | 
            -
            	return true;
         | 
| 16 | 
            -
                  }
         | 
| 17 | 
            -
                }
         | 
| 14 | 
            +
                for(var i=0; i<tags.length; i++)if(val === tags[i])return true;
         | 
| 18 15 | 
             
              }
         | 
| 19 | 
            -
             | 
| 16 | 
            +
               
         | 
| 17 | 
            +
              var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;
         | 
| 18 | 
            +
              
         | 
| 20 19 | 
             
              function tokenBase(stream, state) {
         | 
| 21 20 | 
             
                var ch = stream.next();
         | 
| 22 | 
            -
             | 
| 21 | 
            +
                
         | 
| 23 22 | 
             
                if (ch == "@") {stream.eatWhile(/[\w\-]/); return ret("meta", stream.current());}
         | 
| 24 23 | 
             
                else if (ch == "/" && stream.eat("*")) {
         | 
| 25 24 | 
             
                  state.tokenize = tokenCComment;
         | 
| @@ -30,19 +29,20 @@ CodeMirror.defineMode("less", function(config) { | |
| 30 29 | 
             
                  return tokenSGMLComment(stream, state);
         | 
| 31 30 | 
             
                }
         | 
| 32 31 | 
             
                else if (ch == "=") ret(null, "compare");
         | 
| 33 | 
            -
                else if ( | 
| 32 | 
            +
                else if (ch == "|" && stream.eat("=")) return ret(null, "compare");
         | 
| 34 33 | 
             
                else if (ch == "\"" || ch == "'") {
         | 
| 35 34 | 
             
                  state.tokenize = tokenString(ch);
         | 
| 36 35 | 
             
                  return state.tokenize(stream, state);
         | 
| 37 36 | 
             
                }
         | 
| 38 | 
            -
                else if (ch == "/") { //  | 
| 37 | 
            +
                else if (ch == "/") { // e.g.: .png will not be parsed as a class
         | 
| 39 38 | 
             
                  if(stream.eat("/")){
         | 
| 40 39 | 
             
                    state.tokenize = tokenSComment;
         | 
| 41 40 | 
             
                    return tokenSComment(stream, state);
         | 
| 42 41 | 
             
                  }else{
         | 
| 43 | 
            -
                     | 
| 44 | 
            -
                    if( | 
| 45 | 
            -
                     | 
| 42 | 
            +
                    if(type == "string" || type == "(")return ret("string", "string");
         | 
| 43 | 
            +
                    if(state.stack[state.stack.length-1] != undefined)return ret(null, ch);
         | 
| 44 | 
            +
                    stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/);		
         | 
| 45 | 
            +
                    if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() && stream.peek() == ")"))  || stream.eol() )return ret("string", "string"); // let url(/images/logo.png) without quotes return as string
         | 
| 46 46 | 
             
                  }
         | 
| 47 47 | 
             
                }
         | 
| 48 48 | 
             
                else if (ch == "!") {
         | 
| @@ -53,30 +53,42 @@ CodeMirror.defineMode("less", function(config) { | |
| 53 53 | 
             
                  stream.eatWhile(/[\w.%]/);
         | 
| 54 54 | 
             
                  return ret("number", "unit");
         | 
| 55 55 | 
             
                }
         | 
| 56 | 
            -
                else if (/[,+<>*\/]/.test(ch)) { | 
| 56 | 
            +
                else if (/[,+<>*\/]/.test(ch)) {
         | 
| 57 | 
            +
                  if(stream.peek() == "=" || type == "a")return ret("string", "string");
         | 
| 57 58 | 
             
                  return ret(null, "select-op");
         | 
| 58 59 | 
             
                }
         | 
| 59 | 
            -
                else if (/[;{}:\[\]()]/.test(ch)) { | 
| 60 | 
            -
                  if(ch == ":"){
         | 
| 61 | 
            -
                    stream.eatWhile(/[ | 
| 62 | 
            -
                    if( stream.current() | 
| 60 | 
            +
                else if (/[;{}:\[\]()~\|]/.test(ch)) {
         | 
| 61 | 
            +
                  if(ch == ":"){		
         | 
| 62 | 
            +
                    stream.eatWhile(/[a-z\\\-]/);
         | 
| 63 | 
            +
                    if( selectors.test(stream.current()) ){
         | 
| 63 64 | 
             
                      return ret("tag", "tag");
         | 
| 65 | 
            +
                    }else if(stream.peek() == ":"){//::-webkit-search-decoration
         | 
| 66 | 
            +
                      stream.next();
         | 
| 67 | 
            +
                      stream.eatWhile(/[a-z\\\-]/);
         | 
| 68 | 
            +
                      if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret("string", "string");
         | 
| 69 | 
            +
                      if( selectors.test(stream.current().substring(1)) )return ret("tag", "tag");
         | 
| 70 | 
            +
                      return ret(null, ch);
         | 
| 64 71 | 
             
                    }else{
         | 
| 65 72 | 
             
                      return ret(null, ch); 
         | 
| 66 73 | 
             
                    }
         | 
| 74 | 
            +
                  }else if(ch == "~"){
         | 
| 75 | 
            +
                    if(type == "r")return ret("string", "string");
         | 
| 67 76 | 
             
                  }else{
         | 
| 68 77 | 
             
                    return ret(null, ch);
         | 
| 69 78 | 
             
                  }
         | 
| 70 79 | 
             
                }
         | 
| 71 | 
            -
                else if (ch == ".") { | 
| 80 | 
            +
                else if (ch == ".") {		
         | 
| 81 | 
            +
                  if(type == "(" || type == "string")return ret("string", "string"); // allow url(../image.png)
         | 
| 72 82 | 
             
                  stream.eatWhile(/[\a-zA-Z0-9\-_]/);
         | 
| 83 | 
            +
                  if(stream.peek() == " ")stream.eatSpace();
         | 
| 84 | 
            +
                  if(stream.peek() == ")")return ret("number", "unit");//rgba(0,0,0,.25);
         | 
| 73 85 | 
             
                  return ret("tag", "tag");
         | 
| 74 86 | 
             
                }
         | 
| 75 | 
            -
                else if (ch == "#") { | 
| 87 | 
            +
                else if (ch == "#") {
         | 
| 76 88 | 
             
                  //we don't eat white-space, we want the hex color and or id only
         | 
| 77 89 | 
             
                  stream.eatWhile(/[A-Za-z0-9]/);
         | 
| 78 90 | 
             
                  //check if there is a proper hex color length e.g. #eee || #eeeEEE
         | 
| 79 | 
            -
                  if(stream.current().length  | 
| 91 | 
            +
                  if(stream.current().length == 4 || stream.current().length == 7){
         | 
| 80 92 | 
             
                    if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream
         | 
| 81 93 | 
             
                      //when not a valid hex value, parse as id
         | 
| 82 94 | 
             
                      if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag");
         | 
| @@ -96,8 +108,8 @@ CodeMirror.defineMode("less", function(config) { | |
| 96 108 | 
             
                      stream.eatWhile(/[\w\\\-]/);
         | 
| 97 109 | 
             
                      return ret("atom", "tag"); 
         | 
| 98 110 | 
             
                    }
         | 
| 99 | 
            -
                  }else{
         | 
| 100 | 
            -
                    stream.eatWhile(/[\w\\\-]/); | 
| 111 | 
            +
                  }else{//when not a valid hexvalue length
         | 
| 112 | 
            +
                    stream.eatWhile(/[\w\\\-]/);
         | 
| 101 113 | 
             
                    return ret("atom", "tag");
         | 
| 102 114 | 
             
                  }
         | 
| 103 115 | 
             
                }
         | 
| @@ -107,39 +119,62 @@ CodeMirror.defineMode("less", function(config) { | |
| 107 119 | 
             
                }
         | 
| 108 120 | 
             
                else {
         | 
| 109 121 | 
             
                  stream.eatWhile(/[\w\\\-_%.{]/);
         | 
| 110 | 
            -
                  if( | 
| 122 | 
            +
                  if(type == "string"){
         | 
| 123 | 
            +
                    return ret("string", "string");
         | 
| 124 | 
            +
                  }else if(stream.current().match(/(^http$|^https$)/) != null){
         | 
| 111 125 | 
             
                    stream.eatWhile(/[\w\\\-_%.{:\/]/);
         | 
| 112 126 | 
             
                    return ret("string", "string");
         | 
| 113 127 | 
             
                  }else if(stream.peek() == "<" || stream.peek() == ">"){
         | 
| 114 128 | 
             
                    return ret("tag", "tag");
         | 
| 115 | 
            -
                  }else if( stream.peek() | 
| 129 | 
            +
                  }else if( /\(/.test(stream.peek()) ){																	  
         | 
| 116 130 | 
             
                    return ret(null, ch);
         | 
| 117 131 | 
             
                  }else if (stream.peek() == "/" && state.stack[state.stack.length-1] != undefined){ // url(dir/center/image.png)
         | 
| 118 132 | 
             
                    return ret("string", "string");
         | 
| 119 | 
            -
                  }else if( stream.current().match(/\-\d|\-.\d/) ){ //  | 
| 120 | 
            -
                    // | 
| 121 | 
            -
                    // | 
| 133 | 
            +
                  }else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign
         | 
| 134 | 
            +
                    //commment out these 2 comment if you want the minus sign to be parsed as null -500px
         | 
| 135 | 
            +
                    //stream.backUp(stream.current().length-1);
         | 
| 136 | 
            +
                    //return ret(null, ch); //console.log( stream.current() );		
         | 
| 122 137 | 
             
                    return ret("number", "unit");
         | 
| 123 | 
            -
                  }else if( inTagsArray(stream.current()) ){ //  | 
| 138 | 
            +
                  }else if( inTagsArray(stream.current().toLowerCase()) ){ // match html tags
         | 
| 124 139 | 
             
                    return ret("tag", "tag");
         | 
| 125 140 | 
             
                  }else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == "/")) && stream.current().indexOf(".") !== -1){
         | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
             | 
| 134 | 
            -
             | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 141 | 
            +
                    if(stream.current().substring(stream.current().length-1,stream.current().length) == "{"){
         | 
| 142 | 
            +
                      stream.backUp(1);
         | 
| 143 | 
            +
                      return ret("tag", "tag");
         | 
| 144 | 
            +
                    }//end if
         | 
| 145 | 
            +
                    stream.eatSpace();
         | 
| 146 | 
            +
                    if( /[{<>.a-zA-Z\/]/.test(stream.peek())  || stream.eol() )return ret("tag", "tag"); // e.g. button.icon-plus
         | 
| 147 | 
            +
                    return ret("string", "string"); // let url(/images/logo.png) without quotes return as string
         | 
| 148 | 
            +
                  }else if( stream.eol() || stream.peek() == "[" || stream.peek() == "#" || type == "tag" ){
         | 
| 149 | 
            +
                    if(stream.current().substring(stream.current().length-1,stream.current().length) == "{")stream.backUp(1);
         | 
| 150 | 
            +
                    return ret("tag", "tag");
         | 
| 151 | 
            +
                  }else if(type == "compare" || type == "a" || type == "("){
         | 
| 152 | 
            +
                    return ret("string", "string");
         | 
| 153 | 
            +
                  }else if(type == "|" || stream.current() == "-" || type == "["){
         | 
| 154 | 
            +
                    return ret(null, ch);
         | 
| 155 | 
            +
                  }else if(stream.peek() == ":") {
         | 
| 156 | 
            +
                    stream.next();
         | 
| 157 | 
            +
                    var t_v = stream.peek() == ":" ? true : false;
         | 
| 158 | 
            +
                    if(!t_v){
         | 
| 159 | 
            +
                  	  var old_pos = stream.pos;
         | 
| 160 | 
            +
                  	  var sc = stream.current().length;
         | 
| 161 | 
            +
                  	  stream.eatWhile(/[a-z\\\-]/);
         | 
| 162 | 
            +
                  	  var new_pos = stream.pos;
         | 
| 163 | 
            +
                  	  if(stream.current().substring(sc-1).match(selectors) != null){
         | 
| 164 | 
            +
                  	    stream.backUp(new_pos-(old_pos-1));
         | 
| 165 | 
            +
                  		return ret("tag", "tag");
         | 
| 166 | 
            +
                  	  } else stream.backUp(new_pos-(old_pos-1));
         | 
| 167 | 
            +
                  	}else{
         | 
| 168 | 
            +
                  	  stream.backUp(1);	
         | 
| 169 | 
            +
                  	}
         | 
| 170 | 
            +
                  	if(t_v)return ret("tag", "tag"); else return ret("variable", "variable");
         | 
| 171 | 
            +
                  }else{		
         | 
| 172 | 
            +
                    return ret("variable", "variable");		
         | 
| 137 173 | 
             
                  }
         | 
| 138 | 
            -
                }
         | 
| 139 | 
            -
                
         | 
| 174 | 
            +
                }    
         | 
| 140 175 | 
             
              }
         | 
| 141 | 
            -
             | 
| 142 | 
            -
              function tokenSComment(stream, state) {// SComment = Slash comment
         | 
| 176 | 
            +
              
         | 
| 177 | 
            +
              function tokenSComment(stream, state) { // SComment = Slash comment
         | 
| 143 178 | 
             
                stream.skipToEnd();
         | 
| 144 179 | 
             
                state.tokenize = tokenBase;
         | 
| 145 180 | 
             
                return ret("comment", "comment");
         | 
| @@ -156,7 +191,7 @@ CodeMirror.defineMode("less", function(config) { | |
| 156 191 | 
             
                }
         | 
| 157 192 | 
             
                return ret("comment", "comment");
         | 
| 158 193 | 
             
              }
         | 
| 159 | 
            -
             | 
| 194 | 
            +
              
         | 
| 160 195 | 
             
              function tokenSGMLComment(stream, state) {
         | 
| 161 196 | 
             
                var dashes = 0, ch;
         | 
| 162 197 | 
             
                while ((ch = stream.next()) != null) {
         | 
| @@ -168,7 +203,7 @@ CodeMirror.defineMode("less", function(config) { | |
| 168 203 | 
             
                }
         | 
| 169 204 | 
             
                return ret("comment", "comment");
         | 
| 170 205 | 
             
              }
         | 
| 171 | 
            -
             | 
| 206 | 
            +
              
         | 
| 172 207 | 
             
              function tokenString(quote) {
         | 
| 173 208 | 
             
                return function(stream, state) {
         | 
| 174 209 | 
             
                  var escaped = false, ch;
         | 
| @@ -181,29 +216,28 @@ CodeMirror.defineMode("less", function(config) { | |
| 181 216 | 
             
                  return ret("string", "string");
         | 
| 182 217 | 
             
                };
         | 
| 183 218 | 
             
              }
         | 
| 184 | 
            -
             | 
| 219 | 
            +
              
         | 
| 185 220 | 
             
              return {
         | 
| 186 221 | 
             
                startState: function(base) { 
         | 
| 187 222 | 
             
                  return {tokenize: tokenBase,
         | 
| 188 223 | 
             
                          baseIndent: base || 0,
         | 
| 189 224 | 
             
                          stack: []};
         | 
| 190 225 | 
             
                },
         | 
| 191 | 
            -
             | 
| 226 | 
            +
                
         | 
| 192 227 | 
             
                token: function(stream, state) {
         | 
| 193 228 | 
             
                  if (stream.eatSpace()) return null;
         | 
| 194 229 | 
             
                  var style = state.tokenize(stream, state);
         | 
| 195 | 
            -
             | 
| 230 | 
            +
                  
         | 
| 196 231 | 
             
                  var context = state.stack[state.stack.length-1];
         | 
| 197 232 | 
             
                  if (type == "hash" && context == "rule") style = "atom";
         | 
| 198 233 | 
             
                  else if (style == "variable") {
         | 
| 199 234 | 
             
                    if (context == "rule") style = null; //"tag"
         | 
| 200 | 
            -
                    else if (!context || context == "@media{"){ | 
| 201 | 
            -
             | 
| 202 | 
            -
             | 
| 203 | 
            -
             | 
| 204 | 
            -
            	}
         | 
| 235 | 
            +
                    else if (!context || context == "@media{") {
         | 
| 236 | 
            +
                      style = stream.current() == "when"  ? "variable" :
         | 
| 237 | 
            +
                      /[\s,|\s\)|\s]/.test(stream.peek()) ? "tag"      : type;
         | 
| 238 | 
            +
                    }
         | 
| 205 239 | 
             
                  }
         | 
| 206 | 
            -
             | 
| 240 | 
            +
                  
         | 
| 207 241 | 
             
                  if (context == "rule" && /^[\{\};]$/.test(type))
         | 
| 208 242 | 
             
                    state.stack.pop();
         | 
| 209 243 | 
             
                  if (type == "{") {
         | 
| @@ -215,18 +249,18 @@ CodeMirror.defineMode("less", function(config) { | |
| 215 249 | 
             
                  else if (context == "{" && type != "comment") state.stack.push("rule");
         | 
| 216 250 | 
             
                  return style;
         | 
| 217 251 | 
             
                },
         | 
| 218 | 
            -
             | 
| 252 | 
            +
                
         | 
| 219 253 | 
             
                indent: function(state, textAfter) {
         | 
| 220 254 | 
             
                  var n = state.stack.length;
         | 
| 221 255 | 
             
                  if (/^\}/.test(textAfter))
         | 
| 222 256 | 
             
                    n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
         | 
| 223 257 | 
             
                  return state.baseIndent + n * indentUnit;
         | 
| 224 258 | 
             
                },
         | 
| 225 | 
            -
             | 
| 259 | 
            +
                
         | 
| 226 260 | 
             
                electricChars: "}"
         | 
| 227 261 | 
             
              };
         | 
| 228 262 | 
             
            });
         | 
| 229 263 |  | 
| 230 264 | 
             
            CodeMirror.defineMIME("text/x-less", "less");
         | 
| 231 265 | 
             
            if (!CodeMirror.mimeModes.hasOwnProperty("text/css"))
         | 
| 232 | 
            -
              CodeMirror.defineMIME("text/css", "less");
         | 
| 266 | 
            +
              CodeMirror.defineMIME("text/css", "less");
         |