aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-04-29 17:00:20 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-04-29 17:00:20 -0500
commit56bb018794806c023106f858b4358468de31c003 (patch)
tree07727fc2f3481079efb684985aaf7bb98819ff9b
parent06f286deb40c7f891386b0c68b7c1400c7c7f286 (diff)
downloadvim-textobj-56bb018794806c023106f858b4358468de31c003.tar.gz
vim-textobj-56bb018794806c023106f858b4358468de31c003.zip
allow text object callbacks to throw an exception meaning 'do nothing'
-rw-r--r--vimrc6
1 files changed, 5 insertions, 1 deletions
diff --git a/vimrc b/vimrc
index a0e925b..2b8697a 100644
--- a/vimrc
+++ b/vimrc
@@ -286,7 +286,11 @@ let g:text_object_number = 0
function Textobj(char, callback)
let g:text_object_number += 1
function Textobj_{g:text_object_number}(inner, operator, count, callback)
- let [startline, startcol, endline, endcol] = function(a:callback)(a:inner, a:count)
+ try
+ let [startline, startcol, endline, endcol] = function(a:callback)(a:inner, a:count)
+ catch /no-match/
+ return
+ endtry
if startline == endline
let objlength = endcol - startcol + 1
else