matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.2k stars 56 forks source link

Undoing a move opens folds #52

Closed hugomg closed 4 years ago

hugomg commented 4 years ago

Sometimes if we move over a folded section and then undo it then it opens the folded section. In the following example, if we move the "aaa" down by one and then undo it opens the fold between {{{ and }}}.

# vim:foldenable:foldmethod=marker

aaa
# {{{
bbb
# }}}
ccc

This might have to do with the cursor position. When the fold gets opened the cursor ends up in the line with the {{{.