From 0d99209d9f499ff3d7edf2b34f8343ba23a39aef Mon Sep 17 00:00:00 2001
From: Araki Ken <arakiken@users.sf.net>
Date: Thu, 14 Mar 2013 06:24:43 +0900
Subject: * display.c: Draw underline on anchor text which is not overlapped
 with any image.

---
 display.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/display.c b/display.c
index 471c8af..691437b 100644
--- a/display.c
+++ b/display.c
@@ -521,10 +521,10 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
 		break;
 	}
 	if (hseq >= 0 && an->hseq == hseq) {
-	    int hasImage = 0;
+	    int start_pos = an->start.pos;
 	    for (i = an->start.pos; i < an->end.pos; i++) {
-	        if (l->propBuf[i] & PE_IMAGE)
-		    hasImage = 1 ;
+	        if (support_remote_image && (l->propBuf[i] & PE_IMAGE))
+		    start_pos = i + 1;	/* Lazy check */
 		if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) {
 		    if (active)
 			l->propBuf[i] |= PE_ACTIVE;
@@ -532,10 +532,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
 			l->propBuf[i] &= ~PE_ACTIVE;
 		}
 	    }
-	    if (active &&
-	        (! support_remote_image || ! hasImage))
+	    if (active && start_pos < an->end.pos)
 		redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY,
-				 an->start.pos, an->end.pos);
+				 start_pos, an->end.pos);
 	}
 	else if (prevhseq >= 0 && an->hseq == prevhseq) {
 	    if (active)
-- 
cgit v1.2.3