tweaks: fix compilation with --enable-tiny
parent
dd667ce92c
commit
09723b07a8
|
@ -665,13 +665,13 @@ void edit_scroll(scroll_dir direction, int nrows);
|
|||
#ifndef NANO_TINY
|
||||
size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
|
||||
bool *end_of_line);
|
||||
size_t actual_last_column(size_t leftedge, size_t column);
|
||||
size_t get_chunk(filestruct *line, size_t column, size_t *leftedge);
|
||||
size_t get_chunk_row(filestruct *line, size_t column);
|
||||
size_t get_chunk_leftedge(filestruct *line, size_t column);
|
||||
size_t get_last_chunk_row(filestruct *line);
|
||||
void ensure_firstcolumn_is_aligned(void);
|
||||
#endif
|
||||
size_t actual_last_column(size_t leftedge, size_t column);
|
||||
void edit_redraw(filestruct *old_current);
|
||||
void edit_refresh(void);
|
||||
void adjust_viewport(update_type location);
|
||||
|
|
54
src/winio.c
54
src/winio.c
|
@ -3047,34 +3047,6 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
|
|||
return (editwincols > 1) ? prev_column : column - 1;
|
||||
}
|
||||
|
||||
/* When in softwrap mode, and the given column is on or after the breakpoint of
|
||||
* a softwrapped chunk, shift it back to the last column before the breakpoint.
|
||||
* The given column is relative to the given leftedge in current. The returned
|
||||
* column is relative to the start of the text. */
|
||||
size_t actual_last_column(size_t leftedge, size_t column)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
size_t end_col;
|
||||
bool last_chunk;
|
||||
|
||||
end_col = get_softwrap_breakpoint(openfile->current->data, leftedge,
|
||||
&last_chunk) - leftedge;
|
||||
|
||||
/* If we're not on the last chunk, we're one column past the end of
|
||||
* the row. Shifting back one column might put us in the middle of
|
||||
* a multi-column character, but actual_x() will fix that later. */
|
||||
if (!last_chunk)
|
||||
end_col--;
|
||||
|
||||
if (column > end_col)
|
||||
column = end_col;
|
||||
}
|
||||
#endif
|
||||
|
||||
return leftedge + column;
|
||||
}
|
||||
|
||||
/* Get the row of the softwrapped chunk of the given line that column is on,
|
||||
* relative to the first row (zero-based), and return it. If leftedge isn't
|
||||
* NULL, return the leftmost column of the chunk in it. */
|
||||
|
@ -3134,8 +3106,34 @@ void ensure_firstcolumn_is_aligned(void)
|
|||
/* If smooth scrolling is on, make sure the viewport doesn't center. */
|
||||
focusing = FALSE;
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
||||
/* When in softwrap mode, and the given column is on or after the breakpoint of
|
||||
* a softwrapped chunk, shift it back to the last column before the breakpoint.
|
||||
* The given column is relative to the given leftedge in current. The returned
|
||||
* column is relative to the start of the text. */
|
||||
size_t actual_last_column(size_t leftedge, size_t column)
|
||||
{
|
||||
#ifndef NANO_TINY
|
||||
if (ISSET(SOFTWRAP)) {
|
||||
bool last_chunk;
|
||||
size_t end_col = get_softwrap_breakpoint(openfile->current->data,
|
||||
leftedge, &last_chunk) - leftedge;
|
||||
|
||||
/* If we're not on the last chunk, we're one column past the end of
|
||||
* the row. Shifting back one column might put us in the middle of
|
||||
* a multi-column character, but actual_x() will fix that later. */
|
||||
if (!last_chunk)
|
||||
end_col--;
|
||||
|
||||
if (column > end_col)
|
||||
column = end_col;
|
||||
}
|
||||
#endif
|
||||
|
||||
return leftedge + column;
|
||||
}
|
||||
|
||||
/* Return TRUE if current[current_x] is above the top of the screen, and FALSE
|
||||
* otherwise. */
|
||||
bool current_is_above_screen(void)
|
||||
|
|
Loading…
Reference in New Issue