From 621eb904b3ede30adb56968000b169697f759b76 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 4 Jun 2017 11:05:08 +0200
Subject: [PATCH] bindings: in the tiny version exclude word jumping from the
 prompts

In the tiny version, Ctrl+Left and Ctrl+Right are available only
in the editor itself and in the file browser.

This fixes https://savannah.gnu.org/bugs/?51173.
---
 src/global.c | 8 ++++----
 src/nano.h   | 5 +++++
 src/rcfile.c | 2 ++
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/global.c b/src/global.c
index 4f82ead7..814ddeb4 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1125,15 +1125,15 @@ void shortcut_init(void)
     if (using_utf8()) {
 	add_to_sclist(MMOST, "\xE2\x86\x90", KEY_LEFT, do_left, 0);
 	add_to_sclist(MMOST, "\xE2\x86\x92", KEY_RIGHT, do_right, 0);
-	add_to_sclist(MMOST, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0);
-	add_to_sclist(MMOST, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0);
+	add_to_sclist(MSOME, "^\xE2\x86\x90", CONTROL_LEFT, do_prev_word_void, 0);
+	add_to_sclist(MSOME, "^\xE2\x86\x92", CONTROL_RIGHT, do_next_word_void, 0);
     } else
 #endif
     {
 	add_to_sclist(MMOST, "Left", KEY_LEFT, do_left, 0);
 	add_to_sclist(MMOST, "Right", KEY_RIGHT, do_right, 0);
-	add_to_sclist(MMOST, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
-	add_to_sclist(MMOST, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
+	add_to_sclist(MSOME, "^Left", CONTROL_LEFT, do_prev_word_void, 0);
+	add_to_sclist(MSOME, "^Right", CONTROL_RIGHT, do_next_word_void, 0);
     }
     add_to_sclist(MMOST, "M-Space", 0, do_prev_word_void, 0);
     add_to_sclist(MMOST, "^Space", 0, do_next_word_void, 0);
diff --git a/src/nano.h b/src/nano.h
index dd8c5d09..1a030b62 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -542,6 +542,11 @@ enum
 /* This is an abbreviation for all menus except Help and YesNo. */
 #define MMOST  (MMAIN|MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MWRITEFILE|MINSERTFILE|\
 		MEXTCMD|MBROWSER|MWHEREISFILE|MGOTODIR|MFINDINHELP|MSPELL|MLINTER)
+#ifndef NANO_TINY
+#define MSOME  MMOST
+#else
+#define MSOME  MMAIN|MBROWSER
+#endif
 
 /* Basic control codes. */
 #define TAB_CODE  0x09
diff --git a/src/rcfile.c b/src/rcfile.c
index cb480fc1..7d160312 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -350,7 +350,9 @@ bool is_universal(void (*func))
 {
     if (func == do_left || func == do_right ||
 	func == do_home_void || func == do_end_void ||
+#ifndef NANO_TINY
 	func == do_prev_word_void || func == do_next_word_void ||
+#endif
 	func == do_verbatim_input || func == do_cut_text_void ||
 	func == do_delete || func == do_backspace ||
 	func == do_tab || func == do_enter)
-- 
GitLab