lukakerr / Pine

A modern, native macOS markdown editor
https://lukakerr.github.io/Pine
Other
3.33k stars 170 forks source link

Auto Complete won't work when typing in single line $$ #57

Open WuYuanhun opened 5 years ago

WuYuanhun commented 5 years ago

Trying to use latex auto complete, it works when typing as plain text. It works in multi-line $$. But when I try to type between in single line $$, the auto complete just does not pop out.

For example, auto complete works in:

$$
\A
$$

but does not work in :

$\A  $
WuYuanhun commented 5 years ago

Update the trigger conditions. The auto complete only works when the character beside '\' is in [ ' ', '\n', '\r'].

WuYuanhun commented 5 years ago

Start to wonder if this is a feature other than bug...

lukakerr commented 5 years ago

You’re right, there needs to be a whitespace character to the right otherwise autocomplete won’t trigger, this is by design. But this should not occur inside inline maths, since it’s very common to be typing LaTeX commands inside $$ without whitespace.

WuYuanhun commented 5 years ago

I pull a merge #58 to fix it. And test on my Mac successfully , (which may have little possibility to cause any problem because only changed a line of code) Feel free to leave feedback Thanks for review and Pine!