LuaTikZ 1.9.7 Load-failure fixes
A stability patch. Two separate bugs could stop LuaTikZ from loading at all, showing "LuaTikz failed to load" with a RangeError or Config merge conflict in the console. Both are fixed. No feature or behaviour changes otherwise.
Fixed: failed to load when another plugin provides autocompletion
LuaTikZ configured CodeMirror's autocomplete with the override field. That field has no merge rule, so as soon as any other installed plugin also set it, the editor configuration threw
Config merge conflict for field override
during startup, and Obsidian aborted the whole plugin.
TikZ completions are now registered as language data, which is additive. Two consequences:
- LuaTikZ can no longer conflict with another plugin's autocompletion, whatever it configures.
overridehad also been replacing every completion source in the editor, for all files, so other plugins' completions were being suppressed globally. They now coexist properly.
Fixed: failed to load when notes were already open
The hover-highlight extension used two CodeMirror state fields, one reading the other through the transaction's previous state. Obsidian installs plugin editor extensions into already-open notes by reconfiguring them, and in that transaction the previous state predates the plugin, so the lookup threw
RangeError: Field is not present in this state
again during load. This is why the failure looked intermittent: starting with no notes open worked, while restoring a session with an open note did not.
The two fields are now a single field, which cannot race its own installation.