File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,16 @@ function! ghcmod#detect_module()"{{{
153
153
return ' Main'
154
154
endfunction " }}}
155
155
156
+ function ! s: fix_qf_lnum_col (qf)" {{{
157
+ " ghc-mod reports dummy error message with lnum=0 and col=0.
158
+ " This is not suitable for Vim, so tweak them.
159
+ for l: key in [' lnum' , ' col' ]
160
+ if get (a: qf , l: key , -1 ) == 0
161
+ let a: qf [l: key ] = 1
162
+ endif
163
+ endfor
164
+ endfunction " }}}
165
+
156
166
function ! ghcmod#parse_make (lines , basedir)" {{{
157
167
" `ghc-mod check` and `ghc-mod lint` produces <NUL> characters but Vim cannot
158
168
" treat them correctly. Vim converts <NUL> characters to <NL> in readfile().
@@ -187,10 +197,8 @@ function! ghcmod#parse_make(lines, basedir)"{{{
187
197
call add (l: qflist , {' text' : l: text })
188
198
endfor
189
199
else
190
- let l: qf .filename = ' '
191
- let l: errortext = join (a: lines , " \n " )
192
- let l: qf .bufnr = 0
193
200
let l: qf .type = ' E'
201
+ call s: fix_qf_lnum_col (l: qf )
194
202
let l: qf .text = ' parse error in ghcmod! Could not parse the following ghc-mod output:'
195
203
call add (l: qflist , l: qf )
196
204
for l: text in a: lines
@@ -369,6 +377,7 @@ function! ghcmod#expand()"{{{
369
377
if has_key (l: qf , ' filename' )
370
378
let l: qf .filename = s: join_path (l: dir , l: qf .filename)
371
379
endif
380
+ call s: fix_qf_lnum_col (l: qf )
372
381
call add (l: qflist , l: qf )
373
382
endfor
374
383
return l: qflist
You can’t perform that action at this time.
0 commit comments