vrtmrz / obsidian-tagfolder

MIT License
221 stars 17 forks source link

FR: give the option to sort tag by name (but prioritize number over string) #90

Closed kerhbal closed 1 year ago

kerhbal commented 1 year ago

First of all, thank you for the amazing plugin! I just moved my notes from a previous app that was mainly focused on tags, and since I have plenty notes with multiple nested tags, there is no way for me to remap the structure to folder. Though I found that in the case below, the sorting method is not perfect:

1-xxx
2-mmm
3-nnn
10-ppp

as the result will be:

1-xxx
10-ppp
2-mmm
3-nnn

I suppose this is due to 0 is lower than - when sorting. So do u think it makes sense to add the option to prioritize number sorting over string (maybe only for strictly prefixed number) in tags? Thanks

vrtmrz commented 1 year ago

Thank you for opening the issue! And I am sorry for being delayed. After seeing this issue, I realised that the File Explorer of Obsidian also sorts files in this way.

JavaScript has been amazing in recent years and has a natural sorting as a standard function. It might behave more suitable in some locales and cultures. I think that it should not be an optional feature (If somebody wants the previous behaviour, that would be optional).

It has been implemented at v0.18.3. Would you mind if I ask you to check the behaviour, please?

kerhbal commented 1 year ago

@vrtmrz hi I was gonna reply to the issue lol. I saw the code change, yeah it's very elegant. looks good on the app. thanks! I'll close the issue