mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
vim-patch:7.4.397
Problem: Matchparen only uses the topmost syntax item. Solution: Go through the syntax stack to find items. (James McCoy) Also use getcurpos() when possible. https://code.google.com/p/vim/source/detail?r=v7-4-397
This commit is contained in:
@@ -98,10 +98,17 @@ function! s:Highlight_Matching_Pair()
|
|||||||
call cursor(c_lnum, c_col - before)
|
call cursor(c_lnum, c_col - before)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" When not in a string or comment ignore matches inside them.
|
" Build an expression that detects whether the current cursor position is in
|
||||||
|
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s
|
||||||
|
" skip argument.
|
||||||
" We match "escape" for special items, such as lispEscapeSpecial.
|
" We match "escape" for special items, such as lispEscapeSpecial.
|
||||||
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
|
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
|
||||||
\ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
|
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
|
||||||
|
" If executing the expression determines that the cursor is currently in
|
||||||
|
" one of the syntax types, then we want searchpairpos() to find the pair
|
||||||
|
" within those syntax types (i.e., not skip). Otherwise, the cursor is
|
||||||
|
" outside of the syntax types and s_skip should keep its value so we skip any
|
||||||
|
" matching pair inside the syntax types.
|
||||||
execute 'if' s_skip '| let s_skip = 0 | endif'
|
execute 'if' s_skip '| let s_skip = 0 | endif'
|
||||||
|
|
||||||
" Limit the search to lines visible in the window.
|
" Limit the search to lines visible in the window.
|
||||||
|
@@ -235,7 +235,7 @@ static int included_patches[] = {
|
|||||||
//400 NA
|
//400 NA
|
||||||
//399 NA
|
//399 NA
|
||||||
//398,
|
//398,
|
||||||
//397,
|
397,
|
||||||
//396,
|
//396,
|
||||||
//395,
|
//395,
|
||||||
//394,
|
//394,
|
||||||
|
Reference in New Issue
Block a user