Regex styling errors in CoffeeScript, JavaScript #414

ervumlens opened this Issue Jul 12, 2015 · 1 comment


None yet
2 participants

Regular expression styling in CoffeeScript breaks in normal circumstances. JavaScript has a similar problem when working with very simple statements.

Komodo Edit, version 9.1.0, build 15798, platform linux-x86_64. Built on Sat May 30 05:22:08 2015.

CoffeeScript Code

value = "0"

#Ok (b/c in parens)
if (/\d+/.test value)
    console.log "1"

#Problem: Style is shifted b/c no parens and regex ends in +
if /\d+/.test value
    console.log "2"

#Same problem, regex ends in ? (probably other chars do this too)
if /\d\d?/.test value
    console.log "3"

#Problem: Style is absent b/c no parens and no magic char
if /(\d+)/.test value
    console.log "4"

#half wrong, half right
if /(\d+)/.test(value) || /(\d+)/.test(value)
    console.log "5"

CoffeeScript Screenshot

JavaScript Code

//Problem: no styling (no previous statements)

while (false) {}

//Problem: no styling (no trailing semicolon in line 10)

while (false) {};

//Ok: there is a semicolon at line 16

while (false) {}

//Ok: in parens
if (/c+/g.exec('abcccccdef')) {}

JavaScript Screenshot


This comment has been minimized.

Show comment
Hide comment

ervumlens Jul 12, 2015

JavaScript also has the "style drift" problem in the simple statements.


JavaScript also has the "style drift" problem in the simple statements.


@mitchell-as mitchell-as added this to the 9.2 milestone Jul 13, 2015

@mitchell-as mitchell-as self-assigned this Jul 13, 2015

@mitchell-as mitchell-as modified the milestones: 9.2.1, 9.2 Jul 13, 2015

mitchell-as added a commit that referenced this issue Aug 10, 2015

fix: Scintilla: Highlight JavaScript and CoffeeScript regex properly -
…fixes #414


(integrated from master branch change 9.2.1-214-g2768da4 by Mitchell <>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment