summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2012-01-20 11:29:33 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2012-01-20 11:29:33 +0000
commitb4cecff3775a783aea3fe72bf49c0359adb77cfb (patch)
tree5a8cf985dd29594cb3ced35cc6642b82d922e121
parent8fde28016c2d49e72b44545d4dffc2d6f3df67f9 (diff)
downloadnotepad2-mod-b4cecff3775a783aea3fe72bf49c0359adb77cfb.zip
notepad2-mod-b4cecff3775a783aea3fe72bf49c0359adb77cfb.tar.gz
notepad2-mod-b4cecff3775a783aea3fe72bf49c0359adb77cfb.tar.bz2
add AviSynth script highlighting
Patch by Bruno Barbieri [brunorex], updates in the keywords and a couple of other changes by me This commit fixes issue #58. git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@702 28bd50df-7adb-d945-0439-6e466c6a13cc
-rw-r--r--Readme-mod.txt5
-rw-r--r--build/makefile.deps.mak1
-rw-r--r--build/makefile.mak1
-rw-r--r--lexlink.js1
-rw-r--r--scintilla/include/SciLexer.h17
-rw-r--r--scintilla/include/Scintilla.iface23
-rw-r--r--scintilla/lexers/LexAVS.cxx308
-rw-r--r--scintilla/src/Catalogue.cxx1
-rw-r--r--src/Notepad2.c6
-rw-r--r--src/Notepad2.vcxproj1
-rw-r--r--src/Notepad2.vcxproj.filters3
-rw-r--r--src/Notepad2_icl12.vcxproj1
-rw-r--r--src/Notepad2_icl12.vcxproj.filters3
-rw-r--r--src/Styles.c91
-rw-r--r--src/Styles.h2
15 files changed, 459 insertions, 5 deletions
diff --git a/Readme-mod.txt b/Readme-mod.txt
index 61edf3c..4766b65 100644
--- a/Readme-mod.txt
+++ b/Readme-mod.txt
@@ -6,8 +6,8 @@ Notable changes:
* Support for bookmarks
* Option to mark all occurrences of a word
* Word auto-completion
-* Syntax highlighting support for AutoHotkey, AutoIt3, Bash, CMake,
- Inno Setup, LaTeX, Lua, NSIS, Ruby, and Tcl scripts
+* Syntax highlighting support for AutoHotkey, AutoIt3, AviSynth, Bash,
+ CMake, Inno Setup, LaTeX, Lua, NSIS, Ruby, and Tcl scripts
Supported Operating Systems:
* Windows 2000 (when compiled with WDK)
@@ -17,6 +17,7 @@ Contributors:
* Kai Liu
* RL Vision
* Aleksandar Lekov
+* Bruno Barbieri
More information:
* Source code and binaries: http://code.google.com/p/notepad2-mod/
diff --git a/build/makefile.deps.mak b/build/makefile.deps.mak
index b88a626..a821ae9 100644
--- a/build/makefile.deps.mak
+++ b/build/makefile.deps.mak
@@ -32,6 +32,7 @@ LEX_HEADERS = \
$(SCI_LEX_OBJDIR)\LexAHK.obj: $(SCI_LEX)\LexAHK.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexAsm.obj: $(SCI_LEX)\LexAsm.cxx $(LEX_HEADERS) $(SCI_LIB)\OptionSet.h
$(SCI_LEX_OBJDIR)\LexAU3.obj: $(SCI_LEX)\LexAU3.cxx $(LEX_HEADERS)
+$(SCI_LEX_OBJDIR)\LexAVS.obj: $(SCI_LEX)\LexAVS.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexBash.obj: $(SCI_LEX)\LexBash.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexCmake.obj: $(SCI_LEX)\LexCmake.cxx $(LEX_HEADERS)
$(SCI_LEX_OBJDIR)\LexConf.obj: $(SCI_LEX)\LexConf.cxx $(LEX_HEADERS)
diff --git a/build/makefile.mak b/build/makefile.mak
index fbdabd9..e6c4611 100644
--- a/build/makefile.mak
+++ b/build/makefile.mak
@@ -120,6 +120,7 @@ SCI_LEX_OBJ = \
$(SCI_LEX_OBJDIR)\LexAHK.obj \
$(SCI_LEX_OBJDIR)\LexAsm.obj \
$(SCI_LEX_OBJDIR)\LexAU3.obj \
+ $(SCI_LEX_OBJDIR)\LexAVS.obj \
$(SCI_LEX_OBJDIR)\LexBash.obj \
$(SCI_LEX_OBJDIR)\LexCmake.obj \
$(SCI_LEX_OBJDIR)\LexConf.obj \
diff --git a/lexlink.js b/lexlink.js
index 08820e8..f6a7df6 100644
--- a/lexlink.js
+++ b/lexlink.js
@@ -7,6 +7,7 @@
"lmAHK",
"lmAsm",
"lmAU3",
+ "lmAVS",
"lmBash",
"lmBatch",
"lmCmake",
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h
index 6371b97..15fb3e6 100644
--- a/scintilla/include/SciLexer.h
+++ b/scintilla/include/SciLexer.h
@@ -117,6 +117,7 @@
#define SCLEX_COFFEESCRIPT 102
#define SCLEX_TCMD 103
#define SCLEX_AHK 200
+#define SCLEX_AVS 201
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
@@ -1476,6 +1477,22 @@
#define SCE_AHK_WORD_UD 18
#define SCE_AHK_VARREFKW 19
#define SCE_AHK_ERROR 20
+#define SCE_AVS_DEFAULT 0
+#define SCE_AVS_COMMENTBLOCK 1
+#define SCE_AVS_COMMENTBLOCKN 2
+#define SCE_AVS_COMMENTLINE 3
+#define SCE_AVS_NUMBER 4
+#define SCE_AVS_OPERATOR 5
+#define SCE_AVS_IDENTIFIER 6
+#define SCE_AVS_STRING 7
+#define SCE_AVS_TRIPLESTRING 8
+#define SCE_AVS_STRINGEOL 9
+#define SCE_AVS_KEYWORD 10
+#define SCE_AVS_FILTER 11
+#define SCE_AVS_PLUGIN 12
+#define SCE_AVS_FUNCTION 13
+#define SCE_AVS_CLIPPROP 14
+#define SCE_AVS_USERDFN 15
#define SCE_A68K_DEFAULT 0
#define SCE_A68K_COMMENT 1
#define SCE_A68K_NUMBER_DEC 2
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index 8644564..d553cfe 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -2458,6 +2458,9 @@ val SCLEX_TCMD=103
## notepad2 custom code for the AHK lexer - start
val SCLEX_AHK=200
## notepad2 custom code for the AHK lexer - end
+## notepad2 custom code for the AVS lexer - start
+val SCLEX_AVS=201
+## notepad2 custom code for the AVS lexer - end
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
# value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -4004,6 +4007,26 @@ val SCE_AHK_WORD_UD=18
val SCE_AHK_VARREFKW=19
val SCE_AHK_ERROR=20
## notepad2 custom code for the AHK lexer - end
+## notepad2 custom code for the AVS lexer - start
+# Lexical states for SCLEX_AVS
+lex AVS=SCLEX_AVS SCE_AVS_
+val SCE_AVS_DEFAULT=0
+val SCE_AVS_COMMENTBLOCK=1
+val SCE_AVS_COMMENTBLOCKN=2
+val SCE_AVS_COMMENTLINE=3
+val SCE_AVS_NUMBER=4
+val SCE_AVS_OPERATOR=5
+val SCE_AVS_IDENTIFIER=6
+val SCE_AVS_STRING=7
+val SCE_AVS_TRIPLESTRING=8
+val SCE_AVS_STRINGEOL=9
+val SCE_AVS_KEYWORD=10
+val SCE_AVS_FILTER=11
+val SCE_AVS_PLUGIN=12
+val SCE_AVS_FUNCTION=13
+val SCE_AVS_CLIPPROP=14
+val SCE_AVS_USERDFN=15
+## notepad2 custom code for the AVS lexer - end
# Lexical states for SCLEX_A68K
lex A68k=SCLEX_A68K SCE_A68K_
val SCE_A68K_DEFAULT=0
diff --git a/scintilla/lexers/LexAVS.cxx b/scintilla/lexers/LexAVS.cxx
new file mode 100644
index 0000000..f925333
--- /dev/null
+++ b/scintilla/lexers/LexAVS.cxx
@@ -0,0 +1,308 @@
+// Scintilla source code edit control
+/** @file LexAVS.cxx
+ ** Lexer for AviSynth.
+ **/
+// Copyright 2012 by Bruno Barbieri <brunorex@gmail.com>
+// Heavily based on LexPOV by Neil Hodgson
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+static inline bool IsAWordChar(const int ch) {
+ return (ch < 0x80) && (isalnum(ch) || ch == '_');
+}
+
+static inline bool IsAWordStart(int ch) {
+ return isalpha(ch) || (ch != ' ' && ch != '\n' && ch != '(' && ch != '.' && ch != ',');
+}
+
+static inline bool IsANumberChar(int ch) {
+ // Not exactly following number definition (several dots are seen as OK, etc.)
+ // but probably enough in most cases.
+ return (ch < 0x80) &&
+ (isdigit(ch) || ch == '.' || ch == '-' || ch == '+');
+}
+
+static void ColouriseAvsDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *keywordlists[],
+ Accessor &styler) {
+
+ WordList &keywords = *keywordlists[0];
+ WordList &filters = *keywordlists[1];
+ WordList &plugins = *keywordlists[2];
+ WordList &functions = *keywordlists[3];
+ WordList &clipProperties = *keywordlists[4];
+ WordList &userDefined = *keywordlists[5];
+
+ int currentLine = styler.GetLine(startPos);
+ // Initialize the block comment nesting level, if we are inside such a comment.
+ int blockCommentLevel = 0;
+ if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) {
+ blockCommentLevel = styler.GetLineState(currentLine - 1);
+ }
+
+ // Do not leak onto next line
+ if (initStyle == SCE_AVS_STRINGEOL || initStyle == SCE_AVS_COMMENTLINE) {
+ initStyle = SCE_AVS_DEFAULT;
+ }
+
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ for (; sc.More(); sc.Forward()) {
+ if (sc.atLineEnd) {
+ // Update the line state, so it can be seen by next line
+ currentLine = styler.GetLine(sc.currentPos);
+ if (sc.state == SCE_AVS_COMMENTBLOCK || sc.state == SCE_AVS_COMMENTBLOCKN) {
+ // Inside a block comment, we set the line state
+ styler.SetLineState(currentLine, blockCommentLevel);
+ } else {
+ // Reset the line state
+ styler.SetLineState(currentLine, 0);
+ }
+ }
+
+ if (sc.atLineStart && (sc.state == SCE_AVS_STRING)) {
+ // Prevent SCE_AVS_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_AVS_STRING);
+ }
+
+ // Determine if the current state should terminate.
+ if (sc.state == SCE_AVS_OPERATOR) {
+ sc.SetState(SCE_AVS_DEFAULT);
+ } else if (sc.state == SCE_AVS_NUMBER) {
+ // We stop the number definition on non-numerical non-dot non-sign char
+ if (!IsANumberChar(sc.ch)) {
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AVS_KEYWORD);
+ } else if (filters.InList(s)) {
+ sc.ChangeState(SCE_AVS_FILTER);
+ } else if (plugins.InList(s)) {
+ sc.ChangeState(SCE_AVS_PLUGIN);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_AVS_FUNCTION);
+ } else if (clipProperties.InList(s)) {
+ sc.ChangeState(SCE_AVS_CLIPPROP);
+ } else if (userDefined.InList(s)) {
+ sc.ChangeState(SCE_AVS_USERDFN);
+ }
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_COMMENTBLOCK) {
+ if (sc.Match('/', '*')) {
+ blockCommentLevel++;
+ sc.Forward();
+ } else if (sc.Match('*', '/') && blockCommentLevel > 0) {
+ blockCommentLevel--;
+ sc.Forward();
+ if (blockCommentLevel == 0) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_AVS_COMMENTBLOCKN) {
+ if (sc.Match('[', '*')) {
+ blockCommentLevel++;
+ sc.Forward();
+ } else if (sc.Match('*', ']') && blockCommentLevel > 0) {
+ blockCommentLevel--;
+ sc.Forward();
+ if (blockCommentLevel == 0) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+ } else if (sc.state == SCE_AVS_COMMENTLINE) {
+ if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_STRING) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ChangeState(SCE_AVS_STRINGEOL);
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_TRIPLESTRING) {
+ if (sc.Match("\"\"\"")) {
+ sc.Forward();
+ sc.Forward();
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ } else if (sc.state == SCE_AVS_STRINGEOL) {
+ if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ } else if (sc.atLineEnd) {
+ sc.ForwardSetState(SCE_AVS_DEFAULT);
+ }
+ }
+
+
+ // Determine if a new state should be entered.
+ if (sc.state == SCE_AVS_DEFAULT) {
+ if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+ sc.SetState(SCE_AVS_NUMBER);
+ } else if (IsADigit(sc.ch) || (sc.ch == ',' && IsADigit(sc.chNext))) {
+ sc.Forward();
+ sc.SetState(SCE_AVS_NUMBER);
+ } else if (sc.Match('/', '*')) {
+ blockCommentLevel = 1;
+ sc.SetState(SCE_AVS_COMMENTBLOCK);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.Match('[', '*')) {
+ blockCommentLevel = 1;
+ sc.SetState(SCE_AVS_COMMENTBLOCKN);
+ sc.Forward(); // Eat the * so it isn't used for the end of the comment
+ } else if (sc.ch == '#') {
+ sc.SetState(SCE_AVS_COMMENTLINE);
+ } else if (sc.ch == '\"') {
+ if (sc.Match("\"\"\"")) {
+ sc.SetState(SCE_AVS_TRIPLESTRING);
+ } else {
+ sc.SetState(SCE_AVS_STRING);
+ }
+ } else if (isoperator(static_cast<char>(sc.ch))) {
+ sc.SetState(SCE_AVS_OPERATOR);
+ } else if (IsAWordStart(sc.ch)) {
+ sc.SetState(SCE_AVS_IDENTIFIER);
+ }
+ }
+ }
+
+ // End of file: complete any pending changeState
+ if (sc.state == SCE_AVS_IDENTIFIER) {
+ if (!IsAWordChar(sc.ch)) {
+ char s[100];
+ sc.GetCurrentLowered(s, sizeof(s));
+
+ if (keywords.InList(s)) {
+ sc.ChangeState(SCE_AVS_KEYWORD);
+ } else if (filters.InList(s)) {
+ sc.ChangeState(SCE_AVS_FILTER);
+ } else if (plugins.InList(s)) {
+ sc.ChangeState(SCE_AVS_PLUGIN);
+ } else if (functions.InList(s)) {
+ sc.ChangeState(SCE_AVS_FUNCTION);
+ } else if (clipProperties.InList(s)) {
+ sc.ChangeState(SCE_AVS_CLIPPROP);
+ } else if (userDefined.InList(s)) {
+ sc.ChangeState(SCE_AVS_USERDFN);
+ }
+ sc.SetState(SCE_AVS_DEFAULT);
+ }
+ }
+
+ sc.Complete();
+}
+
+static void FoldAvsDoc(
+ unsigned int startPos,
+ int length,
+ int initStyle,
+ WordList *[],
+ Accessor &styler) {
+
+ bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
+ bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
+ unsigned int endPos = startPos + length;
+ int visibleChars = 0;
+ int lineCurrent = styler.GetLine(startPos);
+ int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
+ int levelCurrent = levelPrev;
+ char chNext = styler[startPos];
+ int styleNext = styler.StyleAt(startPos);
+ int style = initStyle;
+
+ for (unsigned int i = startPos; i < endPos; i++) {
+ char ch = chNext;
+ chNext = styler.SafeGetCharAt(i + 1);
+ int stylePrev = style;
+ style = styleNext;
+ styleNext = styler.StyleAt(i + 1);
+ bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
+ if (foldComment && style == SCE_AVS_COMMENTBLOCK) {
+ if (stylePrev != SCE_AVS_COMMENTBLOCK) {
+ levelCurrent++;
+ } else if ((styleNext != SCE_AVS_COMMENTBLOCK) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (foldComment && style == SCE_AVS_COMMENTBLOCKN) {
+ if (stylePrev != SCE_AVS_COMMENTBLOCKN) {
+ levelCurrent++;
+ } else if ((styleNext != SCE_AVS_COMMENTBLOCKN) && !atEOL) {
+ // Comments don't end at end of line and the next character may be unstyled.
+ levelCurrent--;
+ }
+ }
+
+ if (style == SCE_AVS_OPERATOR) {
+ if (ch == '{') {
+ levelCurrent++;
+ } else if (ch == '}') {
+ levelCurrent--;
+ }
+ }
+
+ if (atEOL) {
+ int lev = levelPrev;
+ if (visibleChars == 0 && foldCompact)
+ lev |= SC_FOLDLEVELWHITEFLAG;
+ if ((levelCurrent > levelPrev) && (visibleChars > 0))
+ lev |= SC_FOLDLEVELHEADERFLAG;
+ if (lev != styler.LevelAt(lineCurrent)) {
+ styler.SetLevel(lineCurrent, lev);
+ }
+ lineCurrent++;
+ levelPrev = levelCurrent;
+ visibleChars = 0;
+ }
+
+ if (!isspacechar(ch))
+ visibleChars++;
+ }
+ // Fill in the real level of the next line, keeping the current flags as they will be filled in later
+ int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
+ styler.SetLevel(lineCurrent, levelPrev | flagsNext);
+}
+
+static const char * const avsWordLists[] = {
+ "Keywords",
+ "Filters",
+ "Plugins",
+ "Functions",
+ "Clip properties",
+ "User defined functions",
+ 0,
+};
+
+LexerModule lmAVS(SCLEX_AVS, ColouriseAvsDoc, "avs", FoldAvsDoc, avsWordLists);
diff --git a/scintilla/src/Catalogue.cxx b/scintilla/src/Catalogue.cxx
index 0f80126..4182ae4 100644
--- a/scintilla/src/Catalogue.cxx
+++ b/scintilla/src/Catalogue.cxx
@@ -91,6 +91,7 @@ int Scintilla_LinkLexers() {
//LINK_LEXER(lmASY);
LINK_LEXER(lmAU3);
//LINK_LEXER(lmAVE);
+ LINK_LEXER(lmAVS);
//LINK_LEXER(lmBaan);
LINK_LEXER(lmBash);
LINK_LEXER(lmBatch);
diff --git a/src/Notepad2.c b/src/Notepad2.c
index 54a3221..a7d137d 100644
--- a/src/Notepad2.c
+++ b/src/Notepad2.c
@@ -3405,6 +3405,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
case SCLEX_RUBY:
case SCLEX_POWERSHELL:
case SCLEX_CMAKE:
+ case SCLEX_AVS:
BeginWaitCursor();
EditToggleLineComments(hwndEdit,L"#",TRUE);
EndWaitCursor();
@@ -3467,6 +3468,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
case SCLEX_CSS:
case SCLEX_CPP:
case SCLEX_NSIS:
+ case SCLEX_AVS:
EditEncloseSelection(hwndEdit,L"/*",L"*/");
break;
case SCLEX_PASCAL:
@@ -6227,7 +6229,7 @@ void ParseCommandLine()
LocalFree(lpSchemeArg);
lpSchemeArg = NULL;
}
- iInitialLexer = 31;
+ iInitialLexer = 32;
flagLexerSpecified = 1;
break;
@@ -6236,7 +6238,7 @@ void ParseCommandLine()
LocalFree(lpSchemeArg);
lpSchemeArg = NULL;
}
- iInitialLexer = 32;
+ iInitialLexer = 33;
flagLexerSpecified = 1;
break;
diff --git a/src/Notepad2.vcxproj b/src/Notepad2.vcxproj
index 9711b04..0194add 100644
--- a/src/Notepad2.vcxproj
+++ b/src/Notepad2.vcxproj
@@ -185,6 +185,7 @@
<ClCompile Include="..\scintilla\lexers\LexAHK.cxx" />
<ClCompile Include="..\scintilla\lexers\LexAsm.cxx" />
<ClCompile Include="..\scintilla\lexers\LexAU3.cxx" />
+ <ClCompile Include="..\scintilla\lexers\LexAVS.cxx" />
<ClCompile Include="..\scintilla\lexers\LexBash.cxx" />
<ClCompile Include="..\scintilla\lexers\LexCmake.cxx" />
<ClCompile Include="..\scintilla\lexers\LexConf.cxx" />
diff --git a/src/Notepad2.vcxproj.filters b/src/Notepad2.vcxproj.filters
index 25d165e..32363d8 100644
--- a/src/Notepad2.vcxproj.filters
+++ b/src/Notepad2.vcxproj.filters
@@ -63,6 +63,9 @@
<ClCompile Include="..\scintilla\lexers\LexAU3.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
+ <ClCompile Include="..\scintilla\lexers\LexAVS.cxx">
+ <Filter>Scintilla\lexers</Filter>
+ </ClCompile>
<ClCompile Include="..\scintilla\lexers\LexBash.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
diff --git a/src/Notepad2_icl12.vcxproj b/src/Notepad2_icl12.vcxproj
index 754c6fc..e8cd278 100644
--- a/src/Notepad2_icl12.vcxproj
+++ b/src/Notepad2_icl12.vcxproj
@@ -227,6 +227,7 @@
<ClCompile Include="..\scintilla\lexers\LexAHK.cxx" />
<ClCompile Include="..\scintilla\lexers\LexAsm.cxx" />
<ClCompile Include="..\scintilla\lexers\LexAU3.cxx" />
+ <ClCompile Include="..\scintilla\lexers\LexAVS.cxx" />
<ClCompile Include="..\scintilla\lexers\LexBash.cxx" />
<ClCompile Include="..\scintilla\lexers\LexCmake.cxx" />
<ClCompile Include="..\scintilla\lexers\LexConf.cxx" />
diff --git a/src/Notepad2_icl12.vcxproj.filters b/src/Notepad2_icl12.vcxproj.filters
index bf4858d..1c7d557 100644
--- a/src/Notepad2_icl12.vcxproj.filters
+++ b/src/Notepad2_icl12.vcxproj.filters
@@ -63,6 +63,9 @@
<ClCompile Include="..\scintilla\lexers\LexAU3.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
+ <ClCompile Include="..\scintilla\lexers\LexAVS.cxx">
+ <Filter>Scintilla\lexers</Filter>
+ </ClCompile>
<ClCompile Include="..\scintilla\lexers\LexBash.cxx">
<Filter>Scintilla\lexers</Filter>
</ClCompile>
diff --git a/src/Styles.c b/src/Styles.c
index 9f23fcf..e6cd8d2 100644
--- a/src/Styles.c
+++ b/src/Styles.c
@@ -1572,6 +1572,96 @@ EDITLEXER lexCmake = { SCLEX_CMAKE, 63324, L"Cmake Script", L"cmake; ctest", L""
{ -1, 00000, L"", L"", L"" } } };
+KEYWORDLIST KeyWords_AVS = {
+"true false return global",
+"addborders alignedsplice amplify amplifydb animate applyrange assumebff assumefieldbased assumefps "
+"assumeframebased assumesamplerate assumescaledfps assumetff audiodub audiodubex avifilesource "
+"avisource bicubicresize bilinearresize blackmanresize blackness blankclip blur bob cache changefps "
+"colorbars colorkeymask coloryuv compare complementparity conditionalfilter conditionalreader "
+"convertaudio convertaudioto16bit convertaudioto24bit convertaudioto32bit convertaudioto8bit "
+"convertaudiotofloat convertbacktoyuy2 convertfps converttobackyuy2 converttomono converttorgb "
+"converttorgb24 converttorgb32 converttoy8 converttoyv16 converttoyv24 converttoyv411 converttoyuy2 "
+"converttoyv12 crop cropbottom delayaudio deleteframe dissolve distributor doubleweave duplicateframe "
+"ensurevbrmp3sync fadein fadein0 fadein2 fadeio fadeio0 fadeio2 fadeout fadeout0 fadeout2 fixbrokenchromaupsampling "
+"fixluminance fliphorizontal flipvertical frameevaluate freezeframe gaussresize generalconvolution "
+"getchannel getchannels getmtmode getparity grayscale greyscale histogram horizontalreduceby2 "
+"imagereader imagesource imagewriter info interleave internalcache internalcachemt invert killaudio "
+"killvideo lanczos4resize lanczosresize layer letterbox levels limiter loop mask maskhs max merge "
+"mergeargb mergechannels mergechroma mergeluma mergergb messageclip min mixaudio monotostereo normalize "
+"null opendmlsource overlay peculiarblend pointresize pulldown reduceby2 resampleaudio resetmask reverse "
+"rgbadjust scriptclip segmentedavisource segmenteddirectshowsource selecteven selectevery selectodd "
+"selectrangeevery separatefields setmtmode sharpen showalpha showblue showfiveversions showframenumber "
+"showgreen showred showsmpte showtime sincresize skewrows spatialsoften spline16resize spline36resize "
+"spline64resize ssrc stackhorizontal stackvertical subtitle subtract supereq swapfields swapuv "
+"temporalsoften timestretch tone trim turn180 turnleft turnright tweak unalignedsplice utoy utoy8 "
+"version verticalreduceby2 vtoy vtoy8 wavsource weave writefile writefileend writefileif writefilestart "
+"ytouv",
+"addgrain addgrainc agc_hdragc analyzelogo animeivtc asharp audiograph autocrop autoyuy2 avsrecursion "
+"awarpsharp bassaudiosource bicublinresize bifrost binarize blendfields blindpp blockbuster bordercontrol "
+"cfielddiff cframediff chromashift cnr2 colormatrix combmask contra convolution3d convolution3dyv12 "
+"dctfilter ddcc deblendlogo deblock deblock_qed decimate decomb dedup deen deflate degrainmedian depan "
+"depanestimate depaninterleave depanscenes depanstabilize descratch despot dfttest dgbob dgsource "
+"directshowsource distancefunction dss2 dup dupmc edeen edgemask ediupsizer eedi2 eedi3 eedi3_rpow2 "
+"expand faerydust fastbicubicresize fastbilinearresize fastediupsizer dedgemask fdecimate ffaudiosource "
+"ffdshow ffindex ffmpegsource ffmpegsource2 fft3dfilter fft3dgpu ffvideosource fielddeinterlace fielddiff "
+"fillmargins fity2uv fity2u fity2v fitu2y fitv2y fluxsmooth fluxsmoothst fluxsmootht framediff framenumber "
+"frfun3b frfun7 gicocu golddust gradfun2db grapesmoother greedyhma grid guavacomb hqdn3d hybridfupp "
+"hysteresymask ibob improvesceneswitch inflate inpand inpaintlogo interframe interlacedresize "
+"interlacedwarpedresize interleaved2planar iscombed iscombedt iscombedtivtc kerneldeint leakkernelbob "
+"leakkerneldeint limitedsharpen limitedsharpenfaster logic lsfmod lumafilter lumayv12 manalyse "
+"maskeddeinterlace maskedmerge maskedmix mblockfps mcompensate mctemporaldenoise mctemporaldenoisepp "
+"mdegrain1 mdegrain2 mdegrain3 mdepan medianblur mergehints mflow mflowblur mflowfps mflowinter minblur "
+"mipsmooth mmask moderatesharpen monitorfilter motionmask mpasource mpeg2source mrecalculate mscdetection "
+"msharpen mshow msmooth msu_fieldshiftfixer msu_frc msuper mt mt_adddiff mt_average mt_binarize mt_circle "
+"mt_clamp mt_convolution mt_deflate mt_diamond mt_edge mt_ellipse mt_expand mt_freeellipse mt_freelosange "
+"mt_freerectangle mt_hysteresis mt_infix mt_inflate mt_inpand mt_invert mt_logic mt_losange mt_lut mt_lutf "
+"mt_luts mt_lutspa mt_lutsx mt_lutxy mt_lutxyz mt_makediff mt_mappedblur mt_merge mt_motion mt_polish "
+"mt_rectangle mt_square mti mtsource multidecimate mvanalyse mvblockfps mvchangecompensate mvcompensate "
+"mvdegrain1 mvdegrain2 mvdegrain3 mvdenoise mvdepan mvflow mvflowblur mvflowfps mvflowfps2 mvflowinter "
+"mvincrease mvmask mvrecalculate mvscdetection mvshow nicac3source nicdtssource niclpcmsource nicmpasource "
+"nicmpg123source nnedi nnedi2 nnedi2_rpow2 nnedi3 nnedi3_rpow2 nomosmooth overlaymask peachsmoother pixiedust "
+"planar2interleaved qtgmc qtinput rawavsource rawsource reduceflicker reinterpolate411 removedirt removedust "
+"removegrain removegrainhd removetemporalgrain repair requestlinear reversefielddominance rgb3dlut rgdeinterlace "
+"rgsdeinterlace rgblut rotate sangnom seesaw sharpen2 showchannels showcombedtivtc smartdecimate smartdeinterlace "
+"smdegrain smoothdeinterlace smoothuv soothess soxfilter spacedust sshiq ssim ssiq stmedianfilter t3dlut tanisotropic "
+"tbilateral tcanny tcomb tcombmask tcpserver tcpsource tdecimate tdeint tedgemask telecide temporalcleaner "
+"temporalrepair temporalsmoother tfieldblank tfm tisophote tivtc tmaskblank tmaskedmerge tmaskedmerge3 tmm "
+"tmonitor tnlmeans tomsmocomp toon textsub ttempsmooth ttempsmoothf tunsharp unblock uncomb undot unfilter "
+"unsharpmask vaguedenoiser variableblur verticalcleaner videoscope vinverse vobsub vqmcalc warpedresize warpsharp "
+"xsharpen yadif yadifmod yuy2lut yv12convolution yv12interlacedreduceby2 yv12interlacedselecttopfields "
+"yv12layer yv12lut yv12lutxy yv12substract yv12torgb24 yv12toyuy2",
+"abs apply assert bool ceil chr clip continueddenominator continuednumerator cos default defined eval "
+"averagechromau averagechromav averageluma chromaudifference chromavdifference lumadifference "
+"exist exp findstr float floor frac hexvalue import int isbool isclip isfloat isint isstring lcase leftstr "
+"load_stdcall_plugin loadcplugin loadplugin loadvfapiplugin loadvirtualdubplugin log midstr muldiv nop "
+"opt_allowfloataudio opt_avipadscanlines opt_dwchannelmask opt_usewaveextensible opt_vdubplanarhack "
+"pi pow rand revstr rightstr round scriptdir scriptfile scriptname select setmemorymax setplanarlegacyalignment "
+"rgbdifference rgbdifferencefromprevious rgbdifferencetonext udifferencefromprevious udifferencetonext "
+"setworkingdir sign sin spline sqrt string strlen time ucase undefined value versionnumber versionstring "
+"uplanemax uplanemedian uplanemin uplaneminmaxdifference vdifferencefromprevious vdifferencetonext "
+"vplanemax vplanemedian vplanemin vplaneminmaxdifference ydifferencefromprevious ydifferencetonext "
+"yplanemax yplanemedian yplanemin yplaneminmaxdifference",
+"audiobits audiochannels audiolength audiolengthf audiorate framecount framerate frameratedenominator "
+"frameratenumerator getleftchannel getrightchannel hasaudio hasvideo height isaudiofloat isaudioint "
+"isfieldbased isframebased isinterleaved isplanar isrgb isrgb24 isrgb32 isyuv isyuy2 isyv12 width",
+"", "", "", "" };
+
+EDITLEXER lexAVS = { SCLEX_AVS, 63332, L"AviSynth Script", L"avs; avsi", L"", &KeyWords_AVS, {
+ { STYLE_DEFAULT, 63126, L"Default", L"", L"" },
+ //{ SCE_AVS_DEFAULT, L"Default", L"", L"" },
+ { MULTI_STYLE(SCE_AVS_COMMENTLINE,SCE_AVS_COMMENTBLOCK,SCE_AVS_COMMENTBLOCKN,0), 63127, L"Comment", L"fore:#008000", L"" },
+ { SCE_AVS_OPERATOR, 63132, L"Operator", L"", L"" },
+ { MULTI_STYLE(SCE_AVS_STRING,SCE_AVS_TRIPLESTRING,SCE_AVS_STRINGEOL,0), 63131, L"String", L"fore:#7F007F", L"" },
+ { SCE_AVS_NUMBER, 63130, L"Number", L"fore:#007F7F", L"" },
+ { SCE_AVS_KEYWORD, 63334, L"Keywords", L"fore:#00007F; bold", L"" },
+ { SCE_AVS_FILTER, 63335, L"Filter", L"fore:#00007F; bold", L"" },
+ { SCE_AVS_PLUGIN, 63336, L"Plugin", L"fore:#0080C0; bold", L"" },
+ { SCE_AVS_FUNCTION, 63277, L"Function", L"fore:#007F7F", L"" },
+ { SCE_AVS_CLIPPROP, 63337, L"Clip property", L"fore:#00007F", L"" },
+ //{ SCE_AVS_USERDFN, 63106, L"User Defined", L"fore:#8000FF", 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!
@@ -1579,6 +1669,7 @@ PEDITLEXER pLexArray[NUMLEXERS] =
{
&lexDefault,
&lexANSI,
+ &lexAVS,
&lexCONF, //Apache Config Scripts
&lexASM,
&lexAHK,
diff --git a/src/Styles.h b/src/Styles.h
index 0d79d4d..496effc 100644
--- a/src/Styles.h
+++ b/src/Styles.h
@@ -55,7 +55,7 @@ typedef struct _editlexer
// Number of Lexers in pLexArray
-#define NUMLEXERS 33
+#define NUMLEXERS 34
void Style_Load();