tweaks: switch from checking SMOOTH_SCROLL to checking JUMPY_SCROLLING

master
Benno Schulenberg 2019-01-29 20:23:13 +01:00
parent b6a762232e
commit 322a6f46fa
5 changed files with 11 additions and 16 deletions

View File

@ -1237,7 +1237,7 @@ void shortcut_init(void)
/* Group of "Appearance" toggles. */ /* Group of "Appearance" toggles. */
add_to_sclist(MMAIN, "M-X", 0, do_toggle_void, NO_HELP); add_to_sclist(MMAIN, "M-X", 0, do_toggle_void, NO_HELP);
add_to_sclist(MMAIN, "M-C", 0, do_toggle_void, CONSTANT_SHOW); add_to_sclist(MMAIN, "M-C", 0, do_toggle_void, CONSTANT_SHOW);
add_to_sclist(MMAIN, "M-S", 0, do_toggle_void, SMOOTH_SCROLL); add_to_sclist(MMAIN, "M-S", 0, do_toggle_void, JUMPY_SCROLLING);
add_to_sclist(MMAIN, "M-$", 0, do_toggle_void, SOFTWRAP); add_to_sclist(MMAIN, "M-$", 0, do_toggle_void, SOFTWRAP);
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS
add_to_sclist(MMAIN, "M-#", 0, do_toggle_void, LINE_NUMBERS); add_to_sclist(MMAIN, "M-#", 0, do_toggle_void, LINE_NUMBERS);
@ -1389,8 +1389,8 @@ const char *flagtostr(int flag)
return N_("Help mode"); return N_("Help mode");
case CONSTANT_SHOW: case CONSTANT_SHOW:
return N_("Constant cursor position display"); return N_("Constant cursor position display");
case SMOOTH_SCROLL: case JUMPY_SCROLLING:
return N_("Smooth scrolling"); return N_("Jumpy scrolling (per half-screen)");
case SOFTWRAP: case SOFTWRAP:
return N_("Soft wrapping of overlong lines"); return N_("Soft wrapping of overlong lines");
case WHITESPACE_DISPLAY: case WHITESPACE_DISPLAY:
@ -1641,7 +1641,7 @@ sc *strtosc(const char *input)
else if (!strcasecmp(input, "constantshow")) else if (!strcasecmp(input, "constantshow"))
s->toggle = CONSTANT_SHOW; s->toggle = CONSTANT_SHOW;
else if (!strcasecmp(input, "smoothscroll")) else if (!strcasecmp(input, "smoothscroll"))
s->toggle = SMOOTH_SCROLL; s->toggle = JUMPY_SCROLLING;
else if (!strcasecmp(input, "softwrap")) else if (!strcasecmp(input, "softwrap"))
s->toggle = SOFTWRAP; s->toggle = SOFTWRAP;
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS

View File

@ -117,7 +117,7 @@ void do_page_up(void)
/* If we're not in smooth scrolling mode, put the cursor at the /* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */ * beginning of the top line of the edit window, as Pico does. */
if (!ISSET(SMOOTH_SCROLL)) { if (ISSET(JUMPY_SCROLLING)) {
openfile->current = openfile->edittop; openfile->current = openfile->edittop;
leftedge = openfile->firstcolumn; leftedge = openfile->firstcolumn;
openfile->current_y = 0; openfile->current_y = 0;
@ -147,7 +147,7 @@ void do_page_down(void)
/* If we're not in smooth scrolling mode, put the cursor at the /* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */ * beginning of the top line of the edit window, as Pico does. */
if (!ISSET(SMOOTH_SCROLL)) { if (ISSET(JUMPY_SCROLLING)) {
openfile->current = openfile->edittop; openfile->current = openfile->edittop;
leftedge = openfile->firstcolumn; leftedge = openfile->firstcolumn;
openfile->current_y = 0; openfile->current_y = 0;
@ -501,7 +501,7 @@ void do_up(void)
set_proper_index_and_pww(&leftedge, target_column, FALSE); set_proper_index_and_pww(&leftedge, target_column, FALSE);
if (openfile->current_y == 0 && ISSET(SMOOTH_SCROLL)) if (openfile->current_y == 0 && !ISSET(JUMPY_SCROLLING))
edit_scroll(BACKWARD); edit_scroll(BACKWARD);
else else
edit_redraw(was_current, FLOWING); edit_redraw(was_current, FLOWING);
@ -524,7 +524,7 @@ void do_down(void)
set_proper_index_and_pww(&leftedge, target_column, TRUE); set_proper_index_and_pww(&leftedge, target_column, TRUE);
if (openfile->current_y == editwinrows - 1 && ISSET(SMOOTH_SCROLL)) if (openfile->current_y == editwinrows - 1 && !ISSET(JUMPY_SCROLLING))
edit_scroll(FORWARD); edit_scroll(FORWARD);
else else
edit_redraw(was_current, FLOWING); edit_redraw(was_current, FLOWING);

View File

@ -2422,11 +2422,6 @@ int main(int argc, char **argv)
} }
#endif /* ENABLE_NANORC */ #endif /* ENABLE_NANORC */
if (ISSET(JUMPY_SCROLLING))
UNSET(SMOOTH_SCROLL);
else
SET(SMOOTH_SCROLL);
if (ISSET(EMPTY_LINE)) if (ISSET(EMPTY_LINE))
UNSET(MORE_SPACE); UNSET(MORE_SPACE);
else else

View File

@ -847,7 +847,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
/* If the target line is close to the tail of the file, put the last /* If the target line is close to the tail of the file, put the last
* line or chunk on the bottom line of the screen; otherwise, just * line or chunk on the bottom line of the screen; otherwise, just
* center the target line. */ * center the target line. */
if (rows_from_tail < editwinrows / 2 && ISSET(SMOOTH_SCROLL)) { if (rows_from_tail < editwinrows / 2 && !ISSET(JUMPY_SCROLLING)) {
openfile->current_y = editwinrows - 1 - rows_from_tail; openfile->current_y = editwinrows - 1 - rows_from_tail;
adjust_viewport(STATIONARY); adjust_viewport(STATIONARY);
} else } else

View File

@ -3237,7 +3237,7 @@ void edit_redraw(filestruct *old_current, update_type manner)
/* If the current line is offscreen, scroll until it's onscreen. */ /* If the current line is offscreen, scroll until it's onscreen. */
if (current_is_offscreen()) { if (current_is_offscreen()) {
adjust_viewport(ISSET(SMOOTH_SCROLL) ? manner : CENTERING); adjust_viewport(ISSET(JUMPY_SCROLLING) ? CENTERING : manner);
refresh_needed = TRUE; refresh_needed = TRUE;
return; return;
} }
@ -3283,7 +3283,7 @@ void edit_refresh(void)
/* If the current line is out of view, get it back on screen. */ /* If the current line is out of view, get it back on screen. */
if (current_is_offscreen()) if (current_is_offscreen())
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : FLOWING); adjust_viewport((focusing || ISSET(JUMPY_SCROLLING)) ? CENTERING : FLOWING);
line = openfile->edittop; line = openfile->edittop;