Skip to content

Commit e6cf6ef

Browse files
committed
Add quickfix support
1 parent 47ac6ce commit e6cf6ef

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

autoload/erlang_compiler.vim

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ function erlang_compiler#AutoRun(buffer)
5454
compiler erlang
5555
let &l:makeprg = fnameescape(g:erlang_compiler_check_script) . ' ' .
5656
\ erlang_compiler#GetFlymakeOptions() . ' %'
57-
setlocal shellpipe=>
58-
execute "silent lmake!" shellescape(bufname(a:buffer), 1)
59-
call erlang_compiler#errors#SetList(a:buffer, getloclist(0))
57+
if !g:erlang_quickfix_support
58+
setlocal shellpipe=>
59+
execute "silent lmake!" shellescape(bufname(a:buffer), 1)
60+
call erlang_compiler#errors#SetList(a:buffer, getloclist(0))
61+
else
62+
setlocal shellpipe=>
63+
execute "silent make!" shellescape(bufname(a:buffer), 1)
64+
call erlang_compiler#errors#SetList(a:buffer, getqflist())
65+
endif
6066
finally
6167
call erlang_compiler#SetLocalInfo(info)
6268
endtry

doc/vim-erlang-compiler.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ g:erlang_flymake_options_rules *g:erlang_flymake_options_rules*
115115
Similar to |g:erlang_make_options_rules|, but used when performing
116116
on-the-fly syntax check (a.k.a. flymake). The default value is [].
117117

118+
g:erlang_quickfix_support *g:erlang_quickfix_support*
119+
Enable |quickfix| support instead of |location-list|. If `1`,
120+
it is enabled, if `0`, it is disabled. The default value is `0`.
121+
118122
COMPILATION OPTIONS *vim-erlang-compilation-options*
119123

120124
--outdir DIR

plugin/erlang_compiler.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ if !exists("g:erlang_flymake_options_rules")
3232
let g:erlang_flymake_options_rules = []
3333
endif
3434

35+
if !exists("g:erlang_quickfix_support")
36+
let g:erlang_quickfix_support = 0
37+
endif
38+
3539
command ErlangDisableShowErrors call erlang_compiler#DisableShowErrors()
3640
command ErlangEnableShowErrors call erlang_compiler#EnableShowErrors()
3741
command ErlangToggleShowErrors call erlang_compiler#ToggleShowErrors()

0 commit comments

Comments
 (0)