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.
This commit is contained in:
Jean-Marc Lasgouttes 2016-02-25 15:00:13 +01:00
parent 158edd30ab
commit b01d7b2262

View File

@ -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