From 7c300e80f733f229c2a0eb1867fed3d431651fe4 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 9 Jul 2015 13:45:47 +0900 Subject: [PATCH] Don't match perens in comments --- autoload/argwrap.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/argwrap.vim b/autoload/argwrap.vim index 581c780..b20258e 100644 --- a/autoload/argwrap.vim +++ b/autoload/argwrap.vim @@ -44,8 +44,9 @@ function! argwrap#compareRanges(range1, range2) endfunction function! argwrap#findRange(braces) - let [l:lineStart, l:colStart] = searchpairpos(a:braces[0], '', a:braces[1], 'Wnb') - let [l:lineEnd, l:colEnd] = searchpairpos(a:braces[0], '', a:braces[1], 'Wcn') + let l:filter = 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"' + let [l:lineStart, l:colStart] = searchpairpos(a:braces[0], '', a:braces[1], 'Wnb', filter) + let [l:lineEnd, l:colEnd] = searchpairpos(a:braces[0], '', a:braces[1], 'Wcn', filter) return {'lineStart': l:lineStart, 'colStart': l:colStart, 'lineEnd': l:lineEnd, 'colEnd': l:colEnd} endfunction