Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.

#364 Improper Syntax Highlighting - Matlab files

Interface (176)

Geany 0.18 does not properly highlight strings in Matlab .m files, if the string ends with "\" (backslash) , such as path names under Win32.

How to reproduce:

1. Open new document in Geany.
2. Select Matlab syntax highlighting.
3. Use the following snippet, or the attached document:


The expected result is to see only the strings (between the quotes) highlighted. However, Geany seem to interpret the backslash incorrectly, and the highlighting continue on the next line. Two backslashes, however, work properly.

Geany version: 0.18, official Win32 binary.
GTK+ version:
OS: Windows XP SP3


  • Martin Tapankov

    Martin Tapankov - 2009-08-31

    Improper Syntax Highlighting - .m files

  • Enrico Tröger

    Enrico Tröger - 2009-09-01

    I don't know Matlab at all but in many other languages a backslash is used as an escape character. If this is also true for Matlab, then the following quote character is escaped, so it would appear literally in the string and then also the highlighting behaviour is correct.

    But as I said, I don't know Matlab.

    After all, this is not strictly a Geany bug (if at all) but a Scintilla bug. Scintilla is the editing component we use in Geany. It be nice if you would report this (if it is a bug) to the Scintilla project. Use this link:


  • Martin Tapankov

    Martin Tapankov - 2009-09-01

    You are right that in Geany it's treated as an escape character, I figured that myself later after I sent the bug report. But not in Matlab - I have similar code in a script I've written, and it's working properly there. without the string character being escaped.

    I'll see to that the issue is reported on Scintilla's bugtracker (thanks for the link), if I am able to reproduce it in Scintilla as well (not in Geany's Scintilla).

    Thanks for the attention, and keep up the good work. :)

  • Enrico Tröger

    Enrico Tröger - 2009-09-01

    As I said, I don't know Matlab :).

    I just tested it in Scite (the Scintilla sample implementation editor) and it behaves like Geany. So I assume it's a bug in the Scintilla lexer. If you found a link to an existing report or open a new report, just drop a link here for reference. Thanks.


Log in to post a comment.