text: do not check for <Tab> + mark while getting input but in do_tab()

This allows a {tab} in a string bind to indent a marked region.

This fixes https://savannah.gnu.org/bugs/?65859.

Problem existed since version 7.0, since braced function names
were introduced.
This commit is contained in:
Benno Schulenberg 2024-06-09 16:32:28 +02:00
parent bc09f0992e
commit 9b7a813069
2 changed files with 7 additions and 7 deletions

View File

@ -57,6 +57,13 @@ void do_mark(void)
* of spaces that a tab would normally take up at this position. */
void do_tab(void)
{
#ifndef NANO_TINY
/* When <Tab> is pressed while a region is marked, indent the region. */
if (openfile->mark && openfile->mark != openfile->current &&
currmenu == MMAIN && !bracketed_paste)
do_indent();
else
#endif
#ifdef ENABLE_COLOR
if (openfile->syntax && openfile->syntax->tabstring)
inject(openfile->syntax->tabstring, strlen(openfile->syntax->tabstring));

View File

@ -1261,13 +1261,6 @@ int parse_kbinput(WINDOW *frame)
}
#endif /* __linux__ */
#ifndef NANO_TINY
/* When <Tab> is pressed while the mark is on, do an indent. */
if (keycode == '\t' && openfile->mark && currmenu == MMAIN &&
!bracketed_paste && openfile->mark != openfile->current)
return INDENT_KEY;
#endif
/* Spurious codes from VTE -- see https://sv.gnu.org/bugs/?64578. */
if (keycode == mousefocusin || keycode == mousefocusout)
return ERR;