summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-26 19:27:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-26 19:27:31 -0700
commitcfe46cb68fe8073f10d08627fb15ea2d91322088 (patch)
tree09fff80b82b865a2f1eb529a5fa9a732313761c9
parentd3010f86f8bf6b4e1f805bb366d25adbb6bf7c8b (diff)
downloadtxr-cfe46cb68fe8073f10d08627fb15ea2d91322088.tar.gz
txr-cfe46cb68fe8073f10d08627fb15ea2d91322088.tar.bz2
txr-cfe46cb68fe8073f10d08627fb15ea2d91322088.zip
linenoise: end-of-line/buffer selection glitch.
In inclusive selection mode, when the selection is reversed (end point is before start), and the starting character is the end of the line or of the buffer, that character is not included in the highlight, as if non-inclusive selection were in effect. This doesn't affect the semantics of the selection, only the way it is rendered visually; the character which is not highlighted is still included in the selection. * linenoise/linenoise.c (sync_data_to_buf): Remove two bogus conditions from the line which extends the visual selection by one character: we must not avoid executing this logic if the current character is zero (end of buffer) or CR (end of line).
-rw-r--r--linenoise/linenoise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index ed0cc5d1..c82e0ca2 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -965,7 +965,7 @@ static void sync_data_to_buf(lino_t *l)
l->sel = pos;
if (l->dend == dpos)
l->end = pos;
- if (l->dsel == dpos - 1 && rev && l->selinclusive && ch && ch != '\r')
+ if (l->dsel == dpos - 1 && rev && l->selinclusive)
l->sel = pos;
if (ch) {