#364 Improper Syntax Highlighting - Matlab files

open
nobody
Interface (176)
5
2009-08-31
2009-08-31
Martin Tapankov
No

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:

foo='bar\';
goo='baz\';

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: 2.16.4.0
OS: Windows XP SP3

Discussion

  • Improper Syntax Highlighting - .m files

     
    Attachments
  • 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:
    https://sourceforge.net/tracker/?func=add&group_id=2439&atid=102439

    Thanks.

     
  • 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.