Skip to content

Commit eb51379

Browse files
committed
Drop User BufEnterRails autocommand
The problem with BufEnter is that since it fires so often, people use it as a cudgel when they can't figure out the right way to do something. References: tpope#535
1 parent ec9c53f commit eb51379

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

autoload/rails.vim

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,14 +1222,6 @@ function! s:Refresh(bang)
12221222
endif
12231223
let i += 1
12241224
endwhile
1225-
if exists('#User#BufEnterRails')
1226-
try
1227-
let [modelines, &modelines] = [&modelines, 0]
1228-
doautocmd User BufEnterRails
1229-
finally
1230-
let &modelines = modelines
1231-
endtry
1232-
endif
12331225
endfunction
12341226

12351227
" }}}1

plugin/rails.vim

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ if !exists('g:loaded_projectionist')
8686
runtime! plugin/projectionist.vim
8787
endif
8888

89-
function! s:doau_user(arg) abort
90-
if exists('#User#'.a:arg)
91-
try
92-
let [modelines, &modelines] = [&modelines, 0]
93-
exe 'doautocmd User' a:arg
94-
finally
95-
let &modelines = modelines
96-
endtry
97-
endif
98-
endfunction
99-
10089
augroup railsPluginDetect
10190
autocmd!
10291

@@ -108,11 +97,9 @@ augroup railsPluginDetect
10897
\ if get(g:, 'rails_vim_enter', get(g:, 'projectionist_vim_enter', 1)) &&
10998
\ argc() == 0 && RailsDetect(getcwd()) |
11099
\ call rails#buffer_setup() |
111-
\ call s:doau_user('BufEnterRails') |
112100
\ endif
113101
autocmd FileType netrw
114102
\ if RailsDetect(get(b:, 'netrw_curdir', @%)) |
115-
\ call s:doau_user('BufEnterRails') |
116103
\ endif
117104
autocmd FileType * if RailsDetect() | call rails#buffer_setup() | endif
118105

0 commit comments

Comments
 (0)