diff --git a/Build/Notepad3.ini b/Build/Notepad3.ini
index 98d32b90e..5cb89200c 100644
--- a/Build/Notepad3.ini
+++ b/Build/Notepad3.ini
@@ -118,7 +118,7 @@ SettingsVersion=5
[ANSI Art]
[Apache Config Files]
[Assembly Script]
-[AutoHotkey_L Script]
+[AutoHotkey Script]
[AutoIt3 Script]
[AviSynth Script]
[Awk Script]
diff --git a/language/common_res.h b/language/common_res.h
index 5664b5d36..1c6a4b97c 100644
--- a/language/common_res.h
+++ b/language/common_res.h
@@ -1232,6 +1232,8 @@
#define IDS_LEX_STR_63373 63373
#define IDS_LEX_STR_63374 63374
#define IDS_LEX_STR_63375 63375
+#define IDS_LEX_STR_63376 63376
+#define IDS_LEX_STR_63377 63377
#define IDS_LEX_CSV_COL_0 63400
#define IDS_LEX_CSV_COL_1 63401
diff --git a/language/np3_de_de/lexer_de_de.rc b/language/np3_de_de/lexer_de_de.rc
index 6888ab35d..39e2ee920 100644
--- a/language/np3_de_de/lexer_de_de.rc
+++ b/language/np3_de_de/lexer_de_de.rc
@@ -481,7 +481,9 @@ BEGIN
IDS_LEX_STR_63373 "Task Marker"
IDS_LEX_STR_63374 "Comment Doc Error"
IDS_LEX_STR_63375 "Type Operator"
- END
+ IDS_LEX_STR_63376 "Special"
+ IDS_LEX_STR_63377 "Syntax Operator"
+END
STRINGTABLE
BEGIN
diff --git a/language/np3_en_us/lexer_en_us.rc b/language/np3_en_us/lexer_en_us.rc
index 0f0423b95..04d667eb9 100644
--- a/language/np3_en_us/lexer_en_us.rc
+++ b/language/np3_en_us/lexer_en_us.rc
@@ -481,6 +481,8 @@ BEGIN
IDS_LEX_STR_63373 "Task Marker"
IDS_LEX_STR_63374 "Comment Doc Error"
IDS_LEX_STR_63375 "Type Operator"
+ IDS_LEX_STR_63376 "Special"
+ IDS_LEX_STR_63377 "Syntax Operator"
END
STRINGTABLE
diff --git a/lexilla/Lexilla.vcxproj b/lexilla/Lexilla.vcxproj
index e420a530d..3b259596d 100644
--- a/lexilla/Lexilla.vcxproj
+++ b/lexilla/Lexilla.vcxproj
@@ -87,7 +87,7 @@
-
+
diff --git a/lexilla/Lexilla.vcxproj.filters b/lexilla/Lexilla.vcxproj.filters
index 412c90057..61ec16a2d 100644
--- a/lexilla/Lexilla.vcxproj.filters
+++ b/lexilla/Lexilla.vcxproj.filters
@@ -203,9 +203,6 @@
lexers
-
- lexers_x
-
lexers_x
@@ -272,6 +269,9 @@
lexers_x
+
+ lexers_x
+
diff --git a/lexilla/lexers_x/CharSetX.h b/lexilla/lexers_x/CharSetX.h
index 430df02ad..c01c2ffd4 100644
--- a/lexilla/lexers_x/CharSetX.h
+++ b/lexilla/lexers_x/CharSetX.h
@@ -50,14 +50,9 @@ constexpr bool IsWordCharEx(int ch) noexcept {
return Lexilla::iswordchar(ch) || ch >= 0x80;
}
-constexpr bool IsABlankOrTab(const int ch) noexcept
-{
- return ((ch == ' ') || (ch == '\t'));
-}
-
constexpr bool IsWhiteSpace(const int ch) noexcept
{
- return ((ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)));
+ return Lexilla::isspacechar(ch);
}
constexpr bool IsAHexDigit(int ch) noexcept
diff --git a/lexilla/lexers_x/LexAHK.cxx b/lexilla/lexers_x/LexAHK.cxx
new file mode 100644
index 000000000..922492058
--- /dev/null
+++ b/lexilla/lexers_x/LexAHK.cxx
@@ -0,0 +1,663 @@
+// encoding: UTF-8
+// Scintilla source code edit control
+/** @file LexAHK.cxx
+ ** Lexer for AutoHotkey, simplified version
+ ** Written by Philippe Lhoste (PhiLho)
+ **/
+ // Copyright 1998-2006 by Neil Hodgson
+ // The License.txt file describes the conditions under which this software may be distributed.
+ /* notepad2-mod custom code for the AutoHotkey lexer */
+
+
+#include
+#include
+#include
diff --git a/src/StyleLexers/EditLexer.c b/src/StyleLexers/EditLexer.c
index f7fd12c10..da7c35471 100644
--- a/src/StyleLexers/EditLexer.c
+++ b/src/StyleLexers/EditLexer.c
@@ -49,7 +49,7 @@ void Lexer_GetStreamCommentStrgs(LPWSTR beg_out, LPWSTR end_out, size_t maxlen)
break;
// ------------------
case SCLEX_NULL:
- case SCLEX_AHKL:
+ case SCLEX_AHK:
case SCLEX_ASM:
case SCLEX_BASH:
case SCLEX_BATCH:
@@ -118,7 +118,7 @@ bool Lexer_GetLineCommentStrg(LPWSTR pre_out, size_t maxlen)
case SCLEX_YAML:
StringCchCopy(pre_out, maxlen, L"#");
return true;
- case SCLEX_AHKL:
+ case SCLEX_AHK:
case SCLEX_ASM:
case SCLEX_AU3:
case SCLEX_INNOSETUP:
diff --git a/src/StyleLexers/EditLexer.h b/src/StyleLexers/EditLexer.h
index 87cdeffec..0ae84b68d 100644
--- a/src/StyleLexers/EditLexer.h
+++ b/src/StyleLexers/EditLexer.h
@@ -93,7 +93,7 @@ extern EDITLEXER lexTEXT; // Pure Text Files
extern EDITLEXER lexANSI; // ANSI Files
extern EDITLEXER lexCONF; // Apache Config Files
extern EDITLEXER lexASM; // Assembly Script
-extern EDITLEXER lexAHKL; // AutoHotkey L Script
+extern EDITLEXER lexAHK; // AutoHotkey Script
extern EDITLEXER lexAU3; // AutoIt3 Script
extern EDITLEXER lexAVS; // AviSynth Script
extern EDITLEXER lexAwk; // Awk Script
diff --git a/src/StyleLexers/styleLexAHK.c b/src/StyleLexers/styleLexAHK.c
new file mode 100644
index 000000000..ce4d6d163
--- /dev/null
+++ b/src/StyleLexers/styleLexAHK.c
@@ -0,0 +1,156 @@
+#include "StyleLexers.h"
+
+// ----------------------------------------------------------------------------
+
+KEYWORDLIST KeyWords_AHK = {
+
+ // Flow of Control
+ "break continue else exit exitapp gosub goto if ifequal ifexist ifgreater ifgreaterorequal "
+ "ifinstring ifless iflessorequal ifmsgbox ifnotequal ifnotexist ifnotinstring ifwinactive "
+ "ifwinexist ifwinnotactive ifwinnotexist loop onexit pause repeat return settimer sleep "
+ "suspend static global local var byref while until for class try catch throw",
+
+ // Commands
+ "autotrim blockinput clipwait control controlclick controlfocus controlget controlgetfocus "
+ "controlgetpos controlgettext controlmove controlsend controlsendraw controlsettext coordmode "
+ "critical detecthiddentext detecthiddenwindows drive driveget drivespacefree edit endrepeat "
+ "envadd envdiv envget envmult envset envsub envupdate fileappend filecopy filecopydir filecreatedir "
+ "filecreateshortcut fileencoding filedelete filegetattrib filegetshortcut filegetsize filegettime filegetversion "
+ "fileinstall filemove filemovedir fileread filereadline filerecycle filerecycleempty fileremovedir "
+ "fileselectfile fileselectfolder filesetattrib filesettime formattime getkeystate groupactivate "
+ "groupadd groupclose groupdeactivategui guicontrol guicontrolget hideautoitwin hotkey imagesearch "
+ "inidelete iniread iniwrite input inputbox keyhistory keywait listhotkeys listlines listvars menu "
+ "mouseclick mouseclickdrag mousegetpos mousemove msgbox outputdebug pixelgetcolor pixelsearch "
+ "postmessage process progress random regdelete regread regwrite reload run runas runwait send "
+ "sendevent sendinput sendmessage sendmode sendplay sendraw setbatchlines setcapslockstate "
+ "setcontroldelay setdefaultmousespeed setenv setformat setkeydelay setmousedelay setnumlockstate "
+ "setscrolllockstate setstorecapslockmode settitlematchmode setwindelay setworkingdir shutdown sort "
+ "soundbeep soundget soundgetwavevolume soundplay soundset soundsetwavevolume splashimage splashtextoff "
+ "splashtexton splitpath statusbargettext statusbarwait stringcasesense stringgetpos stringleft stringlen "
+ "stringlower stringmid stringreplace stringright stringsplit stringtrimleft stringtrimright stringupper "
+ "sysget thread tooltip transform traytip urldownloadtofile winactivate winactivatebottom winclose winget "
+ "wingetactivestats wingetactivetitle wingetclass wingetpos wingettext wingettitle winhide winkill "
+ "winmaximize winmenuselectitem winminimize winminimizeall winminimizeallundo winmove winrestore winset "
+ "winsettitle winshow winwait winwaitactive winwaitclose winwaitnotactive",
+
+ // Functions
+ "abs acos asc asin atan ceil chr cos dllcall exp fileexist floor getkeystate numget numput "
+ "registercallback il_add il_create il_destroy instr islabel isfunc ln log lv_add lv_delete "
+ "lv_deletecol lv_getcount lv_getnext lv_gettext lv_insert lv_insertcol lv_modify lv_modifycol "
+ "lv_setimagelist mod onmessage round regexmatch regexreplace sb_seticon sb_setparts sb_settext "
+ "sin sqrt strlen substr tan tv_add tv_delete tv_getchild tv_getcount tv_getnext tv_get tv_getparent "
+ "tv_getprev tv_getselection tv_gettext tv_modify tv_setimagelist varsetcapacity winactive winexist "
+ "trim ltrim rtrim fileopen strget strput object array isobject objinsert objremove objminindex "
+ "objmaxindex objsetcapacity objgetcapacity objgetaddress objnewenum objaddref objrelease objhaskey "
+ "objclone _insert _remove _minindex _maxindex _setcapacity _getcapacity _getaddress _newenum _addref "
+ "_release _haskey _clone comobjcreate comobjget comobjconnect comobjerror comobjactive comobjenwrap "
+ "comobjunwrap comobjparameter comobjmissing comobjtype comobjvalue comobjarray comobjquery comobjflags "
+ "func getkeyname getkeyvk getkeysc isbyref exception",
+
+ // Directives
+ "allowsamelinecomments clipboardtimeout commentflag errorstdout escapechar hotkeyinterval "
+ "hotkeymodifiertimeout hotstring if iftimeout ifwinactive ifwinexist include includeagain "
+ "installkeybdhook installmousehook keyhistory ltrim maxhotkeysperinterval maxmem maxthreads "
+ "maxthreadsbuffer maxthreadsperhotkey menumaskkey noenv notrayicon persistent singleinstance "
+ "usehook warn winactivateforce",
+
+ // Keys & Buttons
+ "shift lshift rshift alt lalt ralt control lcontrol rcontrol ctrl lctrl rctrl lwin rwin appskey "
+ "altdown altup shiftdown shiftup ctrldown ctrlup lwindown lwinup rwindown rwinup lbutton rbutton "
+ "mbutton wheelup wheeldown xbutton1 xbutton2 joy1 joy2 joy3 joy4 joy5 joy6 joy7 joy8 joy9 joy10 "
+ "joy11 joy12 joy13 joy14 joy15 joy16 joy17 joy18 joy19 joy20 joy21 joy22 joy23 joy24 joy25 joy26 "
+ "joy27 joy28 joy29 joy30 joy31 joy32 joyx joyy joyz joyr joyu joyv joypov joyname joybuttons "
+ "joyaxes joyinfo space tab enter escape esc backspace bs delete del insert ins pgup pgdn home end "
+ "up down left right printscreen ctrlbreak pause scrolllock capslock numlock numpad0 numpad1 numpad2 "
+ "numpad3 numpad4 numpad5 numpad6 numpad7 numpad8 numpad9 numpadmult numpadadd numpadsub numpaddiv "
+ "numpaddot numpaddel numpadins numpadclear numpadup numpaddown numpadleft numpadright numpadhome "
+ "numpadend numpadpgup numpadpgdn numpadenter f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 "
+ "f16 f17 f18 f19 f20 f21 f22 f23 f24 browser_back browser_forward browser_refresh browser_stop "
+ "browser_search browser_favorites browser_home volume_mute volume_down volume_up media_next "
+ "media_prev media_stop media_play_pause launch_mail launch_media launch_app1 launch_app2 blind "
+ "click raw wheelleft wheelright",
+
+ // Variables
+ "a_ahkpath a_ahkversion a_appdata a_appdatacommon a_autotrim a_batchlines a_caretx a_carety "
+ "a_computername a_controldelay a_cursor a_dd a_ddd a_dddd a_defaultmousespeed a_desktop "
+ "a_desktopcommon a_detecthiddentext a_detecthiddenwindows a_endchar a_eventinfo a_exitreason "
+ "a_formatfloat a_formatinteger a_gui a_guievent a_guicontrol a_guicontrolevent a_guiheight "
+ "a_guiwidth a_guix a_guiy a_hour a_iconfile a_iconhidden a_iconnumber a_icontip a_index "
+ "a_ipaddress1 a_ipaddress2 a_ipaddress3 a_ipaddress4 a_isadmin a_iscompiled a_issuspended "
+ "a_keydelay a_language a_lasterror a_linefile a_linenumber a_loopfield a_loopfileattrib "
+ "a_loopfiledir a_loopfileext a_loopfilefullpath a_loopfilelongpath a_loopfilename "
+ "a_loopfileshortname a_loopfileshortpath a_loopfilesize a_loopfilesizekb a_loopfilesizemb "
+ "a_loopfiletimeaccessed a_loopfiletimecreated a_loopfiletimemodified a_loopreadline a_loopregkey "
+ "a_loopregname a_loopregsubkey a_loopregtimemodified a_loopregtype a_mday a_min a_mm a_mmm "
+ "a_mmmm a_mon a_mousedelay a_msec a_mydocuments a_now a_nowutc a_numbatchlines a_ostype "
+ "a_osversion a_priorhotkey a_programfiles a_programs a_programscommon a_screenheight "
+ "a_screenwidth a_scriptdir a_scriptfullpath a_scriptname a_sec a_space a_startmenu "
+ "a_startmenucommon a_startup a_startupcommon a_stringcasesense a_tab a_temp a_thishotkey "
+ "a_thismenu a_thismenuitem a_thismenuitempos a_tickcount a_timeidle a_timeidlephysical "
+ "a_timesincepriorhotkey a_timesincethishotkey a_titlematchmode a_titlematchmodespeed "
+ "a_username a_wday a_windelay a_windir a_workingdir a_yday a_year a_yweek a_yyyy "
+ "clipboard clipboardall comspec errorlevel programfiles true false a_thisfunc a_thislabel "
+ "a_ispaused a_iscritical a_isunicode a_ptrsize a_scripthwnd a_priorkey",
+
+ // Special Parameters (keywords)
+ "ltrim rtrim join ahk_id ahk_pid ahk_class ahk_group ahk_exe processname processpath minmax "
+ "controllist statuscd filesystem setlabel alwaysontop mainwindow nomainwindow useerrorlevel "
+ "altsubmit hscroll vscroll imagelist wantctrla wantf2 vis visfirst wantreturn backgroundtrans "
+ "minimizebox maximizebox sysmenu toolwindow exstyle check3 checkedgray readonly notab lastfound "
+ "lastfoundexist alttab shiftalttab alttabmenu alttabandmenu alttabmenudismiss controllisthwnd "
+ "hwnd deref pow bitnot bitand bitor bitxor bitshiftleft bitshiftright sendandmouse mousemove "
+ "mousemoveoff hkey_local_machine hkey_users hkey_current_user hkey_classes_root hkey_current_config "
+ "hklm hku hkcu hkcr hkcc reg_sz reg_expand_sz reg_multi_sz reg_dword reg_qword reg_binary reg_link "
+ "reg_resource_list reg_full_resource_descriptor reg_resource_requirements_list reg_dword_big_endian "
+ "regex pixel mouse screen relative rgb low belownormal normal abovenormal high realtime between "
+ "contains in is integer float number digit xdigit integerfast floatfast alpha upper lower alnum "
+ "time date not or and topmost top bottom transparent transcolor redraw region id idlast count "
+ "list capacity eject lock unlock label serial type status seconds minutes hours days read parse "
+ "logoff close error single shutdown menu exit reload tray add rename check uncheck togglecheck "
+ "enable disable toggleenable default nodefault standard nostandard color delete deleteall icon "
+ "noicon tip click show edit progress hotkey text picture pic groupbox button checkbox radio "
+ "dropdownlist ddl combobox statusbar treeview listbox listview datetime monthcal updown slider "
+ "tab tab2 activex iconsmall tile report sortdesc nosort nosorthdr grid hdr autosize range xm ym "
+ "ys xs xp yp font resize owner submit nohide minimize maximize restore noactivate na cancel "
+ "destroy center margin owndialogs guiescape guiclose guisize guicontextmenu guidropfiles tabstop "
+ "section wrap border top bottom buttons expand first lines number uppercase lowercase limit "
+ "password multi group background bold italic strike underline norm theme caption delimiter flash "
+ "style checked password hidden left right center section move focus hide choose choosestring text "
+ "pos enabled disabled visible notimers interrupt priority waitclose unicode tocodepage fromcodepage "
+ "yes no ok cancel abort retry ignore force on off all send wanttab monitorcount monitorprimary "
+ "monitorname monitorworkarea pid this base extends __get __set __call __delete __new new "
+ "useunsetlocal useunsetglobal useenv localsameasglobal",
+
+ // User Defined
+ NULL,
+
+ NULL
+};
+
+
+EDITLEXER lexAHK = {
+ SCLEX_AHK, "ahk", IDS_LEX_AHK, L"AutoHotkey Script", L"ahk; ahkl; ia; scriptlet", L"",
+ &KeyWords_AHK, {
+ { {STYLE_DEFAULT}, IDS_LEX_STR_63126, L"Default", L"", L"" },
+ //{ SCE_AHK_DEFAULT, IDS_LEX_STR_63126, L"Default", L"", L"" },
+ { {MULTI_STYLE(SCE_AHK_COMMENTLINE,SCE_AHK_COMMENTBLOCK,0,0)}, IDS_LEX_STR_63127, L"Comment", L"fore:#008000", L"" },
+ { {SCE_AHK_ESCAPE}, IDS_LEX_STR_63306, L"Escape", L"fore:#FF8000", L"" },
+ { {SCE_AHK_SYNOPERATOR}, IDS_LEX_STR_63377, L"Syntax Operator", L"fore:#7F200F", L"" },
+ { {SCE_AHK_EXPOPERATOR}, IDS_LEX_STR_63308, L"Expression Operator", L"fore:#FF4F00", L"" },
+ { {SCE_AHK_STRING}, IDS_LEX_STR_63131, L"String", L"fore:#747474", L"" },
+ { {SCE_AHK_NUMBER}, IDS_LEX_STR_63130, L"Number", L"fore:#416CAD", L"" },
+ { {SCE_AHK_IDENTIFIER}, IDS_LEX_STR_63129, L"Identifier", L"fore:#CF2F0F", L"" },
+ { {SCE_AHK_VARREF}, IDS_LEX_STR_63309, L"Variable Dereferencing", L"fore:#CF2F0F; back:#E4FFE4", L"" },
+ { {SCE_AHK_LABEL}, IDS_LEX_STR_63235, L"Label", L"fore:#000000; back:#FFFFA1", L"" },
+ { {SCE_AHK_WORD_CF}, IDS_LEX_STR_63310, L"Flow of Control", L"bold; fore:#880088", L"" },
+ { {SCE_AHK_WORD_CMD}, IDS_LEX_STR_63236, L"Command", L"fore:#0036D9", L"" },
+ { {SCE_AHK_WORD_FN}, IDS_LEX_STR_63277, L"Function", L"italic; fore:#0F707F", L"" },
+ { {SCE_AHK_WORD_DIR}, IDS_LEX_STR_63203, L"Directive", L"italic; fore:#F04020", L"" },
+ { {SCE_AHK_WORD_KB}, IDS_LEX_STR_63311, L"Keys & Buttons", L"bold; fore:#FF00FF", L"" },
+ { {SCE_AHK_WORD_VAR}, IDS_LEX_STR_63312, L"Built-In Variables", L"italic; fore:#CF00CF", L"" },
+ { {SCE_AHK_WORD_SP}, IDS_LEX_STR_63376, L"Special", L"italic; fore:#BD8E00", L"" },
+ //{ {SCE_AHK_WORD_UD}, IDS_LEX_STR_63106, L"User Defined", L"fore:#800020", L"" },
+ { {SCE_AHK_VARREFKW}, IDS_LEX_STR_63313, L"Variable Keyword", L"italic; fore:#CF00CF; back:#F9F9FF", L"" },
+ EDITLEXER_SENTINEL
+ }
+};
diff --git a/src/Styles.c b/src/Styles.c
index e170ef384..46d77dabe 100644
--- a/src/Styles.c
+++ b/src/Styles.c
@@ -58,7 +58,7 @@ static PEDITLEXER g_pLexArray[] = {
&lexANSI, // ANSI Files (ASCII Art)
&lexCONF, // Apache Config Files
&lexASM, // Assembly Script
- &lexAHKL, // AutoHotkey L Script
+ &lexAHK, // AutoHotkey Script
&lexAU3, // AutoIt3 Script
&lexAVS, // AviSynth Script
&lexAwk, // Awk Script
@@ -4431,7 +4431,7 @@ CASE_WM_CTLCOLOR_SET:
}
++i;
}
- assert(iCurStyleIdx != -1);
+ //assert(iCurStyleIdx != -1);
}
if (pCurrentStyle) {
bIsStyleSelected = true;