2009-11-03

Notepad++, and a "load langs.xml failed" Solution



I'm a huge fan of Notepad++, the F/OSS text editor for Windows.  Based on Scite, it's a clearn and functional text editor maintained primarily by Don HO (don.h@free.fr).

While I use it primarily as a script editor and know that I don't use nearly all of it's features, I find it invaluable.  Even though I prefer working on a Mac at home, and am a big fan of Linux, it is by far my favourite text editor.  Being a Windows SysAd, I do a fair amount of script writing.  Since it's mostly in Perl and VBScript (with some batch and other things thrown in), I prefer to use a single editor for everything.  While I like the EPIC plugin for Eclipse, I haven't found anything comparable for VBScript.  (Thought I must admit that getting plugins installed on Eclipse for Windows has been flaky at best, and downright broken the rest of the time...) I find that I get mildly annoyed at some of the differences in behavior of my Mac and Linux text editors. I think that it is my favorite text editor!

The Tab handling and Session-state persistence (tabs open are recovered/reopened at the next launch after quitting N++) are top notch.  It seems to me to follow the ethic of "easy things are easy, and difficult things are possible."  While the plugins and macros are probly my most under-used features, they have been invaluable in the times that I have used them.  The Compare diff-ing feature (an included plugin), while feels quirky has been invaluable.

Not everything is sunshine and roses, however.  I personally HATE white-background text-editors.  I personally prefer dark backgrounds and text.  I'm not a fan of the project Originator's choice in theme, where comments are in a bright green Comic Sans font.  To me, a comment should be in the background, not highlighted...  (I also think that in his default style, quoted text is subdued, but I can't remember).  But it is his project, and I thank him for it.  Unfortunately the "stylers configurator", while not a bad tool, is not at all helpful for fixing my glaring pain.  As each language has different types of comments, you can't just use the global styler to fix it; comments are specified in this manner in EACH language.  This means that you have to select each language and each comment type within it and clear the font, color, and size.

Or, open stylers.xml (from your profile's Application Data directory), use the excellent find-n-replace for 'comic sans' and then change the XML.  I personally reset the font name to "" and the size back to "10" from the default 8-point.  Save the file, and reload the style (or quit and reopen N++).  Aaaahhhh...

Oh, and his XML theme makes my eyes bleed.  It's bad...

Since my work refreshed my aging laptop, it was time for a fresh start.  I don't use the auto-update utility included since I'd tired of the notices that there was an update available, but it couldn't actually complete the update.  So now I only update rarely.  On my desktop, I am still running N++ v5.3.1, but my new laptop is now running v5.5.  I'm still not thrilled with it.  First, it seems to encourage importing custom themes instead of manually replacing the stylers.xml.  While this was a nice touch, I didn't discover it until after having some general flakiness with the stylers just not working right.  The inheritance just seems weird.  I eventually did figure out the import thing, and that works fine now.

I liked the 5.3 and earlier capability to restrict the exposed list of program languages.  The preference window is reasonably well done, though I wouldn't mind seeing the ability to do a manually-sorted order, though that's a very minor point.

This would produce a menu like this under v5.3:

But now under v5.5, it looks like this:

I just don't like it. I write in few enough languages that I just don't need the extra layer of navigation. Sure I can fix it myself, but that requires a bit of time that I just don't have (especially given my level of C++ expertise...)


But there was another problem.  It seems that v5.5 just doesn't like you editing the config files, and at some point started complaining that on launch couldn't open 'langs.xml', and would then open N++ with the default theme...  Grrrr.  This only occurred when you opened it by itself, but not if you right-clicked on a file and selected "Edit with Notepad++".  (Outstanding feature.  So useful...)  I know that several people have had these symptoms, but I've seen different solutions floated about, but none of them worked for me.

My solution was such:  I found that on my desktop (which was working) the C:\Program Files\Notepad++\langs.xml was about 74kb, but on my laptop it was empty!  A quit, copy, and reopen fixed life!  I don't know what that was all about, but the fix was easy enough.  Since I can't find my sourceforge credentials, I'm going to post this on my blog for now, and make a note on the wiki/forums.

Regardless of the problems that I perceive, Notepad++ is a fantastic editor, so a Great Many Thanks to Don!



UPDATE:  Version 5.7 fixes this.  In Settings --> Preferences on the Language Menu/Tab Settings tab, the option to "Make language menu compact" controls this behavior.  Uncheck the box.



-Waldo



1 comment: