Skip to content

Commit

Permalink
Add conditions for requestLoadSync
Browse files Browse the repository at this point in the history
Add conditions to requestLoadSync to prevent display delay
when reaching EOF.
  • Loading branch information
noborus committed Dec 28, 2024
1 parent 0af2c9d commit ec7316e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions oviewer/move_vertical.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ func (m *Document) moveBottom() {

lN := m.BufEndNum() - 1
height := m.height - lastLineMargin
chunkNum, _ := chunkLineNum(lN - height)
m.requestLoadSync(chunkNum)
if m.BufEOF() {
if chunkNum, _ := chunkLineNum(lN - height); chunkNum > 0 {
m.requestLoadSync(chunkNum)
}
}
m.topLX, m.topLN = m.bottomLineNum(lN, height)
}

Expand Down

0 comments on commit ec7316e

Please sign in to comment.