Closed Pomax closed 3 years ago
That's a way more generic issue than this one, though: I'm just requesting begin
/end
environment autocompletion, because that's something that someone working on the code should be able to do in an hour or two.
Unlike "full autocomplete for LaTeX" as requested in 2988, which is a huge epic and no one would be able to get done even with a full week available to them.
Currently there's no autocomplete at all.
So I think it can be covered by #2988
It can be, but 2988 would be the epic: "add automcomplete for LaTeX", which then breaks apart into quite a few subtasks that all need to be dealt with separately: environment autocomplete (which uses the same logic as HTML tags), base syntax autocomplete (parens, curly brackets, etc), automatically matching \left
to \right
, autoinjection of {}
when someone types ^
or _
, etc. So the tracking of the total task of autocompletion is definitely covered by 2988, but it would make a lot of sense to mark it as epic, and making this issue one of the tasks that needs to be completed for that epic to be considered done.
Typora currently knows that if you type some HTML tag, then text, and then you start typing
</
it autocompletes the open tag for you. In that same vein, it would be great if it knew what to do while in a LaTeX block, where the equivalent of matched tags is matched\begin{...}
and\end{...}
strings.It would be great if Typora tracked which environment it is in (identical logic as for HTML tags), and would automatically fill in "the rest" when you type
\end{
:\begin{aligned}
\end
\end{
, it adds<current env name>
+}
Alternatively, it might be even more useful to follow the same logic that happens when they user types
$$
: this starts a block with the ending$$
already added, so we could use the same pattern:$$
, Typora starts a new LaTeX block\begin{aligned}
\end{aligned}
on the line after that empty line, placing the cursor on the empty line for the user.The second implementation would be distinctly superior, but the first is still by far better than having no autocompletion for matched "tags".