LaTeX command autofill inserts the wrong command

Describe the bug
When you type a command in a LaTeX block, a command menu appears. This command menu sorts alphabetically, not by which command you typed, and pressing enter inserts the first command in the list.

To Reproduce
Steps to reproduce the behavior:

  1. Create a LaTeX block
  2. Type \ce
  3. Press enter
  4. The \bcancel command is inserted instead of \ce

Expected behavior
The commands in this list should be sorted in such a way that typing in a command and pressing enter inserts that command, this could be done with a sorting method that sorts by the similarity to your input, or a sorting method that sorts commands where your input matches the start of the command highest.

System Information:

  • OS: Linux python 5.10.90 #1-NixOS SMP Wed Jan 5 11:40:34 UTC 2022 x86_64 GNU/Linux
  • Device Manufacturer/Model: Dell G3 15 3590
  • Anytype Version: 0.22.3 (Also tried on 0.21.0 to identical effect)

Additional context

@minion Thank you for your notice, it has been added to the bug tracker