Skip to content

Commit

Permalink
Obey noskips in surrounding, fix #322
Browse files Browse the repository at this point in the history
  • Loading branch information
andymass committed Nov 24, 2023
1 parent 9e2ced9 commit 0a14691
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/vim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions autoload/matchup/delim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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('$'))))
Expand Down

0 comments on commit 0a14691

Please sign in to comment.