From 6fed5051008ec464316e6045cb7a900a329929d3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 29 Jul 2019 03:03:53 +0200 Subject: vim-patch:d09091d4955c Update runtime files. https://github.com/vim/vim/commit/d09091d4955c5f41de69928f2db85611ed54ed23 --- runtime/ftplugin/ruby.vim | 100 +++++++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 46 deletions(-) (limited to 'runtime/ftplugin/ruby.vim') diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 84fb9930a4..054c35e5fa 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -2,8 +2,8 @@ " Language: Ruby " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby -" Release Coordinator: Doug Kearns -" ---------------------------------------------------------------------------- +" Release Coordinator: Doug Kearns +" Last Change: 2019 Jan 06 if (exists("b:did_ftplugin")) finish @@ -44,19 +44,12 @@ endif setlocal formatoptions-=t formatoptions+=croql setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\) -setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','') setlocal suffixesadd=.rb if exists("&ofu") && has("ruby") setlocal omnifunc=rubycomplete#Complete endif -" To activate, :set ballooneval -if has('balloon_eval') && exists('+balloonexpr') - setlocal balloonexpr=RubyBalloonexpr() -endif - - " TODO: "setlocal define=^\\s*def @@ -69,7 +62,7 @@ endif function! s:query_path(root) abort let code = "print $:.join %q{,}" - if &shell =~# 'sh' + if &shell =~# 'sh' && empty(&shellxquote) let prefix = 'env PATH='.shellescape($PATH).' ' else let prefix = '' @@ -141,44 +134,54 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") \ "All Files (*.*)\t*.*\n" endif -let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< tags< kp<" +let b:undo_ftplugin = "setl inc= sua= path= tags= fo< com< cms< kp=" \."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" \."| if exists('&ofu') && has('ruby') | setl ofu< | endif" - \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" + +if get(g:, 'ruby_recommended_style', 1) + setlocal shiftwidth=2 softtabstop=2 expandtab + let b:undo_ftplugin .= ' | setl sw< sts< et<' +endif + +" To activate, :set ballooneval +if exists('+balloonexpr') && get(g:, 'ruby_balloonexpr') + setlocal balloonexpr=RubyBalloonexpr() + let b:undo_ftplugin .= "| setl bexpr=" +endif function! s:map(mode, flags, map) abort let from = matchstr(a:map, '\S\+') if empty(mapcheck(from, a:mode)) - exe a:mode.'map' ''.(a:0 ? a:1 : '') a:map + exe a:mode.'map' '' a:map let b:undo_ftplugin .= '|sil! '.a:mode.'unmap '.from endif endfunction -cmap