I'm trying to add syntax highlighting for a new language.
``` # single comments, like # in this file comment_single=# # multiline comments comment_open=#~ comment_close=~# ```
The above is not working. For a single line comment, it will only highlight the first word but not the whole line, e.g: `# foo bar` then it will only highlight `# foo` but not `bar`. For multiline comment, the closing block `~#` is not highlighted.
I copied filetypes.csharp and modify it to create my own filetypes.foo.conf.
These settings have nothing to do with highlighting. Highlighting is determined by the Lexilla lexer selected by the filetype. See the manual for making a custom filetype based on an existing filetype lexer if your language is close enough, otherwise you will need to create a new Lexer, see the Lexilla project.
Then I will have to dive into C++? The language is almost the same as C#, the only different is it use different way to comments.
Well try the C# filetype and see if its "good enough" otherwise you indeed will need to adjust the lexer code.
The way to comment is different to C language family: # for single line comment and #~ for opening and ~# for closing multiline comment.
Well then you will have to make a new lexer by changing the nearest one. Lexers are for identifying lexical entities in a specific programming language and since comment formats don't change often in an established language AFAIK all lexers hard code the comment formats for their language.
github-comments@lists.geany.org