mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
Wrap strike pattern (ruby, re #75)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user