[dev] [PATCH 3/3] selnormalize: check for SEL_REGULAR explicitly

From: noname <noname_AT_inventati.org>
Date: Thu, 30 Apr 2015 20:51:48 +0000

---
 st.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/st.c b/st.c
index 8a28df0..62b0889 100644
--- a/st.c
+++ b/st.c
_AT_@ -683,8 +683,6 @@ tlinelen(int y) {
 
 void
 selnormalize(void) {
-	int i;
-
 	if(sel.type == SEL_REGULAR && sel.ob.y != sel.oe.y) {
 		sel.nb.x = sel.ob.y < sel.oe.y ? sel.ob.x : sel.oe.x;
 		sel.ne.x = sel.ob.y < sel.oe.y ? sel.oe.x : sel.ob.x;
_AT_@ -699,13 +697,13 @@ selnormalize(void) {
 	selsnap(&sel.ne.x, &sel.ne.y, +1);
 
 	/* expand selection over line breaks */
-	if (sel.type == SEL_RECTANGULAR)
-		return;
-	i = tlinelen(sel.nb.y);
-	if (i < sel.nb.x)
-		sel.nb.x = i;
-	if (tlinelen(sel.ne.y) <= sel.ne.x)
-		sel.ne.x = term.col - 1;
+	if(sel.type == SEL_REGULAR) {
+		int len = tlinelen(sel.nb.y);
+		if(len < sel.nb.x)
+			sel.nb.x = len;
+		if(tlinelen(sel.ne.y) <= sel.ne.x)
+			sel.ne.x = term.col - 1;
+	}
 }
 
 bool
-- 
1.8.4
Received on Thu Apr 30 2015 - 22:51:48 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 30 2015 - 23:00:10 CEST