diff --git a/src/proto.h b/src/proto.h index 1d9ba95d..14eeadf1 100644 --- a/src/proto.h +++ b/src/proto.h @@ -668,9 +668,6 @@ void set_modified(void); void statusbar(const char *msg, ...); void bottombars(const shortcut *s); void onekey(const char *keystroke, const char *desc, size_t len); -#ifndef NDEBUG -int check_linenumbers(const filestruct *fileptr); -#endif size_t get_page_start(size_t column); void reset_cursor(void); void edit_add(const filestruct *fileptr, const char *converted, int @@ -693,6 +690,9 @@ size_t help_line_len(const char *ptr); void do_help(void); #endif void do_replace_highlight(bool highlight_flag, const char *word); +#ifndef NDEBUG +int check_linenumbers(const filestruct *fileptr); +#endif #ifdef DEBUG void dump_buffer(const filestruct *inptr); void dump_buffer_reverse(void); diff --git a/src/winio.c b/src/winio.c index eb706117..22128bd6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2969,19 +2969,6 @@ void onekey(const char *keystroke, const char *desc, size_t len) } } -/* And so start the display update routines. */ -#ifndef NDEBUG -int check_linenumbers(const filestruct *fileptr) -{ - int check_line = 0; - const filestruct *filetmp; - - for (filetmp = edittop; filetmp != fileptr; filetmp = filetmp->next) - check_line++; - return check_line; -} -#endif - /* nano scrolls horizontally within a line in chunks. This function * returns the column number of the first character displayed in the * window when the cursor is at the given column. Note that @@ -3979,6 +3966,21 @@ void do_replace_highlight(bool highlight_flag, const char *word) wattroff(edit, A_REVERSE); } +#ifndef NDEBUG +/* Return what the current line number should be, starting at edittop + * and ending at fileptr. */ +int check_linenumbers(const filestruct *fileptr) +{ + int check_line = 0; + const filestruct *filetmp; + + for (filetmp = edittop; filetmp != fileptr; filetmp = filetmp->next) + check_line++; + + return check_line; +} +#endif + #ifdef DEBUG /* Dump the passed-in file structure to stderr. */ void dump_buffer(const filestruct *inptr)