susisu/atom-markdown-table-editor

The plugin is not working any more with default scopes config

Morikko opened this issue · 5 comments

I just update recently (0.6.2) and it didn't work any more when I use "tab" in a table.
After studying I discovered:

  • Even in the command palette I didn't see the commands
  • If I put back the previous config: "source.gfm, text.md" in scopes then the commands work again

I saw a modification in this commit 23d6391

Is it normal ?

Hi.

The package now uses scopes instead of grammars to detect tables, and it perfectly depends on how the grammar package (i.e. language-gfm, language-markdown, or ...) works.

Actually I know only one case where a table is no longer detected as before.
If there are spaces before a table, language-gfm and language-markdown do not consider it is a table (even if it may be "correctly" rendered as a table).

  |  A  |  B  |
  | --- | --- |
  |  C  |  D  |
^^
spaces here

If this is not the case, can you tell me what kind of tables you are dealing with?

As a workaround, you can set source.gfm, text.md (as you mentioned) to make it the same as the old versions.

Thanks.

You are right, it is working well except in two cases:

  1. The one you explained with the space
  2. If a letter follows directly a pipe without a space |P

I always used the second way that was the reason I concluded too easily that it was not working. Thanks for your explanation.

Another question, now default alignment is right instead of center, is it possible to change it ?

  1. If a letter follows directly a pipe without a space |P

Oh, I didn't notice that. I always use language-gfm and it does not happen :)
Maybe I should update the screenshot on readme.

Another question, now default alignment is right instead of center, is it possible to change it ?

You mean that default alignment is left, right?

2017-08-31 20 28 36

For now default alignment is fixed (center for header, left for body) and there is no way to change it, but I feel that it should be configured.
I will implement it sooner or later.

You mean that default alignment is left, right?

Yes sure, my bad.

For now default alignment is fixed (center for header, left for body) and there is no way to change it, but I feel that it should be configured.
I will implement it sooner or later.

I prefer center alignment for body as well, being able to configure it is a nice idea. I will wait your implementation.

Good work :)

I just published v0.6.3, which adds a config to change default alignment!