It is equal to term.col-1 in any case. --- st.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/st.c b/st.c index 695233b..4d383be 100644 --- a/st.c +++ b/st.c @@ -719,7 +719,7 @@ selected(int x, int y) { void selsnap(int *x, int *y, int direction) { - int newx, newy, xt, yt; + int newx, newy, yt; bool delim; Glyph *gp, *prevgp; @@ -739,11 +739,8 @@ selsnap(int *x, int *y, int direction) { if (!BETWEEN(newy, 0, term.row - 1)) break; - if(direction > 0) - yt = *y, xt = *x; - else - yt = newy, xt = newx; - if(!(term.line[yt][xt].mode & ATTR_WRAP)) + yt = direction > 0 ? *y : newy; + if(!(term.line[yt][term.col-1].mode & ATTR_WRAP)) break; } -- 1.8.4