Implement builtin support for sixel images, allow combining with text (#2109)

* Add function for reading lines in file

* Implement sixel drawing

* Remove sixel option

* Fix linting error
This commit is contained in:
Joe Lim authored and GitHub committed 2025-08-25 22:19:14 +10:00
1 parent aba73884e3
commit 13da770af6
11 files changed
+190 -99

No files matched your search

+9 -6
View File
@@ -270,12 +270,14 @@ func (win *win) printReg(screen tcell.Screen, reg *reg, previewLoading bool, sxs
return
}
for i, l := range reg.lines {
if i > win.h-1 {
break
}
if !reg.sixel {
for i, l := range reg.lines {
if i > win.h-1 {
break
}
st = win.print(screen, 2, i, st, l)
st = win.print(screen, 2, i, st, l)
}
}
sxs.printSixel(win, screen, reg)
@@ -768,7 +770,7 @@ type reg struct {
loadTime time.Time
path string
lines []string
sixel *string
sixel bool
}
func (ui *ui) loadFile(app *app, volatile bool) {
@@ -1572,6 +1574,7 @@ func (ui *ui) readNormalEvent(ev tcell.Event, nav *nav) expr {
return &callExpr{"cd", []string{dir.path}, 1}
}
case *tcell.EventResize:
clear(nav.regCache)
return &callExpr{"redraw", nil, 1}
case *tcell.EventError:
log.Printf("Got EventError: '%s' at %s", tev.Error(), tev.When())