Skip to content

Commit

Permalink
fix bug whereby cursor movement in raw row > buffer_row count incorre…
Browse files Browse the repository at this point in the history
…ctly required buffer refresh (#253)

* fix performance bug whereby cursor movement in raw row > buffer_row count incorrectly required buffer refresh
  • Loading branch information
liquidaty authored Oct 31, 2024
1 parent ff1329b commit e636c6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ static zsvsheet_handler_status zsvsheet_move_page(struct zsvsheet_display_info *
static zsvsheet_handler_status zsvsheet_move_ver(struct zsvsheet_display_info *di, bool up) {
size_t current;
struct zsvsheet_ui_buffer *current_ui_buffer = *(di->ui_buffers.current);

current = zsvsheet_get_input_raw_row(&current_ui_buffer->input_offset, &current_ui_buffer->buff_offset,
current_ui_buffer->cursor_row);
if (up) {
Expand Down
4 changes: 2 additions & 2 deletions app/sheet/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ static int zsvsheet_goto_input_raw_row(struct zsvsheet_ui_buffer *uib, size_t in

size_t buffer_rows = zsvsheet_buffer_rows(buffer);
int update_buffer = 0;
if (input_raw_num < input_offset->row // move the buffer up
|| input_raw_num + input_header_span + 1 > buffer_rows // move the buffer down
if (input_raw_num < input_offset->row // move the buffer up
|| input_raw_num + input_header_span + 1 > input_offset->row + buffer_rows // move the buffer down
) {
input_offset->row = input_offset_centered(input_dims, buffer_rows, input_raw_num);
update_buffer = 1;
Expand Down

0 comments on commit e636c6d

Please sign in to comment.