tweaks: make the inclusion condition for do_center() more strict

There is no reason why --enable-help should cause the centering function
to be included in a tiny version.
This commit is contained in:
Benno Schulenberg 2024-06-08 15:27:10 +02:00
parent a98f82e27b
commit 00e2309987
4 changed files with 11 additions and 5 deletions

View File

@ -619,6 +619,8 @@ void shortcut_init(void)
N_("Scroll up one line without moving the cursor textually");
const char *scrolldown_gist =
N_("Scroll down one line without moving the cursor textually");
#endif
#ifndef NANO_TINY
const char *center_gist = N_("Center the line where the cursor is");
#endif
#ifdef ENABLE_MULTIBUFFER
@ -1079,7 +1081,7 @@ void shortcut_init(void)
add_to_funcs(full_refresh, MMAIN,
N_("Refresh"), WHENHELP(refresh_gist), TOGETHER);
#endif
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
#ifndef NANO_TINY
add_to_funcs(do_center, MMAIN,
N_("Center"), WHENHELP(center_gist), BLANKAFTER);
#endif
@ -1430,7 +1432,7 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "M-J", 0, do_full_justify, 0);
add_to_sclist(MEXECUTE, "^J", 0, do_full_justify, 0);
#endif
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
#ifndef NANO_TINY
add_to_sclist(MMAIN, "^L", 0, do_center, 0);
#endif
add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, full_refresh, 0);

View File

@ -620,7 +620,9 @@ void do_scroll_down(void)
))
edit_scroll(FORWARD);
}
#endif /* !NANO_TINY || ENABLE_HELP */
#ifndef NANO_TINY
/* Scroll the line with the cursor to the center of the screen. */
void do_center(void)
{
@ -628,7 +630,7 @@ void do_center(void)
draw_all_subwindows();
full_refresh();
}
#endif /* !NANO_TINY || ENABLE_HELP */
#endif
/* Move left one character. */
void do_left(void)

View File

@ -386,6 +386,8 @@ void do_down(void);
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
void do_scroll_up(void);
void do_scroll_down(void);
#endif
#ifndef NANO_TINY
void do_center(void);
#endif
void do_left(void);

View File

@ -340,8 +340,6 @@ keystruct *strtosc(const char *input)
s->func = do_scroll_up;
else if (!strcmp(input, "scrolldown"))
s->func = do_scroll_down;
else if (!strcmp(input, "center"))
s->func = do_center;
#endif
else if (!strcmp(input, "prevword"))
s->func = to_prev_word;
@ -360,6 +358,8 @@ keystruct *strtosc(const char *input)
s->func = to_top_row;
else if (!strcmp(input, "bottomrow"))
s->func = to_bottom_row;
else if (!strcmp(input, "center"))
s->func = do_center;
#endif
else if (!strcmp(input, "pageup") ||
!strcmp(input, "prevpage"))