From: Georg Baum Date: Sun, 18 Oct 2015 18:55:53 +0000 (+0200) Subject: Fix language end command X-Git-Tag: 2.2.0alpha1~222 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=86325e50d00b917c7c40c99e5ae41577b862af24;p=features.git Fix language end command The code that sets open_polyglossia_lang_ is not only executed for polyglossia, but also for babel, so we have to use the correct language end command. --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index feb51a0039..94c261d044 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -60,7 +60,7 @@ struct OutputState prev_env_language_(0), open_polyglossia_lang_("") { } - int open_encoding_; + OpenEncoding open_encoding_; int cjk_inherited_; Language const * prev_env_language_; string open_polyglossia_lang_; @@ -1240,7 +1240,7 @@ void latexParagraphs(Buffer const & buf, } // if "auto end" is switched off, explicitly close the language at the end - // but only if the last par is in a babel language + // but only if the last par is in a babel or polyglossia language string const lang_end_command = runparams.use_polyglossia ? "\\end{$$lang}" : lyxrc.language_command_end; if (maintext && !lyxrc.language_auto_end && !mainlang.empty() && @@ -1259,7 +1259,10 @@ void latexParagraphs(Buffer const & buf, } // Likewise for polyglossia if (maintext && !is_child && state->open_polyglossia_lang_ != "") { - os << "\\end{" << state->open_polyglossia_lang_ << "}\n"; + os << from_utf8(subst(lang_end_command, + "$$lang", + state->open_polyglossia_lang_)) + << '\n'; state->open_polyglossia_lang_ = ""; }