st

simple terminal

git clone https://9o.is/git/st.git

commit 8f6f8d4cffb5a9bf30bca738fa8e274e22a6f036
parent 64b21a1a71170a9d4515846a433cdd62e747f41e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue,  3 Jun 2014 17:55:53 +0200

tiny cleanup

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>

Diffstat:
Mst.c | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/st.c b/st.c @@ -920,7 +920,7 @@ bpress(XEvent *e) { char * getsel(void) { char *str, *ptr; - int x, y, bufsize, size, i, ex; + int x, y, bufsize, size, ex; Glyph *gp, *last; if(sel.ob.x == -1) @@ -965,13 +965,10 @@ getsel(void) { * after the visible text '\n' is appended. */ if(y == sel.ne.y) { - i = term.col; - while(--i > 0 && term.line[y][i].c[0] == ' ') - /* nothing */; ex = sel.ne.x; if(sel.nb.y == sel.ne.y && sel.ne.x < sel.nb.x) ex = sel.nb.x; - if(i < ex) + if(tlinelen(y) < ex) *ptr++ = '\n'; } }