
 ****************************************************************************
 * NppExec plugin ver. 0.8.2 for Notepad++
 * by DV <dvv81 @ ukr.net>, December 2006 - June 2022
 * https://github.com/d0vgan/nppexec
 * Powered by Function Parser (C) Juha Nieminen, Joel Yliluoma
 ****************************************************************************
 *
 * Abilities:
 *   1) Run multiple commands from the "Execute NppExec Script..." dialog
 *   2) Run stand-alone command from the NppExec Console
 *   3) Separate console for each NppExec.dll (e.g. NppExec1.dll, NppExec2.dll)
 *   4) Additional commands:
 *        cls - clear Console screen
 *        cd - shows current path
 *        cd <path> - changes current directory (absolute or relative)
 *        cd <drive:\path> - changes current drive and directory
 *        dir - lists subdirs and files
 *        dir <mask> - lists subdirs and files matched the mask
 *        dir <path\mask> - lists subdirs and files matched the mask
 *        echo <text> - prints a text in the Console
 *        if <condition> goto <label> - jumps to the label if the condition is true
 *        if~ <condition> goto <label> - calculates and checks the condition
 *        if ... else if ... else ... endif - conditional execution
 *        if~ ... else if~ ... else ... endif - conditional execution
 *        goto <label> - jumps to the label
 *        exit - exits the current NppExec's script
 *        exit <type> - exits the NppExec's script
 *        set - shows all user's variables
 *        set <var> - shows the value of user's variable <var>
 *        set <var> = <value> - sets the value of user's variable <var>
 *        set <var> ~ <math expression> - calculates the math expression
 *        set <var> ~ strlen <string> - calculates the string length
 *        set <var> ~ strlenutf8 <string> - calculates the UTF-8 string length
 *        set <var> ~ strlenu <string> - the same as strlenutf8
 *        set <var> ~ strlensci <string> - string length, using Scintilla's encoding
 *        set <var> ~ strlens <string> - the same as strlensci
 *        set <var> ~ strupper <string> - returns the string in upper case
 *        set <var> ~ strlower <string> - returns the string in lower case
 *        set <var> ~ substr <pos> <len> <string> - returns the substring
 *        set <var> ~ strfind <s> <t> - returns the first position of <t> in <s>
 *        set <var> ~ strrfind <s> <t> - returns the last position of <t> in <s>
 *        set <var> ~ strreplace <s> <t0> <t1> - replaces all <t0> with <t1>
 *        set <var> ~ strquote <s> - surrounds <s> with "" quotes
 *        set <var> ~ strunquote <s> - removes the surrounding "" quotes
 *        set <var> ~ strescape <s> - simple character escaping (e.g. <TAB> to '\t')
 *        set <var> ~ strunescape <s> - simple character unescaping (e.g. '\n' to <LF>)
 *        set <var> ~ strexpand <s> - expands all $(sub) values within <s>
 *        set <var> ~ normpath <path> - returns a normalized path
 *        set <var> ~ strfromhex <hs> - returns a string from the hex-string
 *        set <var> ~ strtohex <s> - returns a hex-string from the string
 *        set <var> ~ chr <n> - returns a character from a character code <n>
 *        set <var> ~ ord <c> - returns a decimal character code of a character <c>
 *        set <var> ~ ordx <c> - returns a hexadecimal character code of a character <c>
 *        set local - shows all user's local variables
 *        set local <var> - shows the value of user's local variable <var>
 *        set local <var> = ... - sets the value of user's local variable <var>
 *        set local <var> ~ ... - calculates the value of user's local variable
 *        unset <var> - removes user's variable <var>
 *        unset local <var> - removes user's local variable <var>
 *        env_set <var> - shows the value of environment variable <var>
 *        env_set <var> = <value> - sets the value of environment variable <var>
 *        env_set local ... - sets an environment variable locally         (**)
 *        env_unset <var> - removes/restores the environment variable <var>
 *        inputbox "message" - shows InputBox, sets $(INPUT)
 *        inputbox "message" : initial_value - InputBox, sets $(INPUT)
 *        inputbox "message" : "value_name" : initial_value - InputBox customization
 *        inputbox "message" : "value_name" : "initial_value" : time_ms - expirable
 *        messagebox "text" - shows a simple MessageBox
 *        messagebox "text" : "title" - shows a MessageBox with a custom title
 *        messagebox "text" : "title" : type - shows a MessageBox of a given type
 *        messagebox "text" : "title" : type : time_ms - expirable MessageBox
 *        con_colour <colours> - sets the Console's colours
 *        con_colour local ... - sets the colours locally                  (**)
 *        con_filter <filters> - enables/disables the Console's output filters
 *        con_filter local ... - sets the filters locally                  (**)
 *        con_loadfrom <file> - loads a file's content to the Console
 *        con_load <file> - see "con_loadfrom"
 *        con_saveto <file> - saves the Console's content to a file
 *        con_save - see "con_saveto"
 *        sel_loadfrom <file> - replace current selection with a file's content
 *        sel_load <file> - see "sel_loadfrom"
 *        sel_saveto <file> - save the selected text to a file
 *        sel_saveto <file> : <encoding> - save the selected text to a file
 *        sel_save <file> : <encoding> - see "sel_saveto"
 *        sel_settext <text> - replace current selection with the text specified
 *        sel_settext+ <text> - replace current selection with the text specified
 *        text_loadfrom <file> - replace the entire text with a file's content
 *        text_load <file> - see "text_loadfrom"
 *        text_saveto <file> - save the entire text to a file
 *        text_saveto <file> : <encoding> - save the entire text to a file
 *        text_save <file> : <encoding> - see "text_saveto"
 *        clip_settext <text> : set the clipboard text
 *        npp_exec <script> - execute commands from specified NppExec's script
 *        npp_exec <file> - execute commands from specified NppExec's file (*)
 *        npp_exectext <mode> <text> - execute the given text
 *        npp_close - close current file in Notepad++
 *        npp_close <file> - close specified file opened in Notepad++      (*)
 *        npp_console <on/off/keep> - show/hide the Console window
 *        npp_console <enable/disable> - enable/disable output to the Console
 *        npp_console <1/0/?> - show/hide the Console window
 *        npp_console <+/-> - enable/disable output to the Console
 *        npp_console local ... - Console on/off locally                   (**)
 *        npp_menucommand <menu\item\name> - executes (invokes) a menu item
 *        npp_open <file> - open a file in Notepad++
 *        npp_open <mask> - open files matched the mask
 *        npp_open <path\mask> - open files matched the mask
 *        npp_run <command> - run external process/command
 *        npp_save - save current file in Notepad++
 *        npp_save <file> - save a file in Notepad++ (if it's opened)      (*)
 *        npp_saveas <file> - save current file with a new (path)name
 *        npp_saveall - save all modified files
 *        npp_switch <file> - switch to specified opened file              (*)
 *        npp_setfocus - set the keyboard focus
 *        npp_sendmsg <msg> - send a message (msg) to Notepad++
 *        npp_sendmsg <msg> <wparam> - message with parameter (wparam)
 *        npp_sendmsg <msg> <wparam> <lparam> - msg to Notepad++
 *        npp_sendmsgex <hwnd> <msg> <wparam> <lparam> - msg to hwnd
 *        sci_sendmsg <msg> - send a message (msg) to current Scintilla
 *        sci_sendmsg <msg> <wparam> - message with parameter (wparam)
 *        sci_sendmsg <msg> <wparam> <lparam> - msg to Scintilla
 *        sci_find <flags> <find_what> - find a string
 *        sci_replace <flags> <find_what> <replace_with> - replace a string
 *        proc_input <string> - send a string to a child process
 *        proc_signal <signal> - signal to a child process
 *        sleep <ms> - sleep for ms milliseconds
 *        sleep <ms> <text> - print the text and sleep for ms milliseconds
 *        npe_cmdalias - show all command aliases
 *        npe_cmdalias <alias> - shows the value of command alias
 *        npe_cmdalias <alias> = - removes the command alias
 *        npe_cmdalias <alias> = <command> - sets the command alias
 *        npe_console <options> - set/modify Console options/mode
 *        npe_console local ... - sets Console's mode locally              (**)
 *        npe_debuglog <on/off> - enable/disable Debug Log
 *        npe_debuglog local ... - enable/disable Debug Log locally        (**)
 *        npe_debug <1/0> - see "npe_debuglog"
 *        npe_noemptyvars <1/0> - enable/disable replacement of empty vars
 *        npe_noemptyvars local ... - sets empty vars on/off locally       (**)
 *        npe_queue <command> - queue NppExec's command to be executed
 *        npe_sendmsgbuflen <max_len> - set npp/sci_sendmsg's buffer length
 *        npe_sendmsgbuflen local ... - sets the buffer length locally     (**)
 *        nppexec: - prefix for NppExec's commands (e.g. "nppexec:npp_console off")
 *        nppexec:: - always executes a command in a collateral (parallel) script
 *        (*) these commands work with a partial file path/name also
 *            i.e.  npp_save c:\dir\f.txt  is the same as  npp_save f.txt
 *        (**) within the current NppExec's script
 *   5) Additional console commands (Console Dlg only):
 *        help           - show available commands
 *        help <command> - information on the specific command (e.g. "help cls")
 *        ver            - show plugin's version
 *        manual         - show NppExec User Guide
 *        about          - show NppExec Help/About
 *        CTRL+C         - kill (via Ctrl+C) or terminate current child process
 *        CTRL+BREAK     - kill (via Ctrl+Break) or terminate current child process
 *        CTRL+BREAK     - abort current NppExec's script (without closing the Console)
 *        CTRL+Z         - send ^Z to current child process
 *   6) All Notepad++ environment variables are supported:
 *        $(FULL_CURRENT_PATH)  : E:\my Web\main\welcome.html
 *        $(CURRENT_DIRECTORY)  : E:\my Web\main
 *        $(FILE_NAME)          : welcome.html
 *        $(NAME_PART)          : welcome
 *        $(EXT_PART)           : .html
 *        $(NPP_DIRECTORY)      : full path of directory with notepad++.exe
 *        $(NPP_FULL_FILE_PATH) : full path to notepad++.exe
 *        $(CURRENT_WORD)       : word(s) you selected in Notepad++
 *        $(CURRENT_LINE)       : current line number
 *        $(CURRENT_LINESTR)    : text of the current line
 *        $(CURRENT_COLUMN)     : current column number
 *   7) Additional environment variables:
 *        $(SELECTED_TEXT)      : the text you selected in Notepad++
 *        $(FILE_NAME_AT_CURSOR): file name selected in the editor
 *        $(WORKSPACE_ITEM_PATH): full path to the current item in the workspace pane
 *        $(WORKSPACE_ITEM_DIR) : directory containing the current item in the workspace pane
 *        $(WORKSPACE_ITEM_NAME): file name of the current item in the workspace pane
 *        $(WORKSPACE_ITEM_ROOT): root path of the current item in the workspace pane
 *        $(CLOUD_LOCATION_PATH): cloud location path (in Notepad++'s settings)
 *        $(CLIPBOARD_TEXT)     : text from the clipboard
 *        $(#0)                 : C:\Program Files\Notepad++\notepad++.exe
 *        $(#N), N=1,2,3...     : full path of the Nth opened document
 *        $(LEFT_VIEW_FILE)     : current file path-name in primary (left) view
 *        $(RIGHT_VIEW_FILE)    : current file path-name in second (right) view
 *        $(PLUGINS_CONFIG_DIR) : full path of the plugins configuration directory
 *        $(CWD)                : current working directory of NppExec (use "cd" to change it)
 *        $(ARGC)               : number of arguments passed to the NPP_EXEC command
 *        $(ARGV)               : all arguments passed to the NPP_EXEC command after the script name
 *        $(ARGV[0])            : script name - first parameter of the NPP_EXEC command
 *        $(ARGV[N])            : Nth argument (N=1,2,3...)
 *        $(RARGV)              : all arguments in reverse order (except the script name)
 *        $(RARGV[N])           : Nth argument in reverse order (N=1,2,3...)
 *        $(INPUT)              : this value is set by the 'inputbox' command
 *        $(INPUT[N])           : Nth field of the $(INPUT) value (N=1,2,3...)
 *        $(OUTPUT)             : this value can be set by the child process, see npe_console v+
 *        $(OUTPUT1)            : first line in $(OUTPUT)
 *        $(OUTPUTL)            : last line in $(OUTPUT)
 *        $(EXITCODE)           : exit code of the last executed child process
 *        $(PID)                : process id of the current (or the last) child process
 *        $(IS_PROCESS)         : is child process running (1 - yes, 0 - no)
 *        $(LAST_CMD_RESULT)    : result of the last NppExec's command
 *                                  (1 - succeeded, 0 - failed, -1 - invalid arg)
 *        $(MSG_RESULT)         : result of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(MSG_WPARAM)         : wParam (output) of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(MSG_LPARAM)         : lParam (output) of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(NPP_HWND)           : Notepad++'s main window handle
 *        $(SCI_HWND)           : current Scintilla's window handle
 *        $(SCI_HWND1)          : primary Scintilla's window handle (main view)
 *        $(SCI_HWND2)          : secondary Scintilla's window handle (second view)
 *        $(CON_HWND)           : NppExec's Console window handle (RichEdit control)
 *        $(FOCUSED_HWND)       : focused window handle
 *        $(SYS.<var>)          : system's environment variable, e.g. $(SYS.PATH)
 *        $(@EXIT_CMD)          : a callback exit command for a child process
 *        $(@EXIT_CMD_SILENT)   : a silent (non-printed) callback exit command
 *
 ****************************************************************************


 *************
 *  HISTORY  *
 *************

 v0.8.2 - June 2022
 ------------------
 * Glory to Ukraine! Glory to the heroes!
 + added: new option "Use Editor Colors" (in the Advanced Options).
   For dark color themes, the following colors may be used:
     Error   - C0 30 30
     Message - 40 B0 40
     Warning - 40 80 C0
   The default colors (for bright color themes) are:
     Error   - A0 10 10
     Message - 20 80 20
 - fixed: TextColorError (in the Advanced Options) was not applied to the
   built-in error filter ("npe_console local -- x+").
 - fixed: in rare cases, the NppExec's Console could "swallow" a first typed
   character. It was caused by the ConsoleDlg not resetting the value of the
   `bFuncItemEntered` back to `false`.
 * changed: IsTabSpaceChar() was replaced with IsAnySpaceChar() to handle
   additional space characters such as '\v' and \f'.
 * npp_files updated to Notepad++ 8.4.2.
 + NppExec Manual updated
 - fixed: NppExec Manual no more contains the misleading HTML tags saying
   `META NAME="Generator"`. (The HTML files are actually modified in a text
   editor such as Notepad++ or AkelPad without any HTML generator).


 v0.8.1 - April 2022
 -------------------
 * 24.02.2022: Russkii voennyi korabl', idi nakhui!!!
     In the memory of those who were killed.
     In the memory of what was destroyed.
     God bless those who defend.
     We will build the better future.
 + added: $(CURRENT_LINESTR), $(SCI_HWND1), $(SCI_HWND2)
 + added: dynamic reloading of the saved scripts ("npes_saved.txt")
 + added: multi-line input in NppExec's Console
 + added: Shift+Enter adds a new line (in NppExec's Console)
 * the "About" dialog slightly updated
 - fixed: potential crash around ScriptContextList.DeleteLast()
 - fixed: CFileBufT::GetLine did not read the trailng empty line
 * changed: now ConsoleDlg::loadCmdHistory ignores empty lines


 v0.8 - February 2022
 --------------------
 + added: built-in highlight filter that catches most of compiler error
   messages, thanks to David Maisonave.
   This filter is disabled by default to avoid an impact on performance.
   It is recommended to enable this filter locally, right before running
   a compiler or an interpreter: "npe_console local -- x+".
   See also: "NppExec_TechInfo.txt", the 'CompilerErrors' setting.
 + added: now WarningAnalyzer caches the previously matched lines.
   It allows the built-in highlight filter (see above) to react to a
   double-click in the Console even when this filter is disabled at the
   moment of double-clicking. Explanation: let's consider a situation when
   the built-in highlight filter had been disabled globally but was locally
   enabled via "npe_console local -- x+" right before running a compiler. So
   the messages produced by compiler are analyzed by the built-in highlight
   filter and the filter is automatically disabled after the compiler exits.
   Now, as WarningAnalyzer has cached the matched lines from the compiler's
   output, it is possible to double-click these lines in NppExec's Console
   to get the cached match result.
 + added: the last executed script is now saved to "npes_last.txt".
 + added: new menu items "Execute Selected Text", "Execute Clipboard Text".
 + NPE_CONSOLE c<N> and s<N> to change the text processing for the
   Execute Clipboard Text and Execute Selected Text.
 + NPE_CONSOLE j+/j- to kill process tree on/off.
 + added: new command "proc_input".
 + added: new command "npp_exectext".
 + added: new variables $(SELECTED_TEXT), $(IS_PROCESS).
 * changed: the menu item "Disable command aliases" has been removed. Use
   the "npe_console q+/q-" instead.
 * changed: now "help" command works in NppExec's scripts.
 * npp_files updated to Notepad++ 8.3.
 * note: 32-bit NppExec is compatible with Notepad++ 7.9.2 under Windows XP.
 - fixed: now "set local" (without an argument) prints only local vars.
 - fixed: "npe_console k3" did not work with Alt+key.
 + NppExec Manual updated


 v0.7.1 - August 2021
 --------------------
 * changed: now IF/IF~/ELSE IF use delayed $(var) substitution.
   It means that IF "$(var)" != "" will work even when the value of $(var)
   contains inner " quote character(s).
 + added: now npe_debuglog supports the keyword "local".
 - fixed: when there was a "local" command followed by a similar "non-local"
   command, the "non-local" one behaved as if it was "local".
 * changed: $(var) substitution has been reworked and improved.
 + added: set <var> ~ strexpand <s>


 v0.7 - July 2021
 ----------------
 + added: now NppExec supports the "Dark Mode" of Notepad++ v8
   (Thanks to Peter Jones for the updated icons!)
   NppExec is still compatible with previous versions of Notepad++.
 * changed: now NppExec supports quoted strings in the form of "abc", 'abc'
   and `abc`.
   This allows to pass quote characters within a quoted string: `"`, '"',
   '"abc" `def`' and so on.
   Now, if you want to pass a text that includes ' or ` character, you need
   to enquote this text in a different pair of quotes. For example:
   `'t was brillig...`, "Can't stop", "Press `Esc`", etc.
 * changed: now NppExec's Console and the Toolbar button explicitly mention
   "NppExec" in their names
 + added: new menu item "Change Execute Script Font..."
 + added: now MESSAGEBOX and INPUTBOX can accept 4th parameter 'time_ms'
 * changed: now the InputBox can be closed by pressing Esc. When it happens,
   the value of $(INPUT) will be empty.
 + added: now con_colour, con_filter, env_set, npe_console, npe_noemptyvars,
   npe_sendmsgbuflen and npp_console support a new keyword "local".
   This new keyword means: the changes are applied locally to the current
   NppExec's script and are reverted back when the current script ends.
   Thus, the "local" keyword does not make sense in a single command executed
   directly in NppExec's Console because the previous state is restored right
   after the execution of this single "local" command, so you will not see any
   effect of it.
 + added: if~ <condition> - first calculates, then checks the condition
 + added: set <var> ~ strescape <s>, set <var> ~ strunescape <s>
 + added: file names "npes_temp.txt" and "npes_saved.txt" can be customized
   (see "NppExec_TechInfo.txt" for details)
 - fixed: indirect variable reference in e.g. "echo #$(i) = $(#$(i))"
 + new advanced option "CustomMsgReady" (see "NppExec_TechInfo.txt")
 + NppExec Manual updated


 v0.6.2 - February 2021
 ----------------------
 * changed: now NppExec uses CreateFile+FILE_FLAG_WRITE_THROUGH while writing
   files to avoid filling with zero bytes on system shutdown.
 * changed: now NppExec changes the current directory to %TEMP% when an unnamed
   file (such as "new 1") is activated and "Follow $(CURRENT_DIRECTORY)" is on.
   To revert to the old behavior (the current directory is not changed when an
   unnamed file is activated), set the manual option "Cd_UnnamedFile" to 0.
 + added: now NppExec supports "cloud location path" in Notepad++'s settings.
     With cloud location path specified in Notepad++'s settings, NppExec does
     the following:
     * On start, NppExec tries to read its configuration files from the cloud
       location path. If these files do not exist or are filled with NULs,
       NppExec reads its configuration from $(PLUGINS_CONFIG_DIR).
     * When NppExec saves its configuration files, first they are saved to
       $(PLUGINS_CONFIG_DIR) and then copied to the cloud location path. Thus,
       NppExec always has copies of its current configuration files within the
       $(PLUGINS_CONFIG_DIR) folder.
     * NppExec's saved scripts - the "npes_saved.txt" file - are monitored in
       the cloud location path. So, if you manually edit the "npes_saved.txt"
       within the cloud location, NppExec detects it. If, however, you manually
       edit the "npes_saved.txt" within the $(PLUGINS_CONFIG_DIR) folder, it is
       ignored.
     When the cloud location path is _not_ specified in Notepad++'s settings,
     NppExec reads and stores its configuration within $(PLUGINS_CONFIG_DIR).
     And the "npes_saved.txt" is monitored in that folder.
 + added: $(NPP_FULL_FILE_PATH), $(CLOUD_LOCATION_PATH)
 + added: indirect variable reference, e.g. $($(name)). Examples:
     set local c = 123        // $(c) = 123
     set local b = c          // $(b) = c
     set local a = $($(b))    // $(a) = $($(b)) = $(c) = 123
     set local $($(b)) = 456  // $(c) = 456
     unset local $($(b))      // deletes $(c)
     set local i = #          // $(i) = #
     set local j = 1          // $(j) = 1
     echo $($(i)$(j))         // echo $(#1)
 * changed: now the variables $(ARGC), $(ARGV), $(ARGV[1]) and so on support
   the indirect variable reference (see above)
 + added: Ctrl+Break in the Console aborts the currently running script


 v0.6.1 - November 2020
 ----------------------
 * improved: now ChildProcess_RunPolicy=1 works better
 * improved: now GoToLineIfWarningAnalyzerMatch calls SCI_ENSUREVISIBLE
 * npp_files updated to Notepad++ 7.9.1


 v0.6 RC4 - September 2020
 -------------------------
 + added: $(FILE_NAME_AT_CURSOR), $(CON_HWND), $(FOCUSED_HWND)
 + added: $(WORKSPACE_ITEM_*)
 + added: the message "==== READY ====" is optional now (npe_console p-)
 + added: ANSI escape sequences can be ignored (npe_console e1)
 + added: set <var> ~ strquote <s>, set <var> ~ strunquote <s>
 + added: set <var> ~ normpath <path>
 + added: set <var> ~ chr <char code>
 + added: set <var> ~ ord <char>, set <var> ~ ordx <char>
 * now $(LAST_CMD_RESULT) will be 0 in case of StrCalc error (set x ~ ...)
 * now WarningAnalyzer tries to find a file in the current view first
 * now GOTO X equals to GOTO :X, as well as LABEL X equals to LABEL :X
 - fixed: variable names can contain brackets - e.g. $(a(b(c)))
 - fixed: end of an embedded npp_exec-ed script may also be the end of its parent script
 * $(var) completion in the "Execute" and "Console" dialogs improved
 + now FParserWrapper::readConstsFromFile supports "enum { ... }" definitions
 * internal improvements
 + NppExec Manual updated


 v0.6 RC3 - April 2019
 ---------------------
 + new advanced option "ChildProcess_RunPolicy" (see "NppExec_TechInfo.txt")
 * better compatibility with Notepad++ 7.6.x (and higher)
 * internal improvements
 + the NppExec Manual has been updated


 v0.6 RC2 - June 2018
 --------------------
 + new environment variables: $(CLIPBOARD_TEXT), $(NPP_HWND), $(SCI_HWND)
 + new commands: clip_settext, messagebox, exit, npe_sendmsgbuflen
 + set <var> ~ strlensci <string>
 * internal improvements
 + the NppExec Manual has been updated


 v0.6 RC1 - May 2018
 -------------------
 ! NppExec's help files were moved from "doc\*.*" to "doc\NppExec\*.*"
 + new command: npp_setfocus
 + Plugin Interface: new messages NPEM_GETSCRIPTNAMES, NPEM_GETSCRIPTBYNAME
 * now the actual name of NppExec.dll affects the "NppExec" submenu and its "Show Console" item name
 * various small improvements


 v0.6 beta 1 - February 2018
 ---------------------------
 * changed: now the Execute dialog's auto-completion pop-up uses the same upper/lower case
   as the first character of a word being typed (e.g. Npp -> NPP...; npp -> npp...);
   also: now the auto-completion pop-up's height is limited by the number of its items
 + new commands: SCI_FIND, SCI_REPLACE
 + new commands: TEXT_SAVETO, TEXT_LOADFROM
 + Function Parser has been updated to support the bitwise operators: ~, |, &, << and >>
   (thanks to Juha Nieminen and Joel Yliluoma for their advice)
 + $(LAST_CMD_RESULT) - result of the last NppExec's command (1 - succeeded, 0 - failed, -1 - invalid arg)
 - fixed: parameters of sci_sendmsg/npp_sendmsg were truncated to 32-bit in 64-bit NppExec
 - fixed: now pasting to the Console via Shift+Insert is equal to Ctrl+V


 v0.6 alpha 1 - December 2017
 ----------------------------
 1. Project infrastructure updated:
    ! Now NppExec uses C++11 and requires at least VS 2013 Express
    ! 32-bit NppExec targets Windows XP SP3 and higher (because of new VS C++ compiler)
    + Project file for Visual Studio 2013 Express (NppExec_VC12.sln)
    + Project file for Visual Studio 2015 Express (NppExec_VC14.sln)
    + NppExec can be build with Orwell Dev-C++ (NppExec_DevCpp.dev)
    + 64-bit ready (the 64-bit NppExec targets Windows 7 x64 and higher)
 2. Third-party components updated:
    + fparser updated to 4.5.2
    + Notepad++ and Scintilla header files updated to Notepad++ 7.5.1
 3. Scripting abilities enhanced:
    + added: "nppexec:" prefix to execute NppExec's commands from a child console process
    + added: "nppexec::" prefix to execute NppExec's command always in a collateral script
    + added: "@EXIT_CMD" and "@EXIT_CMD_SILENT" macro vars to specify child process'es exit command
      (type "help @exit_cmd" in the Console for details)
    + added: $(PID) macro var, e.g. to be able to "nppexec:taskkill /pid $(PID)"
    + new commands: NPP_SAVEAS, PROC_SIGNAL, SLEEP, NPE_QUEUE
    + set <var> ~ strfromhex <hex string>
    + set <var> ~ strtohex <string>
    + now IF...ELSE IF...ELSE...ENDIF sequences are supported (see "help if")
    + now commands can be executed from macro-vars (e.g. "set a = npp_run calc" and then "$(a)" to execute)
    + now a child console process is tried to be killed first, and only then terminated
    + now "set local" in NppExec's Console creates Console's local vars (not shared with NppExec's script)
    + NppExec's Plugin Interface has been enhanced; NppExecPluginMsgTester has been updated
 4. Improved and fixed:
    + Warning Analyser: more accurate detection of %LINE% and %CHAR%
    + NppExec's Console: Tab-completion improved; also works after "help " and "nppexec:"
    + NppExec's Console: "Tab = \t" allows to type Tab character in the Console
    + now SEL_LOADFROM and CON_LOADFROM detect UTF-8 without BOM
    + now SEL_SAVETO can save as UTF-8 without BOM
    - fixed: font of NppExec's Console could be set incorrectly
    - fixed: crash while calculating very big numbers (e.g. 10^72)
    - fixed: the "exit command" dialog did not use the "Key_Enter" value
    - fixed: now pasting (Ctrl+V) to the Console clears the text formatting
    - fixed: now the Console Filters masks' length is not limited by the edit controls' width
    - fixed: double-click on word-wrapped errors and warnings did not work in the Console
    * plugin's core has been rewritten (the layer of the CNppExecCommandExecutor)
    * other internal improvements
    * even more other internal improvements
    * better error reporting
    * output is suppressed while Notepad++ is exiting (applies to the exit script)
 5. Highlights:
    * The "nppexec:" prefix allows to execute NppExec's commands while working
      with a child console process (e.g. you can start cmd in NppExec's Console
      and type "nppexec: set local @exit_cmd = exit" in cmd's prompt or even
      type "nppexec: taskkill /pid $(PID)" to kill the cmd.exe). The command
      that is executed in such way is an example of so-called collateral
      NppExec's script. (It's collateral because it is executed while a child
      console process is already executing.)
    * The "nppexec::" prefix always starts a collateral (parallel) NppExec's
      script to execute the given command. Even if there is no child process or
      script running in NppExec, this prefix forces a collateral script to be
      created to execute the command.
    * All these variables are local now (similar to "set local"):
      - $(INPUT), $(INPUT[N])
      - $(OUTPUT), $(OUTPUT1), $(OUTPUTL)
      - $(EXITCODE), $(PID)
      - $(MSG_RESULT), $(MSG_WPARAM), $(MSG_LPARAM)
      Now, with collateral scripts, it makes perfect sense to make these
      variables to be local - as they are rather unique for each NppExec's
      script than to NppExec as a whole. (Any NppExec's script can call
      "inputbox", start a child process, send a message - and there is no
      sense to share the resulting variables with all the other scripts.)
    * NPE_CMDALIAS and NPE_QUEUE have additional parameters to enable/disable
      the delayed variables substitution. NPE_QUEUE additionally has a parameter
      that controls whether the queued command will be executed as a separate
      NppExec's script (similar to NPEM_EXECUTE_QUEUED) or not.
      Type "help npe_cmdalias" and "help npe_queue" in NppExec's Console for
      details.
    * NppExec's Plugin Interface has been enhanced; the NppExecPluginMsgTester
      has been updated correspondingly.
    * Now there are 32-bit and 64-bit versions of NppExec.
    * More than 10 years of NppExec! :)

 TODO:

 - update the NppExec Manual (currently it's incomplete, see below)

 - NppExec Manual - add info about opening files ( https://sourceforge.net/p/npp-plugins/discussion/672146/thread/b50394f7/ )
   - add info about @exit_cmd ( https://sourceforge.net/p/npp-plugins/discussion/672146/thread/da49de3c/
                                https://sourceforge.net/p/npp-plugins/discussion/672146/thread/c2179f6d/
                              )
   - add info about NppExec Console colours ( https://sourceforge.net/p/npp-plugins/discussion/672146/thread/c2179f6d/ )
   - other interesting info:
     https://sourceforge.net/p/npp-plugins/discussion/672146/thread/b50394f7/
     https://github.com/d0vgan/nppexec/issues/4
     https://notepad-plus-plus.org/community/topic/15804/macro-delete-lines-that-contains-text-in-clipboard
   - FAQ section?

 - callback scripts? (though, we already have NppEventExec)

 - PrintOutput: add support of "ESC ]" and "ESC [" sequences;
   correspondingly, use CHARFORMAT2 to set both Text and Background color.
   This probably will not be included in v0.6 (requires noticeable time for development & testing).


 v0.5.3 - February 2015
 ----------------------
 + new menu items "Go to next error" and "Go to previous error" (based on
   the HighLight masks), thanks to mrmixer
 + now %FILE% is treated as both %ABSFILE% and %FILE%, so there's no need
   to duplicate the masks with %ABSFILE% and %FILE%
 + maximum number of user menu items increased to 100 (was 40)
 + when npes_saved.txt is saved, its previous version is kept as .bak
 + TAB navigation works in Filter/Replace/HighLight dialog
 + now the INPUTBOX command can accept 3 parameters
 + NppExec Manual updated
 + other small improvements


 v0.5.2.2 - December 2014
 ------------------------
 + now the IF-GOTO statement supports floating-point comparison as well
   (e.g. IF 2.5 < 10.1 GOTO Label2)
 + new advanced option "Console_NulChar" (enhancing v0.5.2.1)
 * 8 years since NppExec was born! :)


 v0.5.2.1 - November 2014
 ------------------------
 + Now NppExec is able to deal with NUL ('\0') character when external
   application outputs it to the Console:
   (Unicode) 0x0000 "NUL" is replaced with 0x25E6 "White Bullet";
   (ANSI) 0x00 "NUL" is replaced with 0x17 "End of Text Block".
 + NppExec Manual updated a little bit.
 * The "Donate..." button has been removed. Since I did not receive any
   donation - either due to ukrainian politics/restrictions as for PayPal
   or due to lack of donations itself - and since this situation is unlikely
   to change, the button has been removed.
   You can always donate to Notepad++ itself.


 v0.5.2 - January 2014
 ---------------------
 + set local <var> = <value>
 + NppExec's options are now automatically saved on NPPN_SHUTDOWN
 + Ctrl+Z sends ^Z (end-of-file) to current child process
 + new advanced option "Key_Enter", by default its value is "\n"
 + new advanced option "LogsDir" to create NppExec's log files
 + NPE_CONSOLE k0..3 to enable/disable NppExec's shortcut keys in the Console
 + NppExec Manual updated
 + different internal improvements & refactoring
 + fparser updated to v4.5.1
 * 7th anniversary of NppExec :)


 v0.5 - April 2013
 -----------------
 1. Scripting abilities enhanced:
    + new commands: IF, GOTO
    + set <var> ~ strupper/strlower/substr <string>
    + set <var> ~ strfind/strrfind <string>
    + set <var> ~ strreplace <string>
 2. Highlighting abilities enhanced:
    + now all the Console Filters support run-time $(vars)
    + new commands: CON_COLOUR, CON_FILTER
 3. New/enhanced commands:
    + new command: NPP_MENUCOMMAND
    + now sel_settext+ supports '\r'
 4. Fixed:
    - fixed: could not get/modify Notepad++'s main menu when it was hidden
 5. Other:
    + new Console's commands: MANUAL, ABOUT
    * different internal improvements


 v0.4.3.2 - November 2012
 ------------------------
 - fixed: partial file name matching in npp_exec, npp_close, npp_save and
   npp_switch (CNppExec::nppConvertToFullPathName, nppSwitchToDocument)
 + HELP ALL to show all available help (all the commands in detail)
 + @[] in CScriptEngine::doSendMsg


 v0.4.3.1 - September 2012
 -------------------------
 - fixed: "Follow $(CURRENT_DIRECTORY)" did not work on file save
 + NPE_CONSOLE f+/f- r+/r- to enable/disable the console output filters


 v0.4.3 - May 2012
 -----------------
 + now NppExec's Console keeps its shown/hidden state after Notepad++ restarts
   (* thanks to ufo-pu55y for help)
 + NPP_CONSOLE +/- to enable/disable output to the Console
 + some refactoring of NppExec's Console functions


 v0.4.2.1 - March 2012
 ---------------------
 - fixed: incorrect check of Notepad++ version


 v0.4.2 - November 2011
 ----------------------
 - fixed: $("var") was processed incorrectly
 + now npe_cmdalias uses run-time $(vars)
 + set <var> ~ strlen <string>
 + set <var> ~ strlenutf8 <string>
 + $(EXITCODE)
 + npp_sendmsgex, [] in CScriptEngine::doSendMsg
 + %CHAR% in WarningAnalyzer, thanks to Carlos (cabanela)
 + fparser updated to v4.4.3
 + NppExec Manual updated (one step closer to enlightenment :))


 v0.4.1 - July 2010
 ------------------
 - fix for NPP_SENDMSG/SCI_SENDMSG with parameters containing dbl-quote(s)
 + fparser updated to v4.2
 + NppExec Manual updated


 v0.4 - April 2010
 -----------------
 + new commands: NPP_SENDMSG, SCI_SENDMSG
 + SET command extension: set <var> ~ <math expression>
   (using Function Parser by Juha Nieminen, Joel Yliluoma)
 + several small improvements


 v0.3.3.1 - February 2010
 ------------------------
 - fixed: "WS_VSCROLL" was omitted for combo-boxes in IDD_ADVANCEDOPTIONS


 v0.3.3 - January 2010
 ---------------------
 - fix1: now "\r\n" (Enter key emulation) is sent to the pipe separately
 - fix2: n++'es unsubclassing on exit removed (might be dangerous)
 - fix3: now the Console should keep its font always (IMF_AUTOFONT turned off)
 + Help/Manual updated (sections 4.6.3 and 4.6.4 added)


 v0.3.2 - September 2009
 -----------------------
 + new feature: TAB autocompletes file paths (in the Console)
   (* thanks to ILme for initial implementation)
 + new feature: Shift+Tab (in the Console, the same as TAB but backwards)
 - fixed: 'cd \path', 'dir \path' did not jump to the root of current drive
 - fixed: on-exit script was not executed
 + new command: NPE_CMDALIAS
 + new menu item: Disable command aliases
 + new option in NPE_CONSOLE: q+/q-


 v0.3.1 - June 2009
 ------------------
 + new command: SEL_LOADFROM
 + new command: SEL_SETTEXT, SEL_SETTEXT+
 + new variable: $(OUTPUT), $(OUTPUTL), $(OUTPUT1), see NPE_CONSOLE V+
 + several small improvements


 v0.3 final - April 2009
 -----------------------
 * thanks to Greg Webb for the .chm help file (manual)
 + several small fixes
 + new command: NPE_CONSOLE


 v0.3 RC1 - January 2009
 -----------------------
 * thanks to John LaCasse for useful suggestions
 + new environment variable: $(CWD)
 + new commands: ENV_SET/ENV_UNSET
 + new menu item: Toggle Console Dialog (Ctrl+~)
 + now NPE_DEBUGLOG reports on Console double-clicked line's Highlight Filter
 + NppExecPluginMsgTester has been re-designed and updated
 + both Unicode and ANSI builds are supported
 + now the "Execute..." dialog is resizable
 + now NppExec supports remapped shortcut keys (requires Notepad++ >= 5.1.4)
 + other improvements
 + now NppExec has the manual (yes!)


 v0.3 beta1 - November 2008
 --------------------------
 + full Unicode compatibility (for Unicode version of Notepad++)
 + additional functionality
 + improvements in the script engine (architecture re-design)
 + improvements in the warning analyzer (spaces/tabs can be omitted)
 + other improvements and fixes
 + now NppExec gets its configuration directory from Notepad++
 + now you can exit a console process or interrupt current script at any time
 + now both Console Output and Input can be ANSI, OEM or UTF-8
 + now each copy of NppExec.dll has its own Console History
 + new option: Follow $(CURRENT_DIRECTORY)
 + new command: NPP_CONSOLE
 + new environment variable: $(PLUGINS_CONFIG_DIR)


 v0.2.5 release 2 - September 2008
 ---------------------------------
 - fixed: (potential) bug in CNppExec::DoExecScript()
 - fixed: several (potential) bugs, thanks to Patrick Corwin


 v0.2.5 - August 2008
 --------------------
 + added: word wrap in the Console dialog (Ctrl+W)
 * changed: Advanced Options dialog - SaveCmdHistory added,
   RichEdit_MaxTextLength removed
 - fixed: script with spaces in its name was not started using
   associated menu item
 + some improvements
 + new command: NPP_CLOSE
 + new command: INPUTBOX
 * now NppExec uses Rich Edit 2.0 (instead of 1.0) in its Console window
 + added Notepad++'s variables: $(CURRENT_LINE), $(CURRENT_COLUMN)
 + external plugin interface messages:
   NPEM_GETVERDWORD [returns version as DWORD]
   NPEM_GETVERSTR [returns version as string]
   NPEM_GETSTATE [returns state: ready/busy]
   NPEM_PRINT [prints text which can be highlighted by the Highlight Filters]
   NPEM_EXECUTE [executes given commands]
   NPEM_NPPEXEC [executes script/file]
   NPEN_RESULT [as a result of NPEM_EXECUTE or NPEM_NPPEXEC]


 v0.2.4 - June 2008
 ------------------
 + added: "Replace" tab in the Console Filters dialog
 * improved: the code of the DlgConsoleOutputFilter has been rewritten
 + added: Console text and background colours can be changed
 + new command: SEL_SAVETO - saves the selected text to a file
 - fixed: CON_SAVETO did not work under Windows 9x
 + added: ability to execute specified script when Notepad++ starts/exits
 + added: ability to assign a menu item to specified script
   (then you can assign a shortcut key to this menu item in Notepad++)
 + added: Advanced Options dialog
 + other improvements


 v0.2 RC3.2 - February 2008
 --------------------------
 - fixed: NPP_RUN (ShellExecute) did not work with several arguments


 v0.2 RC3.1 - February 2008
 --------------------------
 - fixed: buffer overflow in the Warning Analyzer
 * changed: now NPP_RUN calls ShellExecute() instead of WinExec()


 v0.2 RC3 - January 2008
 -----------------------
 + search in the Console
 + history in the Console Filters dialog
 + several issues fixed
 + several cosmetic improvements


 v0.2 RC2 - December 2007
 ------------------------
 + speeding up the console output
 + watching for changes in "npes_saved.txt"
 + TAB-key in the console auto-completes current command
 + several cosmetic improvements


 v0.2 RC1 - December 2007
 ------------------------
 1. A lot of internal changes/improvements.
 In particular, now all plugin's options are stored, read and written by the
 Options Manager component.
 The Warning Analyzer component, developed by Nicolas Babled, allows to filter
 and recognize different compiler/interpreter error and warning messages - and
 extract useful information from these messages (such as file name and line
 number).
 The Simple Logger component stores detailed information about last executed
 command (can be usefull for "debugging").
 * The console redirecting engine has been improved.
 * Now the plugin identifies itself by its dll-file name. Each copy of the
 plugin (each dll-file) stores its options in corresponding ini-file.
 * Now plugin's environment variables (e.g. "$(FILE_NAME)") are available for
 child console process. For example, start "cmd.exe" and type "echo $(#1)".
 * Now system's environment variables are available in a form of "$(SYS.<var>)"
 e.g. "$(SYS.WINDIR)", "$(SYS.TEMP)" etc.
 * Now the NPP_EXEC command can pass arguments to the script. These arguments
 can be accessed in the script through the following macro-variables:
 $(ARGC), $(ARGV), $(ARGV[n]).
 Example:  npp_exec "script name" param_1 "param 2".
 This example sets the following values for the script:
 $(ARGC) = 3;  $(ARGV) = param_1 "param 2";  $(ARGV[0]) = script name;
 $(ARGV[1]) = param_1;  $(ARGV[2]) = param 2.
 * Each command now have detailed help information. Type "help" or "help help"
 in the NppExec's Console.
 * Now the console commands history is restored when you restart Notepad++.

 2. New menu items:
 (Thanks to Nicolas Babled & Geert Vancompernolle)
 Direct Execute Previous - directly executes previous script.
 No internal messages - do not show such messages as "Process started >>>", etc.
 Save all files on execute - saves all files before executing a script.
 Also NppExec's toolbar icon has been added.

 3. New dialog:  Console Output Filter -> Highlight.
 (Thanks to Nicolas Babled & Geert Vancompernolle)
 This dialog allows you to specify a string mask for compiler/interpreter error
 and warning messages with such keywords as %FILE%, %ABSFILE% and %LINE%.
 These messages can be highlighted with different colours and allow you to go
 to certain line in certain file when double-clicked in the Console window.

 4. New messages:
 NPP_SAVEALL - saves all modified files.
 CON_LOADFROM - loads a file's content to the Console.
 CON_SAVETO - saves the Console's content to a file.
 ECHO - prints a text in the Console (supports internal env. variables)
 SET - sets the value of user's variable
 UNSET - removes user's variable


 v0.2 beta4 - July 2007
 ----------------------
 - fixed: buffer size was not checked before calling OemToChar()
 - fixed/added: '\b' and '\r' handling
 + a lot of changes in plugin's internals (basic cpp-classes and NppExecEngine)
 + new command: cd, cd <path>, cd <drive:\path>
 + new command: dir, dir <mask>, dir <path\mask>
 + new feature: npp_open <mask>, npp_open <path\mask>
 + new environment variables: $(LEFT_VIEW_FILE) and $(RIGHT_VIEW_FILE)
 * thanks to all who wait for this version


 v0.2 beta3 - April 2007
 -----------------------
 - fixed: Delete button (Script name dialog) was not enabled sometimes
 + Menu: Show Console Dialog
 + Console Output Filter: Exclude all empty lines
 + Comment delimiter can be user-defined, // in :// is no more comment


 v0.2 beta2 - March 2007
 -----------------------
 + Menu: Console Commands History.
     When enabled, previous commands can be scrolled by pressing
     arrow keys Up and Down.
 + Menu: Console Output Filter.
     When enabled, output messages from running console process
     can be filtered (i.e. particular lines can be excluded)
 - ConsoleDlg: Ctrl+A is unlocked
 - ConsoleDlg: Quotes "" are no more added automatically for paths
     with spaces (because of a bug with executables w/o extension
     such as "cmd /c calc.exe")
 - Several internal fixes
 - Several additional internal fixes :-)
 * Thanks to Jim Granville for his suggestions


 v0.1 - March 2007
 -----------------
 * initial version

