From 9b7a813069e9397dcb83e79609bb6ea9ef522eef Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 9 Jun 2024 16:32:28 +0200 Subject: [PATCH] text: do not check for + 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. --- src/text.c | 7 +++++++ src/winio.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/text.c b/src/text.c index 39ca6efd..19c13ce1 100644 --- 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 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 index 2a8b362a..1d66770b 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1261,13 +1261,6 @@ int parse_kbinput(WINDOW *frame) } #endif /* __linux__ */ -#ifndef NANO_TINY - /* When 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;