From eec71e31a0c8c6f88c3aaadd134c1c8337e987a4 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 19 Mar 2014 09:34:37 +0000 Subject: [PATCH] Allowing softwrap to be rebound. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4655 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 ++- doc/man/nanorc.5 | 3 +++ src/global.c | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d8bc679..8d0511d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ -2014-03-18 Benno Schulenberg +2014-03-19 Benno Schulenberg * doc/nanorc.sample.in - Document the changed whitespace defaults. + * src/global.c, doc/man/nanorc.5 - Allow softwrap to be rebound. 2014-03-18 Benno Schulenberg * src/global.c (shortcut_init) - In the file browser one cannot diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index 1c7a4091..582aece2 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -524,6 +524,9 @@ position to the end of the line. .B nowrap Toggle whether long lines will be wrapped to the next line. .TP +.B softwrap +Toggle whether long lines will be displayed over multiple screen lines. +.TP .B suspendenable Toggle whether the suspend sequence (normally ^Z) will suspend the editor window. .TP diff --git a/src/global.c b/src/global.c index 0e7e79cf..21bc27eb 100644 --- a/src/global.c +++ b/src/global.c @@ -1484,8 +1484,7 @@ sc *strtosc(int menu, char *input) } else if (!strcasecmp(input, "nexthistory")) { s->scfunc = get_history_newer_void; s->execute = FALSE; - } else if (!strcasecmp(input, "nohelp") || - !strcasecmp(input, "nohelp")) { + } else if (!strcasecmp(input, "nohelp")) { s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_HELP; @@ -1525,6 +1524,10 @@ sc *strtosc(int menu, char *input) s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_WRAP; + } 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