Skip to content

long lines automatically become foldable even with set nowrap #21000

Description

@cjxgm

Steps to reproduce

Type some text, with some lines extremely long, beyond the screen.

set nowrap
set foldmethod=expr
set foldexpr='>1'

You should see some lines are folded, and each of those folded lines can unfold to a single line. If not, fold all by zM

Expected behaviour

No lines become foldable.

I can see why they are foldable. If you set wrap, long lines wrap to multiple lines, so they becoming foldable is reasonable. But with set nowrap, it makes no sense to make long lines foldable, as you will be folding single line into single line.

Version of Vim

9.2 (2026 Feb 14) included patches 1-849

Environment

Arch Linux

Logs and stack traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions