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
commit3ec64e6c5853e81779e593c24fa79f9d8cad40db (patch)
tree09fff80b82b865a2f1eb529a5fa9a732313761c9
parent24c2898ff6d169b058d41ad68381d2036267ca0d (diff)
downloadtxr-3ec64e6c5853e81779e593c24fa79f9d8cad40db.tar.gz
txr-3ec64e6c5853e81779e593c24fa79f9d8cad40db.tar.bz2
txr-3ec64e6c5853e81779e593c24fa79f9d8cad40db.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) {