Community
    • Login

    sorting in folder as workspace

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    14 Posts 5 Posters 2.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • James TrentonJ
      James Trenton
      last edited by

      Hi,

      I have two different versions of Notepad++ that I’m using:

      1. Version 8.4.2 (64 bit) installed to C:\Program Files\Notepad++.

      2. Version 8.4.2 (64 bit) Portable located on a USB drive.

      I use “folder as workspace” to view my files.

      When I am running on the full-install version of Notepad++ (on my C: drive) and viewing folder as workspace, the files and folders are sorted and appear correctly.

      When I’m running the portable version of Notepad++ (on my USB drive) and viewing folder as workspace (with files located on my USB drive), they are not sorted by alphabetical order.

      TL;DR -

      Installed version sorts folder as workspace correctly while portable version does not.

      Any suggestions for how to fix this?

      faw-local.png faw-portable.png

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @James Trenton
        last edited by PeterJones

        @James-Trenton ,

        What happens if you use the installed Notepad++ instance to open the USB’s garden\ folder as a workspace? (Because if it is sorted on the local garden but not sorted on the USB garden, with the same installed copy of Notepad++, then it’s something to do with the filesystem on the USB stick, not with installed-vs-portable)

        I don’t think that the Folder as Workspace feature currently has sorting capability, so you might want to read the FAQ on how to make a feature request if that’s a feature you’d want

        Addenda: For example, I just created a new garden folder and created apple, carrot, and banana subfolders (in that order) on my drive. Then I opened the garden folder as Workspace in both installed and portable copy, and they both showed them as
        302d94a5-8bda-40ba-9159-48736025eeef-image.png
        (My work machines prohibit USB drives, so I cannot test on a USB garden right now.)

        James TrentonJ 1 Reply Last reply Reply Quote 1
        • James TrentonJ
          James Trenton @PeterJones
          last edited by

          @PeterJones

          To answer your question — if I use the installed version of Notepad++ (from C: drive ) to view the USB directory files via “folder as workspace” – it appears unsorted.

          It’s not a major problem. I just thought that maybe there was some easy “sort” option that I was missing. But, if the app doesn’t do any sorting then it must be OS or USB related.

          I am doing a “trick” on my USB drive to allow for relative paths and changing drive letters.

          (Set shortcut target to: %windir%\explorer.exe “Dev\npp.8.4.2.portable.x64\notepad++.exe”)

          But, to eliminate this as a cause of the problem, I launched the app directly by clicking on the executable directly (avoiding the shortcut):

          D:\Dev\npp.8.4.2.portable.x64\notepad++.exe

          I had the same problem (folders/files are not appearing in alpha order).

          It is only an issue when I’m running the Portable version of Notepad++.

          I appreciate your help.

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • James TrentonJ
            James Trenton
            last edited by

            UPDATE:

            I checked again. It is sorting by alpha order (but, it is descending, instead of ascending).

            1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @James Trenton
              last edited by

              @James-Trenton

              if I use the installed version of Notepad++ (from C: drive ) to view the USB directory files via “folder as workspace” – it appears unsorted.

              vs

              It is only an issue when I’m running the Portable version of Notepad++.

              You just contradicted yourself. If you run the installed Notepad++ and the FolderAsWorkspace of USB\garden is not sorted (or rather, reverse sorted), and run portable Notepad++ and FolderAsWorkspace of USB\garden is also unsorted (or rather, reverse sorted), which is what you’ve told us, then the problem is not with “portable” vs “installed”, because they act the same.

              The problem appears to be that on the USB stick, when Notepad++ asks for a directory listing, the OS gives it unsorted (or reverse sorted), whereas when you FaW on your c:\ drive, the OS tells Notepad++ the list in alphabetical sorted.

              So, as I said, the problem is the difference between c:\ and USB for the FaW, not the difference between portable and installed notepad++. Unless I have misinterpreted what you’ve told us.

              James TrentonJ 1 Reply Last reply Reply Quote 1
              • James TrentonJ
                James Trenton @PeterJones
                last edited by James Trenton

                @PeterJones said in sorting in folder as workspace:

                You just contradicted yourself.

                Sorry, I’m not trying to be confusing. I’m not describing my issue very clearly. Here are my test cases thus far:

                1. Running locally, viewing local files:
                • launch “C:\Program Files\Notepad++\notepad++.exe”

                • add C:\test directory to workspace. File sorting appears correctly (ascending alpha order).

                1. Running Portable from USB drive, viewing USB files:
                • launch “D:\Dev\npp.8.4.2.portable.x64notepad++.exe”

                • add D:\test to workspace. File sorting appears correctly (ascending alpha order).

                • add D:\Dev\servers\UniServerZ\www to workspace. File sorting does NOT appear correctly. (descending alpha order).

                So, it seems to be directory-related. If I store the files in the root level at D:\test the sorting appears correct. But, if I choose a directory 4 levels deep, the sorting is in reverse order.

                This is an older Win 7 (64 bit) machine.

                I appreciate your help. I have learned some new info by researching this. Hopefully, I will be able to clarify the behavior more succinctly? Maybe it’s just a case of a Windows 7 bug?

                I’ll keep investigating.

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @James Trenton
                  last edited by

                  @James-Trenton ,

                  As a reminder, Windows 7 is no longer supported by Notepad++, though it may still be able to run it.

                  From what I know of USB filesystems, their sorting is much more “hardcoded” than a modern hard drive (HDD) or solid state drive (SSD). Windows OS may choose to present the contents of a USB in a different order than it would present the contents of a similar folder structure on a HDD/SSD. I think your problem is OS and filesystem related.

                  James TrentonJ 1 Reply Last reply Reply Quote 1
                  • James TrentonJ
                    James Trenton @PeterJones
                    last edited by

                    @PeterJones

                    Yes, I believe you are correct. Thanks for helping me to troubleshoot this. I will try on a newer version of Windows and see if I have any more issues.

                    Thanks for your help. Much appreciated.

                    1 Reply Last reply Reply Quote 0
                    • christopherpowC
                      christopherpow
                      last edited by

                      I have Notepad++ 8.5.4 64-bit on both Win10 and Win11. In Win10 the files/folders in a “folder as workspace” are sorted alphabetically. In Win11 they are not. I’d very much like the behavior to be the same. Isn’t that possible?

                      PeterJonesP 1 Reply Last reply Reply Quote 0
                      • PeterJonesP
                        PeterJones @christopherpow
                        last edited by

                        @christopherpow ,

                        I am on a Win10 machine right now, so I cannot test. But it would help if you could clarify:

                        1. Share your ?-menu’s Debug Info from both machines
                        2. On the Win10 machine, is the Folder that you are doing Folder As Workspace (FaW) on a Hard Drive (HDD, aka “old noisy hard drive”), Solid State Drive (SSD, aka “whisper mode drive”), on a mapped network drive, or on an external USB drive?
                        3. On the Win11 machine, is the Folder for FaW on a Hard Drive (HDD), Solid State Drive (SSD), on a mapped network drive, or on an external USB drive?

                        I still maintain, as I did a year ago, that the difference is the way the filesystem works on the various types of drives; a USB drive behaves differently than a HDD or SSD, and so when Notepad++ asks the OS to give it a list of files, the USB is presenting them in a different order than a HDD or SSD.

                        If no one else has confirmed or contradicted your findings, when I get home after my workday today, I’ll see if I can test on a Win11 machine that I have access to SSD & HDD & USB.

                        Alan KilbornA 1 Reply Last reply Reply Quote 1
                        • Alan KilbornA
                          Alan Kilborn @PeterJones
                          last edited by

                          If I create apple, carrot, and banana in that order, and then open the containing folder in FAW, I get this on Windows 11 Pro:

                          4ed7a0e9-020f-4592-a36c-a421c9e38a27-image.png

                          So, N++ seems to do some alpha sorting for me.

                          mkupperM 1 Reply Last reply Reply Quote 2
                          • mkupperM
                            mkupper @Alan Kilborn
                            last edited by

                            @Alan-Kilborn said in sorting in folder as workspace:

                            So, N++ seems to do some alpha sorting for me.

                            Or the test was done on an NTFS file system rather than an FAT or ExFAT file system. NTFS uses b-trees and FAT or ExFAT use indexes or lists for directories or folders.

                            The list of files and sub-folders will always be sorted in alphabetical order on NTFS. It’s not quite the same alphabetical sorting order that Windows Explorer uses to display a list of files though… With FAT and ExFAT the default order or more or less the order in which entries are added to a folder. When a file or sub-folder is deleted or moved somewhere else then it’s spot in the directory can be reused.

                            I believe the command prompt’s dir command for all versions of Windows lists files in the the raw on-disk order.(*pesky asterisk, see below) If you use dir /on to sort by name it shows the order that you see in Windows Explorer.

                            Notepad++'s folder as workspace thing seems to be using the unsorted order you would see with a plain dir command.

                            * The dir command checks the %DIRCMD% environment meaning someone’s machine may well have /on enabled by default…

                            Alan KilbornA 1 Reply Last reply Reply Quote 2
                            • Alan KilbornA
                              Alan Kilborn @mkupper
                              last edited by

                              @mkupper

                              If Windows doesn’t provide the same order in all cases, and it doesn’t sound like it does, then it seems like an issue should be created to recommend that Notepad++ do the sorting and unify behavior.

                              PeterJonesP 1 Reply Last reply Reply Quote 3
                              • PeterJonesP
                                PeterJones @Alan Kilborn
                                last edited by

                                @Alan-Kilborn said in sorting in folder as workspace:

                                issue should be created to recommend that Notepad++ do the sorting and unify behavior.

                                Indeed. And make it like the Document List, where it will either present it unsorted (the default order based on the filesystem) or sorted ascending or sorted descending. (Maybe even with the extra Ext column that Document List optionally provides, so that a user could sort by extension within a given subfolder in the FaW view.)

                                1 Reply Last reply Reply Quote 3
                                • First post
                                  Last post
                                The Community of users of the Notepad++ text editor.
                                Powered by NodeBB | Contributors