чување b7b287120b09b845411652b2841286080fddcadd
родитељ 76c114f4357e4f0fe791e570efcf8def08dcf52a
Аутор: Страхиња Радић <sr@strahinja.org>
Датум: Tue, 16 Jul 2024 17:07:30 +0200
sled.c(position_to): Bugfix: pressing right in the last line of screen
or left in the first didn't update first_shown.row
Diffstat:
измењених датотека: 1, додавања: 5(+), брисања: 0(-)
diff --git a/sled.c b/sled.c
@@ -1722,6 +1722,8 @@ position_to(struct DrawState* state, const int row, const int column)
if (state->coord.row > 0)
{
state->coord.row--;
+ if (state->first_shown.row > 0)
+ state->first_shown.row--;
state->coord.col
= state->buffer[state->coord.row].length;
}
@@ -1734,6 +1736,9 @@ position_to(struct DrawState* state, const int row, const int column)
if ((state->coord.row + 1) < state->rows_count)
{
state->coord.row++;
+ if (state->first_shown.row + 1
+ < state->rows_count)
+ state->first_shown.row++;
state->coord.col = 0;
}
else