* src/global.c (assign_keyinfo, shortcut_init): Give nicer names
to the dedicated keys, for when they show up in the help lines.
* src/rcfile.c (parse_binding): K-keys no longer exist.
+ * src/global.c, src/rcfile.c, doc/nanorc.sample.in: Allow the
+ codes from the Ins and Del keys to be rebound.
2014-04-16 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (get_mouseinput): Properly find also the zeroeth
## Key bindings
-## Please see nanorc(5) for more details on this
+## Please see nanorc(5) for more details on this.
##
-## Here are some samples to get you going
+## Here are some samples to get you going.
##
# bind M-W nowrap main
# bind M-A casesens search
# bind ^S research main
-## Set this if your backspace key sends delete most of the time (2.1.3+)
-# bind kdel backspace all
+## Set this if your backspace key sends Del most of the time.
+# bind Del backspace all
s->seq = KEY_LEFT;
else if (!strcasecmp(s->keystr, "Right"))
s->seq = KEY_RIGHT;
- else if (!strcasecmp(s->keystr, "Insert"))
+ else if (!strcasecmp(s->keystr, "Ins"))
s->seq = KEY_IC;
else if (!strcasecmp(s->keystr, "Del"))
s->seq = KEY_DC;
#endif
add_to_sclist(MMAIN, "^R", do_insertfile_void, 0, TRUE);
add_to_sclist(MMAIN, "F5", do_insertfile_void, 0, TRUE);
- add_to_sclist(MMAIN, "Insert", do_insertfile_void, 0, TRUE);
+ add_to_sclist(MMAIN, "Ins", do_insertfile_void, 0, TRUE);
add_to_sclist(MMAIN|MBROWSER, "^W", do_search, 0, TRUE);
add_to_sclist(MMAIN|MBROWSER, "F6", do_search, 0, TRUE);
add_to_sclist(MMAIN|MBROWSER|MHELP|MWHEREISFILE|MLINTER, "^Y", do_page_up, 0, TRUE);
}
}
- if (keycopy[0] != '^' && keycopy[0] != 'M' && keycopy[0] != 'F') {
+ /* Allow the codes for Insert and Delete to be rebound, but apart
+ * from those two only Control, Meta and Function sequences. */
+ if (!strcasecmp(keycopy, "Ins") || !strcasecmp(keycopy, "Del"))
+ keycopy[1] = tolower(keycopy[1]);
+ else if (keycopy[0] != '^' && keycopy[0] != 'M' && keycopy[0] != 'F') {
rcfile_error(N_("Key name must begin with \"^\", \"M\", or \"F\""));
return;
}