Skip to content

modeline in one file destroys folding in all files #313

@dabesl

Description

@dabesl

Neovim version (nvim -v | head -n1)

nvim 0.11.2

Operating system/version

debian bookworm

How to reproduce the issue

I use nvim-ufo with the proposed configuration, especially with zM and zR defined as closeAllFolds and openAllFolds.
provider_selector returns { 'lsp', 'indent' } with basedpyright as lspserver.
Everything works nicely unless when in a series of open python buffers there is one with a modeline saying
# vim: foldmethod=marker foldlevelstart=0
then all folds close at every :w in any of the buffers (not only the one with the modeline). And set foldlevel? shows the value 0 in every buffer.

Expected behavior

Folding should not change state when a buffer is written.

Actual behavior

Folding goes crazy; every fold gets closed when I switch to another buffer or when I write a buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions