diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-30 00:50:29 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-30 00:50:29 -0500 |
commit | 56c55d59531340bad9c3a13222c5ffec58176970 (patch) | |
tree | 22e34a1dcecd5affe46bc7db1b563f33e0b45ddc | |
parent | 0bcdc704f2a0c3100c43ce18cdc0e4ec95f5fd65 (diff) | |
download | vim-textobj-56c55d59531340bad9c3a13222c5ffec58176970.tar.gz vim-textobj-56c55d59531340bad9c3a13222c5ffec58176970.zip |
save and restore the cursor position in the fold text object, so it has no side effects
-rw-r--r-- | vimrc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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 |