thatsIch / sublime-rainmeter

Rainmeter Package for Sublime Text 3
https://thatsich.github.io/sublime-rainmeter/
MIT License
51 stars 3 forks source link

Support for typos in auto completion #50

Open thatsIch opened 7 years ago

thatsIch commented 7 years ago

I am currently thinking about introducing a mechanism used in major IDEs which allow users to type not correctly matched search patterns for the smart auto completion component.

Imagine searching for superTest and just pre will suffice because superTest. But what if we want to allow ptr which would not match because the r is before the t.

I thought about an algorithm which puts a penalty on the search for each time the algorithm has to move backwards to search for a match. In the example above the algorithm would return -1 because it had to move back for the r once. The entries would be sorted by the penalty added to the matching distance. The fine tuning is important how to integrate the penalty into the distance metric.