Permalink
Browse files

[coffeescript mode] Allow single-quote-character strings to span lines

Closes #2050
  • Loading branch information...
1 parent d09247c commit 72f01e8cd33808cc56a85457949bfd5a49362656 @piranha piranha committed with marijnh Dec 12, 2013
Showing with 3 additions and 4 deletions.
  1. +3 −4 mode/coffeescript/coffeescript.js
@@ -119,13 +119,13 @@ CodeMirror.defineMode("coffeescript", function(conf) {
// Handle strings
if (stream.match(stringPrefixes)) {
- state.tokenize = tokenFactory(stream.current(), "string");
+ state.tokenize = tokenFactory(stream.current(), false, "string");
return state.tokenize(stream, state);
}
// Handle regex literals
if (stream.match(regexPrefixes)) {
if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division
- state.tokenize = tokenFactory(stream.current(), "string-2");
+ state.tokenize = tokenFactory(stream.current(), true, "string-2");
return state.tokenize(stream, state);
} else {
stream.backUp(1);
@@ -161,8 +161,7 @@ CodeMirror.defineMode("coffeescript", function(conf) {
return ERRORCLASS;
}
- function tokenFactory(delimiter, outclass) {
- var singleline = delimiter.length == 1;
+ function tokenFactory(delimiter, singleline, outclass) {
return function(stream, state) {
while (!stream.eol()) {
stream.eatWhile(/[^'"\/\\]/);

0 comments on commit 72f01e8

Please sign in to comment.