vkocubinsky / SublimeTableEditor

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

Character '+' should not be recognized as a table #14

Closed vkocubinsky closed 10 years ago

vkocubinsky commented 11 years ago

Now '+' character recognized as a table it make a problem in markdown mode where character '+' uses as list marker.

unnamedcrewman commented 11 years ago

I just wondered how difficult this would be to fix. I may be missing something, but it seems like there needs to be some way to escape the + symbol overall. I've run into issues with markdown as well as simple tables with things like math (2+2) and grade scales (A+, B+, C+, etc). It appears there is no way at all to enter this kind of data with auto-formatting on.

I have only rudimentary programming skills (and that spinning it very positively), but if someone could give me an idea of how to fix this, I might mess around a bit as a personal project.

For example, I found this line in table_base.py: self.hline_borders = ['+', '|']. It looks to me like this is where the + gets identified as a special overall. Is there a way turn this into a regex test or something, to the effect of "if +, then ignore" so that a backslash-escaped + could be used?

How else would one start on this? Is there a better place to work on a change?

vkocubinsky commented 11 years ago

Thanks for feedback!

As workaround for this issue I click ctrl+shift+p click to "Table Editor: Disable For Current View" edit text, then when I go to edit table I click "Table Editor: Enable For Current View". I use this technique when edit tables in python files.

But if you like you can try to play with regular expression. Table Editor plugin commands run when sublime matches regular expression from .sublime-keymap. For example for Windows you can open Table Editor key binding file if click "Preferences > Browse Packages" and then open file Table Editor/Default (Windows).sublime-keymap. You can go to user keybinding "Preferences Keybinding -- User copy content from table editor keybinding and try change regular expression. See http://docs.sublimetext.info/en/latest/customization/key_bindings.html and http://docs.sublimetext.info/en/latest/reference/key_bindings.html for more detail about syntax keybinding file.

7LayersDesign commented 11 years ago

Same issue here. It is making the plugin unusable for me within Markdown. A simple escape code would be fine for me.

Something like:

| Col 1 | Col 2 |
| this \+ that | that \+ this |
vkocubinsky commented 11 years ago

thanks , i will investigate for this

7LayersDesign commented 11 years ago

Thanks vkocubinsky. For now I just use - instead. I am writing a reference sheet so is is just a command connector. Plus makes more sense though.

vkocubinsky commented 11 years ago

I released version 1.7.3

I fixed your issue. Now you can use '+' character inside a cell.

| Col 1       | Col 2       |
| this + that | that + this |

Thanks

7LayersDesign commented 11 years ago

Awesome! Thanks @vkocubinsky.

vkocubinsky commented 10 years ago

Fixed in 1.7.4 as split keybinding for normal row and for horizontal row