Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep table indentation level unchanged during formatting #64

Open
igordejanovic opened this issue Oct 25, 2020 · 0 comments
Open

Keep table indentation level unchanged during formatting #64

igordejanovic opened this issue Oct 25, 2020 · 0 comments

Comments

@igordejanovic
Copy link

It would be nice to keep table indentation level unchanged during formatting. I'm using the extension in the context of a language which uses tables which are nested inside other code elements. Currently, Text Tables always reformat table at the first column.

Emacs orgmode keep indentation according to the first row. So the | of the table beginning is anchored and never moves. User can explicitly indent first line to affect indentation of the whole table.

Example:

        | first | second |
  |  blah blah | this is some text |

after reformatting becomes

        | first     | second            |
        | blah blah | this is some text |

I have investigated the code today and the first idea was to keep the indentation level startCol on the table model during parsing and then indent each line by that value during stringifying. Probably navigation commands should be updated to take indentation into account. For example, pressing Tab when in the indent region should jump into the first column of that row.
Are there any gotchas I'm not aware of?

BTW, thanks for the extension. It is really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant