bindings: bind ASCII DEL during startup instead of repeatedly at runtime

master
Benno Schulenberg 2018-09-14 19:11:56 +02:00
parent e2051a61e0
commit 65e4784eec
2 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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);