Skip to content

Commit

Permalink
fix: Replace direct rownum_col_offset access with macros in sheet.c
Browse files Browse the repository at this point in the history
Co-Authored-By: Matt Wong <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and liquidaty committed Dec 18, 2024
1 parent 4678e7a commit 6825933
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ static zsvsheet_status zsvsheet_move_hor(struct zsvsheet_display_info *di, bool
if (right) {
if (cursor_right(
di->dimensions->columns, zsvsheet_cell_display_width(current_ui_buffer, di->dimensions),
current_ui_buffer->dimensions.col_count + (current_ui_buffer->dimensions.rownum_col_offset ? 1 : 0) >
current_ui_buffer->dimensions.col_count + (rownum_col_offset(current_ui_buffer) ? 1 : 0) >
zsvsheet_screen_buffer_cols(current_ui_buffer->buffer)
? zsvsheet_screen_buffer_cols(current_ui_buffer->buffer)
: current_ui_buffer->dimensions.col_count + (current_ui_buffer->dimensions.rownum_col_offset ? 1 : 0),
: current_ui_buffer->dimensions.col_count + (rownum_col_offset(current_ui_buffer) ? 1 : 0),
&current_ui_buffer->cursor_col, &current_ui_buffer->buff_offset.col) > 0)
;
} else {
Expand Down Expand Up @@ -311,10 +311,10 @@ static zsvsheet_status zsvsheet_move_hor_end(struct zsvsheet_display_info *di, b
// to do: directly set current_ui_buffer->cursor_col and buff_offset.col
while (cursor_right(
di->dimensions->columns, zsvsheet_cell_display_width(current_ui_buffer, di->dimensions),
current_ui_buffer->dimensions.col_count + (current_ui_buffer->dimensions.rownum_col_offset ? 1 : 0) >
current_ui_buffer->dimensions.col_count + (rownum_col_offset(current_ui_buffer) ? 1 : 0) >
zsvsheet_screen_buffer_cols(current_ui_buffer->buffer)
? zsvsheet_screen_buffer_cols(current_ui_buffer->buffer)
: current_ui_buffer->dimensions.col_count + (current_ui_buffer->dimensions.rownum_col_offset ? 1 : 0),
: current_ui_buffer->dimensions.col_count + (rownum_col_offset(current_ui_buffer) ? 1 : 0),
&current_ui_buffer->cursor_col, &current_ui_buffer->buff_offset.col) > 0)
;
{}
Expand Down Expand Up @@ -823,7 +823,7 @@ const char *display_cell(struct zsvsheet_screen_buffer *buff, size_t data_row, s
static size_t zsvsheet_max_buffer_cols(struct zsvsheet_ui_buffer *ui_buffer) {
size_t col_count = ui_buffer->dimensions.col_count + (rownum_col_offset(ui_buffer) ? 1 : 0);
return col_count > zsvsheet_screen_buffer_cols(ui_buffer->buffer) ? zsvsheet_screen_buffer_cols(ui_buffer->buffer)
: col_count;
: col_count;
}

static void display_buffer_subtable(struct zsvsheet_ui_buffer *ui_buffer, size_t input_header_span,
Expand Down

0 comments on commit 6825933

Please sign in to comment.