marijnh/CodeMirror — pull request #1937 by ajoslin (2013-11-07 18:51:51+00:00)
Title: vim: make errors not take code focus - new dialog.openNotification

I was trying out CodeMirror's vim mode and was annoyed by how whenever I typed a bad command it would take away focus from the code and make me press OK before allowing me to continue coding.

I added a new method openNotification to allow a timed notification that doesn't take the user's focus.

Then I made vim mode use it. Vim mode now will open a notification at the bottom when you type a bad command (eg ':err'). The notification can be closed by any of the following:

- clicking the notification
- waiting `options.duration` ms
- opening a new notification

This makes vim mode coding more pleasurable, you don't lose focus :-)

I wanted to add tests, but I didn't really know how to start. if someone can tell me the relevant functions to setup a test for this and what to use to instantiate things etc, I would be happy to add a test for it.