]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix scale parameter for fonts.
[lyx.git] / src / Text.cpp
index 39632954a600aaa519ce8065b80818e090b35ab5..bd4e23db0af4737c6c4bdc957c47e51feab775e6 100644 (file)
@@ -921,6 +921,7 @@ void Text::insertChar(Cursor & cur, char_type c)
                                if (contains(number_unary_operators, c) &&
                                    (cur.pos() == 1
                                     || par.isSeparator(cur.pos() - 2)
+                                    || par.isEnvSeparator(cur.pos() - 2)
                                     || par.isNewline(cur.pos() - 2))
                                  ) {
                                        setCharFont(pit, cur.pos() - 1, cur.current_font,
@@ -1007,7 +1008,10 @@ void Text::insertChar(Cursor & cur, char_type c)
 
        // Prevent to insert uncodable characters in verbatim and ERT
        // (workaround for bug 9012)
-       if (cur.paragraph().isPassThru() && cur.current_font.language()) {
+       // Don't do it for listings inset, since InsetListings::latex() tries
+       // to switch to a usable encoding which works in many cases (bug 9102).
+       if (cur.paragraph().isPassThru() && owner_->lyxCode() != LISTINGS_CODE &&
+           cur.current_font.language()) {
                Encoding const * e = cur.current_font.language()->encoding();
                if (!e->encodable(c)) {
                        cur.message(_("Character is uncodable in verbatim paragraphs."));