LaTeX has plain text (natural language), macros (always preceded by a `\`), 
environments (like macros, but without the `\` in the beginning. They only 
appear as arguments for macros, like in `\begin{env}`.) and labels (which are 
not preceded by `\` and can contain mostly anything, like spaces. They are also 
only used as arguments, like in `\ref{label name}`). The parser identifies each 
one of these (except plain text) as different kinds. Additionally, it has 
chapter, section, subsection and subsubsection, but I guess these are only for 
navigation, so that the user can quickly jump to different parts of the 
document. 

The lexer is capable of identifying a `\begin` and its argument (that is, its 
argument is highlighted differently from arguments of other macros), so 
differentiating between labels and environments should be possible. It also 
treats macros differently from plain text.
Currently, geany is capable of omitting autocomplete inside strings and 
comments. So if plain text is treated as a string by [this 
function](https://github.com/geany/geany/blob/master/src/highlighting.c#L1391), 
autocomplete would be disabled for it. Then it would be possible to remove `\` 
from wordchars in editor.c as well as the LaTeX-specific portion to separate 
macros.



---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1011#issuecomment-215342891

Reply via email to