diff options
author | John Mayhew | 2012-05-07 16:30:19 -0700 |
---|---|---|
committer | John Mayhew | 2012-05-07 16:30:19 -0700 |
commit | db4ba95f50148198759dde503ec1c778184d9dbe (patch) | |
tree | 8b79ad58108af2f17d15abc8cdc33d35229ab20d /imports/codemirror/mode/stex/stex.js | |
parent | 843d8ea8ee58a54bcb71d7b28dbf78fae153b491 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-db4ba95f50148198759dde503ec1c778184d9dbe.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts:
js/components/layout/tools-list.reel/tools-list.html
js/components/layout/tools-properties.reel/tools-properties.html
js/components/tools-properties/brush-properties.reel/brush-properties.html
js/components/tools-properties/fill-properties.reel/fill-properties.html
js/components/tools-properties/pen-properties.reel/pen-properties.html
js/components/tools-properties/pencil-properties.reel/pencil-properties.html
js/components/tools-properties/selection-properties.reel/selection-properties.html
js/components/tools-properties/shape-properties.reel/shape-properties.html
js/components/tools-properties/tag-properties.reel/tag-properties.html
js/components/tools-properties/text-properties.reel/text-properties.html
Diffstat (limited to 'imports/codemirror/mode/stex/stex.js')
-rw-r--r-- | imports/codemirror/mode/stex/stex.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/imports/codemirror/mode/stex/stex.js b/imports/codemirror/mode/stex/stex.js index bb47fb45..b89e619e 100644 --- a/imports/codemirror/mode/stex/stex.js +++ b/imports/codemirror/mode/stex/stex.js | |||
@@ -82,7 +82,7 @@ CodeMirror.defineMode("stex", function(cmCfg, modeCfg) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | function normal(source, state) { | 84 | function normal(source, state) { |
85 | if (source.match(/^\\[a-z]+/)) { | 85 | if (source.match(/^\\[a-zA-Z@]+/)) { |
86 | var cmdName = source.current(); | 86 | var cmdName = source.current(); |
87 | cmdName = cmdName.substr(1, cmdName.length-1); | 87 | cmdName = cmdName.substr(1, cmdName.length-1); |
88 | var plug = plugins[cmdName]; | 88 | var plug = plugins[cmdName]; |
@@ -95,9 +95,22 @@ CodeMirror.defineMode("stex", function(cmCfg, modeCfg) | |||
95 | return plug.style; | 95 | return plug.style; |
96 | } | 96 | } |
97 | 97 | ||
98 | // escape characters | ||
99 | if (source.match(/^\\[$&%#{}_]/)) { | ||
100 | return "tag"; | ||
101 | } | ||
102 | |||
103 | // white space control characters | ||
104 | if (source.match(/^\\[,;!\/]/)) { | ||
105 | return "tag"; | ||
106 | } | ||
107 | |||
98 | var ch = source.next(); | 108 | var ch = source.next(); |
99 | if (ch == "%") { | 109 | if (ch == "%") { |
100 | setState(state, inCComment); | 110 | // special case: % at end of its own line; stay in same state |
111 | if (!source.eol()) { | ||
112 | setState(state, inCComment); | ||
113 | } | ||
101 | return "comment"; | 114 | return "comment"; |
102 | } | 115 | } |
103 | else if (ch=='}' || ch==']') { | 116 | else if (ch=='}' || ch==']') { |