st
simple terminal
git clone https://9o.is/git/st.git
commit 0b73848e416791c0c583b57607c18cb65e2ed81b parent 65638b05a01882ee4cc0de4d7bb7a76c1febc3f1 Author: noname <noname@inventati.org> Date: Fri, 1 May 2015 02:22:32 +0000 selsnap: simplify SNAP_LINE case Also make sure y never exceeds term.row-1 even if ATTR_WRAP is set for some reason. Diffstat:
| M | st.c | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/st.c b/st.c @@ -772,15 +772,15 @@ selsnap(int *x, int *y, int direction) { * previous line will be selected. */ *x = (direction < 0) ? 0 : term.col - 1; - if(direction < 0 && *y > 0) { + if(direction < 0) { for(; *y > 0; *y += direction) { if(!(term.line[*y-1][term.col-1].mode & ATTR_WRAP)) { break; } } - } else if(direction > 0 && *y < term.row-1) { - for(; *y < term.row; *y += direction) { + } else if(direction > 0) { + for(; *y < term.row-1; *y += direction) { if(!(term.line[*y][term.col-1].mode & ATTR_WRAP)) { break;