martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

Disappearing selection #1143

Closed jk411 closed 8 months ago

jk411 commented 8 months ago

Open

vis vis.c

Start "visual-line" mode [Shift-v] keep pressing [arrow-down] or [ j ] ie. move cursor down

selection disappears when anchor is out of screen the same happens in "visual-char" mode when cursor lands on empty line

maybe viev.c: view_coord_get() if (pos < view->start || (pos >= view->end && !eof)) {...

shoul be if (pos < view->start || (pos > view->end && !eof)) {...

rnpnr commented 8 months ago

Hi,

I've seen this before as well. It seems like the bug was introduced in c22b2c2 and its reported 'fix' in 364d212 didn't solve it. I think it might be time to revert both of those since they cause more bugs than they fix. Doing so would reintroduce #1074 but that could very well be a bug elsewhere.