mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-29 16:13:27 +03:00
tweaks: switch from checking SMOOTH_SCROLL to checking JUMPY_SCROLLING
This commit is contained in:
parent
b6a762232e
commit
322a6f46fa
@ -1237,7 +1237,7 @@ void shortcut_init(void)
|
||||
/* Group of "Appearance" toggles. */
|
||||
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-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);
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
add_to_sclist(MMAIN, "M-#", 0, do_toggle_void, LINE_NUMBERS);
|
||||
@ -1389,8 +1389,8 @@ const char *flagtostr(int flag)
|
||||
return N_("Help mode");
|
||||
case CONSTANT_SHOW:
|
||||
return N_("Constant cursor position display");
|
||||
case SMOOTH_SCROLL:
|
||||
return N_("Smooth scrolling");
|
||||
case JUMPY_SCROLLING:
|
||||
return N_("Jumpy scrolling (per half-screen)");
|
||||
case SOFTWRAP:
|
||||
return N_("Soft wrapping of overlong lines");
|
||||
case WHITESPACE_DISPLAY:
|
||||
@ -1641,7 +1641,7 @@ sc *strtosc(const char *input)
|
||||
else if (!strcasecmp(input, "constantshow"))
|
||||
s->toggle = CONSTANT_SHOW;
|
||||
else if (!strcasecmp(input, "smoothscroll"))
|
||||
s->toggle = SMOOTH_SCROLL;
|
||||
s->toggle = JUMPY_SCROLLING;
|
||||
else if (!strcasecmp(input, "softwrap"))
|
||||
s->toggle = SOFTWRAP;
|
||||
#ifdef ENABLE_LINENUMBERS
|
||||
|
@ -117,7 +117,7 @@ void do_page_up(void)
|
||||
|
||||
/* 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. */
|
||||
if (!ISSET(SMOOTH_SCROLL)) {
|
||||
if (ISSET(JUMPY_SCROLLING)) {
|
||||
openfile->current = openfile->edittop;
|
||||
leftedge = openfile->firstcolumn;
|
||||
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
|
||||
* beginning of the top line of the edit window, as Pico does. */
|
||||
if (!ISSET(SMOOTH_SCROLL)) {
|
||||
if (ISSET(JUMPY_SCROLLING)) {
|
||||
openfile->current = openfile->edittop;
|
||||
leftedge = openfile->firstcolumn;
|
||||
openfile->current_y = 0;
|
||||
@ -501,7 +501,7 @@ void do_up(void)
|
||||
|
||||
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);
|
||||
else
|
||||
edit_redraw(was_current, FLOWING);
|
||||
@ -524,7 +524,7 @@ void do_down(void)
|
||||
|
||||
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);
|
||||
else
|
||||
edit_redraw(was_current, FLOWING);
|
||||
|
@ -2422,11 +2422,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
if (ISSET(JUMPY_SCROLLING))
|
||||
UNSET(SMOOTH_SCROLL);
|
||||
else
|
||||
SET(SMOOTH_SCROLL);
|
||||
|
||||
if (ISSET(EMPTY_LINE))
|
||||
UNSET(MORE_SPACE);
|
||||
else
|
||||
|
@ -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
|
||||
* line or chunk on the bottom line of the screen; otherwise, just
|
||||
* 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;
|
||||
adjust_viewport(STATIONARY);
|
||||
} else
|
||||
|
@ -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 (current_is_offscreen()) {
|
||||
adjust_viewport(ISSET(SMOOTH_SCROLL) ? manner : CENTERING);
|
||||
adjust_viewport(ISSET(JUMPY_SCROLLING) ? CENTERING : manner);
|
||||
refresh_needed = TRUE;
|
||||
return;
|
||||
}
|
||||
@ -3283,7 +3283,7 @@ void edit_refresh(void)
|
||||
|
||||
/* If the current line is out of view, get it back on screen. */
|
||||
if (current_is_offscreen())
|
||||
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : FLOWING);
|
||||
adjust_viewport((focusing || ISSET(JUMPY_SCROLLING)) ? CENTERING : FLOWING);
|
||||
|
||||
line = openfile->edittop;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user