Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Renaming note fields not updating custom browser appearance #3245

Merged
merged 10 commits into from
Jun 24, 2024

Conversation

jamesnelmore
Copy link
Contributor

Closes #3244

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks James, looks good! Just one comment:

@@ -575,6 +583,26 @@ impl Notetype {
self.templates[idx].config.a_format = a.template_to_string();
}
}

// Update browser templates, if they exist
for (idx, (q_browser_opt, a_browser_opt)) in parsed_browser.iter_mut().enumerate() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in assuming this is basically a copy+paste of the code above? If so, it would be a bit more elegant to factor the common code into a closure, then call the closure once for the main's enumerate(), and once for the browser templates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I just moved the logic into 2 closures, although I'm not sure if q_update_fields and an_update_fields are the best names. Let me know what you think.

@dae dae merged commit 930c97b into ankitects:main Jun 24, 2024
1 check passed
@dae
Copy link
Member

dae commented Jun 24, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming note fields does not update custom browser appearance
2 participants