columnify icon indicating copy to clipboard operation
columnify copied to clipboard

Preserve All Whitespace

Open shellscape opened this issue 9 years ago • 2 comments

Since the module doesn't have configuration (ala text-table) for leading whitespace or space between columns, collapsing all whitespace is problematic. We're left to hack around it by splitting lines for leading whitespace, and we're hosed if we want to configure the whitespace between columns. We can't always know what the minimum width of a column should be, after all.

An option to either preserve (eg. not collapse) whitespace or options for leading and between-column whitespace is sorely needed.

shellscape avatar Dec 08 '16 18:12 shellscape

Personally I would simply like a padding on the entire column. AKA: add \t\t at the start of every line so that the columns can appear indented on the screen when needed.

bradennapier avatar Feb 03 '17 02:02 bradennapier

Found a hack which works!

dataTransform: (s: string) => s.replace(" ", "\u2063")

\u2063 is an 'invisible separator' (ie an invisible comma) and is not matched by the \s regex here

vsinha avatar Dec 08 '17 18:12 vsinha