obsidian-inline-scripts icon indicating copy to clipboard operation
obsidian-inline-scripts copied to clipboard

state set doesn't work

Open Zhrack opened this issue 2 years ago • 4 comments

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

Zhrack avatar Apr 07 '23 15:04 Zhrack

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 avatar Apr 10 '23 17:04 jeremy-w

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

jeremy-w avatar Apr 10 '23 17:04 jeremy-w

Fixing it locally fixed it! Thanks!

Zhrack avatar Apr 10 '23 17:04 Zhrack

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

Zhrack avatar Apr 10 '23 18:04 Zhrack