abhibeckert/Dux — Issue #48: Support multiple documents per window
Author: abhibeckert
Created: 2012-02-05 18:25:02+00:00
State: open

Split the current document window into two windows. An "editor" window containing the actual titlebar and (in future) any toolbars/etc, and a borderless "document" window containing *only* the text view.

The document window is a childWindow of the main window, so moving one will move the other. The editor window has a placeholder view that is linked to the document window. Resizing the placeholder view will resize the child view. Events sent to the placeholder view will inject the child window's text view into the responder chain before the placeholder view's parent view.

It will then be possible to open multiple documents inside a single editor window, by hiding the current document window and placing a different one in it's place, but still having the previous document open.

Whenever creating a new document or opening an existing document, check preferences and/or the pressed state of the option key and then either create a new editor window for the document, or push it onto a stack of documents in the current editor window.

Allow navigating back and forward through the stack of editor windows in the current document, and also using two finger swipes on the track pad.

Consider that in future we will be even more flexible with this, potentially having multiple document windows visible at once in a single editor window (with nssplitview dividing them) and tabs, and a file browser in the window. There will be a preference for the default behaviour when you open/create a document, a preference for when holding down the option key, and if you hold option-shift a small window pops up asking the user where to open the document (existing window, new window, existing tab, new tab, existing split, new split).