Malabarba / latex-extra

A series of usability improvements for Emacs latex-mode.
GNU General Public License v3.0
69 stars 14 forks source link

latex/clean-fill-indent-environment strange behaviour for comments in environment options #18

Open dinojr opened 8 years ago

dinojr commented 8 years ago

Consider the followin MWE

\documentclass{article}

\begin{document}
\begin{axis}[
  % 1st option
  2nde option,
  % 3rd option
  4th option,
]

\end{axis}
\end{document}

Filling with latex/clean-fill-indent-environment, gives:

\documentclass{article}

\begin{document}
\begin{axis}[
  % 1st option
  2nde option,
  % 3rd option
  % 4th option,
  % ]
\end{axis}
\end{document}

This can be pretty damaging since you end up with an unclosed pair [ ]. This kind of code is in my opinion very common when coding graphics in Tikz.

Malabarba commented 8 years ago

Oh dear. That's definitely not good. :(