commit c2732a30f9e09208cb1010ae42d8e56ee80f2a78
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Thu Mar 21 11:27:51 2019 +0100
Mark inserted/deleted end of paragraph using pilcrow
Instead of the weird corner line, display a pilcrow sign (even when
disabled in prefs) to mark inserted/deleted end of paragraph.
Incidentally, this fixes the recent placement bug of the corner line.
---
src/RowPainter.cpp | 24 ------------------------
src/TextMetrics.cpp | 6 ++++--
2 files changed, 4 insertions(+), 26 deletions(-)
diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp
index 718b1a9..a88ac2a 100644
--- a/src/RowPainter.cpp
+++ b/src/RowPainter.cpp
@@ -507,30 +507,6 @@ static int getEndLabel(pit_type p, Text const & text)
void RowPainter::paintLast() const
{
int const endlabel = getEndLabel(row_.pit(), text_);
-
- // paint imaginary end-of-paragraph character
-
- Change const & change = par_.lookupChange(par_.size());
- if (change.changed()) {
- FontMetrics const & fm =
-
theFontMetrics(pi_.base.bv->buffer().params().getFont());
- int const length = fm.maxAscent() / 2;
- Color col = change.color();
-
- pi_.pain.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 -
length, col,
- Painter::line_solid, 3);
-
- if (change.deleted()) {
- pi_.pain.line(int(x_) + 1 - length, yo_ + 2, int(x_) +
1 + length,
- yo_ + 2, col, Painter::line_solid, 3);
- } else {
- pi_.pain.line(int(x_) + 1 - length, yo_ + 2, int(x_) +
1,
- yo_ + 2, col, Painter::line_solid, 3);
- }
- }
-
- // draw an endlabel
-
switch (endlabel) {
case END_LABEL_BOX:
case END_LABEL_FILLED_BOX: {
diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 88ffa6f..a29b4dc 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1001,7 +1001,9 @@ bool TextMetrics::breakRow(Row & row, int const
right_margin) const
// End of paragraph marker. The logic here is almost the
// same as in redoParagraph, remember keep them in sync.
ParagraphList const & pars = text_->paragraphs();
- if (lyxrc.paragraph_markers && !need_new_row
+ Change const & change = par.lookupChange(i);
+ if ((lyxrc.paragraph_markers || change.changed())
+ && !need_new_row
&& i == end && size_type(row.pit() + 1) < pars.size()) {
// add a virtual element for the end-of-paragraph
// marker; it is shown on screen, but does not exist
@@ -1012,7 +1014,7 @@ bool TextMetrics::breakRow(Row & row, int const
right_margin) const
= text_->inset().buffer().params();
f.setLanguage(par.getParLanguage(bparams));
// ΒΆ U+00B6 PILCROW SIGN
- row.addVirtual(end, docstring(1, char_type(0x00B6)), f,
Change());
+ row.addVirtual(end, docstring(1, char_type(0x00B6)), f, change);
}
// Is there a end-of-paragaph change?