aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-04-28 01:25:09 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-04-28 01:25:09 -0500
commit8383c3b1eae06c1e4a4441c527d5ac667a1239c3 (patch)
tree08713cc624ed07540d740d22ad83d15d7ad9d2d5
parent21d33b933a7cc4c3534749d631707fbf3c0b67b4 (diff)
downloadvim-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--vimrc17
1 files changed, 14 insertions, 3 deletions
diff --git a/vimrc b/vimrc
index 2aad29a..b594357 100644
--- a/vimrc
+++ b/vimrc
@@ -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