Skip to content

Commit d1c8dfe

Browse files
committed
testing
1 parent a360dbd commit d1c8dfe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

eval.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,9 @@ func (e *callExpr) eval(app *app, _ []string) {
12591259
}
12601260
case "draw":
12611261
case "redraw":
1262-
app.ui.screen.Sync()
1262+
if !slices.Contains(e.args, "resize") {
1263+
app.ui.screen.Sync()
1264+
}
12631265
app.ui.renew()
12641266
app.nav.resize(app.ui)
12651267
app.ui.sxScreen.forceClear = true

nav.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ func (nav *nav) preload() {
836836
return
837837
}
838838

839-
if _, ok := nav.regCache[file.path]; ok {
839+
if r, ok := nav.regCache[file.path]; ok && (r.loading || r.height >= nav.height) {
840840
return
841841
}
842842

@@ -948,6 +948,7 @@ func (nav *nav) preview(path string, win *win, mode string) {
948948

949949
reg.lines = lines
950950
reg.sixel = sixel
951+
reg.height = win.h
951952
}
952953

953954
func (nav *nav) loadReg(path string, volatile bool) *reg {

ui.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ type reg struct {
613613
path string
614614
lines []string
615615
sixel bool
616+
height int
616617
}
617618

618619
func (ui *ui) loadFile(app *app, volatile bool) {
@@ -1524,7 +1525,7 @@ func (ui *ui) readNormalEvent(ev tcell.Event, nav *nav) expr {
15241525
return &callExpr{"cd", []string{dir.path}, 1}
15251526
}
15261527
case *tcell.EventResize:
1527-
return &callExpr{"redraw", nil, 1}
1528+
return &callExpr{"redraw", []string{"resize"}, 1}
15281529
case *tcell.EventError:
15291530
log.Printf("Got EventError: '%s' at %s", tev.Error(), tev.When())
15301531
case *tcell.EventInterrupt:

0 commit comments

Comments
 (0)