- mvwhline(editw, TABLINE+1, 0, UI_HLINE_CHAR, EDITW_COLS);
- for(i=0; i < TABS; i++) {
- mvwaddch(editw, TABLINE+1, spacing * i + 2, UI_TEE_CHAR);
- mvwaddch(editw, TABLINE+1, spacing * i + 12, UI_TEE_CHAR);
- }
+ mvwhline(editw, TABLINE + 1, 0, UI_HLINE_CHAR, EDITW_COLS);
+
+ for(i = 0; i < TABS; i++) {
+ int width = mbswidth(gettext(tab_names[i]), 0) + 5;
+
+ if(sum + width + 1> EDITW_COLS) {
+ statusline_msg(_("Tab name too wide for screen"));
+ break;
+ }
+
+ mvwaddch(editw, TABLINE+1, sum, UI_TEE_CHAR);
+ mvwaddch(editw, TABLINE+1, sum + width - 2, UI_TEE_CHAR);
+
+ mvwaddch(editw, TABLINE, sum, UI_ULCORNER_CHAR);
+ mvwaddch(editw, TABLINE, sum + 1, UI_LBOXLINE_CHAR);
+ mvwaddstr(editw, TABLINE, sum + 2, gettext(tab_names[i]));
+ mvwaddch(editw, TABLINE, sum + width - 3, UI_RBOXLINE_CHAR);
+ mvwaddch(editw, TABLINE, sum + width - 2, UI_URCORNER_CHAR);