@@ -153,7 +153,7 @@ function! ghcmod#command#make(type, force) "{{{
153
153
154
154
let l: qflist = ghcmod#make (a: type , l: path )
155
155
call setqflist (l: qflist )
156
- cwindow
156
+ call s: open_quickfix ()
157
157
if empty (l: qflist )
158
158
echo printf (' ghc-mod %s: No errors found' , a: type )
159
159
endif
@@ -168,7 +168,7 @@ function! ghcmod#command#async_make(type, force) "{{{
168
168
let l: callback = { ' type' : a: type }
169
169
function ! l: callback .on_finish (qflist)
170
170
call setqflist (a: qflist )
171
- cwindow
171
+ call s: open_quickfix ()
172
172
if &l: buftype == # ' quickfix'
173
173
" go back to original window
174
174
wincmd p
@@ -194,7 +194,7 @@ function! ghcmod#command#check_and_lint_async(force) "{{{
194
194
let self .first = 0
195
195
else
196
196
call setqflist (a: qflist , ' a' )
197
- cwindow
197
+ call s: open_quickfix ()
198
198
if &l: buftype == # ' quickfix'
199
199
" go back to original window
200
200
wincmd p
@@ -218,7 +218,21 @@ function! ghcmod#command#expand(force) "{{{
218
218
endif
219
219
220
220
call setqflist (ghcmod#expand (l: path ))
221
- cwindow
221
+ call s: open_quickfix ()
222
222
endfunction " }}}
223
223
224
+ function ! s: open_quickfix ()
225
+ let l: func = get (g: , ' ghcmod_open_quickfix_function' , ' ' )
226
+ if empty (l: func )
227
+ cwindow
228
+ else
229
+ try
230
+ call call (l: func , [])
231
+ catch
232
+ echomsg substitute (v: exception , ' ^.*:[WE]\d\+: ' , ' ' , ' ' )
233
+ \ .' : Please check g:ghcmod_open_quickfix_function'
234
+ endtry
235
+ endif
236
+ endfunction
237
+
224
238
" vim: set ts = 2 sw = 2 et fdm = marker:
0 commit comments