Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move opens fold #3

Closed
cpfaff opened this issue Aug 25, 2013 · 8 comments
Closed

Move opens fold #3

cpfaff opened this issue Aug 25, 2013 · 8 comments

Comments

@cpfaff
Copy link

cpfaff commented Aug 25, 2013

I have several folds in my vimrc (with {{{ and }}}) to keep an overview about the stuff in there. When I use vim move in the upper part of the document it opens the last fold. After it is opened the fold is no longer recognized as fold so it can not be closed anymore. I am using vim 7.4

@cpfaff
Copy link
Author

cpfaff commented Aug 25, 2013

Can try it yourself with a simple file containing this:

asdf 
asdf

# {{{
    asdlfjasdf
# }}}

asdf 
asdf

# {{{
    asdlfjasdf
# }}}

@cpfaff
Copy link
Author

cpfaff commented Aug 25, 2013

When all folds in there are closed. Just go to the first line and move it down to replace the second. The last fold will open. And then go to the last fold to close it again but it will not work as no fold is recognized.

@matze
Copy link
Owner

matze commented Aug 30, 2013

Sorry for the late response, I've been on vacation. I use folds myself and this would affect me, however I cannot replicate this behaviour. When I close all folds in your example above (or my vimrc) I can exchange the topmost lines just fine. Maybe some other fold-related plugin is causing this?

However, there is a big problem when trying to move folds but this is worth a separate ticket.

@cpfaff
Copy link
Author

cpfaff commented Aug 31, 2013

No problem. Well actually I do not much modify the fold settings in my vimrc. I only set:

set foldmethod=marker
set foldnestmax=10

But maybe some of my plugins manipulate fold settings which I do not know about.

@matze
Copy link
Owner

matze commented Aug 31, 2013

I edited your vimrc and nothing opened when moving lines in the upper portion. So, I guess one of the plugins may mess with the fold settings somehow. But it's a bit too much asked, to find out which one.

@cpfaff
Copy link
Author

cpfaff commented Sep 1, 2013

Well seems so. I will try it out which one is the guilty by disabling them all and enableling them one after the other again. Thanks.

@matze
Copy link
Owner

matze commented Oct 15, 2013

I don't like to close it for that reason, but still: works for me.

@matze matze closed this as completed Oct 15, 2013
@asm-jaime
Copy link

It may be useful.
When you open a single fold under cursor: hit enter (or zo) and move string, it causes "close all folds under cursor". To avoid this, just open all folds in the file through: zR

hugomg added a commit to hugomg/vim-move that referenced this issue Jul 17, 2020
The MoveVertically commands now behave more similarly to j and k with
respect to folds. We now move past closed folds instead of moving the
lines inside them.

I think this fixes matze#3.
@hugomg hugomg mentioned this issue Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants