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/elm.vim | 28 ++-- ftplugin/eruby.vim | 46 +++++- ftplugin/ruby.vim | 48 ++++--- ftplugin/rust.vim | 363 ++++++++++++++++++++++++----------------------- ftplugin/rust/tagbar.vim | 38 +++++ ftplugin/vue.vim | 12 +- 6 files changed, 316 insertions(+), 219 deletions(-) create mode 100644 ftplugin/rust/tagbar.vim (limited to 'ftplugin') diff --git a/ftplugin/elm.vim b/ftplugin/elm.vim index c989d922..b2423c29 100644 --- a/ftplugin/elm.vim +++ b/ftplugin/elm.vim @@ -43,14 +43,26 @@ setlocal comments=:-- setlocal commentstring=--\ %s " Commands -command! -buffer -nargs=? -complete=file ElmMake call elm#Make() -command! -buffer ElmMakeMain call elm#Make("Main.elm") -command! -buffer -nargs=? -complete=file ElmTest call elm#Test() -command! -buffer ElmRepl call elm#Repl() -command! -buffer ElmErrorDetail call elm#ErrorDetail() -command! -buffer ElmShowDocs call elm#ShowDocs() -command! -buffer ElmBrowseDocs call elm#BrowseDocs() -command! -buffer ElmFormat call elm#Format() +command -buffer -nargs=? -complete=file ElmMake call elm#Make() +command -buffer ElmMakeMain call elm#Make("Main.elm") +command -buffer -nargs=? -complete=file ElmTest call elm#Test() +command -buffer ElmRepl call elm#Repl() +command -buffer ElmErrorDetail call elm#ErrorDetail() +command -buffer ElmShowDocs call elm#ShowDocs() +command -buffer ElmBrowseDocs call elm#BrowseDocs() +command -buffer ElmFormat call elm#Format() + +" Commands cleanup +let b:undo_ftplugin = " + \ delcommand ElmMake + \|delcommand ElmMakeMain + \|delcommand ElmTest + \|delcommand ElmRepl + \|delcommand ElmErrorDetail + \|delcommand ElmShowDocs + \|delcommand ElmBrowseDocs + \|delcommand ElmFormat + \" if get(g:, 'elm_setup_keybindings', 1) nmap m (elm-make) 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