commit b01d7b2262baaebb26713f79e95edc61103fab73
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Thu Feb 25 15:00:13 2016 +0100
Do not merge consecutive hyphens in LyX-Code
The existing code already avoids merging with typewriter font, but it does
not work with LyX-Code, where the typewriter family is inherited. Therefore it
is Cursor::real_current_font that must be tested.
Fixes bug #9987.
diff --git a/src/Text.cpp b/src/Text.cpp
index 187e387..29ff6cf 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -1050,7 +1050,7 @@ void Text::insertChar(Cursor & cur, char_type c)
pos_type pos = cur.pos();
if (!cur.paragraph().isPassThru() && owner_->lyxCode() != IPA_CODE &&
- cur.current_font.fontInfo().family() != TYPEWRITER_FAMILY &&
+ cur.real_current_font.fontInfo().family() != TYPEWRITER_FAMILY &&
c == '-' && pos > 0) {
if (par.getChar(pos - 1) == '-') {
// convert "--" to endash