Author Topic: Files tool Window sort bug  (Read 2354 times)

greggman

  • Senior Community Member
  • Posts: 260
  • Hero Points: 10
Files tool Window sort bug
« on: November 10, 2007, 04:15:17 am »
I recently noticed a sorting bug in the "Files" Window.

If you have two files with the same filename but in different folders, Slickedit will always put the one you are editing second in the list even which means depending on which file you are editing when you bring up the "Files" Window they are in opposite orders.  In other words. If I have

c:\other\foo.txt
c:\temp\foo.txt

If I'm editing c:\other\foo.txt then it will come up second in the Files list. This is confusing because if I'm switching between the two files using the Files window then i can never tell which one I'm selecting by position. 

hs2

  • Senior Community Member
  • Posts: 2727
  • Hero Points: 281
Re: Files tool Window sort bug
« Reply #1 on: November 10, 2007, 02:48:32 pm »
Hi greggman, you could apply this patch (read: hack) to workaround the weird sorting:
tbfilelist.e - ctl_file_list.on_create() [line 498]:
 
Code: [Select]
      // HS2-ADD: also sort secondary column before the primary one
      _TreeSortCol(1);
      _TreeSortCol();

Although it would be better if the sorting of both columns is saved/restored independently by the toolbar the workaround provides a more consistent behaviour at least.
HS2


hs2

  • Senior Community Member
  • Posts: 2727
  • Hero Points: 281
Re: Files tool Window sort bug
« Reply #2 on: November 10, 2007, 09:45:58 pm »
Since only the 'Open Files' view is affected (to avoid double sorting on maybe large project/workspace file lists) and the patch wasn't working with the Files TB being docked (which I normally don't use) this is a better way:
tbfilelist.e - FileListUpdateOpenFiles() [line 1602]:
Code: [Select]
   // HS2-ADD: sort both columns
   _TreeRetrieveColButtonInfo(true);
   _TreeSortCol(1);
   _TreeSortCol();
HS2