Browse Source

Select to the end of row if end of line is reached.

Thanks Alexander Rezinsky <alexrez@gmail.com>!
master
Christoph Lohmann 11 years ago
parent
commit
634c247fa7
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      st.c

+ 12
- 0
st.c View File

@ -679,6 +679,8 @@ selected(int x, int y) {
void void
selsnap(int mode, int *x, int *y, int direction) { selsnap(int mode, int *x, int *y, int direction) {
int i;
switch(mode) { switch(mode) {
case SNAP_WORD: case SNAP_WORD:
/* /*
@ -735,6 +737,16 @@ selsnap(int mode, int *x, int *y, int direction) {
} }
break; break;
default: default:
/*
* Select the whole line when the end of line is reached.
*/
if(direction > 0) {
i = term.col;
while(--i > 0 && term.line[*y][i].c[0] == ' ')
/* nothing */;
if(i > 0 && i < *x)
*x = term.col - 1;
}
break; break;
} }
} }


Loading…
Cancel
Save