draw partial rows at bottom of screen but do not allow cursor to go there

This commit is contained in:
Josh Holtrop 2016-12-24 14:49:08 -05:00
parent 743bfa5179
commit 4d737d09d4

View File

@ -12,7 +12,7 @@ void BufferPane::resize(int width, int height)
{
Pane::resize(width, height);
m_columns = std::max(1, m_width / m_window->font()->get_advance());
m_rows = std::max(1, (m_height + m_window->font()->get_line_height() - 1) / m_window->font()->get_line_height());
m_rows = std::max(1, m_height / m_window->font()->get_line_height());
}
void BufferPane::walk_line(const Buffer::Iterator & start_of_line, std::function<void(int, int, int, int, const Buffer::Iterator &)> callback)
@ -165,7 +165,7 @@ void BufferPane::draw()
break;
}
}
while (screen_row < m_rows)
while (screen_row <= m_rows)
{
screen_row += draw_buffer_line(screen_row, i);
if (!i.go_next_line())
@ -188,7 +188,7 @@ int BufferPane::draw_buffer_line(int screen_row, const Buffer::Iterator & start_
int draw_row = screen_row + row_offset;
int x = col_x(screen_column);
int y = row_y(draw_row);
if ((draw_row >= 0) && (draw_row < m_rows))
if ((draw_row >= 0) && (draw_row <= m_rows))
{
if (i == *m_iterator)
{