I believe there is agreement that the ExtendedAttrsImage mechanism for attaching images to buffers is problematic. I also believe PR #5853 provides a reasonable solution. I can't say I have a solid understanding of the image addon, but I have some preliminary ideas.
PR #5853 extends a Marker with a payload field. We can use this to link from a Marker to image-related information. Perhas an IImageSpec directly. The loop in ImageStorage.render could be something like:
for (let row = start; row <= end; ++row) {
const line = buffer.lines.get(row + buffer.ydisp) as IBufferLine;
if (!line) return;
if (line.isWrapped && row !== start) { continue; } // already handled
line.logicalLine.forEachMarker((marker) => {
if (marker.payload instanceof IImageSpec) {
drawCalls.push({ imgSpec: marker.payload, ...});
}
});
...
}
This way we can get rid all the IExtendedAttrsImage complication.
There are probably some minor complications with images that span multiple lines.
@jerch - what do you think?
I believe there is agreement that the
ExtendedAttrsImagemechanism for attaching images to buffers is problematic. I also believe PR #5853 provides a reasonable solution. I can't say I have a solid understanding of the image addon, but I have some preliminary ideas.PR #5853 extends a Marker with a
payloadfield. We can use this to link from a Marker to image-related information. Perhas anIImageSpecdirectly. The loop inImageStorage.rendercould be something like:This way we can get rid all the
IExtendedAttrsImagecomplication.There are probably some minor complications with images that span multiple lines.
@jerch - what do you think?