Skip to content

line number column has inconsistent width when starting line is set to 0 #183

Closed as duplicate of#57
@Pyr0de

Description

@Pyr0de

For this code,

use annotate_snippets::{Level, Renderer, Snippet};

fn main() {
    let message =
        Level::Error
            .title("mismatched types")
            .snippet(
                Snippet::source("abcd")
                    .line_start(0)
            );

    let renderer = Renderer::styled();
    anstream::println!("{}", renderer.render(message));
}

Output

error: mismatched types
 |
0 |abcd

Output for when starting line is not 0

error: mismatched types
  |
1 | abcd

I would like to try to solve this issue if it needs to be fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions