Based on Afrow UK's NSIS restoration patch with a few minor modifications. See http://nsis.sourceforge.net/Notepad2 --- a\np2src\Notepad2.dsp Fri Jan 16 20:19:40 2009 +++ b\np2src\Notepad2.dsp Fri Jan 16 20:20:26 2009 @@ -246,8 +246,11 @@ SOURCE=.\scintilla\src\LexCSS.cxx # End Source File # Begin Source File SOURCE=.\scintilla\src\LexHTML.cxx # End Source File +# Begin Source File +SOURCE=.\scintilla\src\LexNSIS.cxx +# End Source File # Begin Source File SOURCE=.\scintilla\src\LexOthers.cxx # End Source File # Begin Source File --- a\np2src\Notepad2.vcproj Fri Jan 16 20:19:40 2009 +++ b\np2src\Notepad2.vcproj Fri Jan 16 20:20:50 2009 @@ -337,8 +337,11 @@ + + +KEYWORDLIST KeyWords_NSIS = { +"!addincludedir !addplugindir !appendfile !cd !define !delfile !echo !else !endif !error " +"!execute !if !ifdef !ifmacrodef !ifmacrondef !ifndef !include !insertmacro !macro " +"!macroend !packhdr !system !tempfile !undef !verbose !warning " +".onguiend .onguiinit .oninit .oninstfailed .oninstsuccess .onmouseoversection " +".onrebootfailed .onselchange .onuserabort .onverifyinstdir " +"un.onguiend un.onguiinit un.oninit un.onrebootfailed un.onuninstfailed " +"un.onuninstsuccess un.onuserabort " +"abort addbrandingimage addsize allowrootdirinstall allowskipfiles autoclosewindow " +"bannertrimpath bgfont bggradient brandingtext bringtofront call callinstdll " +"caption changeui checkbitmap clearerrors completedtext componenttext copyfiles " +"crccheck createdirectory createfont createshortcut delete deleteinisec deleteinistr " +"deleteregkey deleteregvalue detailprint detailsbuttontext dirstate dirtext dirvar " +"dirverify enablewindow enumregkey enumregvalue exch exec execshell execwait " +"expandenvstrings file filebufsize fileclose fileerrortext fileopen fileread filereadbyte " +"fileseek filewrite filewritebyte findclose findfirst findnext findwindow flushini " +"getcurinsttype getcurrentaddress getdlgitem getdllversion getdllversionlocal geterrorlevel " +"getfiletime getfiletimelocal getfullpathname getfunctionaddress getinstdirerror " +"getlabeladdress gettempfilename goto hidewindow icon ifabort iferrors iffileexists " +"ifrebootflag ifsilent initpluginsdir installbuttontext installcolors installdir " +"installdirregkey instprogressflags insttypegettext insttypesettext intcmp intcmpu intfmt " +"intop iswindow langstring licensebkcolor licensedata licenseforceselection licenselangstring " +"licensetext loadlanguagefile lockwindow logset logtext messagebox miscbuttontext name nop " +"outfile page pop push quit readenvstr readinistr readregdword readregstr reboot regdll " +"rename requestexecutionlevel reservefile return rmdir searchpath sectiongetflags " +"sectiongetinsttypes sectiongetsize sectiongettext sectionin sectionsetflags sectionsetinsttypes " +"sectionsetsize sectionsettext sendmessage setautoclose setbrandingimage setcompress setcompressor " +"setcompressordictsize setctlcolors setcurinsttype setdatablockoptimize setdatesave setdetailsprint " +"setdetailsview seterrorlevel seterrors setfileattributes setfont setoutpath setoverwrite " +"setpluginunload setrebootflag setregview setshellvarcontext setsilent showinstdetails " +"showuninstdetails showwindow silentinstall silentuninstall sleep spacetexts strcmp strcmps " +"strcpy strlen subcaption uninstallbuttontext uninstallcaption uninstallicon uninstallsubcaption " +"uninstalltext uninstpage unregdll var viaddversionkey viproductversion windowicon writeinistr " +"writeregbin writeregdword writeregexpandstr writeregstr writeuninstaller xpstyle", +"${nsisdir} $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $r0 $r1 $r2 $r3 $r4 $r5 $r6 $r7 $r8 $r9 " +"$instdir $outdir $cmdline $language " +"$programfiles $programfiles32 $programfiles64 $commonfiles $commonfiles32 $commonfiles64 " +"$desktop $exedir $exefile $exepath $windir $sysdir $temp $startmenu $smprograms $smstartup " +"$quicklaunch $documents $sendto $recent $favorites $music $pictures $videos $nethood $fonts " +"$templates $appdata $localappdata $printhood $internet_cache $cookies $history $profile " +"$admintools $resources $resources_localized $cdburn_area $hwndparent $pluginsdir " +"${__date__} ${__file__} ${__function__} ${__global__} ${__line__} ${__pageex__} ${__section__} " +"${__time__} ${__timestamp__} ${__uninstall__}", +"oname rebootok nonfatal ifempty nounload silent filesonly short " +"mb_ok mb_okcancel mb_abortretryignore mb_retrycancel mb_yesno mb_yesnocancel mb_iconexclamation " +"mb_iconinformation mb_iconquestion mb_iconstop mb_usericon mb_topmost mb_setforeground mb_right " +"mb_rtlreading mb_defbutton1 mb_defbutton2 mb_defbutton3 mb_defbutton4 idabort idcancel idignore " +"idno idok idretry idyes sd " +"current all timeout imgid resizetofit listonly textonly both branding " +"hkcr hkey_classes_root hklm hkey_local_machine hkcu hkey_current_user hku hkey_users " +"hkcc hkey_current_config hkdd hkey_dyn_data hkpd hkey_performance_data shctx shell_context silent" +"left right top bottom true false on off italic underline strike trimleft trimright trimcenter " +"idd_license idd_dir idd_selcom idd_inst idd_instfiles idd_uninst idd_verify force windows nocustom " +"customstring componentsonlyoncustom gray none user highest admin lang hide show nevershow normal " +"silent silentlog auto solid final zlib bzip2 lzma try ifnewer ifdiff lastused manual alwaysoff " +"normal file_attribute_normal archive file_attribute_archive hidden file_attribute_hidden " +"offline file_attribute_offline readonly file_attribute_readonly system file_attribute_system " +"temporary file_attribute_temporary custom license components directory instfiles uninstconfirm 32 64 " +"enablecancel", +"", "", "", "", "", "" }; + + +EDITLEXER lexNSIS = { SCLEX_NSIS, L"NSIS Script", L"nsi; nsh", L"", &KeyWords_NSIS, { + { STYLE_DEFAULT, L"Default", L"", L"" }, + //{ SCE_NSIS_DEFAULT, L"Default", L"", L"" }, + { SCE_NSIS_COMMENT, L"Comment", L"fore:#007F00", L"" }, + { SCE_NSIS_COMMENTBOX, L"Comment box", L"fore:#007F00", L"" }, + { SCE_NSIS_STRINGDQ, L"String double quoted", L"fore:#666666; back:#EEEEEE", L"" }, + { SCE_NSIS_STRINGLQ, L"String left quoted", L"fore:#666666; back:#EEEEEE", L"" }, + { SCE_NSIS_STRINGRQ, L"String right quoted", L"fore:#666666; back:#EEEEEE", L"" }, + { SCE_NSIS_FUNCTION, L"Function", L"fore:#0033CC", L"" }, + { SCE_NSIS_VARIABLE, L"Variable", L"fore:#CC3300", L"" }, + { SCE_NSIS_STRINGVAR, L"Variable within String", L"fore:#CC3300; back:#EEEEEE", L"" }, + { SCE_NSIS_NUMBER, L"Number", L"fore:#FF0000", L"" }, + { SCE_NSIS_LABEL, L"Constant", L"fore:#FF9900", L"" }, + //{ SCE_NSIS_USERDEFINED, L"User Defined", L"", L"" }, + { SCE_NSIS_SECTIONDEF, L"Section", L"fore:#0033CC", L"" }, + { SCE_NSIS_SUBSECTIONDEF, L"Sub Section", L"fore:#0033CC", L"" }, + { SCE_NSIS_SECTIONGROUP, L"Section Group", L"fore:#0033CC", L"" }, + { SCE_NSIS_FUNCTIONDEF, L"Function Definition", L"fore:#0033CC", L"" }, + { SCE_NSIS_PAGEEX, L"PageEx", L"fore:#0033CC", L"" }, + { SCE_NSIS_IFDEFINEDEF, L"If Definition", L"fore:#0033CC", L"" }, + { SCE_NSIS_MACRODEF, L"Macro Definition", L"fore:#0033CC", L"" }, + { -1, L"", L"", L"" } } }; +// End NSIS-Patch + + KEYWORDLIST KeyWords_PY = { "and as assert break class continue def del elif else except " "exec False finally for from global if import in is lambda None " "not or pass print raise return True try with while yield", @@ -1294,8 +1382,9 @@ PEDITLEXER pLexArray[NUMLEXERS] = &lexDIFF, &lexBASH, &lexAU3, &lexLATEX, + &lexNSIS, // NSIS-Patch &lexASCII }; @@ -1551,8 +1640,12 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER SendMessage(hwnd,SCI_CLEARDOCUMENTSTYLE,0,0); // Lexer SendMessage(hwnd,SCI_SETLEXER,pLexNew->iLexer,0); + + // NSIS-Patch + if (pLexNew->iLexer == SCLEX_NSIS) + SendMessage(hwnd,SCI_SETPROPERTY,(WPARAM)"nsis.ignorecase", (LPARAM)"1"); if (pLexNew->iLexer == SCLEX_HTML || pLexNew->iLexer == SCLEX_XML) SendMessage(hwnd,SCI_SETSTYLEBITS,7,0); else --- a\np2src\src\Styles.h Fri Jan 16 20:19:40 2009 +++ b\np2src\src\Styles.h Fri Jan 16 20:23:42 2009 @@ -48,9 +48,9 @@ typedef struct _editlexer } EDITLEXER, *PEDITLEXER; // Number of Lexers in pLexArray -#define NUMLEXERS 25 +#define NUMLEXERS 26 void Style_Load(); void Style_Save();