From 56c55d59531340bad9c3a13222c5ffec58176970 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Wed, 30 Apr 2008 00:50:29 -0500 Subject: save and restore the cursor position in the fold text object, so it has no side effects --- vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vimrc b/vimrc index e629abc..9608e09 100644 --- a/vimrc +++ b/vimrc @@ -389,10 +389,12 @@ call Textobj('/', 'Textobj_regex') " }}} " f for folds {{{ function Textobj_fold(inner, count) + let pos = getpos('.') exe 'normal! '.a:count.'[z' let startline = line('.') + a:inner normal! ]z let endline = line('.') - a:inner + call setpos('.', pos) return [startline, 1, endline, strlen(getline(endline))] endfunction -- cgit v1.2.3-54-g00ecf