MarioRicalde / SCSS.tmbundle

The TextMate SCSS Official Bundle. Now Compatible with SublimeText2.
836 stars 110 forks source link

Syntax highlighting (mostly in maps) is strange #186

Open djfarly opened 9 years ago

djfarly commented 9 years ago

Maps are defined as:

$map: (key1: value1, key2: value2, key3: value3);

I'm experiencing are a few issues with their syntax highlighting in sublime 3. Sublime 3 - Syntax highlighting in maps

$map: (
    // comments are not recognized
    key1: value1,
    key-two: value2, 
    text-key: value-three, /*multiline comments aren't as well*/
    another-key: some-value
);

From what I can tell the above code is compiled correctly... highlighting does not suggest it does...

I imagine finding string when there are no delimiters like ", ' is pretty hard if not impossible? Also I am not 100% sure if my scss syntax correct... :)

Cheers, jan

ghost commented 9 years ago

Would love to see this feature as well, mostly concerned with map keys being highlighted the same.

acarnwath commented 6 years ago

This has driven me crazy for quite some time - the following map gets all sorts of crazy highlighting, and anything after it is also affected. In the meantime, I switched over to the Sass plugin using the SCSS highlighting - it handles this issue fine.

screen shot 2018-04-05 at 11 10 49 am
$encoding-reference: (
  //('%','%25'),  // Encode "%" first, otherwise the "%" from encoded code would be encoded again (which would be bad)
  ('<','%3C'),
  ('>','%3E'),
  //('"','%22'),  // Replace " with ' because that's shorter than %22 and normally working
  ('"','\''),
  ('#','%23'),
  ('&','%26')
  // Here are a few more characters you could encode
  //(' ','%20'),
  //('!','%21'),
  //('$','%24'),
  //(',','%27'),
  //('(','%28'),
  //(')','%29'),
  //('*','%2A'),
  //('+','%2B'),
  //('"','%2C'),
  //('/','%2F'),
  //(':','%3A'),
  //(';','%3B'),
  //('=','%3D'),
  //('?','%3F'),
  //('@','%40'),
  //('[','%5B'),
  //(']','%5D'),
  //('^','%5E'),
  //('`','%60'),
  //('{','%7B'),
  //('|','%7C'),
  //('}','%7D'),
  //('~','%7E'),
  //(',','%E2%80%9A'),
  //('\\','%5C'),
  //('_','%5F'),
  //('-','%2D'),
  //('.','%2E'),
  // ('\','%5C'),
  // (' ','%7F'),
  // ('`','%E2%82%AC'),
  //('ƒ','%C6%92'),
  //('„','%E2%80%9E'),
  //('…','%E2%80%A6'),
  //('†','%E2%80%A0'),
  //('‡','%E2%80%A1'),
  //('ˆ','%CB%86')
);