[ZeroBrane Studio] Re: Outline sorting - disable locale

  • From: Mattes Dolak <xoft@xxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Fri, 16 Sep 2016 14:56:24 +0200

  Hi Paul,

sorry for the late answer. The project filelist sorting is okay, no need to worry about it.

It seems impossible to change the locale for a single application in Windows, since the locale is a global setting; however, I found an interesting workaround - the setting is per-user, so I could create a new user, set their locale to what I need and then set ZBS to run under that user (shift+click on the shortcut file, "run as different user"). I don't think all this hassle is worth it, though.

  Thanks anyway,
    Mattes



On 13.9.2016 23:34, Paul K wrote:

Hi Mattes,

I was wondering if anyone knows of a way to disable locale-based sorting in the 
ZBS outline tree, and use ascii-sorting, or simple natural sorting (number / 
ascii-char chunks) instead.
ZBS uses SortChildren method of wxTreeCtrl to sort, so it doesn't have
much control over how it's done (and can't replace it with a custom
"compare" function as it's not exposed in wxlua).

Note that the Project filelist tree actually uses a different sorting method, one that 
seems to be smarter, though not yet there: It ignores the "ch" stupidity of my 
locale, but sorts numbers this way:
The list of files is sorted in Lua, so probably uses a different algorithm.

I can probably add a custom sorting to the project filelist, which you
can then use to provide your own sort function (maybe one of the
number friendly ones from this list:
http://notebook.kulchenko.com/algorithms/alphanumeric-natural-sorting-for-humans-in-lua),
but it's trickier for the outline as it's recalculated/resorted every
time the functions change. I'll take a look if I can make it work, but
maybe it's simpler to set the locale (to a better one) before
launching the IDE?

Paul.


Other related posts: