vim-table-mode icon indicating copy to clipboard operation
vim-table-mode copied to clipboard

TableModeRealign strips leading whitespace in cell

Open brettdh opened this issue 9 years ago • 5 comments

I have a table cell that has a ReST code block, which has leading whitespace. When I call TableModeRealign, the leading spaces are stripped, which collapses the structure of the code in the block.

For example:

    +-------------+-----------------------------------------------------------------------+
    | filters     | JSON object representing a simplified query, of this form::           |
    |             |                                                                       |
    |             |     {                                                                 |
    |             |         "field1": ["value1", "value2"],                               |
    |             |         "field2": ["value3"]                                          |
    |             |     }                                                                 |

becomes

    +-------------+-----------------------------------------------------------------------+
    | filters     | JSON object representing a simplified query, of this form::           |
    |             |                                                                       |
    |             | {                                                                     |
    |             | "field1": ["value1", "value2"],                                       |
    |             | "field2": ["value3"]                                                  |
    |             | }                                                                     |

So far this is my only issue with this extremely useful plugin. Thanks!

brettdh avatar Mar 08 '16 19:03 brettdh

Hey, this is by design, as of now there's no way to configure any padding etc. What it's doing here is simply aligning data within those table separators.

dhruvasagar avatar Aug 23 '16 09:08 dhruvasagar

@brettdh i havn't tried it, but maybe you could insert a character, the plugin doesn't recognize as whitespace at the start of the line and have your indentation behind that. @dhruvasagar would a non break space character work for that?

torpak avatar Feb 12 '18 13:02 torpak

I ran into this issue as well. Any kind of code block within a table gets its leading spaces removed.

camio avatar Aug 23 '18 19:08 camio

The no break space character doesn't work unfortunately.

camio avatar Aug 23 '18 19:08 camio

+1

Timoses avatar Dec 06 '18 10:12 Timoses