Hi all,
(Longish email ahead.)
I'm currently working on making the layout of yi windows more flexible
by the user (see Issue 348). Among other things, I would like to have my
windows side-by-side as well as stacked on top of each other. My basic
design has been to add a layout manager to the Yi.Tab.Tab datatype,
which is responsible for dividing up the available space among the open
windows.
I have found it difficult to deal with mini windows, which led me to
wonder if yi's current design regarding mini windows is too general,
which is the topic of this email.
On to the details. Currently, every window in Yi could be a mini window:
(from Yi.Window)
data Window = Window { ... isMini :: Bool ... }
In contrast, Emacs (for instance) has only one minibuffer, and it is
always at the bottom of the screen. Yi's approach clearly adds some
flexibility: you can have more minibuffers, and they can be in various
places on the screen. Is this flexibility actually useful? Some reasons
against it:
1. Issue 349 discusses what happens when multiple minibuffers open;
the behaviour is certainly wrong.
2. Issue 350 discusses what happens when the minibuffer opens
somewhere other than the bottom of the screen; the usability of
suggested completions is reduced.
3. The current Window datatype makes mini windows the same as windows
in every way except appearance. For instance, mini windows can
visit files, can share buffers with other windows, and so on. Do
we want this to happen?
4. Layout, as discussed above. We would like to support layout
managers which say things like "the windows should be side-by-side
and occupy an equal area, except for the first, which occupies
twice the area". If minibuffers are treated as regular windows,
such a request could not always be satisfied: minibuffers are not
allowed to occupy the same area as normal windows.
For example, if the window stack is [normal window, mini window,
normal window], and the layout manager wants to put the windows
side-by-side, then where can the mini window possibly go? The only
reasonable place is beneath (or above) the other windows.
Because of these points, I suggest:
1. All 'Window's are regular. That is, remove 'isMini' from the
'Window' datatype.
2. Create a new 'MiniWindow' type, which supports only the
appropriate features (in particular, it can't access regular buffers)
3. There is a global 'MiniWindow' for yi. Put it in to the 'Editor'
datatype:
data Editor = Editor { ... minibuffer :: MiniWindow ... }
Thoughts?
Cheers,
Reiner
--
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel