This file is rather big. I'm working in it quite a lot, and find it very hard to navigate in. I constantly get lost or spend time manually looking for things. Move the file to a directory, add an internal header, and split out filtering and sorting code into own files. I'm sticking with these for now to not cause too many conflicts with blender/blender!130543, which does a lot of changes/additions to filelist.cc. Pull Request: https://projects.blender.org/blender/blender/pulls/141744