Table-of-comments
Table-of-comments copied to clipboard
Filtered results show confusing order
Test case:
/* > 1 Test */
/* >> 1.1 Test */
/* >>> 1.1.1 Test */
/* >>> 1.1.2 Test */
/* >>> 1.1.3 Test */
/* >> 1.2 Test */
/* >> 1.3 Test */
/* > 2 Test */
/* > 3 Test */
/* >> 3.1 Test */
/* >> 3.2 Test */
Tests:
- Type "1" to filter. Result order is alright.
- Type "2" to filter. Result order seems to be level first, occurence second (might just be an artifact). The indentation in the results suggest a hierarchy that doesn't exist as the filtered results show it.
- Type "test" to filter. Same issues as above.
I'm not sure if there's a good way to improve this. Any ideas?
Had a look at this - I believe it's because sublimetext uses python alphabetical sorting when filtering results which struggles with this stuff (as the dot in "1.1.2" etc is not interpreted as a number but a string).
So 1.2 comes before 1.1.2 because it's sorted alphabetically as 12 and 112
I am able to replicate it with gotosymbol using the following javascript demo (using "_" instead of ".")
function func_1_1(){ }
function func_1_1_2(){ }
function func_1_2(){ }
Opening gotosymbol shows them in correct order but after typing 1
it immediately orders them out of sequence
So I'm pretty sure that that's what's happening - though from the plugin perspective all the api lets us do is throw in a list of text and it does the rest.
Thoughts?
The most confusing part is not that the ordering gets mixed up (which happens in all Sublime Text dialogs when you filter), but that the indentation suggests a hierarchy that is not there, for instance:
It's not a big issue (I'm just filing UX refinement bugs ^^), so it's okay to wontfix this issue if the API doesn't let us, say, remove the indentation characters when the list is filtered.
+1, I am also having issues with the hierarchy being ignored. alphabetic & numeric orders are maintained - but only secondary to indentation level, which effectively neutralizes the hierarchy in the filtered results