aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'display.c')
-rw-r--r--display.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/display.c b/display.c
index 2fe1183..d4f336a 100644
--- a/display.c
+++ b/display.c
@@ -487,7 +487,7 @@ displayBuffer(Buffer *buf, int mode)
term_title(conv_to_system(buf->buffername));
refresh();
#ifdef USE_IMAGE
- if (activeImage && displayImage && buf->img) {
+ if (activeImage && displayImage && buf->img && buf->image_loaded) {
drawImage();
}
#endif
@@ -521,7 +521,15 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
break;
}
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)) {
+ 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;
@@ -529,9 +537,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq,
l->propBuf[i] &= ~PE_ACTIVE;
}
}
- if (active)
+ if (active && start_pos < end_pos)
redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY,
- an->start.pos, an->end.pos);
+ start_pos, end_pos);
}
else if (prevhseq >= 0 && an->hseq == prevhseq) {
if (active)
@@ -855,14 +863,16 @@ redrawLineImage(Buffer *buf, Line *l, int i)
y = (int)(i * pixel_per_line);
sx = (int)((rcol - COLPOS(l, a->start.pos)) * pixel_per_char);
sy = (int)((l->linenumber - image->y) * pixel_per_line);
- if (sx == 0 && x + image->xoffset >= 0)
- x += image->xoffset;
- else
- sx -= image->xoffset;
- if (sy == 0 && y + image->yoffset >= 0)
- y += image->yoffset;
- else
- sy -= image->yoffset;
+ if (! enable_inline_image) {
+ if (sx == 0 && x + image->xoffset >= 0)
+ x += image->xoffset;
+ else
+ sx -= image->xoffset;
+ if (sy == 0 && y + image->yoffset >= 0)
+ y += image->yoffset;
+ else
+ sy -= image->yoffset;
+ }
if (image->width > 0)
w = image->width - sx;
else