5

I have Notepad++ version 6.1.8 How can I configure it to highlight the matlab multiline comment %{ ... %} as a comment block?

---EDIT---

I read here that this feature was added to Notepad++ in April, so I downloaded the latest Notepad++ (6.4.5) and installed it over my older 6.1 version, but it still does not highlight Matlab block comments. What should I do to get this feature working?

user13267
  • 1,873

2 Answers2

2

Changing the default line in the file langs.model.xml to <Language name="matlab" ext="m" commentLine="%" commentStart="%{" commentEnd="%}"> will do the trick. But it is not going to work because notepad++ shall match the % in %{ as the start of a single line comment and not try to match it for a multiline comment. The same goes of %}

Sorry to provide you a solution that is not going to work :-/

Lord Loh.
  • 1,034
2

Notepad++ is based on the Scintilla code editing component, so that's the part of the application you'll need to update. I had a quick look through the source code, and found that the main reason is that the LexMatlab.cxx file only contains code to handle inline comments, not block comments.

I've submitted a patch to the Scintilla SourceForge project, so it should be fixed soon with regards to Scintilla. As I mentioned in the comments, I'm having trouble compiling the Scintilla bundled with Notepad++, so unless I can get that going, you'll likely have to wait until NPP's next version is released (which should include an updated Scintilla).

Breakthrough
  • 34,847