From a6804b5f08f66a72d6028248a4ca06b839c9181c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 9 May 2014 20:33:49 +0000 Subject: [PATCH] Putting softwrap back among the "Appearance" toggles. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ doc/man/nanorc.5 | 6 +++--- src/global.c | 17 ++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d088ac3d..669a9bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ shortcuts for functions that are disabled. * src/global.c (shortcut_init, strtosc): Define shortcut for the linter when speller is disabled, and fix compilation with --disable-speller. + * src/global.c (shortcut_init, strtosc), doc/man/nanorc.5: Put softwrap + back among the "Appearance" toggles. 2014-05-06 Benno Schulenberg * doc/texinfo/nano.texi: Let makeinfo figure out the node pointers. diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index 37041d69..3b22a976 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -555,6 +555,9 @@ Toggle showing/hiding the blank line which 'separates' the 'title' from the file .B smoothscroll Toggle smooth scrolling when moving via the arrow keys. .TP +.B softwrap +Toggle the displaying of overlong lines on multiple screen lines. +.TP .B whitespacedisplay Toggle the showing of whitespace. .TP @@ -574,9 +577,6 @@ position to the end of the line. .B nowrap Toggle whether long lines will be hard-wrapped to the next line. .TP -.B softwrap -Toggle the displaying of overlong lines on multiple screen lines. -.TP .B tabstospaces Toggle whether typed tabs will be converted to spaces. .TP diff --git a/src/global.c b/src/global.c index 52f787e7..78a1ec85 100644 --- a/src/global.c +++ b/src/global.c @@ -1092,24 +1092,27 @@ void shortcut_init(void) add_to_sclist(MMAIN, "^Z", do_suspend_void, 0, FALSE); #ifndef NANO_TINY + /* Group of "Appearance" toggles. */ add_to_sclist(MMAIN, "M-X", do_toggle_void, NO_HELP, TRUE); add_to_sclist(MMAIN, "M-C", do_toggle_void, CONST_UPDATE, TRUE); add_to_sclist(MMAIN, "M-O", do_toggle_void, MORE_SPACE, TRUE); add_to_sclist(MMAIN, "M-S", do_toggle_void, SMOOTH_SCROLL, TRUE); + add_to_sclist(MMAIN, "M-$", do_toggle_void, SOFTWRAP, TRUE); add_to_sclist(MMAIN, "M-P", do_toggle_void, WHITESPACE_DISPLAY, TRUE); #ifndef DISABLE_COLOR add_to_sclist(MMAIN, "M-Y", do_toggle_void, NO_COLOR_SYNTAX, TRUE); #endif + /* Group of "Editing-behavior" toggles. */ add_to_sclist(MMAIN, "M-H", do_toggle_void, SMART_HOME, TRUE); add_to_sclist(MMAIN, "M-I", do_toggle_void, AUTOINDENT, TRUE); add_to_sclist(MMAIN, "M-K", do_toggle_void, CUT_TO_END, TRUE); #ifndef DISABLE_WRAPPING add_to_sclist(MMAIN, "M-L", do_toggle_void, NO_WRAP, TRUE); #endif - add_to_sclist(MMAIN, "M-$", do_toggle_void, SOFTWRAP, TRUE); add_to_sclist(MMAIN, "M-Q", do_toggle_void, TABS_TO_SPACES, TRUE); + /* Group of "Peripheral-feature" toggles. */ add_to_sclist(MMAIN, "M-B", do_toggle_void, BACKUP_FILE, TRUE); #ifndef DISABLE_MULTIBUFFER add_to_sclist(MMAIN, "M-F", do_toggle_void, MULTIBUFFER, TRUE); @@ -1219,6 +1222,8 @@ const char *flagtostr(int flag) return N_("Use of one more line for editing"); case SMOOTH_SCROLL: return N_("Smooth scrolling"); + case SOFTWRAP: + return N_("Soft wrapping of overlong lines"); case WHITESPACE_DISPLAY: return N_("Whitespace display"); case NO_COLOR_SYNTAX: @@ -1231,8 +1236,6 @@ const char *flagtostr(int flag) return N_("Cut to end"); case NO_WRAP: return N_("Hard wrapping of overlong lines"); - case SOFTWRAP: - return N_("Soft wrapping of overlong lines"); case TABS_TO_SPACES: return N_("Conversion of typed tabs to spaces"); case BACKUP_FILE: @@ -1360,6 +1363,10 @@ sc *strtosc(char *input) s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = SMOOTH_SCROLL; + } else if (!strcasecmp(input, "softwrap")) { + s->scfunc = do_toggle_void; + s->execute = FALSE; + s->toggle = SOFTWRAP; } else if (!strcasecmp(input, "whitespacedisplay")) { s->scfunc = do_toggle_void; s->execute = FALSE; @@ -1388,10 +1395,6 @@ sc *strtosc(char *input) s->execute = FALSE; s->toggle = NO_WRAP; #endif - } else if (!strcasecmp(input, "softwrap")) { - s->scfunc = do_toggle_void; - s->execute = FALSE; - s->toggle = SOFTWRAP; } else if (!strcasecmp(input, "tabstospaces")) { s->scfunc = do_toggle_void; s->execute = FALSE; -- 2.39.5