jon-heard / obsidian-inline-scripts

Obsidian plugin: Type text shortcuts that expand into javascript generated text.
MIT License
134 stars 4 forks source link

state set doesn't work #71

Open Zhrack opened 1 year ago

Zhrack commented 1 year ago

With standard library imported, run state reset. Then run ;;ac chars add Test:: Run ;;state get:: to print the current state.

This is my state at that point. {"lists":{"pcs":{"type":"basic","content":[]},"npcs":{"type":"basic","content":[]},"threads":{"type":"basic","content":[]},"plotline_dupes":{"type":"basic","content":[]},"plotlines":{"type":"combo","content":["threads","plotline_dupes"]},"character_dupes":{"type":"basic","content":["Test"]},"characters":{"type":"combo","content":["pcs","npcs","character_dupes"]}},"notevars":{"isMarkdownRefreshed":true},"notepick":{},"mythicgme":{"chaos":5,"scene":1},"adventurecrafter":{"themeSlots":[]},"cards":{"piles":{},"size":150,"priorShowMoved":true,"backImage":null},"tablefiles":{"paths":{},"configuration":{}},"clips":{}}

Reset the state again.

Run ;;state set with the previous state.

Error in the console: image

Obsidian 1.1.16 Windows Inline Scripts 0.24.12

jeremy-w commented 1 year ago

The erroring line 21 is missing an opening double quote mark for the expFormat string arg.

Apparently State is also a variable name in scope, so it takes till it hits set to barf.

If you examine the sfile for state, is it indeed missing that quote? Does adding it fix it?

jeremy-w commented 1 year ago

The error is present in main at https://github.com/jon-heard/obsidian-inline-scripts-library/blob/793ab6ea78a9b14d7b90e6536e35e6a47d757cec/state.sfile.md?plain=1#L302

Zhrack commented 1 year ago

Fixing it locally fixed it! Thanks!

Zhrack commented 1 year ago

Leraving it open since the issue is still present on main code.