Open jamesls opened 9 years ago
I did some testing with this and have something that works but it has edge cases where things that matched before wont match now because it skips the next occurrence for the next occurrence on a boundary.
describe-classic-link-instances
^--^------^---^
1 2 3 4
This completion is currently punished in two ways: 1) It's skipping to characters that aren't at a 'word' boundary (moves 2,3,4). 2) It's not matching most of the completion string (15/31 characters)
Compared to:
describe-reserved-instances-listings
^--^------------------------^^
1 2 34
Completes 30/36. And the jump from 2 -> 3 isn't penalized very much because 3 is at a boundary. So it basically gets to skip two words and most of the string for nearly free.
Where it's possible for dcli
to match like this:
describe-classic-link-instances
^--------^-------^----^
1 2 3 4
In this case you complete more of the word and the moves are to word boundaries (specifically the next word boundary) which isn't penalized as much. We would need to add some prioritization for the next occurrence of the character vs the next occurrence of the character at a boundary or test both and choose the 'better' completion score.
Example:
describe-classic-link-instances
should be higher.