Version 2.2
Released September 8, 2007

This version adds advanced features related to snippets, regular
expressions, and user-defined tokens. It also strengthens the ability to
select and download files from a web page. Fixes and enhancements are
documented below.


Fixed the Replace with Regular Expression command (Control+Shift+R) not
interpreting standard tokens like \n in the substitution string. Fixed a
space not being inserted before an attribute name in an HTML snippet. Such
an attribute may now contain \n or other nonprinting tokens. It may be
commented out with a semicolon (;) as the first character of the line.

Added a check for whether the file in the current editing window has been
modified by another program since being loaded from disk. If so, you are
prompted whether to open it again (like what Alt+O does manually). If you
answer No, version checking on the current file stops until you save or
reload it.

The Print command (Control+P) now prints a file with a .rtf extension using
the associated program for this operation in the Windows registry (typically
Microsoft Word or WordPad). The Export command (Alt+Shift+E) now includes
options for ASCII format (characters with ANSI codes above 127 are removed),
Mac format (line break is \r), and Unix format (line break is \n).

Added more search commands. As before, Control+F or Control+Shift+F search
forward or backward for standard text. Alt+F3 or Alt+Shift+F3 search
forward or backward for either the chunk at the cursor or selected text.
Control+F3 or Control+Shift+F3 prompt for a regular expression for searching
forward or backward. F3 or Shift+F3 search forward or backward for the last
target, which may be either standard text or a regular expression.

Fixed problems with the Web Download command, and added more commands for
checking and navigation in this and other list-based dialogs (similar to the
FileDir application). Press Shift+DownArrow for check and Next, or
Shift+UpArrow for check and Previous. Press Shift+End for check to Bottom,
or Shift+Home for check to Top. Shift+NumPad5 checks the current item. F8
marks the start of a checking operation, completed with Shift+F8.

Adding the Alt modifier key performs the same action except for uncheckging
rather than checkging. Thus, Alt+Shift+NumPad5 unchecks the current item,
Alt+Shift+Home unchecks to the top of the list, Alt+Shift+End unchecks to
the bottom, Alt+Shift+DownArrow unchecks en route to the next item, and
Alt+Shift+UpArrow unchecks en route to the previous. F8 then Alt+Shift+F8
unchecks items in that range.

Other arrow keypad actions navigate among checkged items. Control+Home goes
to the top checkged item, and Control+End goes to the bottom one.
Control+DownArrow goes to the Next , and Control+UpArrow goes to the

Shift+Space tells you what items are currently checked. Alt+A says the
address of the current item in the list, e.g., 11 of 42.

A new section of EdSharp.ini is called Tokens. Each of these user-defined
tokens is an expression in Microsoft JScript .NET. Three examples are
currently provided in the configuration file. The CurrentDirectory token
illustrates a call to a static method in the .NET Framework Class Library
(FCL) — in this case, returning the current directory of the EdSharp
process. The Signature token shows syntax for a literal string — in this
case, a signature block with multiple lines. The Unordered List token
refers to a JScript file called ul.js that is provided in the HTML snippet

When EdSharp finds that a token refers to a file in the current snippet
folder, it interprets the content of that file as JScript. The ul.js
example creates an unordered list element in HTML after prompting for the
number of items to generate in the list. Its content is as follows:

[Begin Content of ul.js]
var iCount = Interaction.InputBox("Number of Items:", "Input", "0")
var sTag = "<ul>\n"
var i = 1
while (i <= iCount) {
sTag += "<li>Item" + i + "</li>\n"
sTag += "</ul>\n"
[End Content of ul.js]

User-defined tokens may be included in a snippet that has the "form" keyword
in its header. They may also be typed in a document being edited. As
before, the Evaluate Expression command, Control+Equals, evaluates the
current line or selected text as JScript code and places the result on the
line below. The new Replace Tokens command, Control+Shift+Equals, swaps
tokens with their computed results in all or selected text. Thus, you might
press Alt+Shift+M for Manual Options and define a signature token as

Signature=("Sincerely,\nJohn Doe\\n")

Then type %Signature% in your document where you want that to appear, and
use the Replace Tokens command to do it.

Added the Transform Files command (Alt+Equals) to apply a saved set of
search and replace tasks to one or more files — typically to massage data
or formatting in predictable ways (like the Massage Operation command of
TextPal). EdSharp prompts for the job file containing the regular
expressions to apply. Each task is defined by three lines: (1) a comment
explaining the operation, (2) the search expression, and (3) the replacement
expression. A blank line seperates each task. The current editing window
should contain the list of files to process, one per line. Such a list
could be typed manually or generated via the Path List command
(Control+Shift+P). If a file does not include a leading path, the prior one
is assumed.

Here is the content of a sample transform job that defines two tasks:

[Begin Content of TrimLine.txt]
Remove leading space or tab characters from each line
(\A|\n)( |\t)+

Remove trailing space or tab characters from each line
( |\t)+(\r|\Z)
[End Content of TrimLine.txt]