aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-04-30 01:07:44 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-04-30 01:07:44 -0500
commitf78aaa4c9f8893383abfb79d082ce08a844d49ea (patch)
treeeb2eb92bad699c466e20ba5cae259224318f54bd
parent8c7f5761d601115f0c83cd6da7129c44d9b87d86 (diff)
downloadvim-textobj-f78aaa4c9f8893383abfb79d082ce08a844d49ea.tar.gz
vim-textobj-f78aaa4c9f8893383abfb79d082ce08a844d49ea.zip
the fold text object shouldn't do anything if we aren't in a fold
-rw-r--r--vimrc3
1 files changed, 3 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 12d3937..3b2b36c 100644
--- a/vimrc
+++ b/vimrc
@@ -392,6 +392,9 @@ call Textobj('/', 'Textobj_regex')
" }}}
" f for folds {{{
function Textobj_fold(inner, count)
+ if foldlevel(line('.')) == 0
+ throw 'no-match'
+ endif
exe 'normal! '.a:count.'[z'
let startline = line('.') + a:inner
normal! ]z