From 7470ef6eff073170127b6d49a3f2f2e552a0e419 Mon Sep 17 00:00:00 2001 From: Kurtis Moxley Date: Thu, 19 May 2022 22:49:26 +0800 Subject: [PATCH] Update vim-ruby. --- .../etc/examples/generators/syntax.rb | 0 .../vim-ruby/ftplugin/eruby.vim | 10 +++-- sources_non_forked/vim-ruby/ftplugin/ruby.vim | 40 +++++++++++-------- sources_non_forked/vim-ruby/indent/ruby.vim | 10 +++-- .../vim-ruby/spec/indent/case_in_spec.rb | 29 ++++++++++++++ .../vim-ruby/spec/spec_helper.rb | 13 ++++++ .../vim-ruby/spec/syntax/methods_spec.rb | 11 +++++ sources_non_forked/vim-ruby/syntax/eruby.vim | 10 ++--- sources_non_forked/vim-ruby/syntax/ruby.vim | 13 +++--- 9 files changed, 102 insertions(+), 34 deletions(-) mode change 100644 => 100755 sources_non_forked/vim-ruby/etc/examples/generators/syntax.rb create mode 100644 sources_non_forked/vim-ruby/spec/indent/case_in_spec.rb diff --git a/sources_non_forked/vim-ruby/etc/examples/generators/syntax.rb b/sources_non_forked/vim-ruby/etc/examples/generators/syntax.rb old mode 100644 new mode 100755 diff --git a/sources_non_forked/vim-ruby/ftplugin/eruby.vim b/sources_non_forked/vim-ruby/ftplugin/eruby.vim index f16715ab..f84ed7fe 100644 --- a/sources_non_forked/vim-ruby/ftplugin/eruby.vim +++ b/sources_non_forked/vim-ruby/ftplugin/eruby.vim @@ -85,8 +85,12 @@ runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim let b:did_ftplugin = 1 " Combine the new set of values with those previously included. -if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +if !exists('b:undo_ftplugin') + " No-op + let b:undo_ftplugin = 'exe' +endif +if !empty(s:undo_ftplugin) + let b:undo_ftplugin .= '|' . s:undo_ftplugin endif if exists ("b:browsefilter") let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter @@ -118,7 +122,7 @@ endif setlocal commentstring=<%#%s%> let b:undo_ftplugin = "setl cms< " . - \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + \ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo diff --git a/sources_non_forked/vim-ruby/ftplugin/ruby.vim b/sources_non_forked/vim-ruby/ftplugin/ruby.vim index 81457288..07186d1e 100644 --- a/sources_non_forked/vim-ruby/ftplugin/ruby.vim +++ b/sources_non_forked/vim-ruby/ftplugin/ruby.vim @@ -52,7 +52,7 @@ endif " TODO: "setlocal define=^\\s*def -setlocal comments=:# +setlocal comments=b:# setlocal commentstring=#\ %s if !exists('g:ruby_version_paths') @@ -86,8 +86,14 @@ endfunction function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') - if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' - let path = substitute(&g:path,',,$',',','') . ',' . path + if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' + let path = path . ',.,,' + elseif &g:path =~# ',\.,,$' + let path = &g:path[0:-4] . path . ',.,,' + elseif &g:path =~# ',,$' + let path = &g:path[0:-2] . path . ',,' + else + let path = substitute(&g:path, '[^,]\zs$', ',', '') . path endif return path endfunction @@ -163,6 +169,8 @@ let b:undo_ftplugin .= "| sil! cunmap | sil! cunmap