Or: Eat your own dogfood, not just taste it.
I was so happy with my draft piece table code pretty much working as the backend for the undo/redo system of the basic bytearray model implementation in Okteta. Alright, it still lacks some heavy tests that it can be thrown against. But from my simple tests by just using it it seemed to work.
Then I proudly showed Okteta to someone else. To see that editing in the value column is broken by it. The way the intermediate states in the editing process of a value are synched with the model did not match the change model in my piecetable. Ouch. So I had to switch editing in the value column completely off, just in time for the KDE 4.1 Beta 1 release. Still, I could be a little bit proud as the switch-off was just a one-variable substitution: mNavigator instead of mValueEditor. Things like the latter are what then keeps me thinking again I can code a little 🙂
One obvious solution to the problem above was to add the concept of grouped changes to the piecetable code. I had not planned to do this for KDE 4.1, but it was the best fix I could imagine. So when I found/took some time the last days I went ahead and tried to implement something like that. Looks today like I succeeded. There are some little bugs left, but it works enough that I switched editing in the value column on again, in time for 4.1 Beta 2, hurray.
As a bonus I did another few-liner, so changes done by the filter tool are not just named “Replace” as before, but get the name of the filter. I consider this also a fix, as you can only now identify the filter operations in the history, which is to be suspected I guess:
BTW: The version view on the right in the screenshot is just for development, not included in Okteta release builds since 4.1 Beta 1, so do not wonder if you do not find it in the tool menu.
Bonus for you reading until this line: There is a hidden feature in the value column: In Overwrite mode you can increase and decrease the value of the byte below the cursor by pressing + and – (And now that I write it I think I should add support for operating this way on whole selections. But that should be another feature for Okteta in KDE 4.2 🙂 ).