Turn on tab_completion in your settings (I don't use regular "auto_complete")
Start with the following text:
- Code: Select all
Move your cursor to the top of the file above everything else.
Type "tes" then press tab to cycle through the autocomplete options.
In order you should see:
test_really_long_thing, testThing, test, test_other_thing, test2_more, test3_more, test2, test3
In other words it should keep them in order because "tes" matches every single thing in the file and most likely test_really_long_thing is the first one you want to autocomplete because it is closest to you. This is also how TextMate behaves.
In order you will see:
test, test2, test3, testThing, test2_more, test3_more, test_other_thing, test_really_long_thing
I understand that Sublime Text2 here is trying to match the highest percent match based on number of characters, but in actual use that doesn't make sense to me, and I find myself hitting tab a lot to get to the match I want. The point of autocomplete is to be able to type as little as possible and match as much as possible.
In this use case "test_really_long_thing" is the first thing in the list, the one that is closest to the cursor, but it takes 8 tab presses to select it vs. 1 in TextMate.
*Also as a side note I think there should be an option to prevent tab from autocompleting macros based on what you type. I don't have a specific example but sometimes I will type something to try to get an autocomplete match and after a few tab presses it converts it to some function call and the tab key stops cycling through autocomplete options.