SF.net SVN: geany: [658] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Aug 1 13:25:05 UTC 2006


Revision: 658
Author:   ntrel
Date:     2006-08-01 06:24:58 -0700 (Tue, 01 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/geany/?rev=658&view=rev

Log Message:
-----------
Apply the tab width setting for new documents

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c
    trunk/src/document.h
    trunk/src/prefs.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-08-01 11:33:42 UTC (rev 657)
+++ trunk/ChangeLog	2006-08-01 13:24:58 UTC (rev 658)
@@ -17,6 +17,8 @@
  * src/keyfile.c: Change default for removing trailing spaces to off.
  * src/callbacks.c: Clear search flags when using find toolbar entry.
                     Removed some unnecessary static variables.
+ * document.c, document.h, prefs.c:
+   Apply the tab width setting for new documents.
 
 
 2006-07-31  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2006-08-01 11:33:42 UTC (rev 657)
+++ trunk/src/document.c	2006-08-01 13:24:58 UTC (rev 658)
@@ -199,6 +199,21 @@
 }
 
 
+// Apply just the prefs that can change in the Preferences dialog
+void document_apply_update_prefs(ScintillaObject *sci)
+{
+	sci_set_mark_long_lines(sci, app->long_line_type, app->long_line_column, app->long_line_color);
+
+	sci_set_tab_width(sci, app->pref_editor_tab_width);
+
+	sci_set_indentionguides(sci, app->pref_editor_show_indent_guide);
+	sci_set_visible_white_spaces(sci, app->pref_editor_show_white_space);
+	sci_set_visible_eols(sci, app->pref_editor_show_line_endings);
+
+	sci_set_folding_margin_visible(sci, app->pref_editor_folding);
+}
+
+
 /* creates a new tab in the notebook and does all related stuff
  * finally it returns the index of the created document */
 gint document_create_new_sci(const gchar *filename)
@@ -234,14 +249,12 @@
 	sci_assign_cmdkey(sci, SCK_END,  SCI_LINEENDWRAP);
 	// disable select all to be able to redefine it
 	sci_clear_cmdkey(sci, 'A' | (SCMOD_CTRL << 16));
-	sci_set_mark_long_lines(sci, app->long_line_type, app->long_line_column, app->long_line_color);
+
+	document_apply_update_prefs(sci);
+
 	sci_set_symbol_margin(sci, app->show_markers_margin);
-	sci_set_folding_margin_visible(sci, app->pref_editor_folding);
 	sci_set_line_numbers(sci, app->show_linenumber_margin, 0);
 	sci_set_lines_wrapped(sci, app->pref_editor_line_breaking);
-	sci_set_indentionguides(sci, app->pref_editor_show_indent_guide);
-	sci_set_visible_white_spaces(sci, app->pref_editor_show_white_space);
-	sci_set_visible_eols(sci, app->pref_editor_show_line_endings);
 	pfd = pango_font_description_from_string(app->editor_font);
 	fname = g_strdup_printf("!%s", pango_font_description_get_family(pfd));
 	document_set_font(new_idx, fname, pango_font_description_get_size(pfd) / PANGO_SCALE);

Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h	2006-08-01 11:33:42 UTC (rev 657)
+++ trunk/src/document.h	2006-08-01 13:24:58 UTC (rev 658)
@@ -58,6 +58,10 @@
 void document_init_doclist(void);
 
 
+// Apply just the prefs that can change in the Preferences dialog
+void document_apply_update_prefs(ScintillaObject *sci);
+
+
 /* creates a new tab in the notebook and does all related stuff
  * finally it returns the index of the created document */
 gint document_create_new_sci(const gchar*);

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2006-08-01 11:33:42 UTC (rev 657)
+++ trunk/src/prefs.c	2006-08-01 13:24:58 UTC (rev 658)
@@ -622,13 +622,7 @@
 		{
 			if (doc_list[i].is_valid)
 			{
-				sci_set_tab_width(doc_list[i].sci, app->pref_editor_tab_width);
-				sci_set_mark_long_lines(doc_list[i].sci, app->long_line_type,
-										app->long_line_column, app->long_line_color);
-				sci_set_visible_eols(doc_list[i].sci, app->pref_editor_show_line_endings);
-				sci_set_indentionguides(doc_list[i].sci, app->pref_editor_show_indent_guide);
-				sci_set_visible_white_spaces(doc_list[i].sci, app->pref_editor_show_white_space);
-				sci_set_folding_margin_visible(doc_list[i].sci, app->pref_editor_folding);
+				document_apply_update_prefs(doc_list[i].sci);
 				if (! app->pref_editor_folding) document_unfold_all(i);
 			}
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list