commit 5a3de7f117d2b818ca383c2152c4a018b5358cce
parent 7b5cc1dcda523a770b0f0af1f5969b339455e06d
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 5 May 2017 12:33:25 +0200
tweaks: avoid an empty function call in tiny version with line numbers
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2637,9 +2637,10 @@ int main(int argc, char **argv)
margin = needed_margin;
editwincols = COLS - margin;
+#ifndef NANO_TINY
/* Ensure that firstcolumn is the starting column of its chunk. */
ensure_firstcolumn_is_aligned();
-
+#endif
/* The margin has changed -- schedule a full refresh. */
refresh_needed = TRUE;
}
diff --git a/src/proto.h b/src/proto.h
@@ -662,7 +662,9 @@ int go_back_chunks(int nrows, filestruct **line, size_t *leftedge);
int go_forward_chunks(int nrows, filestruct **line, size_t *leftedge);
bool less_than_a_screenful(size_t was_lineno, size_t was_leftedge);
void edit_scroll(scroll_dir direction, int nrows);
+#ifndef NANO_TINY
void ensure_firstcolumn_is_aligned(void);
+#endif
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
@@ -2951,19 +2951,19 @@ void edit_scroll(scroll_dir direction, int nrows)
}
}
+#ifndef NANO_TINY
/* Ensure that firstcolumn is at the starting column of the softwrapped chunk
* it's on. We need to do this when the number of columns of the edit window
* has changed, because then the width of softwrapped chunks has changed. */
void ensure_firstcolumn_is_aligned(void)
{
-#ifndef NANO_TINY
if (openfile->firstcolumn % editwincols != 0)
openfile->firstcolumn -= (openfile->firstcolumn % editwincols);
/* If smooth scrolling is on, make sure the viewport doesn't center. */
focusing = FALSE;
-#endif
}
+#endif
/* Return TRUE if current[current_x] is above the top of the screen, and FALSE
* otherwise. */