SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 365 forks source link

Text versus Source Indenting #1337

Open slienhard opened 6 years ago

slienhard commented 6 years ago

Currently LaTeX in Sublime is considered a text document therefore when there is a long line and word wrap happens, the text on the next line is indented to the same level as the previous line.

Text based

    \item blah blah blah blah
    blah blah blah blah blah
    blah blah blah`

Source based

   \item blah blah blah blah
      blah blah blah blah blah
      blah blah blah`

Source code in Sublime treats the indenting in a better way in my opinion. The indent amount on the subsequent line is indented further. Several LaTeX editors offer this: BBedit, Texpad to name a few.

If possible, please consider having an option for a LaTeX document be considered a source file versus a text file.

I was able to take the LaTeX syntax file and change the scope to source.tex.latex. This had the intended affect, but I think making that change interferes with the LaTeXTools package which is beyond my understanding.

Thanks for considering.

r-stein commented 6 years ago

Changing the scope to source.tex.latex will disable most features of LaTeXTools, because we usually check for the context text.tex.latex. You may use source text.tex.latex, but this should be configurable by settings not by changing the syntax definition. I will further investigate in that direction.

r-stein commented 6 years ago

It doesn't seem to be possible to change that https://github.com/SublimeTextIssues/Core/issues/1722. You may try to use the base scope source text.tex.latex if it really bothers you, but I don't know about other side effects of that.

slienhard commented 6 years ago

Thank you for taking a look!

AnnanFay commented 5 years ago

Has anyone had any success with this?

@slienhard Did using source text.tex.latex have any negative consequences?