Open zhiboz opened 12 years ago
Sorry for the late reply, I totally missed the notification.
If Scintilla supports it and someone provides the keywords I could add it I guess. Although I don't use MATLAB at all so I need some good code samples to check if everything works.
You can't attach anything on GitHub. So use the webform and upload the files somewhere easily accessible.
You may get a copy from http://www.mathworks.com/matlabcentral/fileexchange/8550 . Thanks!
Please try this build and let me know.
Keep in mind that I don't use Matlab myself so there might be things that should be different. The code changes are in the Matlab branch here.
Also the lexer itself which comes from Scintilla seem a little limited, for example it doesn't highlight block comments properly when I use %{...%}
, but from what I read this should be supported.
I cannot do that because .m
files are associated to open with the C/C++ lexer. I'm pretty sure there is another way to solve this apart from removing .m
files from the C/C++ filelist, but unfortunately I have no idea how to do this at this point.
I didn't mean supported in Scintilla, since I know it's not... I mean that in general %{...%}
is a block comment in Matlab.
Anyway, not sure what I'm going to do with this patch since like I said above m
files are associated with the C/C++ lexer.
The matlab branch is up to date, but I still don't know if I should merge this.
If anyone is interested to work on this, they are more than welcome to do so.
Block comments are properly detected now with the updated Scintilla.
Great news, very much appreciated! Any plan to merge this into the master branch?
I cannot solve the issue with .m
files. Please leave this ticket open until the patch is merged.
Another thing I noticed.
M = regexp(str, {'(?-i)\w{5}(?=CASE)', ...
'(?i)\w{5}(?=CASE)'}, 'match');
M{:}
ans =
'UPPER'
ans =
'UPPER' 'lower'
break
If I comment out
M = regexp(str, {'(?-i)\w{5}(?=CASE)', ...
'(?i)\w{5}(?=CASE)'}, 'match');
M{:}
%{ans =
'UPPER'%}
ans =
'UPPER' 'lower'
break
It shows as if it's commented out until the end. But this is a Scintilla issue.
MATLAB editor handles it this way too. It works if you put %} into a separate line as below.
M{:} %{ ans = 'UPPER' %} ans = 'UPPER' 'lower' break
So does this mean that the code isn't commented out unless %}
is in a new line?
M{:} %{ans = 'UPPER'%} ans = 'UPPER' 'lower' break
I meant at least that the MATLAB editor shows the above code as if it's commented out until the end.
Yes I got that, but does it work as expected? If yes then their editor has the same issue or the specs must say that the it must be in a new line.
Yes, I believe the document says the opening and closing of the comment blocks have to be in their own lines.
That's too bad cause I can't fix it properly at this point. I mean I can easily add a new line, but I need to take account for the document's line endings.
I'll add this in the PR's todo.
Thanks very much for your extra efforts! Any chance you could put a x64 build somewhere? I only have VS2010 Express and can not compile np2-mod with it any more.
I added the VS2010 scripts and stuff back.
I want a x86 Notepad2 copy supported MATLAB too. Can you send me a copy please? my email is konguo#gmail.com (please replace # with @)
No, sorry. You can see #36 and help me fix the TODO issues; then it will be merged in the master branch.
Your previous link is dead. Here is my personal build with MATLAB support (link removed per XhmikosR request)
Basically I rebased the matlab
branch on top of master
, and merged it. Then I built the solution using VS2013 Update 3 (both x86/x64).
I had to fix a minor bug in src/Styles.h
, your forgot to increment the number of lexers in a macro: s/#define NUMLEXERS 37/#define NUMLEXERS 38/
The stream comment bug discussed is obviously still there (someone ought to fix the MATLAB lexer in upstream Scintilla). I think it's a minor thing and I can live with it for the moment... Better than having no MATLAB support at all :)
If anyone is interested in working on fixing the bug, here are the doc pages for the "block comment" construct: http://www.mathworks.com/help/matlab/matlab_prog/comments.html http://www.mathworks.com/help/matlab/ref/specialcharacters.html#bqwxykj-1
@amroamroamro: please don't distribute random builds.
If you want to help, you can help by fixing the TODOs from #36.
@XhmikosR: Fair enough. Do you want me to remove the link?
I was just trying to give a quick solution for those who dont have the necessary dev tools installed...
That is not a quick solution. The patch isn't ready; if it was, it would have been merged. So, yeah, please remove any links.
can someone try the build from https://github.com/zufuliu/notepad2/releases?
@zufuliu: you could rebase my branch and make any changes there and submit a PR where you CC me.
MATLAB is gaining its popularity among engineering professionals and students; Its creator, MathWorks, claims that it has over 2 million users worldwide. Is it possible for you to add support for MATLAB please? Thanks very much!