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

[bug][minor] Non-string value of `sorting-spec:` prevents the custom sorting from working w/o error message #119

Closed SebastianMC closed 6 months ago

SebastianMC commented 6 months ago

When the value of sorting-spec: is entered - by mistake - as an object, not as a string, the plugin stops from working. No error message is shown. Any attempt to enable custom sorting (ribbon icon, command, context menu) fails with no error message. Only JS exception is visible in developer console.

For example, missing the trailing pipe character | gives this effect:

sorting-spec:
  target-folder: /*
  /: ... \-D+

For clarity, the correct version of the spec is:

sorting-spec: |
  target-folder: /*
  /: ... \-D+

or

sorting-spec: |-
  target-folder: /*
  /: ... \-D+

The latter form with |- is generated by the Obsidian properties editor.

SebastianMC commented 6 months ago

Fix committed to master branch, will be included in next release. The issue seems to be not deserving a new release.