atom-alignment icon indicating copy to clipboard operation
atom-alignment copied to clipboard

Added &-separators to enable align for Latex tables.

Open grotell opened this issue 10 years ago • 3 comments
trafficstars

grotell avatar Jun 26 '15 14:06 grotell

Interesting! I think this will have unintended consequences for other languages though. Maybe it's time to implement language-specific separator mappings? I imagine the same thing would be handy for Markdown. Any thoughts? How do you normally escape the ampersand if you want to use it normally?

blakeembrey avatar Jun 26 '15 17:06 blakeembrey

I think it would be good to have default separators like: =, +=, -=,: etc. because those are quite common in all major programming languages. As you wrote an ampersand can be problematic in some languages - like HTML. In LaTex you can use the ampersand as char just by putting \ before the ampersand.

I added a possibility to add a language specific separator to this pull request in my last commit. My approach is maybe not the best, but it works. So new language/scope specified separators can be added using the syntax: {"text.Tex.latex": ["&"], "source.coffee": ["!","#"]}. nayttokuva 2015-06-27 kello 17 44 28 "!" and "#" in "source.coffee" scope are just for demonstration purposes.

grotell avatar Jun 27 '15 14:06 grotell

Cool implementation. Do you think it's worth using JSON for configuration? Could be difficult to use. THe approach I've taken in https://github.com/blakeembrey/atom-dash is to tell people how to edit the config directly and using the language names instead of source name.

blakeembrey avatar Jun 29 '15 17:06 blakeembrey