Consider this dummy.sublime-project:
{
"build_systems":
[
],
"folders":
[
{
"path": ".",
}
]
}
If you run sublime.active_window().set_project_data({**sublime.active_window().project_data(), "foo": "10"})
you’ll get:
{
"build_systems":
[
],
"folders":
[
{
"path": ".",
}
],
"foo": "10",
}
And then if you run sublime.active_window().set_project_data({k:v for k,v in sublime.active_window().project_data().items() if k!="foo"})
you’ll get:
{
"build_systems":
[
],
"folders":
[
{
"path": ".",
}
],
/*"foo": "10",*/
}
Why is set_project_data
keeping that foo
member commented rather than deleting it… I guess because sublime-project is not strictly speaking json and you don’t want to make any destructive operations like get rid of comments, right? Anyway, I’ve realized about this one because I’ve got some
plugins that are deactivating/activating stuff so I saw some of my projects becoming polluted because this set_project_data
behaviour.
Is there any workaround to avoid keeping these unused entries and keeping my sublime-project files as tidy and compact as possible?
Thanks