[hackers] [st] Use BETWEEN in tinsertblankline and tdeleteline. || noname

From: <git_AT_suckless.org>
Date: Wed, 23 Apr 2014 15:39:35 +0200

commit f21e47f44a11b9a24a5d5081fea46f5b5f02eadf
Author: noname <noname_AT_inventati.org>
Date: Tue Apr 22 21:59:01 2014 +0400

    Use BETWEEN in tinsertblankline and tdeleteline.

diff --git a/st.c b/st.c
index 019f53c..92fd7da 100644
--- a/st.c
+++ b/st.c
_AT_@ -1628,18 +1628,14 @@ tinsertblank(int n) {
 
 void
 tinsertblankline(int n) {
- if(term.c.y < term.top || term.c.y > term.bot)
- return;
-
- tscrolldown(term.c.y, n);
+ if(BETWEEN(term.c.y, term.top, term.bot))
+ tscrolldown(term.c.y, n);
 }
 
 void
 tdeleteline(int n) {
- if(term.c.y < term.top || term.c.y > term.bot)
- return;
-
- tscrollup(term.c.y, n);
+ if(BETWEEN(term.c.y, term.top, term.bot))
+ tscrollup(term.c.y, n);
 }
 
 int32_t
Received on Wed Apr 23 2014 - 15:39:35 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 23 2014 - 15:48:08 CEST