ehuss / Sublime-Wrap-Plus

Enhanced "wrap lines" command for Sublime Text 2 or 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backslash erroneously interpreted as beginning of new paragraph.

yrammos opened this issue · comments

Thank you for a terrific plug in. One wrinkle: backslashes \ seem to be interpreted as beginnings of a new paragraph, with the result that simple LaTeX commands such as \emph {This is important!] are always placed at the beginning of a new line, even if the immediately preceding line is very short. Would it be possible to fix that? If there is a reasoning that I fail to see, perhaps a toggle could be added in the settings? Thanks once again.

Sorry, I know very little about latex. Long ago (see issue #1), I made it break on backslash to prevent it from messing up neatly formatted formulas.

I imagine properly handling latex would be quite a bit more complex. It looks like the fill code in AUCTeX would be a good inspiration for how to handle it. However, this is a huge project that is unlikely I would ever get to.

I see, thanks for writing back. I might try to remove this functionality in a private branch of your plugin, as I almost never typeset formulas these days. Your code looks clean and neat and I expect it should not be difficult to exempt the backslash, but if there is a quick pointer that you could share with me to do this with minimal revising, I would be thankful.

Just remove all references to latex_hack.

Yes, that will work with some modifications (otherwise wrapping adds a superfluous space character). Thanks!