From 83cd3f4293a3a17f09abfbe55fd4a30418a6ba9d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 24 May 2017 15:40:36 +0200 Subject: [PATCH] Output default mathindent value as "default" This is like parindent now. The old code would avoid outputing the value when it was empty (default indentation). Fixes bug #10657. --- src/BufferParams.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 24aaf02c51..38ca643400 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -866,7 +866,11 @@ string BufferParams::readToken(Lexer & lex, string const & token, lex >> is_math_indent; } else if (token == "\\math_indentation") { lex.next(); - pimpl_->mathindent = Length(lex.getString()); + string mathindent = lex.getString(); + if (mathindent == "default") + pimpl_->mathindent = Length(); + else + pimpl_->mathindent = Length(mathindent); } else if (token == "\\math_numbering_side") { string tmp; lex >> tmp; @@ -1377,8 +1381,9 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const else os << "\n\\defskip " << getDefSkip().asLyXCommand(); os << "\n\\is_math_indent " << is_math_indent; - if (is_math_indent && !getMathIndent().empty()) - os << "\n\\math_indentation " << getMathIndent().asString(); + if (is_math_indent) + os << "\n\\math_indentation " + << (getMathIndent().empty() ? "default" : getMathIndent().asString()); os << "\n\\math_numbering_side "; switch(math_numbering_side) { case LEFT: