diff options
| -rw-r--r-- | st.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -662,7 +662,10 @@ y2row(int y) { | |||
| 662 | static int tlinelen(int y) { | 662 | static 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; |
