From 8218d558802cd4382004b89a1d7c1a7d669207a8 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 15 Dec 2016 21:58:24 -0500 Subject: [PATCH] Fixed off-by-one error when clicking the column after the line ending rune --- TODO.md | 2 -- libedit/view.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 18124f2..2115a10 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ # Implementation Tweaks and Bug Fixes -* investigate weird behavior when editing CRLF files and copy-pasting * Expand tabs setting should be disabled if opened file contains tabs * Add tag for ctags lookup and line number jump * add a shortcut to autocomplete ctag @@ -9,7 +8,6 @@ * block selection should handle brace-balancing * Use select to check for error strings in exec.c * Should not be able to undo initial tag line text insertion -* track down double click bug for selecting whole line * Implement minimal regex search (per Kernighan article) * Implement fuzzy file/buffer/tag picker * check for file changes when window regains focus diff --git a/libedit/view.c b/libedit/view.c index 31eb4eb..3f173a8 100644 --- a/libedit/view.c +++ b/libedit/view.c @@ -160,7 +160,7 @@ static size_t getoffset(View* view, size_t row, size_t col) { Row* scrrow = view_getrow(view, row); if (!scrrow) return SIZE_MAX; size_t pos = scrrow->off; - if (col > scrrow->len) { + if (col >= scrrow->len) { pos = (scrrow->off + scrrow->rlen - 1); } else { /* multi column runes are followed by \0 slots so if we clicked on a \0 -- 2.49.0