--- a\np2src\Notepad2.dsp Sun Jan 25 10:28:46 2009 +++ b\np2src\Notepad2.dsp Sun Jan 25 10:35:29 2009 @@ -228,8 +228,14 @@ SOURCE=.\scintilla\src\KeyWords.cxx # End Source File # Begin Source File SOURCE=.\scintilla\src\LexAsm.cxx # End Source File +# Begin Source File +SOURCE=.\scintilla\src\LexAU3.cxx +# End Source File +# Begin Source File +SOURCE=.\scintilla\src\LexBash.cxx +# End Source File # Begin Source File SOURCE=.\scintilla\src\LexConf.cxx # End Source File # Begin Source File --- a\np2src\Notepad2.vcproj Sat Jan 24 00:00:00 2009 +++ b\np2src\Notepad2.vcproj Sun Jan 25 10:35:46 2009 @@ -319,8 +319,14 @@ + + + + iLexer != SCLEX_NULL) + // A null lexer w/ only 1 entry is just trying to override the default font + if (pLexNew->iLexer != SCLEX_NULL || pLexNew->Styles[1].iStyle == -1) Style_SetStyles(hwnd,pLexNew->Styles[0].iStyle,pLexNew->Styles[0].szValue); // lexer default SendMessage(hwnd,SCI_STYLECLEARALL,0,0); Style_SetStyles(hwnd,lexDefault.Styles[1+iIdx].iStyle,lexDefault.Styles[1+iIdx].szValue); // linenumber @@ -1633,14 +1818,14 @@ void Style_SetCurrentLineBackground(HWND PEDITLEXER __fastcall Style_SniffShebang(char *pchText) { if (StrCmpNA(pchText,"#!",2) == 0) { char *pch = pchText + 2; - while (*pch && (*pch == ' ' || *pch == '\t')) + while (*pch == ' ' || *pch == '\t') pch++; while (*pch && *pch != ' ' && *pch != '\t' && *pch != '\r' && *pch != '\n') pch++; if ((pch - pchText) >= 3 && StrCmpNA(pch-3,"env",3) == 0) { - while (*pch && *pch == ' ') + while (*pch == ' ') pch++; while (*pch && *pch != ' ' && *pch != '\t' && *pch != '\r' && *pch != '\n') pch++; } @@ -1649,8 +1834,10 @@ PEDITLEXER __fastcall Style_SniffShebang else if ((pch - pchText) >= 4 && StrCmpNIA(pch-4,"perl",4) == 0) return(&lexPL); else if ((pch - pchText) >= 6 && StrCmpNIA(pch-6,"python",6) == 0) return(&lexPY); + else if ((pch - pchText) >= 2 && StrCmpNA(pch-2,"sh",2) == 0) + return(&lexBASH); } return(NULL); } --- a\np2src\src\Styles.h Sun Jun 21 00:00:00 2009 +++ b\np2src\src\Styles.h Mon Jun 22 20:29:02 2009 @@ -48,9 +48,9 @@ typedef struct _editlexer } EDITLEXER, *PEDITLEXER; // Number of Lexers in pLexArray -#define NUMLEXERS 21 +#define NUMLEXERS 25 void Style_Load(); void Style_Save();