Wrap strike pattern (ruby, re #75)

This commit is contained in:
Andy K. Massimino
2019-10-07 21:13:41 -04:00
parent 018cf84ff4
commit 41cc6775ee
3 changed files with 28 additions and 3 deletions

View File

@@ -849,7 +849,7 @@ endfunction
" {strike} pattern of disallowed mid words
" {def} is the fallback skip expression
function! matchup#delim#skip2(strike, def)
return getline('.')[col('.')-1:] =~# '^'.a:strike || eval(a:def)
return getline('.')[col('.')-1:] =~# '^' . a:strike || eval(a:def)
endfunction
let s:invert_skip = 0

View File

@@ -442,8 +442,8 @@ function! s:init_delim_lists(...) abort " {{{1
let l:elems = deepcopy(b:match_midmap)
let l:lists.delim_tex.midmap = {
\ 'elements': l:elems,
\ 'strike': join(map(range(len(l:elems)),
\ '"\\(".l:elems[v:val][1]."\\)"'), '\|')
\ 'strike': '\%(' . join(map(range(len(l:elems)),
\ '"\\(".l:elems[v:val][1]."\\)"'), '\|') . '\)'
\}
endif

View File

@@ -13,3 +13,28 @@ Do (Motion %):
Then (Verify):
AssertEqual 'next', expand('<cword>')
Given ruby (Ruby do end):
context 'webhooks' do
before { allow_any_instance_of(described_class).to receive(:webhook_endpoint_active?).and_return(true) }
it 'runs webhooks' do
expect(Webhook::Runner).to receive(:deliver)
subject
end
end
Do (Motion %):
go2W
%
Then (Verify):
AssertEqual 'end', getline('.')
Do (Motion %):
2ggee
%
%
Then (Verify):
AssertEqual '{', getline('.')[col('.')-1]