aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-17 09:15:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-17 09:15:56 +0000
commit045f55a8c61480eff5e43061ee7ffd1207092889 (patch)
tree9ceda699a97ec1e8585a2ba4ad7dc254a0dd8987
parentterm: save/restore charsets on save/restore cursor+attributes (diff)
vt: bug (tab regression): don't get stuck on the same tab stop
There were actually two bugs here: * When checking for a tab stop, make sure the new tab stop is at a different column. Otherwise you can't tab away from a tab stop. * When there aren't any tab stops configured, or when we're already beyond the last tab stop, then tab to the last column (at least I think that's what we're supposed to do).
-rw-r--r--vt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vt.c b/vt.c
index 36c15fc8..cad4cbcf 100644
--- a/vt.c
+++ b/vt.c
@@ -868,9 +868,9 @@ action(struct terminal *term, enum action _action, uint8_t c)
case '\x09': {
/* HT - horizontal tab */
- int new_col = term->cursor.point.col;
+ int new_col = term->cols - 1;
tll_foreach(term->tab_stops, it) {
- if (it->item >= term->cursor.point.col) {
+ if (it->item > term->cursor.point.col) {
new_col = it->item;
break;
}