The syntax highlighting of MATLAB files is sometimes broken. In these cases the ends are not identified correctly and the autoformatting feature is indenting everything. If one types a letter, the bug disappears.
It happens to be related to declarations like
var = {'string1', ...
'string2', ...
'string3'};
It seems that this is related to the length of the file. The lexer doesn't always start from the very first position therefore sometimes not everything is styled incorrectly. A possible solution would be to modify the following line in wxWidgets-3.0.2\src\stc\scintilla\lexers\LexMatlab.cxx:
static void ColouriseMatlabOctaveDoc(
unsigned int startPos, int length, int initStyle,
WordList *keywordlists[], Accessor &styler,
bool (*IsCommentChar)(int)) {
WordList &keywords = *keywordlists[0];
WordList &keywords2 = *keywordlists[1];
// make startPos = 0
styler.StartAt(startPos);
bool transpose = false;
StyleContext sc(startPos, length, initStyle, styler);
int nParens = 0;
StyleContext class was changed to 0. To apply this fix, you have to copy the lexer file to the source directory of wxStyledTextCtrl and rebuild the library.This fix was tested manually. No deviation occured.
Anonymous
Diff:
Diff:
Diff:
Related
Commit: [r366]
Diff: