neovim/neovim — pull request #781 by tarruda (2014-05-29 20:04:34+00:00)
Title: [WIP/RFC] Redraw events

After taking some beating by reading screen.c, I finally started to understand of how it works. This PR will implement redraw events, which will enable the development of UIs and headless functional tests.

While vim uses a static font grid for layout, the data sent from the redraw events assumes little about how it will be displayed and should be very structured. For example, here's some data from the `redraw:tabs` event:

```python
['redraw:tabs', [{'text': '[No Name]', 'selected': False, 'window_count': 4, 'id': 3, 'modified': False}, {'text': '[No Name]', 'selected': True, 'window_count': 5, 'id': 8, 'modified': False}, {'text': '[No Name]', 'selected': False, 'window_count': 5, 'id': 15, 'modified': True}]]
```

The idea is to follow the [presentation model](http://martinfowler.com/eaaDev/PresentationModel.html) pattern, allowing the UI to have as much flexibility as possible. With time we may even enable the allocation of additional "virtual screens" for fonts of different sizes.

The colons in event names is because we will have namespaced event listening, eg:

```python
vim.subscribe('redraw:*')
```