Navigating and rearranging scenes

Posted on July 16, 2012, under FocusWriter

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 a while 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.

Hovering over hidden scene list

Showing scene list

16 comments

Michael says:

July 16, 2012 at 12:47 pm

Brilliant! I’ve been searching for the perfect writing tool and have been using emacs’ org-mode — I enjoyed being able to quickly navigate large sections of the document. At the same time, I enjoyed the focused simplicity of FocusWriter and grew tired of spending so much time futzing with emacs to get it to do what I want. This seems like a great compromise.

Graeme says:

July 16, 2012 at 1:02 pm

Thanks, I hope it works well for you!

Gilles says:

July 17, 2012 at 7:04 am

Graeme, This is wonderful news. I am amazed at the elegance of FocusWriter. It is as aesthetically pleasing as it is simple to use. I have been coming back to it over and over.

Like Michael, have also been using Org Mode in Emacs for the same reasons as his. This feature will make FocusWriter my favorite editor for drafting.

I am very curious about your other plans for this program.

Graeme says:

July 17, 2012 at 11:47 am

Thanks, it isn’t always easy to balance form and function.

I am working on adding a few more features for the next version (editable shortcuts and reloading files), but mostly I only have bug fixes and code cleanups left to do.

Todd Lucas says:

July 17, 2012 at 8:23 pm

Great, so I’m going to be able to change the scene marker to // so it’ll pick up what I’ve been using all along? That’ll be fantastic, and make it very quick for me to test the new release when it drops.

I notice a filter box at the bottom of the scene list. Will it include AND filtering?

Graeme says:

July 17, 2012 at 8:48 pm

Yup, you will be able to set it to // and have it pick things up right away.

Right now the filter only does a simple string match of the text in the list, but this is because I am just using Qt’s QSortFilterProxyModel. I could extend it before release to allow AND filtering.

Todd Lucas says:

July 18, 2012 at 3:40 am

That would be really awesome. I’m already in the habit of putting a //comment in front of each scene with something between list of tag and description of the action. I’m always trying to pick up on threads of scenes where two particular characters appear together or trying to figure out if/when a certain character was present on a certain set or any other number of things where being able to search by Term1 AND Term2 (AND sometimes beyond that) would cut down my search time from non-trivial to nearly instantaneous.

Really looking forward to getting behind the wheel of the new stuff you’ve been packing into FW lately.

Graeme says:

July 18, 2012 at 3:29 pm

I do see how it could be useful to have more complex filtering, and I will definitely have to think about it.

Regular expression based filtering would be incredibly easy to add and quite a bit more powerful, but it isn’t quite what you are looking for. You could accomplish it with a regular expression like (Term1.*Term2|Term2.*Term1), but I imagine that would probably be bit of a hassle to remember.

Todd Lucas says:

July 18, 2012 at 7:56 pm

Not to mention type 20 times a day 😜 Single term filtering is already something of a luxury, so the fact that you included it right off the bat is cool. Once you get multi-term filtering, then you can get FW to mimic many of the vaunted features of a certain other Qt based (at least the Windows version is) writing application, without the nasty chrome and data loss bugs.

Champing at the bit, but trying not to be too obvious about it 😜

Gilles says:

July 19, 2012 at 6:36 am

Hey Graeme, any prognosis on when this update will go live in the Ubuntu ppa? Sorry for sounding impatient, I’m just itching to give a go 🙂

Graeme says:

July 19, 2012 at 11:07 am

When it’s done. 🙂 My best guess would be September, but that it is still only a guess.

Gilles says:

July 19, 2012 at 11:17 am

I know it’ll be well worth the wait. Thank you for sharing your awesome work with us.

mrbernie2 says:

March 3, 2015 at 3:36 am

Hi! Great work! Is it possible to have the scene list display only the first line so that they can be used like headings or titles?

mrbernie2 says:

March 3, 2015 at 3:48 am

Just to elaborate on my last question, I was wondering if I could change the amount of lines that focuswriter’s scene list displays for each scene. I would like for it to display only one line, so that this line could be the heading/title of each scene. Right now, I have so many sections that they do not fit on the scene list without scrolling, but they would if the scene list only displayed a title. The first and second lines of the scene are not important to me in this case. This is the final issue that prevents me from converting to focuswriter completely, as I still use MsWord (gasp!) to drag and drop my headings and move back and forth between them. Is this feature adjustable? Thank you for such a wonderful program!

Graeme says:

March 3, 2015 at 12:52 pm

@mrbernie2 At the moment you can’t control the number of lines shown for the scenes, but it shouldn’t be too much work for me to add that in the next feature release. I can see why it might be useful to show just the scene titles.

mrbernie2 says:

March 3, 2015 at 2:31 pm

Thanks! 😀

Categories