]> git.armaanb.net Git - st.git/commitdiff
Simplify tmoveto.
authornoname@inventati.org <noname@inventati.org>
Mon, 13 Apr 2015 12:03:51 +0000 (14:03 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Mon, 13 Apr 2015 13:15:47 +0000 (15:15 +0200)
LIMIT returns value. This fact is already used in x2col and y2row.

st.c

diff --git a/st.c b/st.c
index 05585937dd19b023d51c7e7800f595b366316f0a..79bb6aa63b5d745543c830cdec8bc8e655cbecf0 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1571,11 +1571,9 @@ tmoveto(int x, int y) {
                miny = 0;
                maxy = term.row - 1;
        }
-       LIMIT(x, 0, term.col-1);
-       LIMIT(y, miny, maxy);
        term.c.state &= ~CURSOR_WRAPNEXT;
-       term.c.x = x;
-       term.c.y = y;
+       term.c.x = LIMIT(x, 0, term.col-1);
+       term.c.y = LIMIT(y, miny, maxy);
 }
 
 void