sorting in folder as workspace
-
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
isnot sorted(or rather, reverse sorted), and run portable Notepad++ and FolderAsWorkspace ofUSB\garden
is alsounsorted(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.
-
@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:
- 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).
- 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.
-
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.
-
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.
-
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?
-
I am on a Win10 machine right now, so I cannot test. But it would help if you could clarify:
- Share your ?-menu’s Debug Info from both machines
- 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?
- 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.
-
If I create
apple
,carrot
, andbanana
in that order, and then open the containing folder in FAW, I get this on Windows 11 Pro:So, N++ seems to do some alpha sorting for me.
-
@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 usedir /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… -
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.
-
@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.)