chrisbra/DistractFree — pull request #8 by jsks (2014-06-19 18:55:37+00:00)
Title: Fix execution of hooks

Hooks aren't being executed for me since the string output of `get(g:distractfree_hook, 'start', 0)` is being coerced to 0 resulting in the test condition being evaluated as `false` even when `distractfree_hook.start` is set. Ex:

```
:echo get(g:distractfree_hook, 'start', 0) != 0
0
```
Relevant .gvimrc:
```
let g:distractfree_hook = {}
let g:distractfree_hook.start = 'hi! link NonText ignore | '.
\ 'hi VertSplit guibg=NONE | '.
\ 'set linespace=3 '
let g:distractfree_hook.stop = 'set linespace=0'
```

`gvim --version`:
http://pastebin.com/raw.php?i=AQub2C01

This commit replaces `get()` with `has_key()` which fixes the problem without changing any functionality.