Browsing articles from "May, 2011"

Beta is now open

May 17, 2011   //   by jIRI   //   Blog  //  Comments Off on Beta is now open

Finally. After long wait, there is first beta of naracea available.

If you wan to participate in this first private beta programme, please, send me an email to jiri at naracea dot com.

When undo is not enough

May 17, 2011   //   by jIRI   //   Blog  //  1 Comment

Writing, at least for me, is iterative process. I tend to write something, then delete it only to find that I actually need deleted part of the text in other place. Eventually I realize, that what I’ve written first time was better than the version I use instead of it.

For short blog posts it is not that annoying, but when writing longer essays or fiction, I feel quite miserable from time to time, because I need to re-write something. To correct this, I decided, that if I was going to write text editor, it would have infinite undo, and that the undo buffer would be saved along with the text.

When I started prototyping what eventually become naracea, I realized two things. First of all, when you store all typing and deleting you have done, there is no need to store the actual text. You can reconstruct it from recorded changes, and with a bit of optimization on the UI side, very good performance can be achieved. Second thing is, that to manage infinite undo buffer old undo and redo operations are not enough.

Let’s take a look on how the undo usually works: we start typing some text:

Lorem ipsum dolor sit amet

Now assume we undo last three words:

Lorem ipsum

But what happens when we hit period? We get the text

Lorem ipsum.

and empty undo buffer. So now the text “dolor sit amet“ is lost, and there is no way getting it back. It is indeed logical behavior, because with just two commands for managing undo and redo, there is no way to get any better. And that’s the reason why naracea uses along with undo and redo (which work the very same way they do in all other text editors) also rewinding and replaying.

If you think about that, undo and redo are editing commands like typing or deleting. It actually alternates the text. But to be able to keep infinite history of the text, we need operations, which are not changing the text it self. We just need to move though the recorded changes and revoke the effect they have on the text.

So in naracea, using undo or redo will store the “change”, which points to changes which are being undone or redone. On the other hand using rewind and replay will just move though the stored changes and present the text in the form it was before each particular change was made.

So using our previous example, rewinding from

Lorem ipsum dolor sit amet

to

Lorem ipsum

will not store any change, or issue and editing command. By clicking on replay button we can get the original text back very easily.

What happens when we rewind the undo? Well, all undone changes will be restored, and the text will look like no undo was done at all.

So taking the final state of the undone document

Lorem ipsum.

and hitting the rewind button will change the text to

Lorem ipsum

Hitting replay again and again will change the text to

Lorem ipsum d

then to

Lorem ipsum do

and if we keep hitting the button long enough, we will end up with the text we had before pressing the first undo:

Lorem ipsum dolor sit amet

Now, what happens if we continue using rewind? The characters will start to disappear again, but now we are not undoing them. We just rewind all the changes until we end up with empty screen. But remember, all changes are stored in the application, so one easy hit on “replay all” button will bring the text back to the last change we have done:

Lorem ipsum.

(Of course, rewinding and replaying text by single change would be tedious, so there are convenience commands to rewind/replay by words, sentences and paragraphs, and similar convenience functions for undo, so you can undo the whole sentence at once.)

You might be thinking: what happens when I have rewound document and I press some key to insert a character in to the editor? Well, there are several options what to do (e.g. preventing editing on rewound text, or replaying it back to the end), but it seems most reasonable to just silently generate undo command, which will turn rewinding in to actual change and allow you to continue as if you undone all the text manually.

But there is more: if we have all these changes stored somewhere, what else can we do with them? You are right. We can try to generate some statistics out of them! While certainly it would be most interesting to build lots of charts and tables from the changes, for version 1.0 there is only one basic “statistic” available. Under the editing area, you can see the timeline. Timeline is graphical representation of how many changes you’ve done to the text in chosen time span.

It is possible to set the span from 1 minute to the 1 year, so you can analyze your writing habits and performance. By default application doesn’t show empty bars, which correspond to the time intervals you have written nothing, because it can turn really annoying really quickly, but for sure you can turn the empty bars on, and then you see your writing performance in one bar graph with resolution you like.

There are more distinctive features in naracea. I will shed some light on them in future posts.