about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/local/pager.nim4
-rw-r--r--src/local/term.nim5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/local/pager.nim b/src/local/pager.nim
index 3822eb77..b0521706 100644
--- a/src/local/pager.nim
+++ b/src/local/pager.nim
@@ -575,8 +575,8 @@ proc initImages(pager: Pager; container: Container) =
       dispw = min(width + xpx, maxwpx) - xpx
       let ypx = (image.y - container.fromy) * pager.attrs.ppl
       erry = -min(ypx, 0) mod 6
-    if dispw <= offx:
-      continue
+      if dispw <= offx:
+        continue
     let cached = container.findCachedImage(image, offx, erry, dispw)
     let imageId = image.bmp.imageId
     if cached == nil:
diff --git a/src/local/term.nim b/src/local/term.nim
index 2f31104a..e9b404a1 100644
--- a/src/local/term.nim
+++ b/src/local/term.nim
@@ -821,8 +821,9 @@ proc outputSixelImage(term: Terminal; x, y: int; image: CanvasImage;
 
 proc outputSixelImage(term: Terminal; x, y: int; image: CanvasImage) =
   var p = cast[ptr UncheckedArray[char]](image.data.buffer)
-  let H = int(image.data.size - 1)
-  term.outputSixelImage(x, y, image, p.toOpenArray(0, H))
+  if image.data.size > 0:
+    let H = int(image.data.size - 1)
+    term.outputSixelImage(x, y, image, p.toOpenArray(0, H))
 
 proc outputKittyImage(term: Terminal; x, y: int; image: CanvasImage) =
   var outs = term.cursorGoto(x, y) &