NSIS support is based on Afrow UK's NSIS restoration patch with a few minor modifications. See --- a\np2src\Notepad2.dsp Sat Jan 31 10:25:36 2009 +++ b\np2src\Notepad2.dsp Sat Jan 31 10:51:47 2009 @@ -246,8 +246,14 @@ 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\LexINNO.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 Sat Jan 31 10:25:36 2009 +++ b\np2src\Notepad2.vcproj Sat Jan 31 10:52:04 2009 @@ -337,8 +337,14 @@ + + + + +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:#008000", L"" }, + { SCE_NSIS_COMMENTBOX, L"Comment box", L"fore:#008000", 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_INNO = { +"code components custommessages dirs files icons ini installdelete langoptions " +"languages messages registry run setup types tasks uninstalldelete " +"uninstallrun _istool", +"allowcancelduringinstall allownoicons allowrootdirectory allowuncpath alwaysrestart alwaysshowcomponentslist " +"alwaysshowdironreadypage alwaysshowgrouponreadypage alwaysusepersonalgroup appcomments appcontact appcopyright " +"appenddefaultdirname appenddefaultgroupname appid appmodifypath appmutex appname apppublisher apppublisherurl " +"appreadmefile appsupporturl appupdatesurl appvername appversion architecturesallowed " +"architecturesinstallin64bitmode backcolor backcolor2 backcolordirection backsolid changesassociations " +"changesenvironment compression copyrightfontname copyrightfontsize createappdir createuninstallregkey " +"defaultdirname defaultgroupname defaultuserinfoname defaultuserinfoorg defaultuserinfoserial dialogfontname " +"dialogfontsize direxistswarning disabledirpage disablefinishedpage disableprogramgrouppage disablereadymemo " +"disablereadypage disablestartupprompt diskclustersize diskslicesize diskspanning enablesdirdoesntexistwarning " +"encryption extradiskspacerequired flatcomponentslist infoafterfile infobeforefile internalcompresslevel " +"languagedetectionmethod languagecodepage languageid languagename licensefile mergeduplicatefiles minversion " +"onlybelowversion outputbasefilename outputdir outputmanifestfile password privilegesrequired reservebytes " +"restartifneededbyrun setupiconfile showcomponentsizes showlanguagedialog showtaskstreelines slicesperdisk " +"solidcompression sourcedir timestamprounding timestampsinutc titlefontname titlefontsize touchdate touchtime " +"uninstallable uninstalldisplayicon uninstalldisplayname uninstallfilesdir uninstalllogmode uninstallrestartcomputer " +"updateuninstalllogappname usepreviousappdir usepreviousgroup useprevioussetuptype useprevioustasks " +"useprevioususerinfo userinfopage usesetupldr versioninfocompany versioninfocopyright versioninfodescription " +"versioninfotextversion versioninfoversion welcomefontname welcomefontsize windowshowcaption windowstartmaximized " +"windowresizable windowvisible wizardimagebackcolor wizardimagefile wizardimagestretch wizardsmallimagefile", +"afterinstall attribs beforeinstall check comment components copymode description destdir destname excludes " +"extradiskspacerequired filename flags fontinstall groupdescription hotkey infoafterfile infobeforefile iconfilename " +"iconindex key languages licensefile messagesfile minversion name onlybelowversion parameters permissions root " +"runonceid section source statusmsg string subkey tasks terminalservicesaware type types valuedata valuename valuetype workingdir", +"append define dim else emit endif endsub error expr file for if ifdef " +"ifexist ifndef ifnexist include insert pragma sub undef", +"begin break case const continue do downto else end except finally for " +"function if of procedure repeat then to try until uses var while with", +"", "", "", "" }; + + +EDITLEXER lexINNO = { SCLEX_INNOSETUP, L"Inno Setup Script", L"iss", L"", &KeyWords_INNO, { + { STYLE_DEFAULT, L"Default", L"", L"" }, + //{ SCE_INNO_DEFAULT, L"Default", L"", L"" }, + { SCE_INNO_COMMENT, L"Comment", L"fore:#008000", L"" }, + { SCE_INNO_KEYWORD, L"Keyword", L"fore:#0000FF", L"" }, + { SCE_INNO_PARAMETER, L"Parameter", L"fore:#0000FF", L"" }, + { SCE_INNO_SECTION, L"Section", L"fore:#000080; bold", L"" }, + { SCE_INNO_PREPROC, L"Preprocessor", L"fore:#CC0000", L"" }, + { SCE_INNO_INLINE_EXPANSION, L"Inline Expansion", L"fore:#800080", L"" }, + { SCE_INNO_COMMENT_PASCAL, L"Pascal Comment", L"fore:#008000", L"" }, + { SCE_INNO_KEYWORD_PASCAL, L"Pascal Keyword", L"fore:#0000FF", L"" }, + //{ SCE_INNO_KEYWORD_USER, L"User Defined", L"", L"" }, + { SCE_INNO_STRING_DOUBLE, L"Double quoted string", L"fore:#008080", L"" }, + { SCE_INNO_STRING_SINGLE, L"Single quoted string", L"fore:#008080", L"" }, + //{ SCE_INNO_IDENTIFIER, L"Identifier", L"", L"" }, + { -1, L"", L"", L"" } } }; + + 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", @@ -1297,8 +1437,10 @@ PEDITLEXER pLexArray[NUMLEXERS] = &lexDIFF, &lexBASH, &lexAU3, &lexLATEX, + &lexNSIS, // NSIS-Patch + &lexINNO, &lexASCII }; @@ -1565,8 +1707,10 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER if (pLexNew->iLexer == SCLEX_CPP) SendMessage(hwnd,SCI_SETPROPERTY,(WPARAM)"styling.within.preprocessor",(LPARAM)"1"); else if (pLexNew->iLexer == SCLEX_PASCAL) SendMessage(hwnd,SCI_SETPROPERTY,(WPARAM)"lexer.pascal.smart.highlighting",(LPARAM)"1"); + else if (pLexNew->iLexer == SCLEX_NSIS) + SendMessage(hwnd,SCI_SETPROPERTY,(WPARAM)"nsis.ignorecase",(LPARAM)"1"); // Add KeyWord Lists for (i = 0; i < 9; i++) SendMessage(hwnd,SCI_SETKEYWORDS,i,(LPARAM)pLexNew->pKeyWords->pszKeyWords[i]); --- a\np2src\src\Styles.h Mon Jun 22 20:32:17 2009 +++ b\np2src\src\Styles.h Mon Jun 22 20:34:30 2009 @@ -48,9 +48,9 @@ typedef struct _editlexer } EDITLEXER, *PEDITLEXER; // Number of Lexers in pLexArray -#define NUMLEXERS 25 +#define NUMLEXERS 27 void Style_Load(); void Style_Save();