lukakerr / Pine

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

Update Character.swift to fix Issue #57 #58

Open WuYuanhun opened 5 years ago

WuYuanhun commented 5 years ago

Fix Latex auto complete bug ( Issue #57) Successfully Tested Locally.

lukakerr commented 5 years ago

Thanks for this. Unfortunately the fix is going to be a little harder than just changing this one line. Also, it doesn’t make sense for isWhitespace to return true when there is a $ sign, since a $ is not whitespace.

The fix would most likely involve looking and the current line, and checking whether the cursor is within two $ signs. If so, this means the user is inside an inline math block, and we then want autocomplete to succeed.