radiatoryang/merino

Empty yarn.txt files not loaded with folder

stalhandske opened this issue · 3 comments

When loading a folder into Merino, yarn files with no nodes in them are not loaded and need to be loaded one by one.

I'm on Windows in Unity 2018.3.4f1 and Merino v0.5.3

looked into this; IsProbablyYarnFile checks whether the text file contains at least one "title" header and "===" / "---" sentinels

if ( AssetDatabase.GetAssetPath(textAsset).EndsWith(".yarn.txt") && textAsset.text.Contains("---") && textAsset.text.Contains("===") && textAsset.text.Contains("title:") )

I'm pretty sure this basic check is the default behavior that would be useful for most users, so I wouldn't want to change it... I could add a "Let Merino load empty or invalid files" setting in the Merino prefs?

It'll be a few weeks before I have time to do that, for now you should probably make the modifications yourself, to disable the Contains() checks

Ok, I see. I would argue that since Merino allows me to delete all nodes from a yarn file, it should still count as valid. Maybe it's more consistent to not let me delete the last node?

Not a huge fan of adding that option in preferences. That feels like I'm trying to do something that isn't supposed to be done, which I might be :)

Ok, I see. I would argue that since Merino allows me to delete all nodes from a yarn file, it should still count as valid. Maybe it's more consistent to not let me delete the last node?

@stalhandske ok, you convinced me, for v0.5.4 I'll remove the more stringent Contains file text checks, since it doesn't make sense for Merino to let users edit files in a way that Merino won't open them again... I was following Yarn Spinner behavior with this one, but maybe it's more consistent to diverge here