Add testcase for #15

This commit is contained in:
Andy K. Massimino
2017-12-20 12:13:18 -05:00
parent f93905c818
commit beb086e12e
3 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
set nocompatible
" load match-up (and commentary)
for s:loc in ['bundle', 'plugged']
let &rtp = '~/.vim/'.s:loc.'/vim-matchup,' . &rtp
let &rtp .= ',~/.vim/'.s:loc.'/vim-matchup/after'
let &rtp = '~/.vim/'.s:loc.'/vim-commentary,' . &rtp
let &rtp .= ',~/.vim/'.s:loc.'/vim-commentary/after'
endfor
" load other plugins, if necessary
" let &rtp = '~/path/to/other/plugin,' . &rtp
filetype plugin indent on
syntax enable
" match-up options go here
function! IsCommentaryOpFunc()
return &operatorfunc ==? matchstr(maparg('<Plug>Commentary', 'n'),
\ '\cset op\%(erator\)\?func=\zs.\{-\}\ze<cr>')
endfunction
let g:matchup_text_obj_linewise_operators = ['d', 'y',
\ 'g@,IsCommentaryOpFunc()', 'V']

13
test/issues/15/gc.vim Normal file
View File

@@ -0,0 +1,13 @@
function! s:test()
let l:str = "hello"
return l:str
endfunction
if condition
call one()
call two()
endif

View File

@@ -0,0 +1,19 @@
set nocompatible
" load match-up (and commentary)
for s:loc in ['bundle', 'plugged']
let &rtp = '~/.vim/'.s:loc.'/vim-matchup,' . &rtp
let &rtp .= ',~/.vim/'.s:loc.'/vim-matchup/after'
let &rtp = '~/.vim/'.s:loc.'/vim-commentary,' . &rtp
let &rtp .= ',~/.vim/'.s:loc.'/vim-commentary/after'
endfor
" load other plugins, if necessary
" let &rtp = '~/path/to/other/plugin,' . &rtp
filetype plugin indent on
syntax enable
" match-up options go here
let g:matchup_text_obj_linewise_operators = ['d', 'y', 'g@', ':']