Fix multiline monospace pre blocks editing.

Now we pass current flags and lnkIndex to the NewlineBlock, so that
we don't get one multiline pre block split to separate line blocks.
This commit is contained in:
John Preston 2017-07-06 17:10:33 +03:00
parent eaf91bba58
commit 148c04fb41
2 changed files with 2 additions and 2 deletions

View file

@ -182,7 +182,7 @@ public:
emoji = 0; emoji = 0;
lastSkipped = true; lastSkipped = true;
} else if (newline) { } else if (newline) {
_t->_blocks.push_back(new NewlineBlock(_t->_st->font, _t->_text, blockStart, len)); _t->_blocks.push_back(new NewlineBlock(_t->_st->font, _t->_text, blockStart, len, flags, lnkIndex));
} else { } else {
_t->_blocks.push_back(new TextBlock(_t->_st->font, _t->_text, _t->_minResizeWidth, blockStart, len, flags, lnkIndex)); _t->_blocks.push_back(new TextBlock(_t->_st->font, _t->_text, _t->_minResizeWidth, blockStart, len, flags, lnkIndex));
} }

View file

@ -108,7 +108,7 @@ public:
} }
private: private:
NewlineBlock(const style::font &font, const QString &str, uint16 from, uint16 length) : ITextBlock(font, str, from, length, 0, 0), _nextDir(Qt::LayoutDirectionAuto) { NewlineBlock(const style::font &font, const QString &str, uint16 from, uint16 length, uchar flags, uint16 lnkIndex) : ITextBlock(font, str, from, length, flags, lnkIndex), _nextDir(Qt::LayoutDirectionAuto) {
_flags |= ((TextBlockTNewline & 0x0F) << 8); _flags |= ((TextBlockTNewline & 0x0F) << 8);
} }