Skip to content

Setting margin=1 strips all vertical spacing #127

@asakura

Description

@asakura

When margin is 1, nufmt removes all empty lines between top-level statements.

Minimal reproducer

use a.nu

def foo[] {1}


def boo[] {2}

Output:

use a.nu
def foo[] {1}
def boo[] {2}

Expected:

use a.nu

def foo[] {1}

def boo[] {2}

Environment

nushell 0.111.0
nufmt 7c5aead0ee254232b78606fa49946fecdcc89c76 and 3982173ee09e562ca2e74068355ae8d858d5e4bf
rustc 1.93.0 (254b59607 2026-01-19) (built from a source tarball)

nufmt.nuon:

{
    indent: 2
    line_length: 80
    margin: 1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions