mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
Assure not to miss requirements on loading with instant preview on
This commit is contained in:
parent
2a9f07336f
commit
2cdeb945ce
@ -612,8 +612,22 @@ bool MathMacro::validName() const
|
||||
|
||||
void MathMacro::validate(LaTeXFeatures & features) const
|
||||
{
|
||||
// Immediately after a document is loaded, in some cases the MacroData
|
||||
// of the global macros defined in the lib/symbols file may still not
|
||||
// be known to the macro machinery because it will be set only after
|
||||
// the first call to updateMacros(). This is not a problem unless
|
||||
// instant preview is on for math, in which case we will be missing
|
||||
// the corresponding requirements.
|
||||
// In this case, we get the required info from the global macro table.
|
||||
if (!requires_.empty())
|
||||
features.require(requires_);
|
||||
else if (!macro_) {
|
||||
// Update requires for known global macros.
|
||||
MacroData const * data = MacroTable::globalMacros().get(name());
|
||||
if (data && !data->requires().empty())
|
||||
features.require(data->requires());
|
||||
}
|
||||
|
||||
|
||||
if (name() == "binom")
|
||||
features.require("binom");
|
||||
|
@ -146,6 +146,9 @@ What's new
|
||||
- Do not add paragraph break on environments with font change if the
|
||||
environments only have one paragraph (bug 9598).
|
||||
|
||||
- Make sure to generate a preview for global macros when they appear
|
||||
in a document containing only a single math inset.
|
||||
|
||||
|
||||
* LYX2LYX
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user