-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
There was a problem hiding this 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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Thanks! |
Closes #3244