Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug whereby cursor movement in raw row > buffer_row count incorrectly required buffer refresh #253

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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