SebastianMC / obsidian-custom-sort

Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
GNU General Public License v3.0
252 stars 19 forks source link

Multi-folders instructions not works #130

Closed arteny closed 4 months ago

arteny commented 5 months ago

Here is my sortspec file from root folder:

---
sorting-spec: |
    target-folder: /*
    %
    files
    attachments

    target-folder: /
    Все задачи
    Входящие
    Личное
    %
    Templates
    files
    sortspec
---

As result rules not works for any folder (attachments folder not the last) and also it is not correct working for root folder now, order is wrong. When it is written that all is successfully applied when turn on sort feature.

colintedford commented 5 months ago

Are you using the Catalyst build of Obsidian? It updated today and seems to be causing problems for Custom Sort. (Discussion in the #insider-desktop-release channel on Discord.)

arteny commented 4 months ago

Are you using the Catalyst build of Obsidian? It updated today and seems to be causing problems for Custom Sort. (Discussion in the #insider-desktop-release channel on Discord.)

no, I am using the regular version of Obsidian

SebastianMC commented 4 months ago

Hi @arteny

could you please update the plugin to the 2.1.6 version released a minute ago and re-test? It is unclear in which exact version Obsidian made some internal refactoring which prevented the plugin from working correctly.

After retesting let me know if the problem persists. At glance I have some questions to the sorting specification, but let's confirm the behavior with recent plugin release first.

arteny commented 4 months ago

@SebastianMC

Tried this, it is not working same way (after restarting too).

SebastianMC commented 4 months ago

Hi @arteny,

I wanted to quickly reproduce your example locally and probably identified the issue. I copied the sorting spec example to a new vault and it turned out there is a tab character in the empty line of the spec (the red highlight):

2024-02-08_18-32-32

The tab character is not allowed in YAML syntax (which is used by Obsidian) and causes the entire metadata piece to be ignored by Obsidian parser. To fix this either delete the tab character from the empty line or remove the empty line entirely.

BTW to help identifying such kind of errors, you can disable automatic integration with boomarks in the settings of custom-sort plugin:

2024-02-08_18-39-29

If you do that, there will be no hidden automatic sorting specification and the plugin will complain that there is no sorting specification at all:

2024-02-08_18-40-20

Please let me know if it helps

arteny commented 4 months ago

@SebastianMC removing tab from empty line fixed the issue, thanks