diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-28 01:25:09 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-28 01:25:09 -0500 |
commit | 8383c3b1eae06c1e4a4441c527d5ac667a1239c3 (patch) | |
tree | 08713cc624ed07540d740d22ad83d15d7ad9d2d5 | |
parent | 21d33b933a7cc4c3534749d631707fbf3c0b67b4 (diff) | |
download | vim-textobj-8383c3b1eae06c1e4a4441c527d5ac667a1239c3.tar.gz vim-textobj-8383c3b1eae06c1e4a4441c527d5ac667a1239c3.zip |
handle the case of the \/ being split when we look forwards and backwards for matching //
-rw-r--r-- | vimrc | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -341,9 +341,20 @@ function Textobj_regex(inner, count) let lines = [line] + getline(pos[1] + 1, line('$')) let linenum = pos[1] for line in lines - let objend = match(line, '\\\@<!/') - if objend != -1 - let objlength += objend + let objend = match(line, '\\\@<!/') + 1 + if objend != 0 + if linenum == pos[1] + " have to account for the possibility of a split escape + " sequence + if objend == 1 && getline(pos[1])[pos[2] - 2] == '\' + let objend = match(line, '\\\@<!/', 1) + 1 + if objend == 0 + let linenum += 1 + continue + endif + endif + let objend += pos[2] - 1 + endif break endif let linenum += 1 |