]> git.gir.st - VimFx.git/commit
Fix commit 241c9bf5 in a better way
authorSimon Lydell <simon.lydell@gmail.com>
Sun, 21 Feb 2016 15:30:57 +0000 (16:30 +0100)
committerSimon Lydell <simon.lydell@gmail.com>
Sun, 21 Feb 2016 15:30:57 +0000 (16:30 +0100)
commit02f74554347b06ca9baa9254c7dd9d949bbf8e0c
tree3912f637b22b1cb403dd5185fe340613b16177dc
parent073db9d06fa1855cae5be1ccf6d17368bd4ed3a4
Fix commit 241c9bf5 in a better way

Mentioned commit attempted to fix a problem where `vim.mode` could be
`undefined` in some `vimfx.on(...)` listeners. The button uses such an event
listener, and uses `vim.mode` in the key for a `translate(key)` call, which
caused `translate` to throw an error. This was because `vim.mode` wasn't set
until after a timeout. The fix was to emit the events after the same timeout.

However, the above solution is very unreliable, and the problem still slipped
through every now and then.

The reason the first timeout was added in the first place was to allow calling
`vimfx.getCurrentVim()` inside `vimfx.on(...)` listeners. This commit removes
both timeouts, while still preserving that behavior by splitting the contructor
of `Vim` into a new method, `._start`. This should be bullet-proof, less hacky
and faster.
extension/lib/main.coffee
extension/lib/vim.coffee
extension/lib/vimfx.coffee
Imprint / Impressum