]> git.lyx.org Git - features.git/commit
Honor pending spaces in InsetMathChar::write
authorEnrico Forestieri <forenr@lyx.org>
Wed, 28 Jun 2023 19:17:26 +0000 (21:17 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 28 Jun 2023 19:17:26 +0000 (21:17 +0200)
commitbefe2da495bf24d651c81bb35fbcda5976f09077
tree565c5e52d05d7300092d9258bcd7cf9c6857e44c
parent889dac7def8036a86cc6ecbac151c34d6cc47b07
Honor pending spaces in InsetMathChar::write

The InsetMathChar::write() method directly accesses the otexrowstream
underlying the TeXMathStream class for writing a character, thus
shortcircuiting the mechanism that allows to separate a macro from the
following material. It has to do so because directly writing a char_type
would cause printing its numerical value instead of the corresponding
unicode character in systems where char_type is typedef'd to uint32_t.

This problem has been uncovered by [7441172d/lyxgit] because each atom
of a mathed cell was being separately written to the output instead of
using the lyx::write() method in MathExtern.cpp that simply converts
everything to a docstring. As InsetMathChar::write() is the only method
bypassing the TeXMathStream machanism, it is simpler teaching it to
honor the pending space instead of modifying the code in InsetMathColor.

This commit amends 7441172d.
src/mathed/InsetMathChar.cpp