From c9fdf376789c787c1a1cbce19b19d1b86b8a653a Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Mon, 19 May 2014 21:50:34 +0200 Subject: [PATCH] Ugly fix for bug #9102 The real problem is the encoding of latex_language: It is hardcoded to latin1, but InsetListig uses the currently active encoding. Therefore, we cannot tell whether any given character wil be encodable or not, and we should not prevent non-ACII characters. In the future, we need to make the encoding of latex_language dynamic, so that it always represents the currently active encoding. Then, we could do the correct check both for listings and ERT. For now, I simply disabled the encoding check for listings, which also means that bug 9012 might occur in other cases for listings, but this is less important than bug 9102. --- src/Text.cpp | 5 ++++- status.21x | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Text.cpp b/src/Text.cpp index cdcc200255..dd097470ae 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -1007,7 +1007,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.")); diff --git a/status.21x b/status.21x index d7e92a2537..26b4c850a5 100644 --- a/status.21x +++ b/status.21x @@ -128,6 +128,8 @@ What's new - Fix wrong on-screen indentation of a paragraph occurring in some cases. +- Fix keyborad input of cyrillic characters in program listings (bug 9102). + * INTERNALS -- 2.39.5