Fix BufferView repeating last line for the remainder of the view

This commit is contained in:
josh committed 2017-09-20 19:40:51 -04:00
1 parent 22171cacf9
commit d2fa28c5e1
2 files changed
+18 -1

No files matched your search

+16
View File
@@ -682,3 +682,19 @@ TEST(BufferViewTest, scrolls_window_through_a_very_long_single_line_file)
EXPECT_EQ(9, bv.cursor_screen_row());
EXPECT_EQ(1009u, **iterator);
}
TEST(BufferViewTest, shows_only_lines_in_buffer_if_fewer_lines_in_buffer_than_view)
{
auto b = buffer1();
auto iterator = b->add_iterator();
BufferView bv(b, iterator, Cwd);
bv.resize(50, 50);
bv.update();
int count = 0;
for (auto it = bv.vert_iter(); it.is_valid(); it++)
{
EXPECT_EQ(count, it.row_offset());
count++;
}
EXPECT_EQ(13, count);
}