Navigating and rearranging scenes
July 15, 2012 16 Comments
After more than a month of work I have finally finished adding scene management to FocusWriter! This is something I have wanted to add for a very long time, and I am excited that it will finally be in the next feature release. It took me a lot longer to implement than I was expecting, and a lot of different attempts to get it to something I am happy with.
On to some details! In essence this is simply a way to quickly navigate and rearrange a document. What I have done is add a sidebar on the left side of the window (resizable by dragging, and only shown when you mouse over and click an expander button). The sidebar lists the scenes of the document and allows you to click to go to different scenes, or to select multiple scenes and drag them around.
One thing that took awhile was deciding what text to show in the sidebar, and how to track it without slowing down typing. In the end I decided to use the first three lines of text for each scene, and it updates them only when the sidebar is shown. I did it that way so that you don’t have to create a description for each scene. Of course, you can write a description at the beginning of a scene, but it is not required and it will be counted in the document statistics.
A scene is detected when a scene divider is found at the beginning of a paragraph. By default it looks for the text
##, but the user can change that to be something else. I considered using text sections as defined by RTF and ODT, but that would not have worked with plain text files. I also didn’t want the scenes to be accidentally thrown away by other word processors.