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.


18
Aug 09

Build 2.0.10.1010 Goes Stable

There have been no show-stopping issues found in 2.0.10.1010 so I’m very happy to finally declare a new stable release. There will probably be an update for this build at some point in the near future to fix a couple of minor issues and also to test the auto-update system for stable release users.

If you’ve been holding off from testing releases, now is a great time to download the new stable release!

Thanks to all the testers, forum users, bug reporters and patch submitters for making 2.0.10 a great release. If you’re still using 2.0.8 here are some of the highlights:

  1. Vastly improved regular expressions support
  2. Explorer view
  3. Open files view
  4. Vista-behaviour improvements
  5. Win7 Support
  6. API file autocomplete
  7. SDK for building extensions
  8. Style presets
  9. Macro/Script recording with PyPN
  10. Smart Highlight to show all instances of selected word
  11. Loads of bug fixes, and a bunch more new features

24
Jul 09

Now signalling 2.0.10.10 as Stable update

Programmer’s Notepad 2.0.10.10 is now being signalled as a stable update to test the update mechanism. It’s been signalled for those checking for testing releases for the last few days and no show-stopping bugs have been found. Those with the default update check settings will now get this build in the next few days.

Note that this doesn’t mean this is the final stable build yet, although I have high hopes. I’ll leave it a few days longer before actually declaring the build stable for public consumption.