This commit is contained in:
rexy712 2023-04-01 13:11:17 -07:00
parent 75f480ba10
commit 960ff2f3bf
3 changed files with 30 additions and 2 deletions

View File

@ -128,6 +128,20 @@ if test "x$enable_color" != xno; then
color_support=yes color_support=yes
fi fi
AC_ARG_ENABLE(folding,
AS_HELP_STRING([--disable-folding], [Disable line folding support]))
if test "x$enable_tiny" = xyes; then
if test "x$enable_folding" = xyes; then
AC_MSG_ERROR([
*** --enable-folding cannot work with --enable-tiny])
else
enable_folding=no
fi
fi
if test "x$enable_folding" != xno; then
AC_DEFINE(ENABLE_FOLDING, 1, [Define this to have line folding support.])
fi
AC_ARG_ENABLE(comment, AC_ARG_ENABLE(comment,
AS_HELP_STRING([--disable-comment], [Disable the comment/uncomment function])) AS_HELP_STRING([--disable-comment], [Disable the comment/uncomment function]))
if test "x$enable_tiny" = xyes; then if test "x$enable_tiny" = xyes; then

View File

@ -30,6 +30,7 @@ nano_SOURCES = \
color.c \ color.c \
cut.c \ cut.c \
files.c \ files.c \
folding.c \
global.c \ global.c \
help.c \ help.c \
history.c \ history.c \

View File

@ -642,6 +642,9 @@ void shortcut_init(void)
const char *savefile_gist = N_("Save file without prompting"); const char *savefile_gist = N_("Save file without prompting");
const char *findprev_gist = N_("Search next occurrence backward"); const char *findprev_gist = N_("Search next occurrence backward");
const char *findnext_gist = N_("Search next occurrence forward"); const char *findnext_gist = N_("Search next occurrence forward");
#ifdef ENABLE_FOLDING
const char *fold_gist = N_("Fold/unfold the currently selected lines");
#endif
#ifndef NANO_TINY #ifndef NANO_TINY
const char *recordmacro_gist = N_("Start/stop recording a macro"); const char *recordmacro_gist = N_("Start/stop recording a macro");
const char *runmacro_gist = N_("Run the last recorded macro"); const char *runmacro_gist = N_("Run the last recorded macro");
@ -998,7 +1001,14 @@ void shortcut_init(void)
N_("Record"), WHENHELP(recordmacro_gist), TOGETHER); N_("Record"), WHENHELP(recordmacro_gist), TOGETHER);
add_to_funcs(run_macro, MMAIN, add_to_funcs(run_macro, MMAIN,
N_("Run Macro"), WHENHELP(runmacro_gist), BLANKAFTER); N_("Run Macro"), WHENHELP(runmacro_gist), BLANKAFTER);
#endif
#ifdef ENABLE_FOLDING
add_to_funcs(do_fold_segment, MMAIN, N_("Fold"),
WHENHELP(fold_gist), BLANKAFTER);
#endif
#ifndef NANO_TINY
add_to_funcs(zap_text, MMAIN, add_to_funcs(zap_text, MMAIN,
/* TRANSLATORS: This refers to deleting a line or marked region. */ /* TRANSLATORS: This refers to deleting a line or marked region. */
N_("Zap"), WHENHELP(zap_gist), BLANKAFTER); N_("Zap"), WHENHELP(zap_gist), BLANKAFTER);
@ -1208,6 +1218,9 @@ void shortcut_init(void)
#ifdef ENABLE_FORMATTER #ifdef ENABLE_FORMATTER
add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0); add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0);
add_to_sclist(MEXECUTE, "^O", 0, do_formatter, 0); add_to_sclist(MEXECUTE, "^O", 0, do_formatter, 0);
#endif
#ifdef ENABLE_FOLDING
add_to_sclist(MMAIN, "M-[", 0, do_fold_segment, 0);
#endif #endif
add_to_sclist(MMAIN, "^C", 0, report_cursor_position, 0); add_to_sclist(MMAIN, "^C", 0, report_cursor_position, 0);
add_to_sclist(MMAIN, SLASH_OR_DASH, 0, do_gotolinecolumn, 0); add_to_sclist(MMAIN, SLASH_OR_DASH, 0, do_gotolinecolumn, 0);
@ -1341,10 +1354,10 @@ void shortcut_init(void)
add_to_sclist(MMAIN|MHELP, "M-=", 0, do_scroll_down, 0); add_to_sclist(MMAIN|MHELP, "M-=", 0, do_scroll_down, 0);
#endif #endif
#ifdef ENABLE_MULTIBUFFER #ifdef ENABLE_MULTIBUFFER
add_to_sclist(MMAIN, "M-,", 0, switch_to_prev_buffer, 0);
add_to_sclist(MMAIN, "M-<", 0, switch_to_prev_buffer, 0); add_to_sclist(MMAIN, "M-<", 0, switch_to_prev_buffer, 0);
add_to_sclist(MMAIN, "M-.", 0, switch_to_next_buffer, 0); add_to_sclist(MMAIN, "M-,", 0, switch_to_prev_buffer, 0);
add_to_sclist(MMAIN, "M->", 0, switch_to_next_buffer, 0); add_to_sclist(MMAIN, "M->", 0, switch_to_next_buffer, 0);
add_to_sclist(MMAIN, "M-.", 0, switch_to_next_buffer, 0);
#endif #endif
add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0); add_to_sclist(MMOST, "M-V", 0, do_verbatim_input, 0);
#ifndef NANO_TINY #ifndef NANO_TINY