From 9082b24b96c233fa2ca58c3d7392bb0953d5c7bd Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Tue, 29 Apr 2008 17:00:48 -0500 Subject: make the regex text object do nothing if it can't find matching pairs of / --- vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vimrc b/vimrc index 2b8697a..a18f33f 100644 --- a/vimrc +++ b/vimrc @@ -339,6 +339,9 @@ function Textobj_regex(inner, count) endif let linenum -= 1 endfor + if objstart == -1 + throw 'no-match' + endif let objstart += a:inner let objstartline = linenum @@ -364,6 +367,9 @@ function Textobj_regex(inner, count) endif let linenum += 1 endfor + if objend == 0 + throw 'no-match' + endif let objend -= a:inner let objendline = linenum -- cgit v1.2.3-54-g00ecf