oakes / Nightlight

An embedded editor for Clojure
https://sekao.net/nightlight/
The Unlicense
788 stars 35 forks source link

Sort directories and files alphabetically #36

Closed chpill closed 7 years ago

chpill commented 7 years ago

This very small change displays the directories and files of the side-bar in alphabetical order. This makes file navigation a lot easier when there many files in a directory for example.

A thing to note is that the sorting added by this PR (which is clojurescript's default sorting for strings) is case sensitive. That means that names that begins with a capitalized Letter will be first in the list. For example, applied to this repository file structure:

README.md
UNLICENSE
boot.properties
build.boot
dev-resources
lein-nightlight
prod-resources
resources
screenshot.png
src
target

I consider it a feature, as it makes files like READMEs and licences go first. Let me know what you think!

oakes commented 7 years ago

Thank you!