yi-editor/yi — pull request #615 by ethercrow (2014-09-21 10:48:35+00:00)
Title: Vty refactoring

This is WIP. I'm making it a pull request so that we have a place for discussion.

The aim here is to decouple Vty frontend and frontend-agnostic layouting code. The latter part goes into `Yi.UI.SimpleLayout` module. Meanwhile `Yi.UI.Vty` becomes oblivious of the facts that we only have horizontal splits, that mini-window always appears at the bottom of the frame, etc. It justs receives a piece of data describing what goes where and renders everything according to it.

Currently for every interaction cycle (User presses a key -> User sees result) layouting is done twice: the first time when `Yi.Core` calls `Yi.UI.Common.layout`, and the second time when `Yi.Core` calls `Yi.UI.Common.refresh`. Comment in `Yi.UI.Common` module says there is a guarantee that both these calls receive the same `Editor` value with respect to how they are rendered. It just makes me sad that this guarantee is in comment and not in the frontend API type itself.