Skip to content

Commit a44e944

Browse files
committed
:Rake! doesn't jump to first error
1 parent b038bcc commit a44e944

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

autoload/rails.vim

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -979,15 +979,15 @@ let s:efm_backtrace='%D(in\ %f),'
979979
\.'%\\s%#[%f:%l:\ %#%m,'
980980
\.'%\\s%#%f:%l:\ %#%m'
981981

982-
function! s:makewithruby(arg,...)
982+
function! s:makewithruby(arg,bang,...)
983983
if &efm == s:efm
984-
if a:0 ? a:1 : 1
984+
if (a:0 ? a:1 : 1) && !a:bang
985985
setlocal efm=\%-E-e:%.%#,\%+E%f:%l:\ parse\ error,%W%f:%l:\ warning:\ %m,%E%f:%l:in\ %*[^:]:\ %m,%E%f:%l:\ %m,%-C%\tfrom\ %f:%l:in\ %.%#,%-Z%\tfrom\ %f:%l,%-Z%p^,%-G%.%#
986986
endif
987987
endif
988988
let old_make = &makeprg
989989
let &l:makeprg = rails#app().ruby_shell_command(a:arg)
990-
make
990+
exe 'make'.(a:bang ? '!' : '')
991991
let &l:makeprg = old_make
992992
endfunction
993993

@@ -1026,14 +1026,14 @@ function! s:Rake(bang,lnum,arg)
10261026
let &l:errorformat = '%-P%f:,\ \ *\ [%*[\ ]%l]\ [%t%*[^]]] %m,\ \ *\ [%*[\ ]%l] %m,%-Q'
10271027
" %D to chdir is apparently incompatible with %P multiline messages
10281028
call s:push_chdir(1)
1029-
exe "make ".arg
1029+
exe 'make '.arg
10301030
call s:pop_command()
10311031
if a:bang
10321032
copen
10331033
endif
10341034
elseif arg =~# '^\%(stats\|routes\|secret\|time:zones\|db:\%(charset\|collation\|fixtures:identify\>.*\|version\)\)\%(:\|$\)'
10351035
let &l:errorformat = '%D(in\ %f),%+G%.%#'
1036-
exe "make ".arg
1036+
exe 'make '.arg
10371037
if a:bang
10381038
copen
10391039
endif
@@ -1050,20 +1050,20 @@ function! s:Rake(bang,lnum,arg)
10501050
let extra = ''
10511051
endif
10521052
if self.has_file(file) || self.has_file(file.'.rb')
1053-
call s:makewithruby(withrubyargs.'-r"'.file.'"'.extra,file !~# '_\%(spec\|test\)\%(\.rb\)\=$')
1053+
call s:makewithruby(withrubyargs.'-r"'.file.'"'.extra,a:bang,file !~# '_\%(spec\|test\)\%(\.rb\)\=$')
10541054
else
1055-
call s:makewithruby(withrubyargs.'-e '.s:esccmd(s:rquote(arg)))
1055+
call s:makewithruby(withrubyargs.'-e '.s:esccmd(s:rquote(arg)),a:bang)
10561056
endif
10571057
elseif arg == 'run' || arg == 'runner'
1058-
call s:makewithruby(withrubyargs.'-r"'.RailsFilePath().'"',RailsFilePath() !~# '_\%(spec\|test\)\%(\.rb\)\=$')
1058+
call s:makewithruby(withrubyargs.'-r"'.RailsFilePath().'"',a:bang,RailsFilePath() !~# '_\%(spec\|test\)\%(\.rb\)\=$')
10591059
elseif arg =~ '^run:'
10601060
let arg = s:sub(arg,'^run:','')
1061-
let arg = s:sub(arg,'^%:h',expand('%:h'))
1061+
let arg = s:sub(arg,'^\%:h',expand('%:h'))
10621062
let arg = s:sub(arg,'^%(\%|$|#@=)',expand('%'))
10631063
let arg = s:sub(arg,'#(\w+[?!=]=)$',' -- -n\1')
1064-
call s:makewithruby(withrubyargs.'-r'.arg,arg !~# '_\%(spec\|test\)\.rb$')
1064+
call s:makewithruby(withrubyargs.'-r'.arg,a:bang,arg !~# '_\%(spec\|test\)\.rb$')
10651065
else
1066-
exe 'make '.arg
1066+
exe 'make'.(a:bang ? '!' : '').' '.arg
10671067
endif
10681068
finally
10691069
let &l:errorformat = old_errorformat

0 commit comments

Comments
 (0)