12
Mar 10

Programmer’s Notepad 2.1.3 Released

A new testing release, version 2.1.3 of Programmer’s Notepad has been released to Google Code. This release fixes a bunch of bugs, but more importantly contains a complete rewrite of the Text Clips UI and Management/Editing features.

Changes in 2.1.3:

  1. Complete re-write of text clips view and clips management system
  2. End clip entry on final empty field (experimental)
  3. Smart highlight range now limited to field of view +/- 200 lines, improves speed and usability with large files.
  4. Translations now fed directly from user translation project at pnotepad-twrans.googlecode.com
  5. Switch to boost 1.42

Bug Fixes:

  1. Fix magic folder path changing. Fixes bug #760.
  2. Default to UTF-8 file type if UTF-8 is our default code page. Fixes bug #821.
  3. Fix incorrect behaviour when cancelling project load. Fixes issue #797.
  4. Don’t ignore the first item when searching in Jump dialog. Fixes issue #820.
  5. Project template bugs introduced in 2.1
  6. Use correct foreground color for options section header. Fixes issue #814.
  7. Fix taggers path. Add .pyw to default ctags options.
  8. Reset chunk position at start of clip insertion. Fixes issue #805.
  9. Fix GetLongPathName call. Fixes issue #803.
  10. Don’t lowercase filename on adding new file. Fixes issue #527.

Downloads

Download 2.1.3 Installer
Download 2.1.3 Portable
Download 2.1.3 Multi-Language


12
Mar 10

Text Clips Changes

There has been confusion ever since the Code Templates feature was originally introduced over which to use, Templates or Clips — each feature had useful aspects and the separation between them was a design mistake. As of the 2.1.3 release all Code Templates features have been merged into Text Clips, and Text Clips has been re-designed to present a more understandable and usable feature – completely revamped User Interface, improved management of Clips files, editing built-in.

Screenshot of New Clips Editor

Built-in Editing

You can now Add/Remove/Edit Text Clips using the new 2.1 smart templates syntax directly from the Text Clips window. Text Clips are organised primarily by the scheme they are relevant to, and then optionally by sub-groups. In the screenshot you can see the main Python clips are shown at the top of the view, and then sub-sections for PyPN and Django are visible and expanded. You can add and remove sections in the Text Clips window.

You can always browse clips associated with any scheme, but keyboard shortcuts are limited to the currently selected scheme.

Storage Changes

All the issues with discovery of .clips files should be resolved, and yet we retain great support for user editing of clips (including for non-admin users). Clips files are now organised by scheme, and any changed set of clips is stored in the user settings directory so that settings are kept user-centric and we don’t need to modify installed files.

Out with the Old, In with the New

This change means that support for the old simple Text Clip syntax has been removed in 2.1.3, and many of the clips files will need updating and could do with new relevant clips creating. All submissions welcome!


05
Feb 10

Programmer’s Notepad 2.1.2 Released

A new testing release, version 2.1.2 of Programmer’s Notepad has been released to Google Code. The major new feature in this release is Code Template Fields, but there have been a lot of other changes too:

  • Code Template Fields
  • Cleaner visual style for the document tabs
  • Added line padding options, allows more whitespace between lines
  • Switch to Scintilla’s built-in line length measurement
  • Removed some 3D styling bits to clean up the look of the editor, more to do.
  • New tab text changed from to Untitled
  • -z parameter now assumes a single file after the -z, designed for notepad replacement.
  • Updated to latest Scintilla bits for some multi-caret fixes
  • Fixed a couple of regular expression issues.
  • Fix tools options tab titles.
  • Made SmartHighlight more visible, less alpha blending

In case you haven’t used a 2.1 build yet, here are the other headline features in the testing builds:

  1. Full Unicode Support
  2. Support for Translations – PN in your language
  3. Prototype Command Bar feature (with PyPN)
  4. Multiple simultaneous selections, including typing into block selections
  5. Virtual space

Downloads:

Download 2.1.2 Installer
Download 2.1.2 Multi-language Installer
Download 2.1.2 Portable

Updated Portable download link now, apologies for the confusion!


05
Feb 10

Introducing Template Fields

The next Programmer’s Notepad testing release (2.1.2) adds support for Template Fields. This is the first new feature in a series of improvements to Code Templates/Text Clips which I’ll talk about more in a future post.

Template Fields are the first part of the work necessary to support TextMate Snippet-style features. The best way to show you what’s supported so far is with a quick screencast:

Here are the standard snippet features that are not supported (yet):

  • Regular Expression Modifiers
  • Environment Variables / Contextual values, e.g. Current File Name
  • Inclusion of output from external tools / scripts

These will all be delivered in future releases. I’ve included some sample clips for PHP with the 2.1.2 distribution, but due to a bug with the way new clips are detected you’ll need to delete your InstallClipCache.xml file to force an update – this will be fixed for the next release. You can find the InstallClipCache.xml file in your User Settings directory (e.g. c:\users\myuser\AppData\Roaming\Echo Software\PN2).

Adding new clips is easy, just go to Code Templates in the Options dialog and add templates to the relevant scheme. You insert template fields with this notation:

$(1:Text User Will Replace)

The number is used to link different fields together, the first instance of each one is the “master” field for that number. The number 0 is special and will cause the cursor to be positioned there at the end of clip insertion, e.g.:

while ($(1:Condition))
{
    $(0)
}

Clips you add yourself in options will be available straight away in the editor, just type the shortcut (or part of it) and press Ctrl-Alt-Space. In the future pressing Tab will expand templates where the name is matched.

I hope you enjoy trying out this new feature, a lot of work went into making it!


19
Nov 09

New Development Build

Now that the Mercurial code move is over and a whole bunch more bugs have been worked out, I’m happy to announce the first 2.1 testing release that’s being signalled for downloads. The new build is also available for download here:

Download 2.1.1.2047 Installer
Download 2.1.1.2047 Portable

In case you haven’t been keeping up with the various announced changes, 2.1 has these headline features:

  1. Full Unicode Support
  2. Support for Translations – PN in your language
  3. Prototype Command Bar feature (with PyPN)
  4. Multiple simultaneous selections, including typing into block selections
  5. Virtual space

There are also a lot of bug fixes, smaller improvements and extensions interface improvements. This release of 2.1 is close to what I want to release as the new stable build as soon as it’s proven at least as stable as 2.0.10.


19
Nov 09

Announcing pnotepad-plugins and TextUtil 0.1

I’d like to introduce you to a new Google Code project, pnotepad-plugins. If you can’t tell from the name, this is a contributors-welcome project for Programmer’s Notepad plugins. Everything you need to make plugins using Visual Studio (Express should be fine) in one repository. The repository is stored in Mercurial so you don’t even need to be a project member to use/fork/branch the code.

The first plugin in pnotepad-plugins is TextUtil, it serves not only as an example but also hopefully as a useful plugin too. The first release of TextUtil is now available, and comes with the following commands:

  • Sort Lines
  • Copy Marked Lines
  • Cut Marked Lines
  • Bookmark Marked Lines
  • Marked Ranges to Selections
  • Selections to Marked Ranges
  • Smart Highlight to Selections
  • Smart Highlight to Marked Ranges
  • Reverse Selection(s)

I’d love to see people store their plugin code in this project, and move things forward.

Download TextUtil 0.1 for PN 2.1 now.

To get started just drop textutil.dll in your Programmer’s Notepad directory, and run pn --findexts.


03
Nov 09

Replacing Notepad with PN via Image File Execution Options

A user opened a bug asking me to look into a new way of replacing notepad.exe with PN. Previous methods have involved a small program that pretends to be notepad.exe but actually launches PN. This has a number of problems:

  1. Replacing system files like notepad.exe on modern Windows is much harder due to System File Protection
  2. Many tools expect notepad.exe to hang around until you save the file, meaning they can pick up the changes when you’re done. The notepad.exe replacement exited having launched PN so didn’t work well with this.

The new technique involves using something called Image File Execution Options. This is a set of registry settings used to make Windows run a debugger automatically when a program is launched. We can piggyback on this to run PN instead of notepad when it’s launched.

Steps

1. Create this Registry Key:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
Image File Execution Options\notepad.exe

2. Add a string value called “Debugger”, set the value to:

c:\Program Files\Programmer's Notepad\pn.exe --allowmulti -z

The –allowmulti deals with the second problem listed above, making sure that even if PN is already running a new instance is started – this means that the calling process can wait for PN to exit. The –z tells PN to ignore the next parameter, which when using Image File Execution Options is the process name that we’re replacing – the full path to notepad.exe in this case.

This is only available in the lastest 2.1 testing release for now (1117), but should be ready to try. Let me know how you get on.

 

Note that if you’re on 64-bit Windows you’ll need the following Registry Key instead:

HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows NT\
CurrentVersion\Image File Execution Options

02
Nov 09

Switching to Mercurial

This is probably only of interest to those who use the PN source code,
if you don’t then feel free to move right along!

Now that Google Code supports Mercurial for source control I’m considering whether to move PN to this. Mercurial provides a much better model for managing Open Source project source control as it allows each user to maintain a local set of changes with full change history without needing project approval for commits. Any changes that the project is interested in taking can then be pulled into the main project tree.

Unless there are any major objections to the move I’ll start working on the import soon. The source at it’s final subversion revision will remain available in subversion indefinitely, but new commits will only go to the mercurial repository.

More on Mercurial:

All feedback welcome, here or in the forums.


13
Oct 09

PN Command Bar

Version 2.1 introduces a new prototype feature called the Command Bar. The Command Bar enables modal editing control, allowing advanced keyboard control of the editor – the initial implementation adds some simple VI-style commands.

The handling for the commands is entirely implemented in PyPN, and it’s designed so it’s easy for you to extend and test your extensions immediately. Just edit commands.py and run it as a script and the command handling is updated.

The look and feel will obviously be worked on over time, but this version will be in the forthcoming testing release and can be enabled from the options if you have PyPN installed. This quick video doesn’t show you all of the features already supported (skipping search and some other combination commands) but gives you a feel for what can be done.


18
Aug 09

New Testing Release Incoming…

Guess what?! I haven’t been idly waiting for the stable release to go gold. Instead I got my head down and spent a lot of hours fixing up the Unicode conversion of Programmer’s Notepad. Long overdue, PN 2.1 will be full-unicode but there’s more than just that. Here’s the list of features in the build I’m currently dogfooding:

  1. Full Unicode Support
  2. Support for Translation – PN in your language
  3. Multiple concurrent selections, and block typing
  4. Virtual space

Full Unicode Support

This support extends right the way throughout Programmer’s Notepad, meaning you can now have projects containing complex-script filenames, search for and find Japanese text in your document, and insert Chinese text from your text clips. I’m sure there will be a few bugs in the unicode support, but they’ll be much easier to fix now this work is done.

Translation

I’ve wanted to do this for a long time, and finally found the time and inspiration (plus the prerequisite Unicode support). Version 2.1 supports translations built into fast, small, Windows-standard resources – no runtime string remapping. Translations, however, are performed using the industry and open-source standard PO file format meaning lots of good tools for maintaining the translations. Each translation is then transformed into a Windows-standard resource DLL by black magic, or something like that anyway – I’ll detail this further later.

Want to get your translation in for 2.1? Get started translating PN.

Multiple Selections, Block Typing, Virtual Space

I’ll probably write some more about this at a later stage, but fantastic upstream changes in Scintilla are coming to you in PN 2.1. You can now Ctrl-Click to set multiple insertion points, or Ctrl-Drag to create multiple selections. With multiple insertion points you can type and the same text will be inserted at each point. Virtual Space has been requested so many times I’ve lost count, and finally this release brings it to you.

Screenshot Anyone?
These claims would be worthless without a released build or proof right, so here’s your screenshot:

Programmer's Notepad 2.1 Pseudo-Localised Build

Programmer's Notepad 2.1 Psuedo Localised Build

This build is running with a pseudo-localised language meaning that I can check where strings still need localising. You’ll see there are a bunch still to do, but progress is being made. You can also see a three-line insertion point where I’ve just typed a sentence once and had it appear in three places (this never gets old). Finally the projects window is showing a project containing a Japanese filename – I have no idea what that file is called, but I do know I can save and load the project and file, and can find that text in that file. For those of you who regularly work with non-English text this is huge.

I just have to add the UI to enable language switches and store the configuration, and I’ll release a new testing build – watch this space.