- PangoTabArray *tab_array;
- PangoContext *pango_context;
-
- tab_array = pango_tab_array_new(tab_count, (gboolean) (1));
- for (i = 1; i <= tab_count; i++) {
- pango_tab_array_set_tab(tab_array,
- i, PANGO_TAB_LEFT,
- tabwidth * i - tab_shift + border);
+ if (last_tabwidth < 0 || last_tabwidth != tabwidth){
+ PangoTabArray *tab_array;
+ // fprintf(stderr,"t");
+ last_tabwidth = tabwidth;
+ tab_array = pango_tab_array_new(tab_count, (gboolean) (1));
+ for (i = 1; i <= tab_count; i++) {
+ pango_tab_array_set_tab(tab_array,
+ i, PANGO_TAB_LEFT,
+ tabwidth * i - tab_shift + border);
+ }
+ pango_layout_set_tabs(layout, tab_array);
+ pango_tab_array_free(tab_array);