diff -ur ../geany/geany.glade ./geany.glade
--- ../geany/geany.glade	2007-07-07 12:29:46.000000000 -0500
+++ ./geany.glade	2007-07-10 05:16:34.000000000 -0500
@@ -6019,6 +6019,26 @@
 			      <property name="fill">False</property>
 			    </packing>
 			  </child>
+
+			  <child>
+			    <widget class="GtkCheckButton" id="check_smart_home">
+			      <property name="visible">True</property>
+			      <property name="tooltip" translatable="yes">When &quot;smart&quot; home is enabled, the HOME key will move the caret to the first non-blank character of the line, unless it is already there, it moves to the very beginning of the line. When this feature is disabled, the HOME key always moves the caret to the start of the current line, regardless of its current position.</property>
+			      <property name="can_focus">True</property>
+			      <property name="label" translatable="yes">Enable &quot;smart&quot; home key</property>
+			      <property name="use_underline">True</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">False</property>
+			      <property name="active">False</property>
+			      <property name="inconsistent">False</property>
+			      <property name="draw_indicator">True</property>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
+			    </packing>
+			  </child>
 			</widget>
 		      </child>
 		    </widget>
diff -ur ../geany/src/document.c ./src/document.c
--- ../geany/src/document.c	2007-07-07 12:29:46.000000000 -0500
+++ ./src/document.c	2007-07-09 14:00:56.000000000 -0500
@@ -299,7 +299,7 @@
 	//SSM(sci, SCI_SETWRAPSTARTINDENT, 4, 0);
 	// disable scintilla provided popup menu
 	sci_use_popup(sci, FALSE);
-	sci_assign_cmdkey(sci, SCK_HOME, SCI_VCHOMEWRAP);
+	sci_assign_cmdkey(sci, SCK_HOME, editor_prefs.smart_home_key?SCI_VCHOMEWRAP:SCI_HOMEWRAP);
 	sci_assign_cmdkey(sci, SCK_END,  SCI_LINEENDWRAP);
 	// disable some Scintilla keybinsings to be able to redefine it
 	sci_clear_cmdkey(sci, 'A' | (SCMOD_CTRL << 16)); // select all
diff -ur ../geany/src/editor.h ./src/editor.h
--- ../geany/src/editor.h	2007-07-07 12:29:46.000000000 -0500
+++ ./src/editor.h	2007-07-09 13:57:30.000000000 -0500
@@ -67,6 +67,7 @@
 	gboolean	replace_tabs;
 	gboolean	trail_space;
 	gboolean	disable_dnd;
+	gboolean	smart_home_key;
 	GHashTable	*auto_completions;
 } EditorPrefs;
 
diff -ur ../geany/src/interface.c ./src/interface.c
--- ../geany/src/interface.c	2007-07-07 12:29:46.000000000 -0500
+++ ./src/interface.c	2007-07-10 05:16:34.000000000 -0500
@@ -2568,6 +2568,7 @@
   GtkWidget *check_indicators;
   GtkWidget *check_disable_dnd;
   GtkWidget *check_use_tabs;
+  GtkWidget *check_smart_home;
   GtkWidget *label172;
   GtkWidget *frame18;
   GtkWidget *alignment21;
@@ -3635,6 +3636,12 @@
   gtk_tooltips_set_tip (tooltips, check_use_tabs, _("Whenever some whitespace is inserted by Geany it will use tabs when enabled otherwise Geany will use just spaces."), NULL);
   gtk_button_set_focus_on_click (GTK_BUTTON (check_use_tabs), FALSE);
 
+  check_smart_home = gtk_check_button_new_with_mnemonic (_("Enable \"smart\" home key"));
+  gtk_widget_show (check_smart_home);
+  gtk_box_pack_start (GTK_BOX (vbox17), check_smart_home, FALSE, FALSE, 0);
+  gtk_tooltips_set_tip (tooltips, check_smart_home, _("When \"smart\" home is enabled, the HOME key will move the caret to the first non-blank character of the line, unless it is already there, it moves to the very beginning of the line. When this feature is disabled, the HOME key always moves the caret to the start of the current line, regardless of its current position."), NULL);
+  gtk_button_set_focus_on_click (GTK_BUTTON (check_smart_home), FALSE);
+
   label172 = gtk_label_new (_("<b>Features</b>"));
   gtk_widget_show (label172);
   gtk_frame_set_label_widget (GTK_FRAME (frame14), label172);
@@ -4252,6 +4259,7 @@
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_indicators, "check_indicators");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_disable_dnd, "check_disable_dnd");
   GLADE_HOOKUP_OBJECT (prefs_dialog, check_use_tabs, "check_use_tabs");
+  GLADE_HOOKUP_OBJECT (prefs_dialog, check_smart_home, "check_smart_home");
   GLADE_HOOKUP_OBJECT (prefs_dialog, label172, "label172");
   GLADE_HOOKUP_OBJECT (prefs_dialog, frame18, "frame18");
   GLADE_HOOKUP_OBJECT (prefs_dialog, alignment21, "alignment21");
diff -ur ../geany/src/keyfile.c ./src/keyfile.c
--- ../geany/src/keyfile.c	2007-07-02 21:54:26.000000000 -0500
+++ ./src/keyfile.c	2007-07-10 02:00:02.000000000 -0500
@@ -268,6 +268,7 @@
 	g_key_file_set_boolean(config, PACKAGE, "pref_editor_replace_tabs", editor_prefs.replace_tabs);
 	g_key_file_set_boolean(config, PACKAGE, "pref_editor_trail_space", editor_prefs.trail_space);
 	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_string(config, PACKAGE, "pref_editor_default_new_encoding", encodings[editor_prefs.default_new_encoding].charset);
 	if (editor_prefs.default_open_encoding == -1)
 		g_key_file_set_string(config, PACKAGE, "pref_editor_default_open_encoding", "none");
@@ -538,6 +539,7 @@
 	editor_prefs.new_line = utils_get_setting_boolean(config, PACKAGE, "pref_editor_new_line", TRUE);
 	editor_prefs.trail_space = utils_get_setting_boolean(config, PACKAGE, "pref_editor_trail_space", FALSE);
 	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);
 
 	tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_MAKE);
 	app->tools_make_cmd = utils_get_setting_string(config, "tools", "make_cmd", tmp_string);
diff -ur ../geany/src/prefs.c ./src/prefs.c
--- ../geany/src/prefs.c	2007-07-09 12:30:55.000000000 -0500
+++ ./src/prefs.c	2007-07-10 05:22:52.000000000 -0500
@@ -288,6 +288,9 @@
 	widget = lookup_widget(app->prefs_dialog, "check_disable_dnd");
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.disable_dnd);
 
+	widget = lookup_widget(app->prefs_dialog, "check_smart_home");
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.smart_home_key);
+
 	widget = lookup_widget(app->prefs_dialog, "check_use_tabs");
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.use_tabs);
 
@@ -643,6 +646,9 @@
 		widget = lookup_widget(app->prefs_dialog, "check_disable_dnd");
 		editor_prefs.disable_dnd = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
+		widget = lookup_widget(app->prefs_dialog, "check_smart_home");
+		editor_prefs.smart_home_key = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
 		widget = lookup_widget(app->prefs_dialog, "check_use_tabs");
 		editor_prefs.use_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
 
