mirror of git://git.sv.gnu.org/nano.git
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:
parent
bc09f0992e
commit
9b7a813069
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue