From 0a1041044141ddbda0c67602e70fe8894e7430fd Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 7 Nov 2021 11:43:28 -0800 Subject: config changes for laptop --- sys/cmd/term/term.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'sys/cmd/term/term.c') diff --git a/sys/cmd/term/term.c b/sys/cmd/term/term.c index f92db28..3cd99c3 100644 --- a/sys/cmd/term/term.c +++ b/sys/cmd/term/term.c @@ -289,11 +289,11 @@ selnormalize(void) int selected(int x, int y) { - if (sel.mode == SelEmpty || sel.ob.x == -1 || + if(sel.mode == SelEmpty || sel.ob.x == -1 || sel.alt != IS_SET(Taltscreen)) return 0; - if (sel.type == SelRectangular) + if(sel.type == SelRectangular) return BETWEEN(y, sel.nb.y, sel.ne.y) && BETWEEN(x, sel.nb.x, sel.ne.x); @@ -389,16 +389,16 @@ getsel(void) ptr = str = xmalloc(bufsize); /* append every set & selected glyph to the selection */ - for (y = sel.nb.y; y <= sel.ne.y; y++) { - if ((linelen = tlinelen(y)) == 0) { + for(y = sel.nb.y; y <= sel.ne.y; y++) { + if((linelen = tlinelen(y)) == 0) { *ptr++ = '\n'; continue; } - if (sel.type == SelRectangular) { + if(sel.type == SelRectangular) { gp = &term.line[y][sel.nb.x]; lastx = sel.ne.x; - } else { + }else{ gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0]; lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1; } @@ -1016,9 +1016,9 @@ tclearregion(int x1, int y1, int x2, int y2) int x, y, temp; Letter *gp; - if (x1 > x2) + if(x1 > x2) temp = x1, x1 = x2, x2 = temp; - if (y1 > y2) + if(y1 > y2) temp = y1, y1 = y2, y2 = temp; LIMIT(x1, 0, term.col-1); @@ -1026,11 +1026,11 @@ tclearregion(int x1, int y1, int x2, int y2) LIMIT(y1, 0, term.row-1); LIMIT(y2, 0, term.row-1); - for (y = y1; y <= y2; y++) { + for(y = y1; y <= y2; y++) { term.dirty[y] = 1; - for (x = x1; x <= x2; x++) { + for(x = x1; x <= x2; x++) { gp = &term.line[y][x]; - if (selected(x, y)) + if(selected(x, y)) selclear(); gp->fg = term.c.attr.fg; gp->bg = term.c.attr.bg; @@ -2104,9 +2104,11 @@ tputc(rune u) else return; +#if 0 if(!hb_unicode_compose(hb_unicode_funcs_get_default(),gp->u, u, &nu)) { return; } +#endif gp->u = nu; return; @@ -2134,7 +2136,7 @@ tputc(rune u) goto check_control_code; } - if (IS_SET(Tsixel)) { + if(IS_SET(Tsixel)) { /* TODO: implement sixel mode */ return; } @@ -2155,7 +2157,7 @@ tputc(rune u) * term.esc = 0; * strhandle(); */ - if (strescseq.siz > (SIZE_MAX - UTFmax) / 2) + if(strescseq.siz > (SIZE_MAX - UTFmax) / 2) return; strescseq.siz *= 2; strescseq.buf = xrealloc(strescseq.buf, strescseq.siz); @@ -2210,20 +2212,20 @@ check_control_code: return; } - if (selected(term.c.x, term.c.y)) + if(selected(term.c.x, term.c.y)) selclear(); gp = &term.line[term.c.y][term.c.x]; - if (IS_SET(Twrap) && (term.c.state & CursorWrap)) { + if(IS_SET(Twrap) && (term.c.state & CursorWrap)) { gp->mode |= Gwrap; tnewline(1); gp = &term.line[term.c.y][term.c.x]; } - if (IS_SET(Tinsert) && term.c.x+width < term.col) + if(IS_SET(Tinsert) && term.c.x+width < term.col) memmove(gp+width, gp, (term.col - term.c.x - width) * sizeof(Letter)); - if (term.c.x+width > term.col) { + if(term.c.x+width > term.col) { tnewline(1); gp = &term.line[term.c.y][term.c.x]; } @@ -2238,9 +2240,9 @@ check_control_code: gp[1].mode = Gwdummy; } } - if (term.c.x+width < term.col) { + if(term.c.x+width < term.col) { tmoveto(term.c.x+width, term.c.y); - } else { + }else{ term.c.state |= CursorWrap; } } -- cgit v1.2.1