randy3k / UnicodeCompletion

Insert Unicode LaTeX δ and Emoji 🍻 to Sublime Text
24 stars 3 forks source link

Problem with completions #4

Closed ViktorQvarfordt closed 7 years ago

ViktorQvarfordt commented 7 years ago

In the default settings (correct me if I have messed something up), typing \pi shows no completions, pressing tab shows the possible completions, pressing tab again inserts the (first) completion. It is annoying to have to press tab twice every time.

One way to get around this would be to use the setting

"auto_complete_triggers": [
  {
    "characters": "\\"
  }
]

however this shows

image

i.e. wrong thing as the first suggestion. In particular, with this setting, there are more completions showed than after pressing tab and not having this setting enabled.

randy3k commented 7 years ago

It is because there are multiple strings which have prefix \pi. Try \alpha<tab>, it will complete the unicode directly.

To minimize the number of keystrokes, one possible solution is to insert the unicode if there is an exact match.

ViktorQvarfordt commented 7 years ago

Oh I see! Yes that could be a good idea.

Either way, it is a problem with the sorting when auto_complete_triggers is activated. And the fact that it doesn't show the same set of completions as ordinary tab completion does. What can be done about this?

randy3k commented 7 years ago

If you do the auto_complete_triggers, all the completions will be shown at once. Sublime text then uses fuzzy logic to filter the completions, so it also shows the Emoji unicode.

PS: it seems that the font that you are using doesn't support unicode, that's why you see the strange char.

ViktorQvarfordt commented 7 years ago

Awesome fix, thanks!

Also, I realize that the fuzzy-search ordering of auto_complete_triggers is not really a problem since sublime remembers the previous choices.

(Regarding my font (terminus), it's a bitmap font that I use on low res. displays (because the font is built to use with no aliasing). Normally I go with something that has all unicode symbols :)

ViktorQvarfordt commented 7 years ago

Also, thanks for keeping the Julia package in sync!