@@ -218,12 +218,11 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
218218 call s: map (' c' , ' ' , ' <C-R><C-W> <Plug><cword>' )
219219 call s: map (' c' , ' ' , ' <C-R><C-F> <Plug><cfile>' )
220220
221- " By using findfile() rather than gf's normal behavior, we prevent
222- " erroneously editing a directory.
223- call s: silmap (' n' , ' gf :<C-U>exe <SID>gf(v:count1,"gf","edit")<CR>' )
224- call s: silmap (' n' , ' <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f","split")<CR>' )
225- call s: silmap (' n' , ' <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>","split")<CR>' )
226- call s: silmap (' n' , ' <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf","tabedit")<CR>' )
221+ nmap <buffer> <script> <SID> : :<C-U><C-R> =v:count ? v:count : ''<CR>
222+ call s: map (' n' , ' <silent>' , ' gf <SID>:find <Plug><cfile><CR>' )
223+ call s: map (' n' , ' <silent>' , ' <C-W>f <SID>:sfind <Plug><cfile><CR>' )
224+ call s: map (' n' , ' <silent>' , ' <C-W><C-F> <SID>:sfind <Plug><cfile><CR>' )
225+ call s: map (' n' , ' <silent>' , ' <C-W>gf <SID>:tabfind <Plug><cfile><CR>' )
227226endif
228227
229228let &cpo = s: cpo_save
@@ -379,20 +378,6 @@ function! RubyCursorFile() abort
379378 return fnameescape (cfile )
380379endfunction
381380
382- function ! s: gf (count ,map ,edit) abort
383- let target = expand (RubyCursorFile ())
384- if target = ~# ' /$'
385- let found = finddir (target, &path , a: count )
386- else
387- let found = findfile (target, &path , a: count )
388- endif
389- if found == # ' '
390- return ' norm! ' .a: count .a: map
391- else
392- return a: edit .' ' .fnameescape (found)
393- endif
394- endfunction
395-
396381"
397382" Instructions for enabling "matchit" support:
398383"
0 commit comments