diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 17:04:05 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 17:04:05 -0500 |
commit | a11458f6b49ed116e2252a5850ea6d0d726b0dc5 (patch) | |
tree | 1c21f0e99ab273d988d6c55e62ffe5f45e82b352 | |
parent | 9082b24b96c233fa2ca58c3d7392bb0953d5c7bd (diff) | |
download | vim-textobj-a11458f6b49ed116e2252a5850ea6d0d726b0dc5.tar.gz vim-textobj-a11458f6b49ed116e2252a5850ea6d0d726b0dc5.zip |
simplify the regex textobj logic a bit
-rw-r--r-- | vimrc | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -332,14 +332,13 @@ function Textobj_regex(inner, count) let lines = getline(1, pos[1] - 1) + [line] let linenum = pos[1] for line in reverse(lines) - let objstart = match(line, '.*\zs\\\@<!/') - if objstart != -1 - let objstart += 1 + let objstart = match(line, '.*\zs\\\@<!/') + 1 + if objstart != 0 break endif let linenum -= 1 endfor - if objstart == -1 + if objstart == 0 throw 'no-match' endif let objstart += a:inner |