Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Release!

  • Loading branch information...
commit a9faf04a34d2d78d5b20bfdd72749a56cd5936f4 1 parent 0558b2d
Tim Pope authored
Showing with 17 additions and 5 deletions.
  1. +3 −3 doc/rails.txt
  2. +14 −2 plugin/rails.vim
6 doc/rails.txt
View
@@ -46,8 +46,8 @@ Rails application development.
and knows about partials, fixtures, and much more. There are two commands,
:A (alternate) and :R (related) for easy jumping between files, including
favorites like model to migration, template to helper, and controller to
- functional test. For more advanced usage, there exists :Rmodel, :Rview,
- :Rcontroller, and several others. |rails-navigation|
+ functional test. For more advanced usage, :Rmodel, :Rview, :Rcontroller,
+ and several other commands are provided. |rails-navigation|
5. Enhanced syntax highlighting. From has_and_belongs_to_many to
distance_of_time_in_words, it's here. For Vim 7 users, 'completefunc' is
@@ -67,7 +67,7 @@ Rails application development.
8. Integration with other plugins. |:Rproject| creates a new project.vim
project. |:Rdbext| loads database settings from database.yml for dbext.vim
(and this happens by default under most situations). Cream users get some
- additional keybindings, and all GUI users get a menu.
+ additional mappings, and all GUI users get a menu.
==============================================================================
INSTALLATION AND USAGE *rails-installation*
16 plugin/rails.vim
View
@@ -600,7 +600,7 @@ function! s:BufCommands()
let rp = s:ra()
call s:BufScriptWrappers()
call s:BufNavCommands()
- command! -buffer -bar -nargs=? -complete=custom,s:RakeComplete Rake :call s:Rake(<bang>0,<q-args>)
+ command! -buffer -bar -nargs=? -bang -complete=custom,s:RakeComplete Rake :call s:Rake(<bang>0,<q-args>)
command! -buffer -bar -nargs=? -bang -complete=custom,s:PreviewComplete Rpreview :call s:Preview(<bang>0,<q-args>)
command! -buffer -bar -nargs=? -bang -complete=custom,s:environments Rlog :call s:Log(<bang>0,<q-args>)
command! -buffer -bar -nargs=* -bang -complete=custom,s:SetComplete Rset :call s:Set(<bang>0,<f-args>)
@@ -615,6 +615,8 @@ function! s:BufCommands()
let ext = expand("%:e")
if ext == "rhtml" || ext == "rxml" || ext == "rjs" || ext == "mab" || ext == "liquid"
command! -buffer -bar -nargs=? -range Rpartial :<line1>,<line2>call s:Partial(<bang>0,<f-args>)
+ " In case we one day we make Rpartial act like Rview
+ command! -buffer -bar -nargs=? -range Rextract :<line1>,<line2>call s:Partial(<bang>0,<f-args>)
endif
if RailsFileType() =~ '^\%(db-\)\=migration\>' && RailsFilePath() !~ '\<db/schema\.rb$'
command! -buffer -bar Rinvert :call s:Invert(<bang>0)
@@ -729,6 +731,13 @@ function! s:makewithruby(arg)
endfunction
function! s:Rake(bang,arg)
+ let oldefm = ""
+ if a:bang
+ let oldefm = &efm
+ "errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%*\d]: Leaving directory `%f',%D%*\a: Entering directory `%
+ setlocal efm=\%+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%.%#
+ " Want an error format for a full stack backtrace
+ endif
let t = RailsFileType()
let arg = a:arg
if &filetype == "ruby" && arg == '' && g:rails_modelines
@@ -748,7 +757,7 @@ function! s:Rake(bang,arg)
endif
endif
if arg == "stats"
- " So you can see it in Windows
+ " So you can see the output even with an inadequate redirect
call s:QuickFixCmdPre()
exe "!".&makeprg." stats"
call s:QuickFixCmdPost()
@@ -798,6 +807,9 @@ function! s:Rake(bang,arg)
else
make
endif
+ if oldefm != ''
+ let &efm = oldefm
+ endif
endfunction
function! s:raketasks()
Please sign in to comment.
Something went wrong with that request. Please try again.