From 664a1d77f00477878c30732bc0b5d57a54248299 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 8 Aug 2008 14:33:23 +0000 Subject: [PATCH] Fix using correct display tab width when the Tabs & Spaces indent type is set. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2865 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 +++++++ src/printing.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9eed5a09d..374e3b5ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-08 Nick Treleaven + + * src/printing.c: + Fix using correct display tab width when the Tabs & Spaces indent + type is set. + + 2008-08-08 Enrico Tröger * src/printing.c: diff --git a/src/printing.c b/src/printing.c index e6247a1c4..9495b038c 100644 --- a/src/printing.c +++ b/src/printing.c @@ -470,6 +470,7 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { DocInfo *dinfo = user_data; + GeanyEditor *editor; cairo_t *cr; gdouble width, height; gdouble x, y; @@ -480,6 +481,8 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, if (dinfo == NULL || page_nr >= dinfo->n_pages) return; + editor = dinfo->doc->editor; + #ifdef GEANY_PRINT_DEBUG geany_debug("draw_page = %d, pages = %d, (real) lines_per_page = %d", page_nr, dinfo->n_pages, dinfo->lines_per_page); @@ -563,8 +566,8 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, /* convert tabs to spaces which seems to be better than using Pango tabs */ if (c == '\t') { - const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(dinfo->doc->editor); - gchar *s = g_strnfill(iprefs->width, ' '); + gint tab_width = sci_get_tab_width(editor->sci); + gchar *s = g_strnfill(tab_width, ' '); g_string_append(str, s); g_free(s); }