From 1eabd79f5bb07addda737183d6681cadae4ebf38 Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Wed, 24 Sep 2014 20:08:54 +0900 Subject: Draw underline on anchor which contains cboth text and images. --- display.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/display.c b/display.c index 6dd0976..d4f336a 100644 --- a/display.c +++ b/display.c @@ -522,9 +522,14 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, } if (hseq >= 0 && an->hseq == hseq) { int start_pos = an->start.pos; + int end_pos = an->end.pos; for (i = an->start.pos; i < an->end.pos; i++) { - if (enable_inline_image && (l->propBuf[i] & PE_IMAGE)) - start_pos = i + 1; /* Lazy check */ + if (enable_inline_image && (l->propBuf[i] & PE_IMAGE)) { + if (start_pos == i) + start_pos = i + 1; + else if (end_pos == an->end.pos) + end_pos = i - 1; + } if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { if (active) l->propBuf[i] |= PE_ACTIVE; @@ -532,9 +537,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, l->propBuf[i] &= ~PE_ACTIVE; } } - if (active && start_pos < an->end.pos) + if (active && start_pos < end_pos) redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, - start_pos, an->end.pos); + start_pos, end_pos); } else if (prevhseq >= 0 && an->hseq == prevhseq) { if (active) -- cgit v1.2.3