diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 19:08:12 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 19:08:12 -0500 |
commit | 8ef822cfc8114cfcdf68318b13d6b42b3a7e1d09 (patch) | |
tree | 80d43e48d57c6288d6e350c17bc0e6179cc8995b | |
parent | a11458f6b49ed116e2252a5850ea6d0d726b0dc5 (diff) | |
download | vim-textobj-8ef822cfc8114cfcdf68318b13d6b42b3a7e1d09.tar.gz vim-textobj-8ef822cfc8114cfcdf68318b13d6b42b3a7e1d09.zip |
don't try to handle regex textobjects being called when the cursor is on a /, since there's no good way to tell which direction to look for the closing /
-rw-r--r-- | vimrc | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -353,11 +353,17 @@ function Textobj_regex(inner, count) 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 + if objend == 1 + if getline(pos[1])[pos[2] - 2] == '\' + let objend = match(line, '\\\@<!/', 1) + 1 + if objend == 0 + let linenum += 1 + continue + endif + else + " if we're sitting on a /, don't do anything, since it's + " impossible to know which direction to look + throw 'no-match' endif endif let objend += pos[2] - 1 |