From ed677c34d55a0e025b7008f29419498a3989cde2 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 4 Mar 2019 09:15:44 +0100 Subject: Update --- ftplugin/ruby.vim | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'ftplugin/ruby.vim') diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 5b763e16..4c925fab 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -4,8 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 " Language: Ruby " Maintainer: Tim Pope " URL: https://github.com/vim-ruby/vim-ruby -" Release Coordinator: Doug Kearns -" ---------------------------------------------------------------------------- +" Release Coordinator: Doug Kearns if (exists("b:did_ftplugin")) finish @@ -26,20 +25,20 @@ if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = - \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' . + \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|=\@=\@!' . \ ':' . \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' . \ ':' . - \ '\%(^\|[^.\:@$]\)\@<=\' . + \ '\%(^\|[^.\:@$=]\)\@<=\' . + \ ',^=begin\>:^=end\>,' . \ ',{:},\[:\],(:)' let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . - \ "\\'" endif @@ -154,7 +153,7 @@ 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:map + exe a:mode.'map' '' a:flags a:map let b:undo_ftplugin .= '|sil! '.a:mode.'unmap '.from endif endfunction @@ -313,13 +312,16 @@ function! s:synid() abort endfunction function! s:wrap_i(back,forward) abort - execute 'norm k'.a:forward + execute 'norm! k' + execute 'norm '.a:forward let line = line('.') execute 'norm '.a:back if line('.') == line - 1 return s:wrap_a(a:back,a:forward) endif - execute 'norm jV'.a:forward.'k' + execute 'norm! jV' + execute 'norm '.a:forward + execute 'norm! k' endfunction function! s:wrap_a(back,forward) abort @@ -332,11 +334,15 @@ function! s:wrap_a(back,forward) abort - endwhile if exists('after') - execute 'norm V'.a:forward.'j' + execute 'norm! V' + execute 'norm '.a:forward + execute 'norm! j' elseif line('.') > 1 && getline(line('.')-1) =~# '^\s*$' - execute 'norm kV'.a:forward + execute 'norm! kV' + execute 'norm '.a:forward else - execute 'norm V'.a:forward + execute 'norm! V' + execute 'norm '.a:forward endif endfunction -- cgit v1.2.3