X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FText.cpp;h=8337e6db4f9bacf13809d626aed7aa90bd9c23d8;hb=c7d29be153debac82e3d2e8865fcc849f0a5f40d;hp=bdff46efec99d179821e66a38f16cfd98e990673;hpb=741d81ecc6d029425b4fea6815cdbb49cc7dc857;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index bdff46efec..8337e6db4f 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -693,6 +693,7 @@ static void breakParagraph(Text & text, pit_type par_offset, pos_type pos, tmp->params().depth(par.params().depth()); tmp->params().noindent(par.params().noindent()); + tmp->params().spacing(par.params().spacing()); // move everything behind the break position // to the new paragraph @@ -866,8 +867,8 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str, ++pos; space_inserted = true; } - } else if (!isPrintable(*cit)) { - // Ignore unprintables + } else if (!isPrintable(*cit) && *cit != 0x200c) { + // Ignore unprintables, except for ZWNJ (0x200c) continue; } else { // just insert the character @@ -969,11 +970,11 @@ void Text::insertChar(Cursor & cur, char_type c) static docstring const number_operators = from_ascii("+-/*"); static docstring const number_unary_operators = from_ascii("+-"); - // European Number Separators: comma, dot etc. + // Common Number Separators: comma, dot etc. // European Number Terminators: percent, permille, degree, euro etc. if (cur.current_font.fontInfo().number() == FONT_ON) { if (!isDigitASCII(c) && !contains(number_operators, c) && - !(isEuropeanNumberSeparator(c) && + !(isCommonNumberSeparator(c) && cur.pos() != 0 && cur.pos() != cur.lastpos() && tm.displayFont(pit, cur.pos()).fontInfo().number() == FONT_ON && @@ -998,7 +999,7 @@ void Text::insertChar(Cursor & cur, char_type c) ) { setCharFont(pit, cur.pos() - 1, cur.current_font, tm.font_); - } else if (isEuropeanNumberSeparator(c) + } else if (isCommonNumberSeparator(c) && cur.pos() >= 2 && tm.displayFont(pit, cur.pos() - 2).fontInfo().number() == FONT_ON) { setCharFont(pit, cur.pos() - 1, cur.current_font, @@ -1897,7 +1898,7 @@ bool Text::read(Lexer & lex, } -// Returns the current font and depth as a message. +// Returns the current state (font, depth etc.) as a message for status bar. docstring Text::currentState(Cursor const & cur, bool devel_mode) const { LBUFERR(this == cur.text()); @@ -1927,7 +1928,7 @@ docstring Text::currentState(Cursor const & cur, bool devel_mode) const os << bformat(_("Font: %1$s"), font.stateText(&buf.params())); // The paragraph depth - int depth = cur.paragraph().getDepth(); + int depth = par.getDepth(); if (depth > 0) os << bformat(_(", Depth: %1$d"), depth); @@ -1955,6 +1956,11 @@ docstring Text::currentState(Cursor const & cur, bool devel_mode) const } } + // Custom text style + InsetLayout const & layout = cur.inset().getLayout(); + if (layout.lyxtype() == InsetLayout::CHARSTYLE) + os << _(", Style: ") << translateIfPossible(layout.labelstring()); + if (devel_mode) { os << _(", Inset: ") << &cur.inset(); os << _(", Paragraph: ") << cur.pit(); @@ -2041,7 +2047,7 @@ docstring Text::getPossibleLabel(Cursor const & cur) const // We need a unique label docstring label = text; int i = 1; - while (cur.buffer()->insetLabel(label)) { + while (cur.buffer()->activeLabel(label)) { label = text + '-' + convert(i); ++i; }