diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 17:00:20 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-29 17:00:20 -0500 |
commit | 56bb018794806c023106f858b4358468de31c003 (patch) | |
tree | 07727fc2f3481079efb684985aaf7bb98819ff9b | |
parent | 06f286deb40c7f891386b0c68b7c1400c7c7f286 (diff) | |
download | vim-textobj-56bb018794806c023106f858b4358468de31c003.tar.gz vim-textobj-56bb018794806c023106f858b4358468de31c003.zip |
allow text object callbacks to throw an exception meaning 'do nothing'
-rw-r--r-- | vimrc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |