SF.net SVN: geany: [1875] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Sep 12 12:08:07 UTC 2007


Revision: 1875
          http://geany.svn.sourceforge.net/geany/?rev=1875&view=rev
Author:   ntrel
Date:     2007-09-12 05:08:07 -0700 (Wed, 12 Sep 2007)

Log Message:
-----------
Allow autocompletion on a line with trailing whitespace.
Add auto_complete_whilst_editing hidden preference.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/editor.c
    trunk/src/editor.h
    trunk/src/keyfile.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/ChangeLog	2007-09-12 12:08:07 UTC (rev 1875)
@@ -7,6 +7,10 @@
    Apply patch from John Gabriele for an overview in the Tags section
    (thanks).
    (Format paragraph with fmt -w72).
+ * src/keyfile.c, src/editor.c, src/editor.h, doc/geany.txt,
+   doc/geany.html:
+   Allow autocompletion on a line with trailing whitespace.
+   Add auto_complete_whilst_editing hidden preference.
 
 
 2007-09-11  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/doc/geany.html	2007-09-12 12:08:07 UTC (rev 1875)
@@ -6,7 +6,7 @@
 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
 <title>Geany</title>
 <meta name="authors" content="Enrico Tröger  Nick Treleaven  Frank Lanitz" />
-<meta name="date" content="2007-09-09" />
+<meta name="date" content="2007-09-12" />
 <style type="text/css">
 
 /*
@@ -133,7 +133,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2007-09-09</td></tr>
+<td>2007-09-12</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.12</td></tr>
 </tbody>
@@ -2517,6 +2517,11 @@
 commands</a>).</td>
 <td>true</td>
 </tr>
+<tr><td>auto_complete_whilst_editing</td>
+<td>Whether to allow autocompletion when editing
+an existing line.</td>
+<td>false</td>
+</tr>
 </tbody>
 </table>
 </div>
@@ -3031,7 +3036,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2007-09-12 11:40 UTC.
+Generated on: 2007-09-12 11:56 UTC.
 Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/doc/geany.txt	2007-09-12 12:08:07 UTC (rev 1875)
@@ -2263,19 +2263,21 @@
 The table below refers to the key names in the configuration file, under the
 ``[geany]`` group.
 
-==============================  ============================================  ==================
-Option                          Description                                   Default
-==============================  ============================================  ==================
-brace_match_ltgt                Whether to highlight <, > angle brackets.     false
-show_editor_scrollbars          Whether to display scrollbars when the        true
+==============================  ============================================    ==================
+Option                          Description                                     Default
+==============================  ============================================    ==================
+brace_match_ltgt                Whether to highlight <, > angle brackets.       false
+show_editor_scrollbars          Whether to display scrollbars when the          true
                                 editor window is bigger than the display.
-use_tab_to_indent               Whether pressing tab when a line is selected  true
+use_tab_to_indent               Whether pressing tab when a line is selected    true
                                 will indent the line.
-use_gtk_word_boundaries         Whether to look for the end of a word when    true
+use_gtk_word_boundaries         Whether to look for the end of a word when      true
                                 using word-boundary related Scintilla
                                 commands (see `Scintilla keyboard
                                 commands`_).
-==============================  ============================================  ==================
+auto_complete_whilst_editing    Whether to allow autocompletion when editing    false
+                                an existing line.
+==============================  ============================================    ==================
 
 
 Compile-time options

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/src/editor.c	2007-09-12 12:08:07 UTC (rev 1875)
@@ -1205,7 +1205,18 @@
 static gboolean at_eol(ScintillaObject *sci, gint pos)
 {
 	gint line = sci_get_line_from_position(sci, pos);
+	gchar c;
 
+	// skip any trailing spaces
+	while (TRUE)
+	{
+		c = sci_get_char_at(sci, pos);
+		if (c == ' ' || c == '\t')
+			pos++;
+		else
+			break;
+	}
+
 	return (pos == sci_get_line_end_position(sci, line));
 }
 
@@ -1221,7 +1232,7 @@
 
 	sci = doc_list[idx].sci;
 	// return if we are editing an existing line (chars on right of cursor)
-	if (! at_eol(sci, pos))
+	if (! editor_prefs.auto_complete_whilst_editing && ! at_eol(sci, pos))
 		return FALSE;
 
 	lexer = SSM(sci, SCI_GETLEXER, 0, 0);

Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/src/editor.h	2007-09-12 12:08:07 UTC (rev 1875)
@@ -73,6 +73,7 @@
 	GHashTable	*auto_completions;
 	gboolean	brace_match_ltgt;	// whether to highlight < and > chars (hidden pref)
 	gboolean	use_gtk_word_boundaries;	// hidden pref
+	gboolean	auto_complete_whilst_editing;	// hidden pref
 } EditorPrefs;
 
 extern EditorPrefs editor_prefs;

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2007-09-12 11:39:21 UTC (rev 1874)
+++ trunk/src/keyfile.c	2007-09-12 12:08:07 UTC (rev 1875)
@@ -196,6 +196,7 @@
 	g_key_file_set_boolean(config, PACKAGE, "pref_editor_disable_dnd", editor_prefs.disable_dnd);
 	g_key_file_set_boolean(config, PACKAGE, "pref_editor_smart_home_key", editor_prefs.smart_home_key);
 	g_key_file_set_boolean(config, PACKAGE, "use_gtk_word_boundaries", editor_prefs.use_gtk_word_boundaries);
+	g_key_file_set_boolean(config, PACKAGE, "auto_complete_whilst_editing", editor_prefs.auto_complete_whilst_editing);
 
 	// files
 	g_key_file_set_string(config, PACKAGE, "pref_editor_default_new_encoding", encodings[prefs.default_new_encoding].charset);
@@ -448,6 +449,7 @@
 	editor_prefs.disable_dnd = utils_get_setting_boolean(config, PACKAGE, "pref_editor_disable_dnd", FALSE);
 	editor_prefs.smart_home_key = utils_get_setting_boolean(config, PACKAGE, "pref_editor_smart_home_key", TRUE);
 	editor_prefs.use_gtk_word_boundaries = utils_get_setting_boolean(config, PACKAGE, "use_gtk_word_boundaries", TRUE);
+	editor_prefs.auto_complete_whilst_editing = utils_get_setting_boolean(config, PACKAGE, "auto_complete_whilst_editing", FALSE);
 
 	// Files
 	// use current locale encoding as default for new files (should be UTF-8 in most cases)


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