File Tab Order for Same Name Files

File Tab Order for Same Name Files

4
NewbieNewbie
4

    Oct 13, 2014#1

    I work across multiple parallel environments and will often have a number of files open that are all named the same - but open from paths. The [File View - Open] tab lists them in alpha order of their paths, but the file tabs are random in this situation. When a file is edited its tab will jump to the end of the tabs, so as I am editing and saving the tabs will be shuffling all of the time.

    I have Multiline Tabs turned on. With differing named files the tabs are alpha orders. The file tab R-Click context menu [File Tabs - Sort File Tabs] does not have a checkbox - not sure if it is supposed to. But they do consistently sort by file name when they are different.

    Is there any way to get the File Tabs to order based on the full file path and stop this shuffling? Would like the File Tabs order to match the File View - Open listing.

    6,675585
    Grand MasterGrand Master
    6,675585

      Oct 14, 2014#2

      In context menu of tab Open in File View there are 2 options:
      • Show Names Only
      • Sort By Extension
      With second option not enabled, the first option determines if the list of open files is sorted alphabetically according to
      • path + file name
      • file name only

      For sorting the File Tabs there is the setting Sort tabs on file open at Advanced - Configuration - Application Layout - File Tabs. The file tabs are sorted with this setting enabled according to their names only, i.e. without path.

      The menu item Sort File Tabs in submenu File Tabs of context menu of the file tabs is a command to sort the file tabs now on clicking it. It does not toggle the configuration setting.

      I could see that with Sort tabs on file open enabled and the opened files have all the same name like index.html, modifying a file results in moving the tab of this file to end of the list.

      It looks like this is caused by appending * to end of file name on file tab to indicate that this file is modified. This additional character (invalid for a file name) is taken into account on sorting the file tabs according to string displayed in file tab. That is definitely an unexpected behavior, especially if setting Display status icons is enabled resulting in not displaying * on file tab.

      And this unexpected behavior makes it also clear that sorting the file tabs does not occur only on opening a file. In real the sort of the file tabs is done always if a change is made on string list of the file tabs, i.e. a * is appended to a file name because of first modification since load/last save, or a modified file is saved, or a file is renamed, or a file is closed.

      I suggest to report this issue by email to IDM support. On sorting the file tabs according to list of file names the * appended at end of the file name on modifying a file or removed on saving of a modified file should be always ignored.

      In other words instead of sorting the file tabs according to list of displayed strings after a modification of the file tabs list, it is necessary to create a copy of this list, remove all * from all strings in the copied list, sort the copied list and check if sort order has changed at all. If this is the case, the same sort order must be applied to list of file tabs containing one or more file names with * at end and then update the file tabs bar. Of course it would be most likely more efficient to code a special sort function for file tabs list which ignores * on sorting instead of using standard sort list library function which I suppose is used in code of UE/UES for sorting the file tabs list. Even more efficient would be to trigger sorting the file tabs list only if a file is opened, closed or renamed and not on any change in file tabs strings list.

      In your case it would be even necessary to sort file tabs with identical file name taking file path also into account to determine the sort order. But file path should be only taken into account if two file tabs have without * identical strings. If path of file would be always taken into account on sorting the file tabs, the sort order would be very confusing for files with different names in different folders for the users.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Oct 23, 2014#3

        Thanks for the detailed reply. I'll contact support.

        49
        Basic UserBasic User
        49

          Jan 23, 2015#4

          Mofi wrote:In context menu of tab Open in File View there are 2 options:

          1. Show Names Only
          2. Sort By Extension

          With second option not enabled, the first option determines if the list of open files is sorted alphabetically according to

          1. path + file name
          2. file name only
          Hi Mofi,

          Just wanted to point that even with the second option not enabled, the first option has no effect on the way tabs are sorted. They are always sorted by file name (and not path + file name) whether or not first option is checked. I unchecked the first option and the "Open Files" list now showed the full path of the files. I then clicked on Right Click context menu of the tabs under File Tabs/Sort Tabs. It still sorted by file name alone. I am having exactly same problem and would like this to work.

          This is at least I noticed unless I am missing something here.

          Thanks.
          Subhash.

          6,675585
          Grand MasterGrand Master
          6,675585

            Jan 24, 2015#5

            This first part of my answer was about tab Open in File View and not about Open File Tabs.

            The list of opened files is sorted on tab Open in File View as described by me.

            For example there are following 3 files opened currently in UltraEdit:
            1. C:\Temp\Test2\Example1.txt
            2. C:\Temp\Test1\Example2.txt
            3. C:\Temp\Test1\Example1.txt
            Those 3 files are listed on tab Open in File View with context menu option Show Names Only enabled:
            1. Example1.txt
            2. Example1.txt
            3. Example2.txt
            But those 3 files are listed on tab Open in File View with context menu option Show Names Only not enabled:
            1. C:\Temp\Test1\Example1.txt
            2. C:\Temp\Test1\Example2.txt
            3. C:\Temp\Test2\Example1.txt
            It is of course right that the context menu options of tab Open in File View have no effect on sort order of the Open File Tabs.
            Best regards from an UC/UE/UES for Windows user from Austria

            49
            Basic UserBasic User
            49

              Feb 06, 2015#6

              Hi Mofi,

              If I try to venture on it, is it possible to write a JavaScript to sort the tabs in the order we want. I have done some research but could not find enough information on tab index and moving tabs within UltraEdit Window.

              If it is not possible, then I will just leave it at that.

              Thanks.
              Subhash.

              6,675585
              Grand MasterGrand Master
              6,675585

                Feb 06, 2015#7

                The only method to change order of file tabs per script would be to get the names of all opened and named files into an array of strings, then close all named files so that just new, unnamed files remain, sort the array elements depending on your requirements, and finally re-open the files from the list. Closing a file means loosing undo history, line change indication information, code folding, bookmarks, and caret position.

                Other methods do not exist. UltraEdit scripts/macros are designed for modifying files and not for automate GUI related user actions. So there are no commands available for UltraEdit scripts or macros which require the usage of mouse by the user.
                Best regards from an UC/UE/UES for Windows user from Austria

                49
                Basic UserBasic User
                49

                  Feb 09, 2015#8

                  Hi Mofi,

                  Thanks for the reply.

                  I guess that will sacrificing too much as compared to the gain.

                  I will continue with the manual method of rearranging the tabs manually as and when I need to.

                  However, I would certainly like to keep track of if and when IDM adds this feature to UE.

                  Thanks again.
                  Subhash.