diff options
| author | Christoph Lohmann <20h@r-36.net> | 2012-11-15 16:26:50 +0100 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2012-11-15 16:26:50 +0100 |
| commit | d5640c772998de7bccd76c3f8e934fa685cb2bb4 (patch) | |
| tree | c367fc895dbad1d5baa3be94c6c23d0b59993bd9 /st.c | |
| parent | Import the patch of Eckehard Berns to add insert mode. Thanks! (diff) | |
| download | st-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
| @@ -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 | ||
| 2114 | int | 2118 | int |
