Fix editor extension settings not properly reflected #2091
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug description
settings.enableInlineDataview
) and "Enable Inline JavaScript Queries" (settings.enableInlineDataviewJS
) are turned off when the plugin's loading, any inline queries are not enabled even if these settings are turned on later on.settings.prettyRenderInlineFields
).Steps to reproduce bug 1
Solution
1 is caused by how
cmExtension
is treated in the plugin'sonload
method:obsidian-dataview/src/main.ts
Lines 102 to 106 in 52fcd0b
Here, the comment mentions dynamic updates, but in fact, the editor extensions are not updated at all after the initial loading.
obsidian-dataview/src/main.ts
Lines 41 to 42 in 52fcd0b
So, I updated
main.ts
so that the editor extensions are dynamically updated according to the settings. This also resolves 2.https://github.com/RyotaUshio/obsidian-dataview/blob/83524a47f30508cde5be99b74a6dd987c58e3e56/src/main.ts#L183-L196
https://github.com/RyotaUshio/obsidian-dataview/blob/83524a47f30508cde5be99b74a6dd987c58e3e56/src/main.ts#L343
Thank you!