Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using value formatters of type string while all values in a row are strings leads to formating for that row being skipped #37

Open
YuumiPie opened this issue May 25, 2024 · 0 comments
Labels

Comments

@YuumiPie
Copy link

YuumiPie commented May 25, 2024

I'm not sure that this is similar for other types, but the example below gives an bugged output for the string case:

public Void Run()
{
Table table = new TableBuilder()
    .AddColumn("one")
    .AddColumn("two")
    .RowFormatter<string>(Format)
    .AddColumn("three")
    .RowFormatter<string>(Format)
    .AddColumn("four")
    .AddColumn("five")
    .Build();

table.Config = TableConfig.Unicode();
table.Config = TableConfig.Unicode();
table.AddRow("1", "2","3","4", 123);
table.AddRow("1", "2(\u2190test)","3(\u2190test)","test", 123);
table.AddRow("1", "2(test)","3(test)","test", "123");
table.AddRow("1", "2(test)","3(test)","test", "123");
table.AddRow("1", "2(\u2190test)","3(\u2190test)","test", "123");

Console.WriteLine(table.ToString());
}

private string Format(string test)
{
Color positive = Color.FromArgb(152, 168, 75);
return test.ForegroundColor(positive);
}

Output:
image

Expected result is that all lines would have the two green columns. Breakpoints show that the whole method is skipped in the incorrect rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants