From f0f33ffc6cd0a75bf4d7d7fd2865ffd15d9bd726 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Thu, 22 Oct 2009 15:52:51 +0200
Subject: [PATCH] GNU LilyPond point-and-click support: use +LINE[:COLUMN] positioning -- Take 3.

Third revision of [a once trivial*] +line:column patch.

As requested by pbor, instead of adding a column parameter, implement
the LINE:COLUMN functionality by adding a whole set of _LINE_COLUMN
suffixed functions.

    * gedit/gedit-tab.c (_GeditTabPrivate): Add tmp_column_pos field.

    (io_loading_error_message_area_response):
    (conversion_loading_error_message_area_response):
    (document_loaded): Use it, updating callers.

    * gedit/gedit-view.c (search_init): Update callers.
    (_gedit_tab_new_from_uri_line_column):
    (_gedit_tab_load_line_column): New function with column parameter,
    update callers.

    * gedit/gedit-window.c (gedit_window_create_tab_from_uri_line_column):
    New function with column parameter, update caller.

    * gedit/gedit-document.c (gedit_document_set_line_column_iter):
    New function, refactored from gedit_document_goto_line.

    (gedit_document_goto_line_column): Use it.  Rename from
    gedit_document_goto_line.  Add column parameter.  Jump to column.

    * gedit/gedit-document-loader.c: gedit_document_loader_load_line_column:
    New function.

    * gedit/gedit-gio-document-loader.c (gedit_gio_document_loader_class_init):
    Initialize load_line_column.

    * gedit/gedit-commands-file.c (load_file_list): Add column parameter.
    Remove code duplication, also jumping to column.

    * gedit/gedit-session.c: Update callers.

    * gedit/gedit-commands.h:
    * gedit/gedit-document.h:
    * gedit-document-loader.h
    * gedit/gedit-tab.h:
    * gedit/gedit-window.h: Add _line_column prototypes.

    * gedit/gedit.c (get_line_column_position): New function.
    (gedit_get_command_line_data):
    (on_message_received): Use it to grok +LINE[:COLUMN] option.
    (gedit_get_command_line_data):
    (options): Document +LINE[:COLUMN] option, as good/bad as GOption
    seems to allow.
    (send_bacon_message): Send positioning info as +LINE:COLUMN.
    (main): Update callers.

    * plugins/filebrowser/gedit-file-browser-plugin.c (on_uri_activated_cb):
    Update caller.

    * data/gedit.1: Update.

*) http://lilypond.org/~janneke/software/patches/gedit-line-column.diff -- 338 lines
   http://lilypond.org/~janneke/software/patches/gedit-line-column-2.diff -- 815 lines
   http://lilypond.org/~janneke/software/patches/0001-GNU-LilyPond-point-and-click-support-use-LINE-COLUMN.patch -- 1386 lines
---
 data/gedit.1                                    |    7 +-
 gedit/gedit-commands-file.c                     |  131 ++++++++++++-----
 gedit/gedit-commands.h                          |   22 +++
 gedit/gedit-document-loader.c                   |   19 +++
 gedit/gedit-document-loader.h                   |    5 +
 gedit/gedit-document.c                          |  180 ++++++++++++++++------
 gedit/gedit-document.h                          |   26 +++-
 gedit/gedit-gio-document-loader.c               |    1 +
 gedit/gedit-session.c                           |   15 +-
 gedit/gedit-tab.c                               |  103 +++++++++-----
 gedit/gedit-tab.h                               |   13 ++
 gedit/gedit-view.c                              |   10 +-
 gedit/gedit-window.c                            |   57 +++++--
 gedit/gedit-window.h                            |   11 ++
 gedit/gedit.c                                   |   52 +++++--
 plugins/filebrowser/gedit-file-browser-plugin.c |    3 +-
 16 files changed, 489 insertions(+), 166 deletions(-)

diff --git a/data/gedit.1 b/data/gedit.1
index 309c5e7..7112d9b 100644
--- a/data/gedit.1
+++ b/data/gedit.1
@@ -37,9 +37,10 @@ Create a new toplevel window in an existing instance of
 Create a new document in an existing instance of
 .B gedit.
 .TP
-\fB+[num]\fR
-For the first file, go to the line specified by "num" (do not insert a space between the "+" sign and the number).
-If "num" is missing, go to the last line.
+\fB+[LINE[:COLUMN]]\fR For the first file, move the cursor the line
+specified by "LINE", and to the column specified by "COLUMN" (do not
+insert a spaces between the "+" or ":" signs and the number).  If
+"LINE" is missing, go to the last line.
 .TP
 \fBfilename(s)...\fR
 Specifies the file to open when 
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 23767fc..96b22af 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-commands-file.c
  * This file is part of gedit
@@ -128,6 +129,7 @@ load_file_list (GeditWindow         *window,
 		GSList              *files,
 		const GeditEncoding *encoding,
 		gint                 line_pos,
+		gint                 column_pos,
 		gboolean             create)
 {
 	GeditTab      *tab;
@@ -155,17 +157,12 @@ load_file_list (GeditWindow         *window,
 					gedit_window_set_active_tab (window, tab);
 					jump_to = FALSE;
 
-					if (line_pos > 0)
+					if (line_pos > 0 || column_pos > 0)
 					{
 						GeditDocument *doc;
-						GeditView *view;
 
 						doc = gedit_tab_get_document (tab);
-						view = gedit_tab_get_view (tab);
-
-						/* document counts lines starting from 0 */
-						gedit_document_goto_line (doc, line_pos - 1);
-						gedit_view_scroll_to_cursor (view);
+						gedit_document_goto_line_column (doc, line_pos, column_pos);
 					}
 				}
 
@@ -201,11 +198,12 @@ load_file_list (GeditWindow         *window,
 
 			// FIXME: pass the GFile to tab when api is there
 			uri = g_file_get_uri (l->data);
-			_gedit_tab_load (tab,
-					 uri,
-					 encoding,
-					 line_pos,
-					 create);
+			_gedit_tab_load_line_column (tab,
+						     uri,
+						     encoding,
+						     line_pos,
+						     column_pos,
+						     create);
 			g_free (uri);
 
 			l = g_slist_next (l);
@@ -223,12 +221,13 @@ load_file_list (GeditWindow         *window,
 
 		// FIXME: pass the GFile to tab when api is there
 		uri = g_file_get_uri (l->data);
-		tab = gedit_window_create_tab_from_uri (window,
-							uri,
-							encoding,
-							line_pos,
-							create,
-							jump_to);
+		tab = gedit_window_create_tab_from_uri_line_column (window,
+								    uri,
+								    encoding,
+								    line_pos,
+								    column_pos,
+								    create,
+								    jump_to);
 		g_free (uri);
 
 		if (tab != NULL)
@@ -282,6 +281,7 @@ load_uri_list (GeditWindow         *window,
 	       const GSList        *uris,
 	       const GeditEncoding *encoding,
 	       gint                 line_pos,
+	       gint                 column_pos,
 	       gboolean             create)
 {
 	GSList *files = NULL;
@@ -299,7 +299,8 @@ load_uri_list (GeditWindow         *window,
 	}
 	files = g_slist_reverse (files);
 
-	ret = load_file_list (window, files, encoding, line_pos, create);
+	ret = load_file_list (window, files, encoding, line_pos, column_pos,
+			      create);
 
 	g_slist_foreach (files, (GFunc) g_object_unref, NULL);
 	g_slist_free (files);
@@ -308,15 +309,16 @@ load_uri_list (GeditWindow         *window,
 }
 
 /**
- * gedit_commands_load_uri:
+ * gedit_commands_load_uri_line_column:
  *
  * Do nothing if URI does not exist
  */
 void
-gedit_commands_load_uri (GeditWindow         *window,
-			 const gchar         *uri,
-			 const GeditEncoding *encoding,
-			 gint                 line_pos)
+gedit_commands_load_uri_line_column (GeditWindow         *window,
+				     const gchar         *uri,
+				     const GeditEncoding *encoding,
+				     gint                 line_pos,
+				     gint                 column_pos)
 {
 	GSList *uris = NULL;
 
@@ -328,28 +330,59 @@ gedit_commands_load_uri (GeditWindow         *window,
 
 	uris = g_slist_prepend (uris, (gchar *)uri);
 
-	load_uri_list (window, uris, encoding, line_pos, FALSE);
+	load_uri_list (window, uris, encoding, line_pos, column_pos, FALSE);
 
 	g_slist_free (uris);
 }
 
 /**
- * gedit_commands_load_uris:
+ * gedit_commands_load_uri:
  *
- * Ignore non-existing URIs 
+ * Deprecated: 2.29.2.  Use gedit_commands_load_uri_line_column instead.
+ */
+void
+gedit_commands_load_uri (GeditWindow         *window,
+			 const gchar         *uri,
+			 const GeditEncoding *encoding,
+			 gint                 line_pos)
+{
+	gedit_commands_load_uri_line_column (window, uri, encoding, line_pos,
+					     0);
+}
+
+/**
+ * gedit_commands_load_uris_line_column:
+ *
+ * Ignore non-existing URIs.
  */
 gint
-gedit_commands_load_uris (GeditWindow         *window,
-			  const GSList        *uris,
-			  const GeditEncoding *encoding,
-			  gint                 line_pos)
+gedit_commands_load_uris_line_column (GeditWindow         *window,
+				      const GSList        *uris,
+				      const GeditEncoding *encoding,
+				      gint                 line_pos,
+				      gint                 column_pos)
 {
 	g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0);
 	g_return_val_if_fail ((uris != NULL) && (uris->data != NULL), 0);
 
 	gedit_debug (DEBUG_COMMANDS);
 
-	return load_uri_list (window, uris, encoding, line_pos, FALSE);
+ 	return load_uri_list (window, uris, encoding, line_pos, column_pos,
+ 			      FALSE);
+}
+
+/**
+ * gedit_commands_load_uris:
+ *
+ * Deprecated: 2.29.2.  Use gedit_commands_load_uris_line_column instead.
+ */
+gint
+gedit_commands_load_uris (GeditWindow         *window,
+			  const GSList        *uris,
+			  const GeditEncoding *encoding,
+			  gint                 line_pos)
+{
+	return gedit_commands_load_uris_line_column (window, uris, encoding, line_pos, 0);
 }
 
 /*
@@ -359,14 +392,16 @@ static gint
 gedit_commands_load_files (GeditWindow         *window,
 			   GSList              *files,
 			   const GeditEncoding *encoding,
-			   gint                 line_pos)
+			   gint                 line_pos,
+			   gint                 column_pos)
 {
 	g_return_val_if_fail (GEDIT_IS_WINDOW (window), 0);
 	g_return_val_if_fail ((files != NULL) && (files->data != NULL), 0);
 
 	gedit_debug (DEBUG_COMMANDS);
 
-	return load_file_list (window, files, encoding, line_pos, FALSE);
+	return load_file_list (window, files, encoding, line_pos, column_pos,
+			       FALSE);
 }
 
 /*
@@ -375,14 +410,35 @@ gedit_commands_load_files (GeditWindow         *window,
  * titled document.
  */
 gint
+_gedit_cmd_load_files_from_prompt_line_column (GeditWindow         *window,
+					       GSList              *files,
+					       const GeditEncoding *encoding,
+					       gint                 line_pos,
+					       gint                 column_pos)
+{
+	gedit_debug (DEBUG_COMMANDS);
+
+	return load_file_list (window, files, encoding, line_pos, column_pos,
+			       TRUE);
+}
+
+/**
+ * _gedit_cmd_load_files_from_prompt
+ *
+ * Deprecated: 2.29.2.  Use
+ * _gedit_cmd_load_files_from_prompt_line_column instead.
+ */
+gint
 _gedit_cmd_load_files_from_prompt (GeditWindow         *window,
 				   GSList              *files,
 				   const GeditEncoding *encoding,
 				   gint                 line_pos)
 {
-	gedit_debug (DEBUG_COMMANDS);
-
-	return load_file_list (window, files, encoding, line_pos, TRUE);
+	return _gedit_cmd_load_files_from_prompt_line_column (window,
+							      files,
+							      encoding,
+							      line_pos,
+							      0);
 }
 
 static void
@@ -426,6 +482,7 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
 	gedit_commands_load_files (window,
 				   files,
 				   encoding,
+				   0,
 				   0);
 
 	g_slist_foreach (files, (GFunc) g_object_unref, NULL);
diff --git a/gedit/gedit-commands.h b/gedit/gedit-commands.h
index 08e7088..05b9ede 100644
--- a/gedit/gedit-commands.h
+++ b/gedit/gedit-commands.h
@@ -40,12 +40,26 @@
 G_BEGIN_DECLS
 
 /* Do nothing if URI does not exist */
+void		 gedit_commands_load_uri_line_column		(GeditWindow         *window,
+								 const gchar         *uri,
+								 const GeditEncoding *encoding,
+								 gint                 line_pos,
+								 gint                 column_pos);
+
+/* Deprecated: 2.29.2.  Use gedit_commands_load_uri_line_column instead.  */
 void		 gedit_commands_load_uri		(GeditWindow         *window,
 							 const gchar         *uri,
 							 const GeditEncoding *encoding,
 							 gint                 line_pos);
 
 /* Ignore non-existing URIs */
+gint		 gedit_commands_load_uris_line_column		(GeditWindow         *window,
+								 const GSList        *uris,
+								 const GeditEncoding *encoding,
+								 gint                 line_pos,
+								 gint                 column_pos);
+
+/* Deprecated: 2.29.2.  Use gedit_commands_load_uris_line_column instead.  */
 gint		 gedit_commands_load_uris		(GeditWindow         *window,
 							 const GSList        *uris,
 							 const GeditEncoding *encoding,
@@ -61,6 +75,14 @@ void		 gedit_commands_save_all_documents 	(GeditWindow         *window);
  */
 
 /* Create titled documens for non-existing URIs */
+gint		_gedit_cmd_load_files_from_prompt_line_column	(GeditWindow         *window,
+								 GSList              *files,
+								 const GeditEncoding *encoding,
+								 gint                 line_pos,
+								 gint                 column_pos);
+
+/* Deprecated: 2.29.2.  Use
+   _gedit_cmd_load_files_from_prompt_line_column instead.  */
 gint		_gedit_cmd_load_files_from_prompt	(GeditWindow         *window,
 							 GSList              *files,
 							 const GeditEncoding *encoding,
diff --git a/gedit/gedit-document-loader.c b/gedit/gedit-document-loader.c
index f528eb0..ee4f427 100644
--- a/gedit/gedit-document-loader.c
+++ b/gedit/gedit-document-loader.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-document-loader.c
  * This file is part of gedit
@@ -382,6 +383,24 @@ gedit_document_loader_new (GeditDocument       *doc,
 
 /* If enconding == NULL, the encoding will be autodetected */
 void
+gedit_document_loader_load_line_column (GeditDocumentLoader *loader)
+{
+	gedit_debug (DEBUG_LOADER);
+
+	g_return_if_fail (GEDIT_IS_DOCUMENT_LOADER (loader));
+
+	/* the loader can be used just once, then it must be thrown away */
+	g_return_if_fail (loader->used == FALSE);
+	loader->used = TRUE;
+
+	if (loader->encoding == NULL)
+		loader->metadata_encoding = get_metadata_encoding (loader->uri);
+
+	GEDIT_DOCUMENT_LOADER_GET_CLASS (loader)->load_line_column (loader);
+}
+
+/* Deprecated: 2.29.2.  Use gedit_document_loader_load_line_column instead.  */
+void
 gedit_document_loader_load (GeditDocumentLoader *loader)
 {
 	gedit_debug (DEBUG_LOADER);
diff --git a/gedit/gedit-document-loader.h b/gedit/gedit-document-loader.h
index 97f6a3d..8eb219b 100644
--- a/gedit/gedit-document-loader.h
+++ b/gedit/gedit-document-loader.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-document-loader.h
  * This file is part of gedit
@@ -83,6 +84,8 @@ struct _GeditDocumentLoaderClass
 			  const GError        *error);
 
 	/* VTable */
+	void			(* load_line_column)	(GeditDocumentLoader *loader);
+	/* Deprecated: 2.29.2.  Use gedit_document_loader_load_line_column instead.  */
 	void			(* load)		(GeditDocumentLoader *loader);
 	gboolean		(* cancel)		(GeditDocumentLoader *loader);
 	const gchar *		(* get_content_type)	(GeditDocumentLoader *loader);
@@ -111,6 +114,8 @@ void			 gedit_document_loader_loading		(GeditDocumentLoader *loader,
 								 gboolean             completed,
 								 GError              *error);
 
+void			 gedit_document_loader_load_line_column	(GeditDocumentLoader *loader);
+/* Deprecated: 2.29.2.  Use gedit_document_loader_load_line_column instead.  */
 void			 gedit_document_loader_load		(GeditDocumentLoader *loader);
 #if 0
 gboolean		 gedit_document_loader_load_from_stdin	(GeditDocumentLoader *loader);
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index aafb422..a473396 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-document.c
  * This file is part of gedit
@@ -73,6 +74,12 @@ PROFILE (static GTimer *timer = NULL)
 
 #define GEDIT_DOCUMENT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GEDIT_TYPE_DOCUMENT, GeditDocumentPrivate))
 
+static void	gedit_document_load_line_column_real	(GeditDocument          *doc,
+							 const gchar            *uri,
+							 const GeditEncoding    *encoding,
+							 gint                    line_pos,
+							 gint                    column_pos,
+							 gboolean                create);
 static void	gedit_document_load_real	(GeditDocument          *doc,
 						 const gchar            *uri,
 						 const GeditEncoding    *encoding,
@@ -125,6 +132,7 @@ struct _GeditDocumentPrivate
 	                              * to a non existing file */
 	const GeditEncoding *requested_encoding;
 	gint                 requested_line_pos;
+	gint                 requested_column_pos;
 
 	/* Saving stuff */
 	GeditDocumentSaver *saver;
@@ -154,6 +162,7 @@ enum {
 enum {
 	CURSOR_MOVED,
 	LOAD,
+	LOAD_LINE_COLUMN,
 	LOADING,
 	LOADED,
 	SAVE,
@@ -401,6 +410,7 @@ gedit_document_class_init (GeditDocumentClass *klass)
 	buf_class->mark_set = gedit_document_mark_set;
 	buf_class->changed = gedit_document_changed;
 
+	klass->load_line_column = gedit_document_load_line_column_real;
 	klass->load = gedit_document_load_real;
 	klass->save = gedit_document_save_real;
 
@@ -485,14 +495,38 @@ gedit_document_class_init (GeditDocumentClass *klass)
 			      0);
 
 	/**
-	 * GeditDocument::load:
+	 * GeditDocument::load_line_column:
 	 * @document: the #GeditDocument.
 	 * @uri: the uri where to load the document from.
 	 * @encoding: the #GeditEncoding to encode the document.
 	 * @line_pos: the line to show.
+	 * @column_pos: the column to visualize.
 	 * @create: whether the document should be created if it doesn't exist.
 	 *
-	 * The "load" signal is emitted when a document is loaded.
+	 * The "load-line-column" signal is emitted when a document is loaded.
+	 *
+	 */
+	document_signals[LOAD_LINE_COLUMN] =
+		g_signal_new ("load-line-column",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (GeditDocumentClass, load_line_column),
+			      NULL, NULL,
+			      gedit_marshal_VOID__STRING_BOXED_INT_BOOLEAN,
+			      G_TYPE_NONE,
+			      4,
+			      G_TYPE_STRING,
+			      /* we rely on the fact that the GeditEncoding pointer stays
+			       * the same forever */
+			      GEDIT_TYPE_ENCODING | G_SIGNAL_TYPE_STATIC_SCOPE,
+			      G_TYPE_INT,
+			      G_TYPE_INT,
+			      G_TYPE_BOOLEAN);
+
+	/**
+	 * GeditDocument::load:
+	 *
+	 * Deprecated: 2.29.2.  Use load_line_column instead.
 	 *
 	 * Since: 2.22
 	 */
@@ -1008,6 +1042,38 @@ reset_temp_loading_data (GeditDocument       *doc)
 
 	doc->priv->requested_encoding = NULL;
 	doc->priv->requested_line_pos = 0;
+	doc->priv->requested_column_pos = 0;
+}
+
+static gboolean
+gedit_document_set_line_column_iter (GeditDocument *doc, gint line, gint column,
+				     GtkTextIter *iter)
+{
+	guint line_count;
+	guint char_count;
+
+	gedit_debug (DEBUG_DOCUMENT);
+	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE);
+	g_return_val_if_fail (line >= -1, FALSE);
+	g_return_val_if_fail (column >= -1, FALSE);
+
+	if (line)
+	{
+		line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc));
+		if (line > line_count)
+			line = line_count;
+		line--;
+	}
+	if (column)
+	{
+		gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc), iter, line);
+		char_count = gtk_text_iter_get_chars_in_line (iter);
+		if (column > char_count)
+			column = char_count + 1;
+		column--;
+	}
+	gtk_text_buffer_get_iter_at_line_offset (GTK_TEXT_BUFFER (doc), iter, line, column);
+	return TRUE;
 }
 
 static void
@@ -1038,13 +1104,12 @@ document_loader_loaded (GeditDocumentLoader *loader,
 		set_uri (doc, NULL, content_type);
 
 		/* move the cursor at the requested line if any */
-		if (doc->priv->requested_line_pos > 0)
-		{
-			/* line_pos - 1 because get_iter_at_line counts from 0 */
-			gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc),
-							  &iter,
-							  doc->priv->requested_line_pos - 1);
-		}
+		if (doc->priv->requested_line_pos > 0
+		    || doc->priv->requested_column_pos > 0)
+			gedit_document_set_line_column_iter (doc,
+							     doc->priv->requested_line_pos,
+							     doc->priv->requested_column_pos,
+							     &iter);
 		/* else, if enabled, to the position stored in the metadata */
 		else if (gedit_prefs_manager_get_restore_cursor_position ())
 		{
@@ -1130,15 +1195,16 @@ document_loader_loading (GeditDocumentLoader *loader,
 }
 
 static void
-gedit_document_load_real (GeditDocument       *doc,
-			  const gchar         *uri,
-			  const GeditEncoding *encoding,
-			  gint                 line_pos,
-			  gboolean             create)
+gedit_document_load_line_column_real (GeditDocument       *doc,
+				      const gchar         *uri,
+				      const GeditEncoding *encoding,
+				      gint                 line_pos,
+				      gint                 column_pos,
+				      gboolean             create)
 {
 	g_return_if_fail (doc->priv->loader == NULL);
 
-	gedit_debug_message (DEBUG_DOCUMENT, "load_real: uri = %s", uri);
+	gedit_debug_message (DEBUG_DOCUMENT, "load_line_column_real: uri = %s", uri);
 
 	/* create a loader. It will be destroyed when loading is completed */
 	doc->priv->loader = gedit_document_loader_new (doc, uri, encoding);
@@ -1151,21 +1217,55 @@ gedit_document_load_real (GeditDocument       *doc,
 	doc->priv->create = create;
 	doc->priv->requested_encoding = encoding;
 	doc->priv->requested_line_pos = line_pos;
+	doc->priv->requested_column_pos = column_pos;
 
 	set_uri (doc, uri, NULL);
 
-	gedit_document_loader_load (doc->priv->loader);
+	gedit_document_loader_load_line_column (doc->priv->loader);
+}
+
+static void
+gedit_document_load_real (GeditDocument       *doc,
+			  const gchar         *uri,
+			  const GeditEncoding *encoding,
+			  gint                 line_pos,
+			  gboolean             create)
+{
+	return gedit_document_load_line_column_real (doc, uri, encoding,
+						     line_pos, 0, create);
 }
 
 /**
- * gedit_document_load:
+ * gedit_document_load_line_column:
  * @doc: the #GeditDocument.
  * @uri: the uri where to load the document from.
  * @encoding: the #GeditEncoding to encode the document.
  * @line_pos: the line to show.
+ * @column_pos: the column to show.
  * @create: whether the document should be created if it doesn't exist.
  *
- * Load a document. This results in the "load" signal to be emitted.
+ * Load a document. This results in the "load-line-column" signal to be emitted.
+ */
+void
+gedit_document_load_line_column (GeditDocument       *doc,
+				 const gchar         *uri,
+				 const GeditEncoding *encoding,
+				 gint                 line_pos,
+				 gint                 column_pos,
+				 gboolean             create)
+{
+	g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
+	g_return_if_fail (uri != NULL);
+	g_return_if_fail (gedit_utils_is_valid_uri (uri));
+
+	g_signal_emit (doc, document_signals[LOAD_LINE_COLUMN], 0, uri,
+		       encoding, line_pos, column_pos, create);
+}
+
+/**
+ * gedit_document_load:
+ *
+ * Deprecated: 2.29.2.  Use gedit_document_load_line_column instead.
  */
 void
 gedit_document_load (GeditDocument       *doc,
@@ -1174,11 +1274,8 @@ gedit_document_load (GeditDocument       *doc,
 		     gint                 line_pos,
 		     gboolean             create)
 {
-	g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
-	g_return_if_fail (uri != NULL);
-	g_return_if_fail (gedit_utils_is_valid_uri (uri));
-
-	g_signal_emit (doc, document_signals[LOAD], 0, uri, encoding, line_pos, create);
+	return gedit_document_load_line_column (doc, uri, encoding,
+						line_pos, 0, create);
 }
 
 /**
@@ -1395,36 +1492,21 @@ gedit_document_get_deleted (GeditDocument *doc)
  * to the last line and FALSE is returned.
  */
 gboolean
-gedit_document_goto_line (GeditDocument *doc, 
-			  gint           line)
+gedit_document_goto_line_column (GeditDocument *doc, gint line, gint column)
 {
-	gboolean ret = TRUE;
-	guint line_count;
 	GtkTextIter iter;
+	gboolean result = gedit_document_set_line_column_iter (doc, line, column, &iter);
 
-	gedit_debug (DEBUG_DOCUMENT);
-
-	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE);
-	g_return_val_if_fail (line >= -1, FALSE);
-
-	line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (doc));
-
-	if (line >= line_count)
-	{
-		ret = FALSE;
-		gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (doc),
-					      &iter);
-	}
-	else
-	{
-		gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (doc),
-						  &iter,
-						  line);
-	}
-
-	gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter);
+	if (result)
+		gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &iter);
+	return result;
+}
 
-	return ret;
+/* Deprecated: 2.29.2.  Use gedit_document_goto_line_column instead.  */
+gboolean
+gedit_document_goto_line (GeditDocument *doc, gint line)
+{
+	return gedit_document_goto_line_column (doc, line, 0);
 }
 
 gboolean
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index 7928601..4acdbe1 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-document.h
  * This file is part of gedit
@@ -102,6 +103,14 @@ struct _GeditDocumentClass
 	void (* cursor_moved)		(GeditDocument    *document);
 
 	/* Document load */
+	void (* load_line_column)	(GeditDocument       *document,
+					 const gchar         *uri,
+					 const GeditEncoding *encoding,
+					 gint                 line_pos,
+					 gint                 column_pos,
+					 gboolean             create);
+
+	/* Deprecated: 2.29.2.  Use load_line_column instead.  */
 	void (* load)			(GeditDocument       *document,
 					 const gchar         *uri,
 					 const GeditEncoding *encoding,
@@ -169,6 +178,14 @@ gchar		*gedit_document_get_mime_type 	(GeditDocument       *doc);
 
 gboolean	 gedit_document_get_readonly 	(GeditDocument       *doc);
 
+void		 gedit_document_load_line_column	(GeditDocument       *doc,
+							 const gchar         *uri,
+							 const GeditEncoding *encoding,
+							 gint                 line_pos,
+							 gint                 column_pos,
+							 gboolean             create); 
+
+/* Deprecated: 2.29.2.  Use gedit_document_load_line_column instead.  */
 void		 gedit_document_load 		(GeditDocument       *doc,
 						 const gchar         *uri,
 						 const GeditEncoding *encoding,
@@ -197,8 +214,13 @@ gboolean	 gedit_document_is_local	(GeditDocument       *doc);
 
 gboolean	 gedit_document_get_deleted	(GeditDocument       *doc);
 
-gboolean	 gedit_document_goto_line 	(GeditDocument       *doc, 
-						 gint                 line);
+gboolean	 gedit_document_goto_line_column (GeditDocument       *doc, 
+						  gint                 line,
+						  gint                 column);
+
+/* Deprecated: 2.29.2.  Use gedit_document_goto_line_column instead.  */
+gboolean	 gedit_document_goto_line	 (GeditDocument       *doc, 
+						  gint                 line);
 
 gboolean	 gedit_document_goto_line_offset(GeditDocument *doc,
 						 gint           line,
diff --git a/gedit/gedit-gio-document-loader.c b/gedit/gedit-gio-document-loader.c
index 1bc65bb..ba3a474 100644
--- a/gedit/gedit-gio-document-loader.c
+++ b/gedit/gedit-gio-document-loader.c
@@ -129,6 +129,7 @@ gedit_gio_document_loader_class_init (GeditGioDocumentLoaderClass *klass)
 
 	object_class->finalize = gedit_gio_document_loader_finalize;
 
+	loader_class->load_line_column = gedit_gio_document_loader_load;
 	loader_class->load = gedit_gio_document_loader_load;
 	loader_class->cancel = gedit_gio_document_loader_cancel;
 	loader_class->get_content_type = gedit_gio_document_loader_get_content_type;
diff --git a/gedit/gedit-session.c b/gedit/gedit-session.c
index 7468664..c2682c8 100644
--- a/gedit/gedit-session.c
+++ b/gedit/gedit-session.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-session.c - Basic session management for gedit
  * This file is part of gedit
@@ -550,12 +551,14 @@ parse_window (GKeyFile *state_file, const char *group_name)
 					     "URI: %s (%s)",
 					     documents[i],
 					     jump_to ? "active" : "not active");
-			gedit_window_create_tab_from_uri (window,
-							  documents[i],
-							  NULL,
-							  0,
-							  FALSE,
-							  jump_to);
+			gedit_window_create_tab_from_uri_line_column
+				(window,
+				 documents[i],
+				 NULL,
+				 0,
+				 0,
+				 FALSE,
+				 jump_to);
 		}
 		g_strfreev (documents);
 	}
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index d4a7a35..60fd3ef 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-tab.c
  * This file is part of gedit
@@ -71,6 +72,7 @@ struct _GeditTabPrivate
 
 	/* tmp data for loading */
 	gint                    tmp_line_pos;
+	gint                    tmp_column_pos;
 	const GeditEncoding    *tmp_encoding;
 	
 	GTimer 		       *timer;
@@ -485,11 +487,12 @@ io_loading_error_message_area_response (GtkWidget        *message_area,
 
 		g_return_if_fail (tab->priv->auto_save_timeout <= 0);
 
-		gedit_document_load (doc,
-				     uri,
-				     tab->priv->tmp_encoding,
-				     tab->priv->tmp_line_pos,
-				     FALSE);
+		gedit_document_load_line_column (doc,
+						 uri,
+						 tab->priv->tmp_encoding,
+						 tab->priv->tmp_line_pos,
+						 tab->priv->tmp_column_pos,
+						 FALSE);
 	}
 	else
 	{
@@ -527,11 +530,12 @@ conversion_loading_error_message_area_response (GtkWidget        *message_area,
 
 		g_return_if_fail (tab->priv->auto_save_timeout <= 0);
 
-		gedit_document_load (doc,
-				     uri,
-				     encoding,
-				     tab->priv->tmp_line_pos,
-				     FALSE);
+		gedit_document_load_line_column (doc,
+						 uri,
+						 encoding,
+						 tab->priv->tmp_line_pos,
+						 tab->priv->tmp_column_pos,
+						 FALSE);
 	}
 	else
 	{
@@ -1092,6 +1096,7 @@ document_loaded (GeditDocument *document,
 	g_free (uri);
 
 	tab->priv->tmp_line_pos = 0;
+	tab->priv->tmp_column_pos = 0;
 	tab->priv->tmp_encoding = NULL;
 }
 
@@ -1625,10 +1630,11 @@ _gedit_tab_new (void)
 /* Whether create is TRUE, creates a new empty document if location does 
    not refer to an existing file */
 GtkWidget *
-_gedit_tab_new_from_uri (const gchar         *uri,
-			 const GeditEncoding *encoding,
-			 gint                 line_pos,			
-			 gboolean             create)
+_gedit_tab_new_from_uri_line_column (const gchar         *uri,
+				     const GeditEncoding *encoding,
+				     gint                 line_pos,
+				     gint                 column_pos,
+				     gboolean             create)
 {
 	GeditTab *tab;
 
@@ -1636,15 +1642,27 @@ _gedit_tab_new_from_uri (const gchar         *uri,
 
 	tab = GEDIT_TAB (_gedit_tab_new ());
 
-	_gedit_tab_load (tab,
-			 uri,
-			 encoding,
-			 line_pos,
-			 create);
+	_gedit_tab_load_line_column (tab,
+				     uri,
+				     encoding,
+				     line_pos,
+				     column_pos,
+				     create);
 
 	return GTK_WIDGET (tab);
 }		
 
+/* Deprecated: 2.29.2.  Use _gedit_tab_new_from_uri_line_column instead.  */
+GtkWidget *
+_gedit_tab_new_from_uri (const gchar         *uri,
+			 const GeditEncoding *encoding,
+			 gint                 line_pos,
+			 gboolean             create)
+{
+	return _gedit_tab_new_from_uri_line_column (uri, encoding,
+						    line_pos, 0, create);
+}		
+
 /**
  * gedit_tab_get_view:
  * @tab: a #GeditTab
@@ -2008,11 +2026,12 @@ gedit_tab_get_from_document (GeditDocument *doc)
 }
 
 void
-_gedit_tab_load (GeditTab            *tab,
-		 const gchar         *uri,
-		 const GeditEncoding *encoding,
-		 gint                 line_pos,
-		 gboolean             create)
+_gedit_tab_load_line_column (GeditTab            *tab,
+			     const gchar         *uri,
+			     const GeditEncoding *encoding,
+			     gint                 line_pos,
+			     gint                 column_pos,
+			     gboolean             create)
 {
 	GeditDocument *doc;
 
@@ -2025,16 +2044,30 @@ _gedit_tab_load (GeditTab            *tab,
 	gedit_tab_set_state (tab, GEDIT_TAB_STATE_LOADING);
 
 	tab->priv->tmp_line_pos = line_pos;
+	tab->priv->tmp_column_pos = column_pos;
 	tab->priv->tmp_encoding = encoding;
 
 	if (tab->priv->auto_save_timeout > 0)
 		remove_auto_save_timeout (tab);
 
-	gedit_document_load (doc,
-			     uri,
-			     encoding,
-			     line_pos,
-			     create);
+	gedit_document_load_line_column (doc,
+					 uri,
+					 encoding,
+					 line_pos,
+					 column_pos,
+					 create);
+}
+
+/* Deprecated: 2.29.2.  Use _gedit_tab_load_line_column instead.  */
+void
+_gedit_tab_load (GeditTab            *tab,
+		 const gchar         *uri,
+		 const GeditEncoding *encoding,
+		 gint                 line_pos,
+		 gboolean             create)
+{
+	return _gedit_tab_load_line_column (tab, uri, encoding, line_pos, 0,
+					    create);
 }
 
 void
@@ -2061,16 +2094,18 @@ _gedit_tab_revert (GeditTab *tab)
 	g_return_if_fail (uri != NULL);
 
 	tab->priv->tmp_line_pos = 0;
+	tab->priv->tmp_column_pos = 0;
 	tab->priv->tmp_encoding = gedit_document_get_encoding (doc);
 
 	if (tab->priv->auto_save_timeout > 0)
 		remove_auto_save_timeout (tab);
 
-	gedit_document_load (doc,
-			     uri,
-			     tab->priv->tmp_encoding,
-			     0,
-			     FALSE);
+	gedit_document_load_line_column (doc,
+					 uri,
+					 tab->priv->tmp_encoding,
+					 0,
+					 0,
+					 FALSE);
 
 	g_free (uri);
 }
diff --git a/gedit/gedit-tab.h b/gedit/gedit-tab.h
index 43d90d2..c12fbc0 100644
--- a/gedit/gedit-tab.h
+++ b/gedit/gedit-tab.h
@@ -128,6 +128,12 @@ GtkWidget 	*_gedit_tab_new 		(void);
 
 /* Whether create is TRUE, creates a new empty document if location does 
    not refer to an existing file */
+GtkWidget	*_gedit_tab_new_from_uri_line_column	(const gchar         *uri,
+							 const GeditEncoding *encoding,
+							 gint                 line_pos,
+							 gint                 column_pos,
+							 gboolean             create);
+/* Deprecated: 2.29.2.  Use _gedit_tab_new_from_uri_line_column instead.  */
 GtkWidget	*_gedit_tab_new_from_uri	(const gchar         *uri,
 						 const GeditEncoding *encoding,
 						 gint                 line_pos,
@@ -135,6 +141,13 @@ GtkWidget	*_gedit_tab_new_from_uri	(const gchar         *uri,
 gchar 		*_gedit_tab_get_name		(GeditTab            *tab);
 gchar 		*_gedit_tab_get_tooltips	(GeditTab            *tab);
 GdkPixbuf 	*_gedit_tab_get_icon		(GeditTab            *tab);
+void		 _gedit_tab_load_line_column	(GeditTab            *tab,
+						 const gchar         *uri,
+						 const GeditEncoding *encoding,
+						 gint                 line_pos,
+						 gint                 column_pos,
+						 gboolean             create);
+/* Deprecated: 2.29.2.  Use _gedit_tab_load_line_column instead.  */
 void		 _gedit_tab_load		(GeditTab            *tab,
 						 const gchar         *uri,
 						 const GeditEncoding *encoding,
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index b999d29..9f752e5 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-view.c
  * This file is part of gedit
@@ -1675,6 +1676,7 @@ search_init (GtkWidget *entry,
 		{
 			gboolean moved, moved_offset;
 			gint line;
+			gint column = 0;
 			gint offset_line = 0;
 			gint line_offset = 0;
 			gchar **split_text = NULL;
@@ -1721,13 +1723,11 @@ search_init (GtkWidget *entry,
 			
 			g_strfreev (split_text);
 			
-			moved = gedit_document_goto_line (doc, line);
-			moved_offset = gedit_document_goto_line_offset (doc, line,
-									line_offset);
-			
+ 			moved = gedit_document_goto_line_column (doc, line, column);
+
 			gedit_view_scroll_to_cursor (view);
 
-			if (!moved || !moved_offset)
+			if (!moved)
 				set_entry_background (view->priv->search_entry,
 						      GEDIT_SEARCH_ENTRY_NOT_FOUND);
 			else
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 680393c..ed48285 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-window.c
  * This file is part of gedit
@@ -1132,7 +1133,8 @@ open_recent_file (const gchar *uri,
 
 	uris = g_slist_prepend (uris, (gpointer) uri);
 
-	if (gedit_commands_load_uris (window, uris, NULL, 0) != 1)
+	if (gedit_commands_load_uris_line_column (window, uris, NULL, 0, 0)
+	    != 1)
 	{
 		_gedit_recent_remove (window, uri);
 	}
@@ -2729,10 +2731,11 @@ load_uris_from_drop (GeditWindow  *window,
 	}
 
 	uris = g_slist_reverse (uris);
-	gedit_commands_load_uris (window,
-				  uris,
-				  NULL,
-				  0);
+	gedit_commands_load_uris_line_column (window,
+					      uris,
+					      NULL,
+					      0,
+					      0);
 
 	g_slist_free (uris);
 }
@@ -3999,11 +4002,12 @@ gedit_window_create_tab (GeditWindow *window,
 }
 
 /**
- * gedit_window_create_tab_from_uri:
+ * gedit_window_create_tab_from_uri_line_column:
  * @window: a #GeditWindow
  * @uri: the uri of the document
  * @encoding: a #GeditEncoding
  * @line_pos: the line position to visualize
+ * @colum_pos: the column position to visualize
  * @create: %TRUE to create a new document in case @uri does exist
  * @jump_to: %TRUE to set the new #GeditTab as active
  *
@@ -4015,22 +4019,24 @@ gedit_window_create_tab (GeditWindow *window,
  * Returns: a new #GeditTab
  */
 GeditTab *
-gedit_window_create_tab_from_uri (GeditWindow         *window,
-				  const gchar         *uri,
-				  const GeditEncoding *encoding,
-				  gint                 line_pos,
-				  gboolean             create,
-				  gboolean             jump_to)
+gedit_window_create_tab_from_uri_line_column (GeditWindow         *window,
+					      const gchar         *uri,
+					      const GeditEncoding *encoding,
+					      gint                 line_pos,
+					      gint                 column_pos,
+					      gboolean             create,
+					      gboolean             jump_to)
 {
 	GtkWidget *tab;
 
 	g_return_val_if_fail (GEDIT_IS_WINDOW (window), NULL);
 	g_return_val_if_fail (uri != NULL, NULL);
 
-	tab = _gedit_tab_new_from_uri (uri,
-				       encoding,
-				       line_pos,
-				       create);	
+	tab = _gedit_tab_new_from_uri_line_column (uri,
+						   encoding,
+						   line_pos,
+						   column_pos,
+						   create);
 	if (tab == NULL)
 		return NULL;
 
@@ -4045,6 +4051,25 @@ gedit_window_create_tab_from_uri (GeditWindow         *window,
 }				  
 
 /**
+ * gedit_window_create_tab_from_uri:
+ *
+ * Deprecated: 2.29.2.  Use
+ * gedit_window_create_tab_from_uri_line_column instead.  */
+GeditTab *
+gedit_window_create_tab_from_uri (GeditWindow         *window,
+				  const gchar         *uri,
+				  const GeditEncoding *encoding,
+				  gint                 line_pos,
+				  gboolean             create,
+				  gboolean             jump_to)
+{
+	return gedit_window_create_tab_from_uri_line_column (window, uri,
+							     encoding,
+							     line_pos, 0,
+							     create, jump_to);
+}
+
+/**
  * gedit_window_get_active_tab:
  * @window: a GeditWindow
  *
diff --git a/gedit/gedit-window.h b/gedit/gedit-window.h
index e8c7eef..efb1a6c 100644
--- a/gedit/gedit-window.h
+++ b/gedit/gedit-window.h
@@ -105,6 +105,16 @@ GType 		 gedit_window_get_type 			(void) G_GNUC_CONST;
 GeditTab	*gedit_window_create_tab		(GeditWindow         *window,
 							 gboolean             jump_to);
 							 
+GeditTab	*gedit_window_create_tab_from_uri_line_column	(GeditWindow         *window,
+								 const gchar         *uri,
+								 const GeditEncoding *encoding,
+								 gint                 line_pos,
+								 gint                 column_pos,
+								 gboolean             create,
+								 gboolean             jump_to);
+							 
+/* Deprecated: 2.29.2.  Use
+   gedit_window_create_tab_from_uri_line_column instead.  */
 GeditTab	*gedit_window_create_tab_from_uri	(GeditWindow         *window,
 							 const gchar         *uri,
 							 const GeditEncoding *encoding,
@@ -112,6 +122,7 @@ GeditTab	*gedit_window_create_tab_from_uri	(GeditWindow         *window,
 							 gboolean             create,
 							 gboolean             jump_to);
 							 
+
 void		 gedit_window_close_tab			(GeditWindow         *window,
 							 GeditTab            *tab);
 							 
diff --git a/gedit/gedit.c b/gedit/gedit.c
index 03a1705..9c02724 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit.c
  * This file is part of gedit
@@ -81,6 +82,8 @@ static BaconMessageConnection *connection;
 
 /* command line */
 static gint line_position = 0;
+static gint column_position = 0;
+static gchar *line_column_position = NULL;
 static gchar *encoding_charset = NULL;
 static gboolean new_window_option = FALSE;
 static gboolean new_document_option = FALSE;
@@ -128,6 +131,9 @@ static const GOptionEntry options [] =
 	{ "new-document", '\0', 0, G_OPTION_ARG_NONE, &new_document_option,
 	  N_("Create a new document in an existing instance of gedit"), NULL },
 
+	{ "+LINE[:COLUMN]", '\0', 0, G_OPTION_ARG_NONE, &line_column_position,
+	  N_("    Move cursor to LINE, COLUMN"), NULL },
+
 	{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args,
 	  NULL, N_("[FILE...]") }, /* collects file arguments */
 
@@ -150,6 +156,20 @@ free_command_line_data (void)
 	new_window_option = FALSE;
 	new_document_option = FALSE;
 	line_position = 0;
+	column_position = 0;
+}
+
+static void
+get_line_column_position (char const* arg)
+{
+	char const* p;
+
+	p = strchr (arg, ':');
+	if (p != NULL)
+		column_position = atoi (p + 1);
+	else
+		column_position = 0;
+	line_position = atoi (arg + 1);
 }
 
 static void
@@ -164,10 +184,13 @@ gedit_get_command_line_data (void)
 			if (*remaining_args[i] == '+')
 			{
 				if (*(remaining_args[i] + 1) == '\0')
+				{
 					/* goto the last line of the document */
 					line_position = G_MAXINT;
+					column_position = 0;
+				}
 				else
-					line_position = atoi (remaining_args[i] + 1);
+					get_line_column_position (remaining_args[i]);
 			}
 			else
 			{
@@ -313,7 +336,7 @@ on_message_received (const char *message,
 			gint n_uris, j;
 			gchar **uris;
 
-			line_position = atoi (params[1]);
+ 			get_line_column_position (params[1]);
 
 			if (params[2] != '\0')
 				encoding = gedit_encoding_get_from_charset (params[2]);
@@ -363,10 +386,11 @@ on_message_received (const char *message,
 
 	if (file_list != NULL)
 	{
-		_gedit_cmd_load_files_from_prompt (window,
-						   file_list,
-						   encoding,
-						   line_position);
+		_gedit_cmd_load_files_from_prompt_line_column (window,
+							       file_list,
+							       encoding,
+							       line_position,
+							       column_position);
 
 		if (new_document_option)
 			gedit_window_create_tab (window, TRUE);
@@ -470,7 +494,7 @@ send_bacon_message (void)
 		command = g_string_append (command, "NEW-DOCUMENT");
 	}
 
-	/* OPEN_URIS command, optionally specify line_num and encoding */
+	/* OPEN_URIS command, optionally specify +line:column and encoding */
 	if (file_list)
 	{
 		GSList *l;
@@ -479,8 +503,8 @@ send_bacon_message (void)
 		command = g_string_append (command, "OPEN-URIS");
 
 		g_string_append_printf (command,
-					"\t%d\t%s\t%u\t",
-					line_position,
+					"\t+%d:%d\t%s\t%u\t",
+					line_position, column_position,
 					encoding_charset ? encoding_charset : "",
 					g_slist_length (file_list));
 
@@ -708,10 +732,12 @@ main (int argc, char *argv[])
 				encoding = gedit_encoding_get_from_charset (encoding_charset);
 		
 			gedit_debug_message (DEBUG_APP, "Load files");
-			_gedit_cmd_load_files_from_prompt (window, 
-							   file_list, 
-							   encoding, 
-							   line_position);
+			_gedit_cmd_load_files_from_prompt_line_column
+				(window,
+				 file_list,
+				 encoding,
+				 line_position,
+				 column_position);
 		}
 		else
 		{
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index ba37e20..6c63339 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * gedit-file-browser-plugin.c - Gedit plugin providing easy file access 
  * from the sidepanel
@@ -845,7 +846,7 @@ static void
 on_uri_activated_cb (GeditFileBrowserWidget * tree_widget,
 		     gchar const *uri, GeditWindow * window)
 {
-	gedit_commands_load_uri (window, uri, NULL, 0);
+	gedit_commands_load_uri_line_column (window, uri, NULL, 0, 0);
 }
 
 static void
-- 
1.6.3.3


