CodeSnip v4.25.0 released (includes a fix of a fix for a fix)
It's nice to be able to release a version of CodeSnip containing new features instead of bug fixes. Except that this release also includes bug fixes, including episode 3 of the hibernation bug fix saga.
So what's new? Not a lot except for some new snippet export options:
- For the longest time you've been able to get a copy on the clipboard all the information about a snippet that gets displayed in the detail pane. Now you can finally save the information directly to a file. The only option is Rich Text Format just now, but more formats may make an appearance later.
- When exporting Pascal units and annotated snippet source code various formats can be chosen. HTML 5 format export files has now joined the list or plain text, Pascal, RTF and XHTML
Some annoying, but relatively trivial bugs have also been fixed. Go see the change log if you're curious.
But I can't close this post without mentioning the hibernation bug fix saga.
A third fix of the bug where CodeSnip sometimes crashes after hibernation has been rolled into this release. Now this doesn't mean that the previous fixes didn't work - they did. But, as I mentioned in my posts about releases v4.24.1 and v4.24.2, those fixes relied on dirty hacks of which I was ashamed.
So, along comes Oliver (@SirRufo on GitHub) with a patch that fixes the bug without all the hacks. I've gratefully included this patch in this release. No more shame for me! Thanks Oliver.
⮞ Get release v4.25.0 from GitHub
Here's CodeSnip displaying the new Save Snippet Information dialogue box:
And here it is again, showing the new HTML 5 option when saving annotated source code, and showing a preview of a weirdly named, but valid, function that I use to test the rendering of Unicode identifiers:
The problem with the previous fix was that it does not addresses all situations where the TreeView control gets recreated. I have a RDP session and after closing and reconnect I got that exception because of a WM_SYSCOLORCHANGE event. And there are a lot more reasons for that to happen.
ReplyDeleteNow this should address any recreation although it feels somehow sus with that pointer in the game ;o)
That's interesting that things other than hibernation could cause Windows to recreate the tree view. I'd only ever experienced the hibernation related problem.
DeleteI agree that the pointer is a bit dodgy, but it's a much better solution than my original hack, especially given what you've just said.
I have thought of storing an index into the IView list in the tree node instead of a pointer to the IView instance. But then the data field of the tree node would have to be type cast from Pointer to Integer, which I also don't like to do!! Using indices could cause other problems too.
The most "natural" way would be using a pointer to a record which then has the valuable values. But that would only make sense when you have more than a single reference to an interface, as there is no difference in managing records in a collection or interface instances. It would only be one layer more for nothing.
DeleteThat's true. Certainly not worth loosing sleep over! Given this program is 20 years old this year and started life with Delphi 7, there's going to be a lot more worrying code hidden in there somewhere. I do keep discovering code I'd entirely forgotten about that I wish I'd not seen!
Delete