Skip to content

Pretty Printing: Table-making functions should support auto-breaking any column #5550

Open
@xmbhasin

Description

Describe and demonstrate the bug

The table-making functions in Unison.Util.Pretty, such as column2Header and column3Header only support auto-breaking of content in the last column. Content in other columns stretches out the column to fit, leading to potentially very long lines.

Screenshots

I don't have an easy to use reproduction right now, which may be best done with unit tests covering the table-making functions. But from working on a new alternative output for the names command (see #5521), when I tried putting names in the first column, I observed this behaviour:

scratch/main> names max

  'max':
  Hash                                                                        Kind          Names
  a.max, b.max, bar.max, c.max, d.max, e.max, f.max, foo.max, g.max, my.max   #u496htu1d7   Term
  builtin.Float.max                                                           ##Float.max   Term

Another odd issue I encountered is that with many names, the output gets paged through less and everything ends up in one column. TODO: Add example.

Environment (please complete the following information):

  • release/0.5.32-21-gdce127d97 (built on 2025-01-18)
  • Windows 11, Intel CPU

Additional context
Add any other context about the problem here.

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