atom / language-coffee-script

CoffeeScript support in Atom
Other
59 stars 56 forks source link

Indexing an array with a function application breaks syntax highlighting #163

Closed nathancarter closed 7 years ago

nathancarter commented 7 years ago

Description

In literate mode, indexing an array with a function application (using a space, not parentheses, to apply the function) breaks syntax highlighting, as shown below.

Steps to Reproduce

  1. Create a new file.
  2. Save it with the .litcoffee extension.
  3. Enter the code below.

    
    Comments, highlighted correctly.
    
    array[func arg]

Comments, highlighted as if they were code.



**Expected behavior:** Text without indentation should always be treated and highlighted as Markdown, never mistaken for Coffeescript code.  GitHub highlights it incorrectly as well, as you can see immediately above.

**Actual behavior:** The following screenshot shows that the syntax highlighter has begun to treat unindented code as if it were Coffeescript code.

![screen shot 2017-10-30 at 4 44 51 pm](https://user-images.githubusercontent.com/1316622/32194813-d76b6092-bd91-11e7-870c-189ed43130ce.png)

**Reproduces how often:** 100%

### Versions

Atom    : 1.21.0

Electron: 1.6.9

Chrome  : 56.0.2924.87

Node    : 7.4.0

Mac OS X 10.11.6