bindings: add a dedicated keycode for <Tab> for when a region is marked
In this way the keycode cannot be unbound from the 'indent' function, so pressing <Tab> on a marked region will always indent the region. This fixes https://savannah.gnu.org/bugs/?56960. Bug existed since the "tabbing" of a marked region was introduced, in version 2.9.2, commit 09958ebd.
Этот коммит содержится в:
родитель
cfd17f5722
Коммит
5103bfe6b8
@ -1146,7 +1146,7 @@ void shortcut_init(void)
|
|||||||
add_to_sclist(MMAIN, "M-6", 0, copy_text, 0);
|
add_to_sclist(MMAIN, "M-6", 0, copy_text, 0);
|
||||||
add_to_sclist(MMAIN, "M-^", 0, copy_text, 0);
|
add_to_sclist(MMAIN, "M-^", 0, copy_text, 0);
|
||||||
add_to_sclist(MMAIN, "M-}", 0, do_indent, 0);
|
add_to_sclist(MMAIN, "M-}", 0, do_indent, 0);
|
||||||
add_to_sclist(MMAIN, "Tab", TAB_CODE, do_indent, 0);
|
add_to_sclist(MMAIN, "Tab", INDENT_KEY, do_indent, 0);
|
||||||
add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0);
|
add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0);
|
||||||
add_to_sclist(MMAIN, "Sh-Tab", SHIFT_TAB, do_unindent, 0);
|
add_to_sclist(MMAIN, "Sh-Tab", SHIFT_TAB, do_unindent, 0);
|
||||||
add_to_sclist(MMAIN, "M-:", 0, record_macro, 0);
|
add_to_sclist(MMAIN, "M-:", 0, record_macro, 0);
|
||||||
|
@ -605,6 +605,9 @@ enum
|
|||||||
#define SHIFT_DELETE 0x45D
|
#define SHIFT_DELETE 0x45D
|
||||||
#define SHIFT_TAB 0x45F
|
#define SHIFT_TAB 0x45F
|
||||||
|
|
||||||
|
/* A special keycode for when <Tab> is pressed while the mark is on. */
|
||||||
|
#define INDENT_KEY 0x4F1
|
||||||
|
|
||||||
#ifdef USE_SLANG
|
#ifdef USE_SLANG
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
#define KEY_BAD 0xFF /* Clipped error code. */
|
#define KEY_BAD 0xFF /* Clipped error code. */
|
||||||
|
@ -658,12 +658,8 @@ int parse_kbinput(WINDOW *win)
|
|||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* When <Tab> is pressed while the mark is on, do an indent. */
|
/* When <Tab> is pressed while the mark is on, do an indent. */
|
||||||
if (retval == TAB_CODE && openfile->mark && currmenu == MMAIN) {
|
if (retval == TAB_CODE && openfile->mark && currmenu == MMAIN)
|
||||||
const keystruct *command = first_sc_for(MMAIN, do_indent);
|
return INDENT_KEY;
|
||||||
|
|
||||||
meta_key = command->meta;
|
|
||||||
return command->keycode;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (retval) {
|
switch (retval) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user