- mvwaddch(editw, TABLINE+1, spacing * tab + 2, UI_LRCORNER_CHAR);
- mvwaddstr(editw, TABLINE+1, spacing * tab + 3, " ");
- mvwaddch(editw, TABLINE+1, spacing * tab + 12, UI_LLCORNER_CHAR);
+ if(x_pos + width + 1 > EDITW_COLS) {
+ statusline_msg(_("Tab name too wide for screen"));
+ break;
+ }
+
+ mvwaddch(editw, TABLINE + 1, x_pos, UI_TEE_CHAR);
+ mvwaddch(editw, TABLINE + 1, x_pos + width - 2, UI_TEE_CHAR);
+
+ mvwaddch(editw, TABLINE, x_pos, UI_ULCORNER_CHAR);
+ mvwaddch(editw, TABLINE, x_pos + 1, UI_LBOXLINE_CHAR);
+ mvwaddstr(editw, TABLINE, x_pos + 2, gettext(tab_names[i]));
+ mvwaddch(editw, TABLINE, x_pos + width - 3, UI_RBOXLINE_CHAR);
+ mvwaddch(editw, TABLINE, x_pos + width - 2, UI_URCORNER_CHAR);
+
+ if(i == tab) {
+ mvwaddch(editw, TABLINE + 1, x_pos, UI_LRCORNER_CHAR);
+ for(j = 0; j < width - 3; j++)
+ mvwaddstr(editw,
+ TABLINE + 1, x_pos + j + 1, " ");
+ mvwaddch(editw, TABLINE + 1, x_pos + width - 2,
+ UI_LLCORNER_CHAR);
+ }
+ x_pos += width;
+ }