aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-11-15 16:26:50 +0100
committerChristoph Lohmann <20h@r-36.net>2012-11-15 16:26:50 +0100
commitd5640c772998de7bccd76c3f8e934fa685cb2bb4 (patch)
treec367fc895dbad1d5baa3be94c6c23d0b59993bd9 /st.c
parent801ea034b652025dc22d26f6e1b802de932346da (diff)
downloadst-d5640c772998de7bccd76c3f8e934fa685cb2bb4.tar.gz
st-d5640c772998de7bccd76c3f8e934fa685cb2bb4.zip
Fixing the return and keypad enter sent characters. Terminals produce \r. And
some minor style changes.
Diffstat (limited to 'st.c')
-rw-r--r--st.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/st.c b/st.c
index 7b7bd55..ba93f2f 100644
--- a/st.c
+++ b/st.c
@@ -2100,15 +2100,19 @@ tputc(char *c, int len) {
2100 sel.bx = -1; 2100 sel.bx = -1;
2101 if(IS_SET(MODE_WRAP) && term.c.state & CURSOR_WRAPNEXT) 2101 if(IS_SET(MODE_WRAP) && term.c.state & CURSOR_WRAPNEXT)
2102 tnewline(1); /* always go to first col */ 2102 tnewline(1); /* always go to first col */
2103 if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col) 2103
2104 if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col) {
2104 memmove(&term.line[term.c.y][term.c.x+1], 2105 memmove(&term.line[term.c.y][term.c.x+1],
2105 &term.line[term.c.y][term.c.x], 2106 &term.line[term.c.y][term.c.x],
2106 (term.col - term.c.x - 1) * sizeof(Glyph)); 2107 (term.col - term.c.x - 1) * sizeof(Glyph));
2108 }
2109
2107 tsetchar(c, &term.c.attr, term.c.x, term.c.y); 2110 tsetchar(c, &term.c.attr, term.c.x, term.c.y);
2108 if(term.c.x+1 < term.col) 2111 if(term.c.x+1 < term.col) {
2109 tmoveto(term.c.x+1, term.c.y); 2112 tmoveto(term.c.x+1, term.c.y);
2110 else 2113 } else {
2111 term.c.state |= CURSOR_WRAPNEXT; 2114 term.c.state |= CURSOR_WRAPNEXT;
2115 }
2112} 2116}
2113 2117
2114int 2118int