mileszs / ack.vim

Vim plugin for the Perl module / CLI script 'ack'
Other
3.08k stars 396 forks source link

Undefined variable: g:ack_autofold_results on save #124

Closed felixbuenemann closed 10 years ago

felixbuenemann commented 10 years ago

Since updating to the newest version I sometimes get this error on save:

Error detected while processing /Users/felix/Dropbox/dotfiles/vim/bundle/ack.vim/ftplugin/qf.vim:
line    1:
E121: Undefined variable: g:ack_autofold_results
E15: Invalid expression: g:ack_autofold_results
Error detected while processing function <SNR>56_BufWritePostHook..<SNR>56_UpdateErrors..<SNR>56_CacheErrors:
line   28:
E170: Missing :endfor
Error detected while processing function <SNR>56_BufWritePostHook..<SNR>56_UpdateErrors:
line    8:
E171: Missing :endif

I think it happens if a linter chokes on a syntax error in the code I'm writing, so it opens the quickfix window on save.

felixbuenemann commented 10 years ago

I replaced the if check in ftplugin/qf.vim with:

if exists("g:ack_autofold_results") && g:ack_autofold_results

which gets rid of the error.

felixbuenemann commented 10 years ago

Thanks!