commit 65e4784eec62e49d253bb6ff8b441dc298bc9519
parent e2051a61e02c95e71721b1c0e6671a3373edcc85
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 14 Sep 2018 19:11:56 +0200
bindings: bind ASCII DEL during startup instead of repeatedly at runtime
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1076,6 +1076,11 @@ void shortcut_init(void)
add_to_sclist(MMOST, "Bsp", KEY_BACKSPACE, do_backspace, 0);
add_to_sclist(MMOST, "^D", 0, do_delete, 0);
add_to_sclist(MMOST, "Del", 0, do_delete, 0);
+ /* Make ASCII DEL do a delete when requested, otherwise a backspace. */
+ if (ISSET(REBIND_DELETE))
+ add_to_sclist(MMOST, "Del", DEL_CODE, do_delete, 0);
+ else
+ add_to_sclist(MMOST, "Bsp", DEL_CODE, do_backspace, 0);
add_to_sclist(MMOST, "^I", 0, do_tab, 0);
add_to_sclist(MMOST, "Tab", TAB_CODE, do_tab, 0);
add_to_sclist(MMOST & ~MFINDINHELP, "^G", 0, do_help_void, 0);
diff --git a/src/winio.c b/src/winio.c
@@ -709,11 +709,6 @@ int parse_kbinput(WINDOW *win)
case KEY_SDC:
return KEY_BACKSPACE;
#endif
- case DEL_CODE:
- if (ISSET(REBIND_DELETE))
- return the_code_for(do_delete, KEY_DC);
- else
- return KEY_BACKSPACE;
#ifdef KEY_SIC /* Slang doesn't support KEY_SIC. */
case KEY_SIC:
return the_code_for(do_insertfile_void, KEY_IC);