From 0e04fff0ea80fa5cbe96b8354db38bd334aea83a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 16:04:05 -0700 Subject: upgrade to codemirror 2.3 Signed-off-by: Ananya Sen Conflicts: js/code-editor/codemirror-ninja/theme/lesser-dark-ninja.css Signed-off-by: Ananya Sen --- imports/codemirror/mode/coffeescript/coffeescript.js | 6 ++++++ imports/codemirror/mode/coffeescript/index.html | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'imports/codemirror/mode/coffeescript') diff --git a/imports/codemirror/mode/coffeescript/coffeescript.js b/imports/codemirror/mode/coffeescript/coffeescript.js index 4f2bd66d..dece5f8a 100644 --- a/imports/codemirror/mode/coffeescript/coffeescript.js +++ b/imports/codemirror/mode/coffeescript/coffeescript.js @@ -60,6 +60,12 @@ CodeMirror.defineMode('coffeescript', function(conf) { var ch = stream.peek(); + // Handle docco title comment (single line) + if (stream.match("####")) { + stream.skipToEnd(); + return 'comment'; + } + // Handle multi line comments if (stream.match("###")) { state.tokenize = longComment; diff --git a/imports/codemirror/mode/coffeescript/index.html b/imports/codemirror/mode/coffeescript/index.html index 127c4bf9..98bd4971 100644 --- a/imports/codemirror/mode/coffeescript/index.html +++ b/imports/codemirror/mode/coffeescript/index.html @@ -46,12 +46,18 @@ root = this # Save the previous value of the `_` variable. previousUnderscore = root._ +### Multiline + comment +### # Establish the object that gets thrown to break out of a loop iteration. # `StopIteration` is SOP on Mozilla. breaker = if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration +#### Docco style single line comment (title) + + # Helper function to escape **RegExp** contents, because JS doesn't have one. escapeRegExp = (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1') -- cgit v1.2.3