diff options
-rw-r--r-- | config.def.h | 6 | ||||
-rw-r--r-- | st.c | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/config.def.h b/config.def.h index e02bc29..da1191c 100644 --- a/config.def.h +++ b/config.def.h | |||
@@ -109,7 +109,7 @@ static Key key[] = { | |||
109 | { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +1, 0, 0}, | 109 | { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +1, 0, 0}, |
110 | { XK_KP_Add, XK_ANY_MOD, "\033Ok", +1, 0, 0}, | 110 | { XK_KP_Add, XK_ANY_MOD, "\033Ok", +1, 0, 0}, |
111 | { XK_KP_Enter, XK_ANY_MOD, "\033OM", +1, 0, 0}, | 111 | { XK_KP_Enter, XK_ANY_MOD, "\033OM", +1, 0, 0}, |
112 | { XK_KP_Enter, XK_ANY_MOD, "\n", -1, 0, -1}, | 112 | { XK_KP_Enter, XK_ANY_MOD, "\r", -1, 0, -1}, |
113 | { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, | 113 | { XK_KP_Enter, XK_ANY_MOD, "\r\n", -1, 0, +1}, |
114 | { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +1, 0, 0}, | 114 | { XK_KP_Subtract, XK_ANY_MOD, "\033Om", +1, 0, 0}, |
115 | { XK_KP_Decimal, XK_ANY_MOD, "\033On", +1, 0, 0}, | 115 | { XK_KP_Decimal, XK_ANY_MOD, "\033On", +1, 0, 0}, |
@@ -146,9 +146,9 @@ static Key key[] = { | |||
146 | { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, | 146 | { XK_Right, XK_ANY_MOD, "\033[C", 0, -1, 0}, |
147 | { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, | 147 | { XK_Right, XK_ANY_MOD, "\033OC", 0, +1, 0}, |
148 | { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, | 148 | { XK_ISO_Left_Tab, ShiftMask, "\033[Z", 0, 0, 0}, |
149 | { XK_Return, Mod1Mask, "\033\n", 0, 0, -1}, | 149 | { XK_Return, Mod1Mask, "\033\r", 0, 0, -1}, |
150 | { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, | 150 | { XK_Return, Mod1Mask, "\033\r\n", 0, 0, +1}, |
151 | { XK_Return, XK_ANY_MOD, "\n", 0, 0, -1}, | 151 | { XK_Return, XK_ANY_MOD, "\r", 0, 0, -1}, |
152 | { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, | 152 | { XK_Return, XK_ANY_MOD, "\r\n", 0, 0, +1}, |
153 | { XK_Insert, ShiftMask, "\033[2;2~", 0, 0, 0}, | 153 | { XK_Insert, ShiftMask, "\033[2;2~", 0, 0, 0}, |
154 | { XK_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0}, | 154 | { XK_Insert, XK_ANY_MOD, "\033[2~", 0, 0, 0}, |
@@ -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 |