Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
Add support for Matlab.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 9, 2014
1 parent e4f7485 commit ce398e2
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Readme-mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Notable changes:
* Option to mark all occurrences of a word
* Word auto-completion
* Syntax highlighting support for AutoHotkey, AutoIt3, AviSynth, Bash,
CMake, Inno Setup, LaTeX, Lua, Markdown, NSIS, Ruby, Tcl, YAML and VHDL scripts
CMake, Inno Setup, LaTeX, Lua, Markdown, MATLAB, NSIS, Ruby, Tcl, YAML and VHDL scripts
* Improved support for NFO ANSI art
* Support for replacing Windows Notepad using a clean, unintrusive registry-based method
* Other various minor changes and tweaks
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _A modified version (fork) of Notepad2 based on Kai Liu's and other people's pat
* Option to mark all occurrences of a word
* Word auto-completion
* Syntax highlighting support for AutoHotkey, AutoIt3, AviSynth, Bash, CMake, Inno Setup,
LaTeX, Lua, Markdown, NSIS, Ruby, Tcl, YAML and VHDL scripts
LaTeX, Lua, Markdown, MATLAB, NSIS, Ruby, Tcl, YAML and VHDL scripts
* Improved support for NFO ANSI art
* Support for replacing Windows Notepad using a clean, unintrusive registry-based method
* Other various minor changes and tweaks
Expand Down
1 change: 1 addition & 0 deletions build/makefile.deps.mak
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ $(SCI_LEX_OBJDIR)\LexInno.obj: $(SCI_LEX)\LexInno.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexLua.obj: $(SCI_LEX)\LexLaTeX.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexLua.obj: $(SCI_LEX)\LexLua.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexMarkdown.obj: $(SCI_LEX)\LexMarkdown.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexMatlab.obj: $(SCI_LEX)\LexMatlab.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexNsis.obj: $(SCI_LEX)\LexNsis.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexOthers.obj: $(SCI_LEX)\LexOthers.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexPascal.obj: $(SCI_LEX)\LexPascal.cxx $(LEX_HEADERS)
Expand Down
1 change: 1 addition & 0 deletions build/makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ SCI_LEX_OBJ = \
$(SCI_LEX_OBJDIR)\LexLaTeX.obj \
$(SCI_LEX_OBJDIR)\LexLua.obj \
$(SCI_LEX_OBJDIR)\LexMarkdown.obj \
$(SCI_LEX_OBJDIR)\LexMatlab.obj \
$(SCI_LEX_OBJDIR)\LexNsis.obj \
$(SCI_LEX_OBJDIR)\LexOthers.obj \
$(SCI_LEX_OBJDIR)\LexPascal.obj \
Expand Down
1 change: 1 addition & 0 deletions lexlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lmLua",
"lmMake",
"lmMarkdown",
"lmMatlab",
"lmNsis",
"lmNull",
"lmPascal",
Expand Down
1 change: 1 addition & 0 deletions scintilla/Scintilla.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
<ClCompile Include="lexers\LexLaTeX.cxx" />
<ClCompile Include="lexers\LexLua.cxx" />
<ClCompile Include="lexers\LexMarkdown.cxx" />
<ClCompile Include="lexers\LexMatlab.cxx" />
<ClCompile Include="lexers\LexNsis.cxx" />
<ClCompile Include="lexers\LexOthers.cxx" />
<ClCompile Include="lexers\LexPascal.cxx" />
Expand Down
3 changes: 3 additions & 0 deletions scintilla/Scintilla.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<ClCompile Include="lexers\LexMarkdown.cxx">
<Filter>lexers</Filter>
</ClCompile>
<ClCompile Include="lexers\LexMatlab.cxx">
<Filter>lexers</Filter>
</ClCompile>
<ClCompile Include="lexers\LexNsis.cxx">
<Filter>lexers</Filter>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion scintilla/src/Catalogue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int Scintilla_LinkLexers() {
//LINK_LEXER(lmMagikSF);
LINK_LEXER(lmMake);
LINK_LEXER(lmMarkdown);
//LINK_LEXER(lmMatlab);
LINK_LEXER(lmMatlab);
//LINK_LEXER(lmMETAPOST);
//LINK_LEXER(lmMMIXAL);
//LINK_LEXER(lmModula);
Expand Down
8 changes: 6 additions & 2 deletions src/Notepad2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
EndWaitCursor();
break;
case SCLEX_LATEX:
case SCLEX_MATLAB:
BeginWaitCursor();
EditToggleLineComments(hwndEdit,L"%",TRUE);
EndWaitCursor();
Expand Down Expand Up @@ -3484,6 +3485,9 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
break;
case SCLEX_LUA:
EditEncloseSelection(hwndEdit,L"--[[",L"]]");
break;
case SCLEX_MATLAB:
EditEncloseSelection(hwndEdit,L"%{",L"%}");
}
break;

Expand Down Expand Up @@ -6244,7 +6248,7 @@ void ParseCommandLine()
LocalFree(lpSchemeArg);
lpSchemeArg = NULL;
}
iInitialLexer = 33;
iInitialLexer = 34;
flagLexerSpecified = 1;
break;

Expand All @@ -6253,7 +6257,7 @@ void ParseCommandLine()
LocalFree(lpSchemeArg);
lpSchemeArg = NULL;
}
iInitialLexer = 34;
iInitialLexer = 35;
flagLexerSpecified = 1;
break;

Expand Down
22 changes: 22 additions & 0 deletions src/Styles.c
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,7 @@ EDITLEXER lexYAML = { SCLEX_YAML, 63355, L"YAML", L"yaml; yml", L"", &KeyWords_Y
{ SCE_YAML_OPERATOR, 63132, L"Operator", L"fore:#333366", L"" },
{ -1, 00000, L"", L"", L"" } } };


KEYWORDLIST KeyWords_VHDL = {
"access after alias all architecture array assert attribute begin block body buffer bus case component configuration "
"constant disconnect downto else elsif end entity exit file for function generate generic group guarded if impure in "
Expand Down Expand Up @@ -2428,6 +2429,26 @@ EDITLEXER lexVHDL = { SCLEX_VHDL, 63370, L"VHDL", L"vhdl; vhd", L"", &KeyWords_V
{ SCE_VHDL_STDTYPE, 63375, L"Standard type", L"fore:#FF8000", L"" },
{ -1, 00000, L"", L"", L"" } } };


KEYWORDLIST KeyWords_MATLAB = {
"break case catch continue else elseif end for function global if otherwise "
"persistent return switch try while",
"", "", "", "", "", "", "", "" };


EDITLEXER lexMATLAB = { SCLEX_MATLAB, 63360, L"MATLAB", L"matlab", L"", &KeyWords_MATLAB, {
{ STYLE_DEFAULT, 63126, L"Default", L"", L"" },
//{ SCE_MATLAB_DEFAULT, L"Default", L"", L"" },
{ SCE_MATLAB_COMMENT, 63127, L"Comment", L"fore:#008000", L"" },
{ SCE_MATLAB_COMMAND, 63236, L"Command", L"bold", L"" },
{ SCE_MATLAB_NUMBER, 63130, L"Number", L"fore:#FF8000", L"" },
{ SCE_MATLAB_KEYWORD, 63128, L"Keyword", L"fore:#00007F; bold", L"" },
{ MULTI_STYLE(SCE_MATLAB_STRING,SCE_MATLAB_DOUBLEQUOTESTRING,0,0), 63131, L"String", L"fore:#7F007F", L"" },
{ SCE_MATLAB_OPERATOR, 63132, L"Operator", L"", L"" },
{ SCE_MATLAB_IDENTIFIER, 63129, L"Identifier", L"", L"" },
{ -1, 00000, L"", L"", L"" } } };


// This array holds all the lexers...
// Don't forget to change the number of the lexer for HTML and XML
// in Notepad2.c ParseCommandLine() if you change this array!
Expand All @@ -2452,6 +2473,7 @@ PEDITLEXER pLexArray[NUMLEXERS] =
&lexJS,
&lexMAK,
&lexMARKDOWN,
&lexMATLAB,
&lexLATEX,
&lexLUA,
&lexNSIS,
Expand Down

0 comments on commit ce398e2

Please sign in to comment.