Use spaces to compute indentation

master
Yevgen Muntyan 2006-07-03 01:32:20 -05:00
parent 17966b9fe2
commit 2ddeaf535d
1 changed files with 5 additions and 5 deletions

View File

@ -3269,9 +3269,8 @@ update_tab_width (MooTextView *view)
{
PangoTabArray *tabs;
PangoLayout *layout;
guint tab_width;
int layout_width;
const char *string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
int tab_width;
char *string;
if (!GTK_WIDGET_REALIZED (view))
return;
@ -3279,9 +3278,9 @@ update_tab_width (MooTextView *view)
g_return_if_fail (view->priv->tab_width > 0);
g_return_if_fail (GTK_WIDGET (view)->style != NULL);
string = g_strnfill (view->priv->tab_width, ' ');
layout = gtk_widget_create_pango_layout (GTK_WIDGET (view), string);
pango_layout_get_size (layout, &layout_width, NULL);
tab_width = (layout_width * view->priv->tab_width) / strlen (string);
pango_layout_get_size (layout, &tab_width, NULL);
tabs = pango_tab_array_new (2, FALSE);
pango_tab_array_set_tab (tabs, 0, PANGO_TAB_LEFT, 0);
@ -3291,6 +3290,7 @@ update_tab_width (MooTextView *view)
pango_tab_array_free (tabs);
g_object_unref (layout);
g_free (string);
}
void