CJK
};
+// FIXME THREAD
+// There could easily be a conflict here, with the export process
+// setting this one way, and a View>Source process (possbily for
+// another Buffer) resetting it.
static int open_encoding_ = none;
static int cjk_inherited_ = 0;
Language const * prev_env_language_ = 0;
string const & everypar,
int start_pos, int end_pos)
{
- BufferParams const & bparams = buf.params();
+ BufferParams const & bparams = runparams_in.is_child
+ ? buf.masterParams() : buf.params();
ParagraphList const & paragraphs = text.paragraphs();
Paragraph const & par = paragraphs.at(pit);
// FIXME This check should not really be needed.
{
Encoding const & oldEnc = *runparams.encoding;
bool moving_arg = runparams.moving_arg;
- if (!force && ((bparams.inputenc != "auto" && bparams.inputenc != "default")
- || moving_arg))
+ // If we switch from/to CJK, we need to switch anyway, despite custom inputenc
+ bool const from_to_cjk =
+ (oldEnc.package() == Encoding::CJK && newEnc.package() != Encoding::CJK)
+ || (oldEnc.package() != Encoding::CJK && newEnc.package() == Encoding::CJK);
+ if (!force && !from_to_cjk
+ && ((bparams.inputenc != "auto" && bparams.inputenc != "default") || moving_arg))
return make_pair(false, 0);
// Do nothing if the encoding is unchanged.