aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--st.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/st.c b/st.c
index 497885b..097775d 100644
--- a/st.c
+++ b/st.c
@@ -662,7 +662,10 @@ y2row(int y) {
662static int tlinelen(int y) { 662static int tlinelen(int y) {
663 int i = term.col; 663 int i = term.col;
664 664
665 while (i > 0 && term.line[y][i - 1].c[0] == ' ') 665 if(term.line[y][i - 1].mode & ATTR_WRAP)
666 return i;
667
668 while(i > 0 && term.line[y][i - 1].c[0] == ' ')
666 --i; 669 --i;
667 670
668 return i; 671 return i;
@@ -959,7 +962,7 @@ getsel(void) {
959 * st. 962 * st.
960 * FIXME: Fix the computer world. 963 * FIXME: Fix the computer world.
961 */ 964 */
962 if(sel.ne.y > y || lastx >= linelen) 965 if((y < sel.ne.y || lastx >= linelen) && !(last->mode & ATTR_WRAP))
963 *ptr++ = '\n'; 966 *ptr++ = '\n';
964 } 967 }
965 *ptr = 0; 968 *ptr = 0;