dhruvasagar / dhruvasagar/vim-table-mode

table_mode_align_char doesn't work with multi-line headers

Open
#203 1 comment 1 reaction 0 assignees View on GitHub
hacktoberfest help wanted
Dominant language
Vim Script
Stars
2.2k
Forks
100
PR merge metrics
No merged PRs in 30d

Description

Suppose I make a table with a right alignment marker in the second column:
```
| first thing | second thing |
|-------------+-------------:|
| 1 | 2 |
```
If I run `:TableModeRealign`, the second column is right-aligned as expected:
```
| first thing | second thing |
|-------------+-------------:|
| 1 | 2 |
```
But if I use multiple lines in the header:
```
| first | second |
| thing | thing |
|-------+-------:|
| 1 | 2 |
```
then run `:TableModeRealign`, I instead get left alignment:
```
| first | second |
| thing | thing |
|-------+-------:|
| 1 | 2 |
```
This seems to be caused by the interaction of `tablemode#align#Align` and `tablemode#align#alignments`, together assuming a border line will appear after the first text line.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.