aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-04-29 17:04:05 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-04-29 17:04:05 -0500
commita11458f6b49ed116e2252a5850ea6d0d726b0dc5 (patch)
tree1c21f0e99ab273d988d6c55e62ffe5f45e82b352
parent9082b24b96c233fa2ca58c3d7392bb0953d5c7bd (diff)
downloadvim-textobj-a11458f6b49ed116e2252a5850ea6d0d726b0dc5.tar.gz
vim-textobj-a11458f6b49ed116e2252a5850ea6d0d726b0dc5.zip
simplify the regex textobj logic a bit
-rw-r--r--vimrc7
1 files changed, 3 insertions, 4 deletions
diff --git a/vimrc b/vimrc
index a18f33f..afeb53c 100644
--- a/vimrc
+++ b/vimrc
@@ -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