Table-of-comments icon indicating copy to clipboard operation
Table-of-comments copied to clipboard

Filtered results show confusing order

Open fvsch opened this issue 10 years ago • 3 comments

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:

  1. Type "1" to filter. Result order is alright.
  2. 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.
  3. Type "test" to filter. Same issues as above.

I'm not sure if there's a good way to improve this. Any ideas?

fvsch avatar Feb 05 '15 10:02 fvsch

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?

kizza avatar Feb 06 '15 02:02 kizza

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:

Screen shot 1 Screen shot 2

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.

fvsch avatar Feb 06 '15 07:02 fvsch

+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

Enteleform avatar Mar 03 '15 22:03 Enteleform