After a bit of debugging, I found out that the normal word-based commands pass match start and end positions in candidates, while the subword commands don't. If I'm not mistaken, those end positions are always the following character in this case — so I just added that to the candidates. It might be a bit of a hack, and I didn't have the time to get a full understanding of your code, so I can't guarantee that it doesn't break something else, but it seems to get the job done.
The subword commands don't work with my custom order function settings:
After a bit of debugging, I found out that the normal word-based commands pass match start and end positions in
candidates
, while the subword commands don't. If I'm not mistaken, those end positions are always the following character in this case — so I just added that to the candidates. It might be a bit of a hack, and I didn't have the time to get a full understanding of your code, so I can't guarantee that it doesn't break something else, but it seems to get the job done.