vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 6817b2fd137d39b757f3574fb097cf2b6f23ce5c
parent 80eb3de92eddfb27f55ca4c9bb6388c9023e9a5e
Author: Randy Palamar <palamar@ualberta.ca>
Date:   Mon,  9 Oct 2023 23:17:40 -0600

revert b6647ad & 6b5f9c7

aka:
"check for EOF before unsetting row, col & line cache in view_coord_get"
"fix bug where visual-line selections after view were considered visible"

These commits have created more bugs then they fix. Reverting them
reintroduces #1074: Slave selection strangled by view cliff.

Fixes #1143: Disappearing selection

Diffstat:
MCHANGELOG.md | 1-
Mview.c | 3+--
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -6,7 +6,6 @@ - fix a ~ being considered a special character in path patterns (except at the start) - improvements to and clean-up of vis-open - add Selection:remove() to lua API -- fix bug where visual-line selections after view were considered visible - don't set `_FORTIFY_SOURCE` in configure - update dockerfile to alpine 3.18 diff --git a/view.c b/view.c @@ -330,8 +330,7 @@ bool view_coord_get(View *view, size_t pos, Line **retline, int *retrow, int *re size_t cur = view->start; Line *line = view->topline; - bool eof = view->end == text_size(view->text); - if (pos < view->start || (pos >= view->end && !eof)) { + if (pos < view->start || pos > view->end) { if (retline) *retline = NULL; if (retrow) *retrow = -1; if (retcol) *retcol = -1;