vim opens my folds on paste. how to prevent that ?

Posted by Stefano Borini on Stack Overflow See other posts from Stack Overflow or by Stefano Borini
Published on 2010-10-13T09:23:36Z Indexed on 2011/01/15 18:53 UTC
Read the original article Hit count: 291

Filed under:
|

There's something weird going on in my fortran folding. This is the example file

module foo
contains
subroutine hello()

end subroutine hello
subroutine hello()

end subroutine

subroutine hello()

end subroutine
end module foo

subroutine hello()

end subroutine
subroutine hello()

end subroutine
subroutine hello()

end subroutine

and this is the vimrc

syntax on
au! BufRead,BufNewFile *.f90 setfiletype fortran
set foldmethod=syntax
let fortran_fold=1

The annoying thing is the following. If I cut (dd) and paste (P) a folded subroutine outside the module/end module block, the freshly pasted fold stay closed. If I paste it inside the module/end module block, the newly pasted folded region appears instead unfolded. Can you reproduce the issue (vim 7.2 here) and do you know any workaround/fix ?

© Stack Overflow or respective owner

Related posts about vim

Related posts about fortran