zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.4k stars 1.16k forks source link

Broken Rust raw string literal highlighting #3191

Closed Andriamanitra closed 3 months ago

Andriamanitra commented 3 months ago

Description of the problem

When a Rust source file has a raw string literal it needs to start and end with the same number of '#' characters. The syntax definition does not currently check this, so for example micro fails to highlight this piece of code properly because there is "# inside the string:

let ruby_code = r##"
greeting = "hello"
puts "#{greeting} world"
"##;

The issue is caused by these lines:

https://github.com/zyedidia/micro/blob/c64add289b396b35f790c5b20b9db9c750fb1706/runtime/syntax/rust.yaml#L31-L34