aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoname <noname@inventati.org>2014-04-22 21:59:01 +0400
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-04-23 15:39:02 +0200
commitf21e47f44a11b9a24a5d5081fea46f5b5f02eadf (patch)
tree7233376020b5a4cf0d81f0ed8183b20e01c64299
parent87abc7cd596ca34a2e664f1c762f8b69b82eba40 (diff)
downloadst-f21e47f44a11b9a24a5d5081fea46f5b5f02eadf.tar.gz
st-f21e47f44a11b9a24a5d5081fea46f5b5f02eadf.tar.bz2
Use BETWEEN in tinsertblankline and tdeleteline.
-rw-r--r--st.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/st.c b/st.c
index 019f53c..92fd7da 100644
--- a/st.c
+++ b/st.c
@@ -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