Skip to content

Commit

Permalink
fix preview scrolling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Stewart committed Oct 15, 2023
1 parent 98304ee commit 5cf080f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool ItemPreview::scrollDown(int lines) {
return true;
}
else if (!m_optimizeAnsi || lines >= m_height) {
m_offset = std::min((int)m_content.lines.size() - m_height, m_offset + lines);
m_offset = std::max(std::min(m_offset + lines, (int)m_content.lines.size() - m_height), 0);
redraw();
return true;
}
Expand Down

0 comments on commit 5cf080f

Please sign in to comment.