vscode-markdown-table-formatter icon indicating copy to clipboard operation
vscode-markdown-table-formatter copied to clipboard

Leading and trailing space when formatting without pipes

Open droberts-sea opened this issue 6 years ago • 1 comments

When formatting with the "Keep First And Last Pipes" option disabled, one space character is inserted before each line, and spaces are included at the end of each line up to the padding limit. IMO it would look better without (particularly the leading space).

Here's a copy-paste. It's much more pronounced if you see it in an editor that displays whitespace.

 Attribute  | Description                                      | Rules                                                                                           
------------|--------------------------------------------------|-------------------------------------------------------------------------------------------------
 vehicle_id | The driver's Vehicle Identification Number (VIN) | String of length 17. Raise an `ArgumentError` if it's the wrong length.                         
 status     | Is this `Driver` available to drive?             | Must be one of `:AVAILABLE` or `:UNAVAILABLE`                                                 
 trips      | A list of trips this driver has driven           | Optional parameter. If not provided, initialize to an empty array (similar to `Passenger`).

droberts-sea avatar Jan 30 '19 04:01 droberts-sea

Hi @droberts-ada, thanks for the feedback.

Currently this feature is controlled by the config option Space Padding which says "How many spaces between left and right of each column content". It doesn't care whether it is the beginning of the line or the end.

This could be an additional option or could be implied when Keep First And Last Pipes is set.

I'll take a look at this sometime this week. But, if you like, you can give it a shot on this change and open a PR.

Much appreciated.

fcrespo82 avatar Jan 30 '19 16:01 fcrespo82