Skip to content

Commit

Permalink
revert c22b2c2 & 364d212
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rnpnr committed Oct 10, 2023
1 parent cbaa0d8 commit 1bfe132
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1bfe132

Please sign in to comment.