]> Sergey Matveev's repositories - st.git/blobdiff - st.c
Fix selection: ignore ATTR_WRAP when rectangular selection in getsel
[st.git] / st.c
diff --git a/st.c b/st.c
index a8de17d64f6104aa57a370b9a09fc854fbe6bff9..7c15d5f68fdc6d52b75b14d0c0d63ad78215a318 100644 (file)
--- a/st.c
+++ b/st.c
@@ -634,7 +634,8 @@ getsel(void)
                 * st.
                 * FIXME: Fix the computer world.
                 */
-               if ((y < sel.ne.y || lastx >= linelen) && !(last->mode & ATTR_WRAP))
+               if ((y < sel.ne.y || lastx >= linelen) &&
+                   (!(last->mode & ATTR_WRAP) || sel.type == SEL_RECTANGULAR))
                        *ptr++ = '\n';
        }
        *ptr = 0;
@@ -2412,7 +2413,7 @@ check_control_code:
                 */
                return;
        }
-       if (sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y))
+       if (selected(term.c.x, term.c.y))
                selclear();
 
        gp = &term.line[term.c.y][term.c.x];