From 055f7710b65dfa2df52fc0b5be2486ae36ac5751 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 8 Jul 2018 15:16:28 +0200 Subject: Update dependencies --- ftplugin/eruby.vim | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'ftplugin/eruby.vim') diff --git a/ftplugin/eruby.vim b/ftplugin/eruby.vim index bf380e8a..12d3245f 100644 --- a/ftplugin/eruby.vim +++ b/ftplugin/eruby.vim @@ -7,7 +7,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 " Release Coordinator: Doug Kearns " Only do this when not done yet for this buffer -if exists("b:did_ftplugin") +if get(b:, 'did_ftplugin') =~# '\' finish endif @@ -25,6 +25,8 @@ endif if &filetype =~ '^eruby\.' let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif &filetype =~ '^.*\.eruby\>' + let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>') elseif !exists("b:eruby_subtype") let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') @@ -47,11 +49,14 @@ elseif !exists("b:eruby_subtype") endif endif -if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby' - exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" -else - runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +if &filetype =~# '^eruby\>' + if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby' + exe "runtime! ftplugin/".b:eruby_subtype.".vim ftplugin/".b:eruby_subtype."_*.vim ftplugin/".b:eruby_subtype."/*.vim" + else + runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim + endif endif +let s:did_ftplugin = get(b:, 'did_ftplugin', 1) unlet! b:did_ftplugin " Override our defaults if these were set by an included ftplugin. @@ -68,8 +73,23 @@ if exists("b:match_words") unlet b:match_words endif +let s:cfilemap = v:version >= 704 ? maparg('', 'c', 0, 1) : {} +if !get(s:cfilemap, 'buffer') || !s:cfilemap.expr || s:cfilemap.rhs =~# 'ErubyAtCursor()' + let s:cfilemap = {} +endif +if !has_key(s:cfilemap, 'rhs') + let s:cfilemap.rhs = "substitute(&l:inex =~# '\\' && len(expand('')) ? eval(substitute(&l:inex, '\\', '\\=string(expand(\"\"))', 'g')) : '', '^$', \"\\022\\006\",'')" +endif +let s:ctagmap = v:version >= 704 ? maparg('', 'c', 0, 1) : {} +if !get(s:ctagmap, 'buffer') || !s:ctagmap.expr || s:ctagmap.rhs =~# 'ErubyAtCursor()' + let s:ctagmap = {} +endif +let s:include = &l:include +let s:path = &l:path +let s:suffixesadd = &l:suffixesadd + runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim -let b:did_ftplugin = 1 +let b:did_ftplugin = s:did_ftplugin . '.eruby' " Combine the new set of values with those previously included. if exists("b:undo_ftplugin") @@ -82,6 +102,15 @@ if exists("b:match_words") let s:match_words = b:match_words . ',' . s:match_words endif +if len(s:include) + let &l:include = s:include +endif +let &l:path = s:path . (s:path =~# ',$\|^$' ? '' : ',') . &l:path +let &l:suffixesadd = s:suffixesadd . (s:suffixesadd =~# ',$\|^$' ? '' : ',') . &l:suffixesadd +exe 'cmap