commit 0271e4a187966783f8ca25fa2eb044422bdc6a3b
parent 076eb6f6af1454dd2635e1186cbe730a74306f7d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 2 Dec 2019 16:56:41 +0100
input: make <Tab> indent only when mark and cursor are on different lines
It allows entering a TAB character at the cursor position while the
mark is on the same line as the cursor, as some users sometimes do.
This refines the feature that was added in version 2.9.2, and makes
it behave like in the Gedit and Kate editors, for example.
This addresses https://savannah.gnu.org/bugs/?57357.
Reported-by: Sébastien Desreux <seb@h-k.fr>
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/winio.c b/src/winio.c
@@ -658,7 +658,8 @@ int parse_kbinput(WINDOW *win)
#ifndef NANO_TINY
/* 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 &&
+ openfile-> mark != openfile->current)
return INDENT_KEY;
#endif