Kaydet (Commit) 664a1d77 authored tarafından Nick Treleaven's avatar Nick Treleaven

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
üst 19247c47
2008-08-08 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/printing.c:
Fix using correct display tab width when the Tabs & Spaces indent
type is set.
2008-08-08 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2008-08-08 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/printing.c: * src/printing.c:
......
...@@ -470,6 +470,7 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, ...@@ -470,6 +470,7 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context,
gint page_nr, gpointer user_data) gint page_nr, gpointer user_data)
{ {
DocInfo *dinfo = user_data; DocInfo *dinfo = user_data;
GeanyEditor *editor;
cairo_t *cr; cairo_t *cr;
gdouble width, height; gdouble width, height;
gdouble x, y; gdouble x, y;
...@@ -480,6 +481,8 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, ...@@ -480,6 +481,8 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context,
if (dinfo == NULL || page_nr >= dinfo->n_pages) if (dinfo == NULL || page_nr >= dinfo->n_pages)
return; return;
editor = dinfo->doc->editor;
#ifdef GEANY_PRINT_DEBUG #ifdef GEANY_PRINT_DEBUG
geany_debug("draw_page = %d, pages = %d, (real) lines_per_page = %d", geany_debug("draw_page = %d, pages = %d, (real) lines_per_page = %d",
page_nr, dinfo->n_pages, dinfo->lines_per_page); page_nr, dinfo->n_pages, dinfo->lines_per_page);
...@@ -563,8 +566,8 @@ static void draw_page(GtkPrintOperation *operation, GtkPrintContext *context, ...@@ -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 */ /* convert tabs to spaces which seems to be better than using Pango tabs */
if (c == '\t') if (c == '\t')
{ {
const GeanyIndentPrefs *iprefs = editor_get_indent_prefs(dinfo->doc->editor); gint tab_width = sci_get_tab_width(editor->sci);
gchar *s = g_strnfill(iprefs->width, ' '); gchar *s = g_strnfill(tab_width, ' ');
g_string_append(str, s); g_string_append(str, s);
g_free(s); g_free(s);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment