commit 9b7a813069e9397dcb83e79609bb6ea9ef522eef
parent bc09f0992efa68c574ce3ced5a3b769177011a0e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 9 Jun 2024 16:32:28 +0200
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.
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -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));
diff --git a/src/winio.c b/src/winio.c
@@ -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;