diff --git a/src/files.c b/src/files.c index 9e2b784fa9557432b691fadd0069e4d762442ee4..6a6bb1ca7da612cd7a2d2c0f4deaf8263174c97f 100644 --- a/src/files.c +++ b/src/files.c @@ -639,16 +639,16 @@ void switch_to_adjacent_buffer(bool to_next) #endif } -/* Switch to the previous entry in the openfile filebuffer. */ +/* Switch to the previous entry in the list of open files. */ void switch_to_prev_buffer(void) { - switch_to_adjacent_buffer(FALSE); + switch_to_adjacent_buffer(BACKWARD); } -/* Switch to the next entry in the openfile filebuffer. */ +/* Switch to the next entry in the list of open files. */ void switch_to_next_buffer(void) { - switch_to_adjacent_buffer(TRUE); + switch_to_adjacent_buffer(FORWARD); } /* Delete an entry from the circular list of open files, and switch to the diff --git a/src/move.c b/src/move.c index 21cd22214a16b7274f3b03797c3baa2350df1125..59a969f5630926cb657b6e79d8f1354e0b94b5d7 100644 --- a/src/move.c +++ b/src/move.c @@ -502,7 +502,7 @@ void do_up(bool scroll_only) set_proper_index_and_pww(&leftedge, target_column, FALSE); if (scroll_only) - edit_scroll(UPWARD, 1); + edit_scroll(BACKWARD, 1); edit_redraw(was_current, FLOWING); @@ -526,7 +526,7 @@ void do_down(bool scroll_only) set_proper_index_and_pww(&leftedge, target_column, TRUE); if (scroll_only) - edit_scroll(DOWNWARD, 1); + edit_scroll(FORWARD, 1); edit_redraw(was_current, FLOWING); diff --git a/src/nano.h b/src/nano.h index 28c688c9bef3f5263a25f2f2d06afc9928307e6e..1a77097a415f8a4f962c915a12c80db5be865369 100644 --- a/src/nano.h +++ b/src/nano.h @@ -132,6 +132,9 @@ #define DISABLE_WRAPJUSTIFY 1 #endif +#define BACKWARD FALSE +#define FORWARD TRUE + /* Enumeration types. */ typedef enum { NIX_FILE, DOS_FILE, MAC_FILE @@ -149,10 +152,6 @@ typedef enum { SOFTMARK, HARDMARK } mark_type; -typedef enum { - UPWARD, DOWNWARD -} scroll_dir; - typedef enum { CENTERING, FLOWING, STATIONARY } update_type; diff --git a/src/proto.h b/src/proto.h index 452eeb5cef2a25630d39e4e2c2555c8deee6d234..8ee4eb0e184c6dd7a8cb52b2cf770575ae0869a9 100644 --- a/src/proto.h +++ b/src/proto.h @@ -663,7 +663,7 @@ bool line_needs_update(const size_t old_column, const size_t new_column); 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); +void edit_scroll(bool direction, int nrows); #ifndef NANO_TINY size_t get_softwrap_breakpoint(const char *text, size_t leftedge, bool *end_of_line); diff --git a/src/winio.c b/src/winio.c index 4fe9db06e3731eab902eaccbc85d9b9876c7ae55..76cc4cc8bdb022638a19a850acdb74e9a86b9c3e 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2902,7 +2902,7 @@ bool less_than_a_screenful(size_t was_lineno, size_t was_leftedge) /* Scroll the edit window in the given direction and the given number of rows, * and draw new lines on the blank lines left after the scrolling. */ -void edit_scroll(scroll_dir direction, int nrows) +void edit_scroll(bool direction, int nrows) { filestruct *line; size_t leftedge; @@ -2912,7 +2912,7 @@ void edit_scroll(scroll_dir direction, int nrows) /* Move the top line of the edit window the requested number of rows up or * down, and reduce the number of rows with the amount we couldn't move. */ - if (direction == UPWARD) + if (direction == BACKWARD) nrows -= go_back_chunks(nrows, &openfile->edittop, &openfile->firstcolumn); else nrows -= go_forward_chunks(nrows, &openfile->edittop, &openfile->firstcolumn); @@ -2935,7 +2935,7 @@ void edit_scroll(scroll_dir direction, int nrows) /* Scroll the text of the edit window a number of rows up or down. */ scrollok(edit, TRUE); - wscrl(edit, (direction == UPWARD) ? -nrows : nrows); + wscrl(edit, (direction == BACKWARD) ? -nrows : nrows); scrollok(edit, FALSE); /* Part 2: nrows is now the number of rows in the scrolled region of the @@ -2951,7 +2951,7 @@ void edit_scroll(scroll_dir direction, int nrows) leftedge = openfile->firstcolumn; /* If we scrolled forward, move down to the start of the blank region. */ - if (direction == DOWNWARD) + if (direction == FORWARD) go_forward_chunks(editwinrows - nrows, &line, &leftedge); #ifndef NANO_TINY