AndreaCrotti/yasnippet-snippets

[bug] Indent after begin snippet in LaTeX

Closed this issue · 1 comments

After the snippet exits, there's no indentation on the new line.
Steps to reproduce:

  1. Make a LaTeX file with following content:
\documentclass{article}
\begin{document}

\end{document}

  1. Type "begin" on the empty line (below begin{document})
  2. Run command-yas-expand
  3. Type something
  4. Press TAB
  5. See how the cursor moves to a new empty line without indentation

The line gets indented after you press RET, so most of the time it's not an issue, but there are situations where you don't press RET at all and the line doesn't get indented. It also looks incredibly inconsistent when you type something on said unindented line until you make a new line.

Mm well I think this is not really a problem with the snippet, the snippet itself doesn't have any indentation @veronikazaglotova .
When I enable latex-mode I can see that RET is bound to TeX-newline which is what is actually doing the extra indentation.

It looks like you can customize that if you want

Hide Tex Newline Function: Value Menu newline
    State : STANDARD.
   Function to be called upon pressing ‘RET’.```

but yeah I'll close this issue since it's not related to the snippet.