Skip to content

Commit b92ee35

Browse files
committed
Activate on FileType, not BufRead
This suspiciously speeds things up.
1 parent b56cad5 commit b92ee35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/rails.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ endfunction
7878

7979
augroup railsPluginDetect
8080
autocmd!
81-
autocmd BufNewFile,BufRead * call s:Detect(expand("<afile>:p"))
8281
autocmd VimEnter * if expand("<amatch>") == "" && !exists("b:rails_root") | call s:Detect(getcwd()) | endif | if exists("b:rails_root") | silent doau User BufEnterRails | endif
83-
autocmd FileType netrw if !exists("b:rails_root") | call s:Detect(expand("%:p")) | endif | if exists("b:rails_root") | silent doau User BufEnterRails | endif
82+
autocmd BufNewFile,BufRead * if empty(&filetype) | call s:Detect(expand("<afile>:p")) | endif
83+
autocmd FileType * if !exists("b:rails_root") | call s:Detect(expand("%:p")) | endif | if exists("b:rails_root") | silent doau User BufEnterRails | endif
8484
autocmd BufEnter * if exists("b:rails_root")|silent doau User BufEnterRails|endif
8585
autocmd BufLeave * if exists("b:rails_root")|silent doau User BufLeaveRails|endif
8686
autocmd Syntax railslog if s:autoload()|call rails#log_syntax()|endif

0 commit comments

Comments
 (0)