all repos — st @ 634c247fa76a5f649cdcc51109970e46ddaf5c32

st (suckless terminal) config

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

Thanks Alexander Rezinsky <alexrez@gmail.com>!
Christoph Lohmann 20h@r-36.net
commit

634c247fa76a5f649cdcc51109970e46ddaf5c32

parent

5938fa9d32379815757a83076069584f29a8d276

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M st.cst.c

@@ -679,6 +679,8 @@ }

void selsnap(int mode, int *x, int *y, int direction) { + int i; + switch(mode) { case SNAP_WORD: /*

@@ -735,6 +737,16 @@ }

} break; 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; } }