commit 09723b07a8e3fcfcfdf9a9a7c65462cc5e7eba4f
parent dd667ce92c83ce5f724931f39120bc8d7c6b46f9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 29 Jun 2017 21:53:49 +0200
tweaks: fix compilation with --enable-tiny
Diffstat:
2 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/src/proto.h b/src/proto.h
@@ -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);
diff --git a/src/winio.c b/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)