mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 13:34:48 +02:00
Show proper error message in diff when failing to load image
This commit is contained in:
@@ -362,7 +362,7 @@ func image_lines(left_path, right_path string, screen_size screen_size, margin_s
|
|||||||
if errors.Is(err, graphics.ErrNotFound) {
|
if errors.Is(err, graphics.ErrNotFound) {
|
||||||
return splitlines("Loading image...", available_cols)
|
return splitlines("Loading image...", available_cols)
|
||||||
}
|
}
|
||||||
return splitlines(fmt.Sprintf("Failed to load image: %s", err), available_cols)
|
return splitlines(fmt.Sprintf("%s", err), available_cols)
|
||||||
}
|
}
|
||||||
left_lines := do_side(left_path)
|
left_lines := do_side(left_path)
|
||||||
if ll.left_image.count = len(left_lines); ll.left_image.count > 0 {
|
if ll.left_image.count = len(left_lines); ll.left_image.count > 0 {
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ func (self *ImageCollection) GetSizeIfAvailable(key string, page_size Size) (Siz
|
|||||||
}
|
}
|
||||||
ans := img.renderings[page_size]
|
ans := img.renderings[page_size]
|
||||||
if ans == nil {
|
if ans == nil {
|
||||||
|
if img.err != nil {
|
||||||
|
return Size{}, img.err
|
||||||
|
}
|
||||||
return Size{}, ErrNotFound
|
return Size{}, ErrNotFound
|
||||||
}
|
}
|
||||||
return Size{ans.img.Width, ans.img.Height}, img.err
|
return Size{ans.img.Width, ans.img.Height}, img.err
|
||||||
|
|||||||
Reference in New Issue
Block a user