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()"{{{
153153 return ' Main'
154154endfunction " }}}
155155
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+
156166function ! ghcmod#parse_make (lines , basedir)" {{{
157167 " `ghc-mod check` and `ghc-mod lint` produces <NUL> characters but Vim cannot
158168 " treat them correctly. Vim converts <NUL> characters to <NL> in readfile().
@@ -187,10 +197,8 @@ function! ghcmod#parse_make(lines, basedir)"{{{
187197 call add (l: qflist , {' text' : l: text })
188198 endfor
189199 else
190- let l: qf .filename = ' '
191- let l: errortext = join (a: lines , " \n " )
192- let l: qf .bufnr = 0
193200 let l: qf .type = ' E'
201+ call s: fix_qf_lnum_col (l: qf )
194202 let l: qf .text = ' parse error in ghcmod! Could not parse the following ghc-mod output:'
195203 call add (l: qflist , l: qf )
196204 for l: text in a: lines
@@ -369,6 +377,7 @@ function! ghcmod#expand()"{{{
369377 if has_key (l: qf , ' filename' )
370378 let l: qf .filename = s: join_path (l: dir , l: qf .filename)
371379 endif
380+ call s: fix_qf_lnum_col (l: qf )
372381 call add (l: qflist , l: qf )
373382 endfor
374383 return l: qflist
You can’t perform that action at this time.
0 commit comments