John,<div>You can use a Matlab lexer from JuffEd project: <a href="http://juffed.svn.sourceforge.net/viewvc/juffed/0.9/src/app/qsci/lexers/my/">http://juffed.svn.sourceforge.net/viewvc/juffed/0.9/src/app/qsci/lexers/my/</a></div>
<div><br></div><div><a href="http://juffed.svn.sourceforge.net/viewvc/juffed/0.9/src/app/qsci/lexers/my/"></a>Phil,</div><div>Feel free to include it in QScintilla.</div><div><br></div><div>--<br clear="all">Best regards,<br>
Mikhail.<br>
<br><br><div class="gmail_quote">On Wed, Apr 13, 2011 at 1:51 PM, John Swensen <span dir="ltr"><<a href="mailto:jpswensen@gmail.com">jpswensen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
On Apr 13, 2011, at 1:13 PM, Phil Thompson wrote:<br>
<br>
> On Wed, 13 Apr 2011 11:44:11 -0400, John Swensen <<a href="mailto:jpswensen@gmail.com">jpswensen@gmail.com</a>><br>
> wrote:<br>
>> I am looking at using the QScintilla package for the editor component of<br>
>> an IDE for GNU Octave. I see there is a lexer for Matlab, but am<br>
> wondering<br>
>> if something hasn't been completed yet. For almost every language, I<br>
> see<br>
>> both a Lex<NAMEOFLANGUAGE>.cpp file in the lexer directory and a<br>
>> corresponding qscilexer<NAMEOFLANGUAGE>.cpp file in the Qt4 directory.<br>
>> However, there is no qscimatlab.cpp file. Do I need to create a<br>
>> qscimatlab.cpp file, following the pattern of some of the other<br>
> languages,<br>
>> to have Matlab syntax support or is there some other way to get the<br>
> Matlab<br>
>> lexer working? I see that the Matlab lexer is linked in by looking at<br>
>> src/Catalogue.cpp and that when building inside Qt4 there is a<br>
> LexMatlab.o<br>
>> file after the build completes, but I can't figure out how to use the<br>
>> lexer.<br>
><br>
> High-level support for lexers is added when requested - nobody has asked<br>
> for Matlab before.<br>
><br>
> You can still use the low-level support (the high-level support mainly<br>
> just manages the lexer configuration).<br>
><br>
> Phil<br>
<br>
</div></div>Makes sense. I will try to get the higher level lexer class for Matlab/Octave done and contribute it back to the project. That issue aside, I am still having problems getting QScintilla to highlight even using the low-level support. I added the following to the constructor of the MainWindow class for the example-Qt4 project after the textEdit object has been created.<br>
<br>
textEdit->SendScintilla (QsciScintillaBase::SCI_SETLEXERLANGUAGE, "octave");<br>
// Also tried this, but it didn't work either<br>
//textEdit->SendScintilla (QsciScintillaBase::SCI_SETLEXER, QsciScintillaBase::SCLEX_MATLAB);<br>
<br>
textEdit->SendScintilla (QsciScintillaBase::SCI_SETKEYWORDS, "for if end");<br>
<br>
It did not syntax highlight an m-file when I opened it. So, I tried putting it in the loadFile() method of the MainWindow in the example, think that maybe you had to set the lexer after the file was opened. It still didn't work. Sorry to be such a noob, but is there something I am missing that will tell the lexer to start lexing? I took a look at the setLexer method of the QsciScintilla class and couldn't see anything that my simple code was missing, but am clearly wrong somehow.<br>
<font color="#888888"><br>
John<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
QScintilla mailing list<br>
<a href="mailto:QScintilla@riverbankcomputing.com">QScintilla@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/qscintilla" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/qscintilla</a><br>
</div></div></blockquote></div><br></div>