vspinu / company-math

Completion back-ends for for math unicode symbols and latex tags
124 stars 8 forks source link

`_` as a prefix is a bit aggressive #12

Closed cpitclaudel closed 7 years ago

cpitclaudel commented 7 years ago

Hi there,

I'm very happy with the new subscript support, and the solution taken by https://github.com/vspinu/company-math/issues/10… except for one small thing. I usually put company-math-symbols-unicode at the front of my backend list, but this screws up prefix calculations when a word contains an _.

Suppose I have a function call pr_var_unbound. I type pr_va, and at this point company-math kicks in, taking over the usual backend.

What would you think of using \_ as the prefix for subscripts instead of just _?

vspinu commented 7 years ago

What would you think of using _ as the prefix for subscripts instead of just _?

Any other ideas of how to fix this? \_ is awkward to type.

cpitclaudel commented 7 years ago

Hmm. Fair point :) Maybe a double underscore ? Or a customizable prefix?

vspinu commented 7 years ago

I am setting the prefixes to __ and ^^ accordingly. Users can customize those if needed, and \_, \^ are now hardwired irrespective of the values of company-math-subscript-prefix and company-math-superscript-prefix. I think this is a good trade-off.

Thanks for bringing this up. As always your input results in useful changes ;).

cpitclaudel commented 7 years ago

Thanks!