vkocubinsky / SublimeTableEditor

This package is no more supported. I moved to vim.
Other
494 stars 67 forks source link

Add support for reStructuredText code syntax #16

Closed herau closed 11 years ago

herau commented 11 years ago

would it be possible at an indentation to keep the spaces left? I work with rst format and I would like to add code in a column of a table and to reformat the table with your plugin. (with the key tab)

Actual

+--------------------------------------------+
|                widget code                 | 
+============================================+
| .. code-block::javascript                  |
|                                            | 
|    widget.dispatchEvent('onSetTags', object); |
+--------------------------------------------+

Needed : press in tab key (the left spaces have to stay)

+-----------------------------------------------+
|                widget code                    | 
+===============================================+
| .. code-block::javascript                     |
|                                               | 
|    widget.dispatchEvent('onSetTags', object); |
+-----------------------------------------------+

Thanks in advance

vkocubinsky commented 11 years ago

Thanks for feedback.

I am not very familiar with rst, could you clarify how rst work with left space and right space. I tried 2 online reader , one from http://www.tele3.cz/jbar/rest/rest.html (it referred from http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html), and second I found in google http://rst.ninjs.org/, both did not show your table.

I saw on http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables, it looks that rst doesn't change left and rigth space. Is that correct sentence? In case if rst renderer keep left and right spaces , does keep left space more important than keep both?

Thanks!

kakawait commented 11 years ago

Aurelien1 combines two thing

He tried to add some code (formated) inside a table cell, using code syntax. The code syntax is:

.. code-block::language

   the code but indentation is mandatory because it's code-block syntax

there is another syntax where you do not defined language:

::

   the code etc ...

I understand it's two different things but it will be nice if we can configure re-align to left or not

vkocubinsky commented 11 years ago

It looks that it is helpfull feature for tables. I will add configuration parameter like 're-align to lef' or 'keep the spaces left'.

There is other example that use spaces left.

| List       |
|   - item 1 |
|   - item 2 |
|   - item 3 |
|            |
herau commented 11 years ago

Thanks a lot. Le 14 févr. 2013 07:57, "Valery Kocubinsky" notifications@github.com a écrit :

It looks that it is helpfull feature for tables. I will add configuration parameter like 're-align to lef' or 'keep the spaces' left'.

There is other example that use space left.

List - item 1 - item 2 - item 3

— Reply to this email directly or view it on GitHubhttps://github.com/vkocubinsky/SublimeTableEditor/issues/16#issuecomment-13535589.

vkocubinsky commented 11 years ago

Fixed in 1.2.0

Now Table Editor has property

{
    "table_editor_keep_space_left": true
}

If you set this property to true, Table Editor will not touch left space. By default this property is false. You can set this property per file syntax or with the user properties.

Also you can disable/enable this setting on the fly with command palette

If you set "table_editor_keep_space_left": true header will not keep space and will be aligned to center. But you can keep space in header if set property "table_editor_detect_header": false

{

    "table_editor_detect_header": false
}

Also you can disable/enable this setting on the fly with command palette