mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
Obey noskips in surrounding, fix #322
This commit is contained in:
4
.github/workflows/vim.yml
vendored
4
.github/workflows/vim.yml
vendored
@@ -14,12 +14,12 @@ jobs:
|
||||
matrix:
|
||||
vim_type: ['Vim']
|
||||
vim_version:
|
||||
- 'head'
|
||||
- 'nightly'
|
||||
- 'v8.0.1575'
|
||||
- 'v7.4.2273'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: 'actions/checkout@v2'
|
||||
- uses: 'actions/checkout@v3'
|
||||
|
||||
- name: Install vader.vim
|
||||
run: git clone --depth=1 https://github.com/junegunn/vader.vim.git test/vader/vader.vim
|
||||
|
||||
@@ -40,7 +40,7 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
function! s:get_delim_multi(opts) " {{{1
|
||||
function! s:get_delim_multi(opts) abort " {{{1
|
||||
let l:best = {}
|
||||
for l:e in get(get(b:, 'matchup_active_engines', {}), a:opts.type, [])
|
||||
let l:res = call(s:engines[l:e].get_delim, [a:opts])
|
||||
@@ -439,11 +439,12 @@ function! s:get_delim(opts) abort " {{{1
|
||||
\ line('.'), l:to)
|
||||
if l:lnum == 0 | break | endif
|
||||
|
||||
" note: the skip here should not be needed
|
||||
" note: the skip here should never be called
|
||||
" in 'current' mode, but be explicit
|
||||
if a:opts.direction !=# 'current'
|
||||
\ && (l:check_skip || g:matchup_delim_noskips == 1
|
||||
\ && getline(l:lnum)[l:cnum-1] =~? '[^[:punct:]]')
|
||||
\ && getline(l:lnum)[l:cnum-1] =~? '[^[:punct:]]'
|
||||
\ || g:matchup_delim_noskips >= 2)
|
||||
\ && matchup#delim#skip(l:lnum, l:cnum)
|
||||
\ && (a:opts.direction ==# 'prev' ? (l:lnum > 1 || l:cnum > 1)
|
||||
\ : (l:lnum < line('$') || l:cnum < len(getline('$'))))
|
||||
|
||||
Reference in New Issue
Block a user