[latexila/releases-2-2: 95/95] Release 2.1.1 (beta release)



commit 96b8ffa3a6120613b7337f128041b390e427fdb8
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Fri Jul 15 20:26:20 2011 +0200

    Release 2.1.1 (beta release)
    
    The tarball is based on this commit.

 src/C/app_settings.c         |  146 +-
 src/C/application.c          |  193 ++-
 src/C/build_tool_dialog.c    |  128 +-
 src/C/build_tool_runner.c    |  297 +++--
 src/C/build_tools.c          |   71 +-
 src/C/build_view.c           |  115 +-
 src/C/clean_build_files.c    |  943 +++++++++++++
 src/C/completion.c           |  547 +++++---
 src/C/custom_statusbar.c     |    2 +-
 src/C/dialogs.c              |  380 +-----
 src/C/document.c             |  605 +++-----
 src/C/document_structure.c   | 3206 ++++++++++++++++++++++++++++++++----------
 src/C/document_tab.c         |  332 +++---
 src/C/document_view.c        |   80 +-
 src/C/documents_panel.c      |  110 +-
 src/C/encodings.c            |    2 +-
 src/C/file_browser.c         |  282 +++--
 src/C/latex_menu.c           |   14 +-
 src/C/latex_post_processor.c |  245 ++--
 src/C/main.c                 |   20 +-
 src/C/main_window.c          | 1158 +++++++++------
 src/C/menu_in_toolbar.c      |    2 +-
 src/C/most_used_symbols.c    |   22 +-
 src/C/post_processors.c      |  212 ++--
 src/C/preferences_dialog.c   |  586 +++++---
 src/C/project_dialogs.c      |   78 +-
 src/C/projects.c             |   22 +-
 src/C/search.c               |  329 +++--
 src/C/side_panel.c           |   20 +-
 src/C/structure.c            | 2024 +++++++++++++++++----------
 src/C/structure_model.c      | 1962 ++++++++++++++++++++++++++
 src/C/symbols.c              |  138 +-
 src/C/tab_info_bar.c         |   14 +-
 src/C/templates.c            |  264 +++--
 src/C/utils.c                |  262 ++++-
 35 files changed, 10293 insertions(+), 4518 deletions(-)
---
diff --git a/src/C/app_settings.c b/src/C/app_settings.c
index 0395e86..2c7edc5 100644
--- a/src/C/app_settings.c
+++ b/src/C/app_settings.c
@@ -1,4 +1,4 @@
-/* app_settings.c generated by valac 0.12.0, the Vala compiler
+/* app_settings.c generated by valac 0.12.1, the Vala compiler
  * generated from app_settings.vala, do not modify */
 
 /*
@@ -133,42 +133,42 @@ static void _lambda3_ (GSettings* setting, const gchar* key, AppSettings* self);
 static void app_settings_set_font (AppSettings* self, const gchar* font);
 const gchar* app_settings_get_system_font (AppSettings* self);
 static void __lambda3__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda87_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda87__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda88_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda88__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda89_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void _lambda101_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda101__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda102_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda102__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda103_ (GSettings* setting, const gchar* key, AppSettings* self);
 GType application_get_type (void) G_GNUC_CONST;
 Application* application_get_default (void);
 GType document_get_type (void) G_GNUC_CONST;
 GList* application_get_documents (Application* self);
 static void _g_object_unref0_ (gpointer var);
 static void _g_list_free__g_object_unref0_ (GList* self);
-static void __lambda89__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda90_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda103__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda104_ (GSettings* setting, const gchar* key, AppSettings* self);
 GType document_view_get_type (void) G_GNUC_CONST;
 GList* application_get_views (Application* self);
-static void __lambda90__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda91_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda91__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda92_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda92__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda93_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda93__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda94_ (GSettings* setting, const gchar* key, AppSettings* self);
-static void __lambda94__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda95_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda104__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda105_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda105__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda106_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda106__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda107_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda107__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda108_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda108__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda109_ (GSettings* setting, const gchar* key, AppSettings* self);
 GType document_tab_get_type (void) G_GNUC_CONST;
 void document_tab_set_auto_save (DocumentTab* self, gboolean value);
-static void __lambda95__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda96_ (GSettings* setting, const gchar* key, AppSettings* self);
+static void __lambda109__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda110_ (GSettings* setting, const gchar* key, AppSettings* self);
 void document_tab_set_auto_save_interval (DocumentTab* self, guint value);
-static void __lambda96__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda97_ (GSettings* setting, const gchar* key, AppSettings* self);
-static gboolean _lambda98_ (AppSettings* self);
+static void __lambda110__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda111_ (GSettings* setting, const gchar* key, AppSettings* self);
+static gboolean _lambda112_ (AppSettings* self);
 void symbols_reload_most_used_symbols (void);
-static gboolean __lambda98__gsource_func (gpointer self);
-static void __lambda97__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static gboolean __lambda112__gsource_func (gpointer self);
+static void __lambda111__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
 void document_view_set_font_from_string (DocumentView* self, const gchar* font);
 static void app_settings_finalize (GObject* obj);
 static void _vala_app_settings_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
@@ -230,7 +230,7 @@ static void __lambda3__g_settings_changed (GSettings* _sender, const gchar* key,
 }
 
 
-static void _lambda87_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda101_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	gchar* _tmp1_ = NULL;
@@ -259,12 +259,12 @@ static void _lambda87_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda87__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda87_ (_sender, key, self);
+static void __lambda101__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda101_ (_sender, key, self);
 }
 
 
-static void _lambda88_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda102_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gchar* _tmp1_ = NULL;
 	gchar* _tmp2_;
@@ -281,8 +281,8 @@ static void _lambda88_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda88__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda88_ (_sender, key, self);
+static void __lambda102__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda102_ (_sender, key, self);
 }
 
 
@@ -297,7 +297,7 @@ static void _g_list_free__g_object_unref0_ (GList* self) {
 }
 
 
-static void _lambda89_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda103_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gchar* _tmp0_ = NULL;
 	gchar* scheme_id;
 	GtkSourceStyleSchemeManager* _tmp1_ = NULL;
@@ -347,12 +347,12 @@ static void _lambda89_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda89__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda89_ (_sender, key, self);
+static void __lambda103__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda103_ (_sender, key, self);
 }
 
 
-static void _lambda90_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda104_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	guint val = 0U;
 	guint _tmp0_;
 	Application* _tmp1_ = NULL;
@@ -388,12 +388,12 @@ static void _lambda90_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda90__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda90_ (_sender, key, self);
+static void __lambda104__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda104_ (_sender, key, self);
 }
 
 
-static void _lambda91_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda105_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	Application* _tmp1_ = NULL;
@@ -428,12 +428,12 @@ static void _lambda91_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda91__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda91_ (_sender, key, self);
+static void __lambda105__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda105_ (_sender, key, self);
 }
 
 
-static void _lambda92_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda106_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	Application* _tmp1_ = NULL;
@@ -468,12 +468,12 @@ static void _lambda92_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda92__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda92_ (_sender, key, self);
+static void __lambda106__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda106_ (_sender, key, self);
 }
 
 
-static void _lambda93_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda107_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	Application* _tmp1_ = NULL;
@@ -508,12 +508,12 @@ static void _lambda93_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda93__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda93_ (_sender, key, self);
+static void __lambda107__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda107_ (_sender, key, self);
 }
 
 
-static void _lambda94_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda108_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	Application* _tmp1_ = NULL;
@@ -548,12 +548,12 @@ static void _lambda94_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda94__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda94_ (_sender, key, self);
+static void __lambda108__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda108_ (_sender, key, self);
 }
 
 
-static void _lambda95_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda109_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	gboolean _tmp0_;
 	gboolean val;
 	Application* _tmp1_ = NULL;
@@ -588,12 +588,12 @@ static void _lambda95_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda95__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda95_ (_sender, key, self);
+static void __lambda109__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda109_ (_sender, key, self);
 }
 
 
-static void _lambda96_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda110_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	guint val = 0U;
 	Application* _tmp0_ = NULL;
 	Application* _tmp1_;
@@ -626,12 +626,12 @@ static void _lambda96_ (GSettings* setting, const gchar* key, AppSettings* self)
 }
 
 
-static void __lambda96__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda96_ (_sender, key, self);
+static void __lambda110__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda110_ (_sender, key, self);
 }
 
 
-static gboolean _lambda98_ (AppSettings* self) {
+static gboolean _lambda112_ (AppSettings* self) {
 	gboolean result = FALSE;
 	self->priv->timeout_id = (guint) 0;
 	symbols_reload_most_used_symbols ();
@@ -640,27 +640,27 @@ static gboolean _lambda98_ (AppSettings* self) {
 }
 
 
-static gboolean __lambda98__gsource_func (gpointer self) {
+static gboolean __lambda112__gsource_func (gpointer self) {
 	gboolean result;
-	result = _lambda98_ (self);
+	result = _lambda112_ (self);
 	return result;
 }
 
 
-static void _lambda97_ (GSettings* setting, const gchar* key, AppSettings* self) {
+static void _lambda111_ (GSettings* setting, const gchar* key, AppSettings* self) {
 	guint _tmp0_;
 	g_return_if_fail (setting != NULL);
 	g_return_if_fail (key != NULL);
 	if (self->priv->timeout_id != 0) {
 		g_source_remove (self->priv->timeout_id);
 	}
-	_tmp0_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda98__gsource_func, g_object_ref (self), g_object_unref);
+	_tmp0_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda112__gsource_func, g_object_ref (self), g_object_unref);
 	self->priv->timeout_id = _tmp0_;
 }
 
 
-static void __lambda97__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda97_ (_sender, key, self);
+static void __lambda111__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda111_ (_sender, key, self);
 }
 
 
@@ -693,17 +693,17 @@ static void app_settings_initialize (AppSettings* self) {
 		_g_free0 (_tmp6_);
 		g_signal_connect_object (self->priv->desktop_interface, "changed::monospace-font-name", (GCallback) __lambda3__g_settings_changed, self, 0);
 	}
-	g_signal_connect_object (self->priv->editor, "changed::use-default-font", (GCallback) __lambda87__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::editor-font", (GCallback) __lambda88__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::scheme", (GCallback) __lambda89__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::tabs-size", (GCallback) __lambda90__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::insert-spaces", (GCallback) __lambda91__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::display-line-numbers", (GCallback) __lambda92__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::highlight-current-line", (GCallback) __lambda93__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::bracket-matching", (GCallback) __lambda94__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::auto-save", (GCallback) __lambda95__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::auto-save-interval", (GCallback) __lambda96__g_settings_changed, self, 0);
-	g_signal_connect_object (self->priv->editor, "changed::nb-most-used-symbols", (GCallback) __lambda97__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::use-default-font", (GCallback) __lambda101__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::editor-font", (GCallback) __lambda102__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::scheme", (GCallback) __lambda103__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::tabs-size", (GCallback) __lambda104__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::insert-spaces", (GCallback) __lambda105__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::display-line-numbers", (GCallback) __lambda106__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::highlight-current-line", (GCallback) __lambda107__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::bracket-matching", (GCallback) __lambda108__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::auto-save", (GCallback) __lambda109__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::auto-save-interval", (GCallback) __lambda110__g_settings_changed, self, 0);
+	g_signal_connect_object (self->priv->editor, "changed::nb-most-used-symbols", (GCallback) __lambda111__g_settings_changed, self, 0);
 	_g_object_unref0 (prefs);
 }
 
diff --git a/src/C/application.c b/src/C/application.c
index 7529927..ed06f48 100644
--- a/src/C/application.c
+++ b/src/C/application.c
@@ -1,4 +1,4 @@
-/* application.c generated by valac 0.12.0, the Vala compiler
+/* application.c generated by valac 0.12.1, the Vala compiler
  * generated from application.vala, do not modify */
 
 /*
@@ -91,7 +91,7 @@ typedef struct _DocumentClass DocumentClass;
 
 typedef struct _DocumentView DocumentView;
 typedef struct _DocumentViewClass DocumentViewClass;
-typedef struct _Block22Data Block22Data;
+typedef struct _Block20Data Block20Data;
 
 #define TYPE_PROJECTS (projects_get_type ())
 #define PROJECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROJECTS, Projects))
@@ -156,7 +156,7 @@ struct _ApplicationStockIcon {
 	gchar* stock_id;
 };
 
-struct _Block22Data {
+struct _Block20Data {
 	int _ref_count_;
 	Application * self;
 	MainWindow* window;
@@ -188,6 +188,7 @@ static void application_set_windows (Application* self, GList* value);
 static void _g_object_unref0_ (gpointer var);
 static void _g_list_free__g_object_unref0_ (GList* self);
 static void application_register_my_stock_icons (Application* self);
+static void application_add_theme_icon_to_stock (Application* self, const gchar* icon_name, const gchar* stock_id);
 GType app_settings_get_type (void) G_GNUC_CONST;
 AppSettings* app_settings_get_default (void);
 MainWindow* application_create_window (Application* self, GdkScreen* screen);
@@ -205,12 +206,12 @@ gboolean main_window_is_on_workspace_screen (MainWindow* self, GdkScreen* screen
 static void application_set_active_window (Application* self, MainWindow* value);
 void application_create_document (Application* self);
 void application_open_documents (Application* self, gchar** uris);
-static Block22Data* block22_data_ref (Block22Data* _data22_);
-static void block22_data_unref (Block22Data* _data22_);
+static Block20Data* block20_data_ref (Block20Data* _data20_);
+static void block20_data_unref (Block20Data* _data20_);
 void main_window_save_state (MainWindow* self, gboolean sync);
 MainWindow* main_window_new (void);
 MainWindow* main_window_construct (GType object_type);
-static void _lambda70_ (Block22Data* _data22_);
+static void _lambda82_ (Block20Data* _data20_);
 gpointer projects_ref (gpointer instance);
 void projects_unref (gpointer instance);
 GParamSpec* param_spec_projects (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -232,9 +233,9 @@ void build_tools_save (BuildTools* self);
 GType most_used_symbols_get_type (void) G_GNUC_CONST;
 MostUsedSymbols* most_used_symbols_get_default (void);
 void most_used_symbols_save (MostUsedSymbols* self);
-static void __lambda70__gtk_object_destroy (GtkObject* _sender, gpointer self);
-static gboolean _lambda71_ (Block22Data* _data22_);
-static gboolean __lambda71__gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
+static void __lambda82__gtk_object_destroy (GtkObject* _sender, gpointer self);
+static gboolean _lambda83_ (Block20Data* _data20_);
+static gboolean __lambda83__gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
 GType document_tab_get_type (void) G_GNUC_CONST;
 DocumentTab* main_window_create_tab (MainWindow* self, gboolean jump_to);
 DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
@@ -245,7 +246,7 @@ static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNoti
 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 static gint _vala_array_length (gpointer array);
 
-static const ApplicationStockIcon APPLICATION_stock_icons[84] = {{DATA_DIR "/images/icons/compile_dvi.png", "compile_dvi"}, {DATA_DIR "/images/icons/compile_pdf.png", "compile_pdf"}, {DATA_DIR "/images/icons/compile_ps.png", "compile_ps"}, {DATA_DIR "/images/icons/view_dvi.png", "view_dvi"}, {DATA_DIR "/images/icons/view_pdf.png", "view_pdf"}, {DATA_DIR "/images/icons/view_ps.png", "view_ps"}, {DATA_DIR "/images/icons/textbf.png", "bold"}, {DATA_DIR "/images/icons/textit.png", "italic"}, {DATA_DIR "/images/icons/texttt.png", "typewriter"}, {DATA_DIR "/images/icons/textsl.png", "slanted"}, {DATA_DIR "/images/icons/textsc.png", "small_caps"}, {DATA_DIR "/images/icons/textsf.png", "sans_serif"}, {DATA_DIR "/images/icons/roman.png", "roman"}, {DATA_DIR "/images/icons/underline.png", "underline"}, {DATA_DIR "/images/misc-math/set-R.png", "blackboard"}, {DATA_DIR "/images/icons/sectioning-part.png", "sectioning-part"}, {DATA_DIR "/images/icons/sectioning-chapter.png", "sectioning-
 chapter"}, {DATA_DIR "/images/icons/sectioning-section.png", "sectioning-section"}, {DATA_DIR "/images/icons/sectioning-subsection.png", "sectioning-subsection"}, {DATA_DIR "/images/icons/sectioning-subsubsection.png", "sectioning-subsubsection"}, {DATA_DIR "/images/icons/sectioning-paragraph.png", "sectioning-paragraph"}, {DATA_DIR "/images/icons/character-size.png", "character-size"}, {DATA_DIR "/images/icons/list-itemize.png", "list-itemize"}, {DATA_DIR "/images/icons/list-enumerate.png", "list-enumerate"}, {DATA_DIR "/images/icons/list-description.png", "list-description"}, {DATA_DIR "/images/icons/list-item.png", "list-item"}, {DATA_DIR "/images/icons/references.png", "references"}, {DATA_DIR "/images/icons/math.png", "math"}, {DATA_DIR "/images/icons/math-centered.png", "math-centered"}, {DATA_DIR "/images/icons/math-numbered.png", "math-numbered"}, {DATA_DIR "/images/icons/math-array.png", "math-array"}, {DATA_DIR "/images/icons/math-numbered-array.png", "math-numbere
 d-array"}, {DATA_DIR "/images/icons/math-superscript.png", "math-superscript"}, {DATA_DIR "/images/icons/math-subscript.png", "math-subscript"}, {DATA_DIR "/images/icons/math-frac.png", "math-frac"}, {DATA_DIR "/images/icons/math-square-root.png", "math-square-root"}, {DATA_DIR "/images/icons/math-nth-root.png", "math-nth-root"}, {DATA_DIR "/images/icons/mathcal.png", "mathcal"}, {DATA_DIR "/images/icons/mathfrak.png", "mathfrak"}, {DATA_DIR "/images/icons/delimiters-left.png", "delimiters-left"}, {DATA_DIR "/images/icons/delimiters-right.png", "delimiters-right"}, {DATA_DIR "/images/icons/badbox.png", "badbox"}, {DATA_DIR "/images/icons/logviewer.png", "view_log"}, {DATA_DIR "/images/greek/01.png", "symbol_alpha"}, {DATA_DIR "/images/icons/accent0.png", "accent0"}, {DATA_DIR "/images/icons/accent1.png", "accent1"}, {DATA_DIR "/images/icons/accent2.png", "accent2"}, {DATA_DIR "/images/icons/accent3.png", "accent3"}, {DATA_DIR "/images/icons/accent4.png", "accent4"}, {DATA_DI
 R "/images/icons/accent5.png", "accent5"}, {DATA_DIR "/images/icons/accent6.png", "accent6"}, {DATA_DIR "/images/icons/accent7.png", "accent7"}, {DATA_DIR "/images/icons/accent8.png", "accent8"}, {DATA_DIR "/images/icons/accent9.png", "accent9"}, {DATA_DIR "/images/icons/accent10.png", "accent10"}, {DATA_DIR "/images/icons/accent11.png", "accent11"}, {DATA_DIR "/images/icons/accent12.png", "accent12"}, {DATA_DIR "/images/icons/accent13.png", "accent13"}, {DATA_DIR "/images/icons/accent14.png", "accent14"}, {DATA_DIR "/images/icons/accent15.png", "accent15"}, {DATA_DIR "/images/icons/mathaccent0.png", "mathaccent0"}, {DATA_DIR "/images/icons/mathaccent1.png", "mathaccent1"}, {DATA_DIR "/images/icons/mathaccent2.png", "mathaccent2"}, {DATA_DIR "/images/icons/mathaccent3.png", "mathaccent3"}, {DATA_DIR "/images/icons/mathaccent4.png", "mathaccent4"}, {DATA_DIR "/images/icons/mathaccent5.png", "mathaccent5"}, {DATA_DIR "/images/icons/mathaccent6.png", "mathaccent6"}, {DATA_DIR "
 /images/icons/mathaccent7.png", "mathaccent7"}, {DATA_DIR "/images/icons/mathaccent8.png", "mathaccent8"}, {DATA_DIR "/images/icons/mathaccent9.png", "mathaccent9"}, {DATA_DIR "/images/icons/mathaccent10.png", "mathaccent10"}, {DATA_DIR "/images/icons/completion_choice.png", "completion_choice"}, {DATA_DIR "/images/icons/completion_cmd.png", "completion_cmd"}, {DATA_DIR "/images/icons/image.png", "image"}, {DATA_DIR "/images/icons/tree_part.png", "tree_part"}, {DATA_DIR "/images/icons/tree_chapter.png", "tree_chapter"}, {DATA_DIR "/images/icons/tree_section.png", "tree_section"}, {DATA_DIR "/images/icons/tree_subsection.png", "tree_subsection"}, {DATA_DIR "/images/icons/tree_subsubsection.png", "tree_subsubsection"}, {DATA_DIR "/images/icons/tree_paragraph.png", "tree_paragraph"}, {DATA_DIR "/images/icons/tree_include.png", "tree_include"}, {DATA_DIR "/images/icons/tree_todo.png", "tree_todo"}, {DATA_DIR "/images/icons/tree_label.png", "tree_label"}, {DATA_DIR "/images/icons
 /table.png", "table"}};
+static const ApplicationStockIcon APPLICATION_stock_icons[82] = {{DATA_DIR "/images/icons/compile_dvi.png", "compile_dvi"}, {DATA_DIR "/images/icons/compile_pdf.png", "compile_pdf"}, {DATA_DIR "/images/icons/compile_ps.png", "compile_ps"}, {DATA_DIR "/images/icons/view_dvi.png", "view_dvi"}, {DATA_DIR "/images/icons/view_pdf.png", "view_pdf"}, {DATA_DIR "/images/icons/view_ps.png", "view_ps"}, {DATA_DIR "/images/icons/textbf.png", "bold"}, {DATA_DIR "/images/icons/textit.png", "italic"}, {DATA_DIR "/images/icons/texttt.png", "typewriter"}, {DATA_DIR "/images/icons/textsl.png", "slanted"}, {DATA_DIR "/images/icons/textsc.png", "small_caps"}, {DATA_DIR "/images/icons/textsf.png", "sans_serif"}, {DATA_DIR "/images/icons/roman.png", "roman"}, {DATA_DIR "/images/icons/underline.png", "underline"}, {DATA_DIR "/images/misc-math/set-R.png", "blackboard"}, {DATA_DIR "/images/icons/sectioning-part.png", "sectioning-part"}, {DATA_DIR "/images/icons/sectioning-chapter.png", "sectioning-
 chapter"}, {DATA_DIR "/images/icons/sectioning-section.png", "sectioning-section"}, {DATA_DIR "/images/icons/sectioning-subsection.png", "sectioning-subsection"}, {DATA_DIR "/images/icons/sectioning-subsubsection.png", "sectioning-subsubsection"}, {DATA_DIR "/images/icons/sectioning-paragraph.png", "sectioning-paragraph"}, {DATA_DIR "/images/icons/character-size.png", "character-size"}, {DATA_DIR "/images/icons/list-itemize.png", "list-itemize"}, {DATA_DIR "/images/icons/list-enumerate.png", "list-enumerate"}, {DATA_DIR "/images/icons/list-description.png", "list-description"}, {DATA_DIR "/images/icons/list-item.png", "list-item"}, {DATA_DIR "/images/icons/references.png", "references"}, {DATA_DIR "/images/icons/math.png", "math"}, {DATA_DIR "/images/icons/math-centered.png", "math-centered"}, {DATA_DIR "/images/icons/math-numbered.png", "math-numbered"}, {DATA_DIR "/images/icons/math-array.png", "math-array"}, {DATA_DIR "/images/icons/math-numbered-array.png", "math-numbere
 d-array"}, {DATA_DIR "/images/icons/math-superscript.png", "math-superscript"}, {DATA_DIR "/images/icons/math-subscript.png", "math-subscript"}, {DATA_DIR "/images/icons/math-frac.png", "math-frac"}, {DATA_DIR "/images/icons/math-square-root.png", "math-square-root"}, {DATA_DIR "/images/icons/math-nth-root.png", "math-nth-root"}, {DATA_DIR "/images/icons/mathcal.png", "mathcal"}, {DATA_DIR "/images/icons/mathfrak.png", "mathfrak"}, {DATA_DIR "/images/icons/delimiters-left.png", "delimiters-left"}, {DATA_DIR "/images/icons/delimiters-right.png", "delimiters-right"}, {DATA_DIR "/images/icons/badbox.png", "badbox"}, {DATA_DIR "/images/icons/logviewer.png", "view_log"}, {DATA_DIR "/images/greek/01.png", "symbol_alpha"}, {DATA_DIR "/images/icons/accent0.png", "accent0"}, {DATA_DIR "/images/icons/accent1.png", "accent1"}, {DATA_DIR "/images/icons/accent2.png", "accent2"}, {DATA_DIR "/images/icons/accent3.png", "accent3"}, {DATA_DIR "/images/icons/accent4.png", "accent4"}, {DATA_DI
 R "/images/icons/accent5.png", "accent5"}, {DATA_DIR "/images/icons/accent6.png", "accent6"}, {DATA_DIR "/images/icons/accent7.png", "accent7"}, {DATA_DIR "/images/icons/accent8.png", "accent8"}, {DATA_DIR "/images/icons/accent9.png", "accent9"}, {DATA_DIR "/images/icons/accent10.png", "accent10"}, {DATA_DIR "/images/icons/accent11.png", "accent11"}, {DATA_DIR "/images/icons/accent12.png", "accent12"}, {DATA_DIR "/images/icons/accent13.png", "accent13"}, {DATA_DIR "/images/icons/accent14.png", "accent14"}, {DATA_DIR "/images/icons/accent15.png", "accent15"}, {DATA_DIR "/images/icons/mathaccent0.png", "mathaccent0"}, {DATA_DIR "/images/icons/mathaccent1.png", "mathaccent1"}, {DATA_DIR "/images/icons/mathaccent2.png", "mathaccent2"}, {DATA_DIR "/images/icons/mathaccent3.png", "mathaccent3"}, {DATA_DIR "/images/icons/mathaccent4.png", "mathaccent4"}, {DATA_DIR "/images/icons/mathaccent5.png", "mathaccent5"}, {DATA_DIR "/images/icons/mathaccent6.png", "mathaccent6"}, {DATA_DIR "
 /images/icons/mathaccent7.png", "mathaccent7"}, {DATA_DIR "/images/icons/mathaccent8.png", "mathaccent8"}, {DATA_DIR "/images/icons/mathaccent9.png", "mathaccent9"}, {DATA_DIR "/images/icons/mathaccent10.png", "mathaccent10"}, {DATA_DIR "/images/icons/completion_choice.png", "completion_choice"}, {DATA_DIR "/images/icons/completion_cmd.png", "completion_cmd"}, {DATA_DIR "/images/icons/tree_part.png", "tree_part"}, {DATA_DIR "/images/icons/tree_chapter.png", "tree_chapter"}, {DATA_DIR "/images/icons/tree_section.png", "tree_section"}, {DATA_DIR "/images/icons/tree_subsection.png", "tree_subsection"}, {DATA_DIR "/images/icons/tree_subsubsection.png", "tree_subsubsection"}, {DATA_DIR "/images/icons/tree_paragraph.png", "tree_paragraph"}, {DATA_DIR "/images/icons/tree_todo.png", "tree_todo"}, {DATA_DIR "/images/icons/tree_label.png", "tree_label"}, {DATA_DIR "/images/icons/table.png", "table"}};
 
 static void _g_object_unref0_ (gpointer var) {
 	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
@@ -322,11 +323,11 @@ static Application* application_construct (GType object_type) {
 				_tmp8_ = gdk_pixbuf_new_from_file (filename, &_inner_error_);
 				_tmp9_ = _tmp8_;
 				if (_inner_error_ != NULL) {
-					goto __catch47_g_error;
+					goto __catch49_g_error;
 				}
 				list = g_list_append (list, _tmp9_);
-				goto __finally47;
-				__catch47_g_error:
+				goto __finally49;
+				__catch49_g_error:
 				{
 					GError * e;
 					e = _inner_error_;
@@ -334,7 +335,7 @@ static Application* application_construct (GType object_type) {
 					fprintf (stderr, "Error with an icon: %s\n", e->message);
 					_g_error_free0 (e);
 				}
-				__finally47:
+				__finally49:
 				if (_inner_error_ != NULL) {
 					_g_free0 (filename);
 					__g_list_free__g_object_unref0_0 (list);
@@ -349,6 +350,8 @@ static Application* application_construct (GType object_type) {
 	}
 	gtk_window_set_default_icon_list (list);
 	application_register_my_stock_icons (self);
+	application_add_theme_icon_to_stock (self, "image-x-generic", "image");
+	application_add_theme_icon_to_stock (self, "text-x-generic", "tree_include");
 	_tmp10_ = app_settings_get_default ();
 	_tmp11_ = _tmp10_;
 	_g_object_unref0 (_tmp11_);
@@ -524,26 +527,26 @@ UniqueResponse application_message (Application* self, UniqueApp* sender, gint c
 }
 
 
-static Block22Data* block22_data_ref (Block22Data* _data22_) {
-	g_atomic_int_inc (&_data22_->_ref_count_);
-	return _data22_;
+static Block20Data* block20_data_ref (Block20Data* _data20_) {
+	g_atomic_int_inc (&_data20_->_ref_count_);
+	return _data20_;
 }
 
 
-static void block22_data_unref (Block22Data* _data22_) {
-	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
-		_g_object_unref0 (_data22_->self);
-		_g_object_unref0 (_data22_->window);
-		g_slice_free (Block22Data, _data22_);
+static void block20_data_unref (Block20Data* _data20_) {
+	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
+		_g_object_unref0 (_data20_->self);
+		_g_object_unref0 (_data20_->window);
+		g_slice_free (Block20Data, _data20_);
 	}
 }
 
 
-static void _lambda70_ (Block22Data* _data22_) {
+static void _lambda82_ (Block20Data* _data20_) {
 	Application * self;
 	guint _tmp0_;
-	self = _data22_->self;
-	self->priv->_windows = g_list_remove (self->priv->_windows, _data22_->window);
+	self = _data20_->self;
+	self->priv->_windows = g_list_remove (self->priv->_windows, _data20_->window);
 	_tmp0_ = g_list_length (self->priv->_windows);
 	if (_tmp0_ == 0) {
 		Projects* _tmp1_ = NULL;
@@ -566,7 +569,7 @@ static void _lambda70_ (Block22Data* _data22_) {
 		_g_object_unref0 (_tmp6_);
 		gtk_main_quit ();
 	} else {
-		if (_data22_->window == self->priv->_active_window) {
+		if (_data20_->window == self->priv->_active_window) {
 			application_set_active_window (self, MAIN_WINDOW ((MainWindow*) self->priv->_windows->data));
 			g_object_notify ((GObject*) self, "active-window");
 		}
@@ -574,58 +577,58 @@ static void _lambda70_ (Block22Data* _data22_) {
 }
 
 
-static void __lambda70__gtk_object_destroy (GtkObject* _sender, gpointer self) {
-	_lambda70_ (self);
+static void __lambda82__gtk_object_destroy (GtkObject* _sender, gpointer self) {
+	_lambda82_ (self);
 }
 
 
-static gboolean _lambda71_ (Block22Data* _data22_) {
+static gboolean _lambda83_ (Block20Data* _data20_) {
 	Application * self;
 	gboolean result = FALSE;
-	self = _data22_->self;
-	application_set_active_window (self, _data22_->window);
+	self = _data20_->self;
+	application_set_active_window (self, _data20_->window);
 	g_object_notify ((GObject*) self, "active-window");
 	result = FALSE;
 	return result;
 }
 
 
-static gboolean __lambda71__gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
+static gboolean __lambda83__gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
 	gboolean result;
-	result = _lambda71_ (self);
+	result = _lambda83_ (self);
 	return result;
 }
 
 
 MainWindow* application_create_window (Application* self, GdkScreen* screen) {
 	MainWindow* result = NULL;
-	Block22Data* _data22_;
+	Block20Data* _data20_;
 	MainWindow* _tmp0_ = NULL;
 	MainWindow* _tmp1_;
 	MainWindow* _tmp2_;
 	g_return_val_if_fail (self != NULL, NULL);
-	_data22_ = g_slice_new0 (Block22Data);
-	_data22_->_ref_count_ = 1;
-	_data22_->self = g_object_ref (self);
+	_data20_ = g_slice_new0 (Block20Data);
+	_data20_->_ref_count_ = 1;
+	_data20_->self = g_object_ref (self);
 	if (self->priv->_active_window != NULL) {
 		main_window_save_state (self->priv->_active_window, TRUE);
 	}
 	_tmp0_ = main_window_new ();
-	_data22_->window = g_object_ref_sink (_tmp0_);
-	application_set_active_window (self, _data22_->window);
+	_data20_->window = g_object_ref_sink (_tmp0_);
+	application_set_active_window (self, _data20_->window);
 	g_object_notify ((GObject*) self, "active-window");
 	if (screen != NULL) {
-		gtk_window_set_screen ((GtkWindow*) _data22_->window, screen);
+		gtk_window_set_screen ((GtkWindow*) _data20_->window, screen);
 	}
-	g_signal_connect_data ((GtkObject*) _data22_->window, "destroy", (GCallback) __lambda70__gtk_object_destroy, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
-	g_signal_connect_data ((GtkWidget*) _data22_->window, "focus-in-event", (GCallback) __lambda71__gtk_widget_focus_in_event, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
-	_tmp1_ = _g_object_ref0 (_data22_->window);
+	g_signal_connect_data ((GtkObject*) _data20_->window, "destroy", (GCallback) __lambda82__gtk_object_destroy, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
+	g_signal_connect_data ((GtkWidget*) _data20_->window, "focus-in-event", (GCallback) __lambda83__gtk_widget_focus_in_event, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
+	_tmp1_ = _g_object_ref0 (_data20_->window);
 	self->priv->_windows = g_list_append (self->priv->_windows, _tmp1_);
-	gtk_widget_show ((GtkWidget*) _data22_->window);
-	_tmp2_ = _g_object_ref0 (_data22_->window);
+	gtk_widget_show ((GtkWidget*) _data20_->window);
+	_tmp2_ = _g_object_ref0 (_data20_->window);
 	result = _tmp2_;
-	block22_data_unref (_data22_);
-	_data22_ = NULL;
+	block20_data_unref (_data20_);
+	_data20_ = NULL;
 	return result;
 }
 
@@ -722,6 +725,102 @@ static void application_register_my_stock_icons (Application* self) {
 }
 
 
+static void application_add_theme_icon_to_stock (Application* self, const gchar* icon_name, const gchar* stock_id) {
+	GtkIconTheme* _tmp0_ = NULL;
+	GtkIconTheme* _tmp1_;
+	GtkIconTheme* theme;
+	GtkIconSet* _tmp2_ = NULL;
+	GtkIconSet* icon_set;
+	GtkIconSize* _tmp3_ = NULL;
+	GtkIconSize* sizes;
+	gint sizes_length1;
+	gint _sizes_size_;
+	GtkIconFactory* _tmp7_ = NULL;
+	GtkIconFactory* icon_factory;
+	GError * _inner_error_ = NULL;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (icon_name != NULL);
+	g_return_if_fail (stock_id != NULL);
+	_tmp0_ = gtk_icon_theme_get_default ();
+	_tmp1_ = _g_object_ref0 (_tmp0_);
+	theme = _tmp1_;
+	_tmp2_ = gtk_icon_set_new ();
+	icon_set = _tmp2_;
+	_tmp3_ = g_new0 (GtkIconSize, 6);
+	_tmp3_[0] = GTK_ICON_SIZE_MENU;
+	_tmp3_[1] = GTK_ICON_SIZE_SMALL_TOOLBAR;
+	_tmp3_[2] = GTK_ICON_SIZE_LARGE_TOOLBAR;
+	_tmp3_[3] = GTK_ICON_SIZE_BUTTON;
+	_tmp3_[4] = GTK_ICON_SIZE_DND;
+	_tmp3_[5] = GTK_ICON_SIZE_DIALOG;
+	sizes = _tmp3_;
+	sizes_length1 = 6;
+	_sizes_size_ = 6;
+	{
+		GtkIconSize* size_collection;
+		int size_collection_length1;
+		int size_it;
+		size_collection = sizes;
+		size_collection_length1 = sizes_length1;
+		for (size_it = 0; size_it < sizes_length1; size_it = size_it + 1) {
+			GtkIconSize size;
+			size = size_collection[size_it];
+			{
+				GdkPixbuf* pixbuf;
+				GdkPixbuf* _tmp4_ = NULL;
+				GdkPixbuf* _tmp5_;
+				GtkIconSource* _tmp6_ = NULL;
+				GtkIconSource* icon_source;
+				pixbuf = NULL;
+				_tmp4_ = gtk_icon_theme_load_icon (theme, icon_name, (gint) size, 0, &_inner_error_);
+				_tmp5_ = _tmp4_;
+				if (_inner_error_ != NULL) {
+					goto __catch50_g_error;
+				}
+				_g_object_unref0 (pixbuf);
+				pixbuf = _tmp5_;
+				goto __finally50;
+				__catch50_g_error:
+				{
+					GError * e;
+					e = _inner_error_;
+					_inner_error_ = NULL;
+					fprintf (stderr, "Warning: get theme icon failed: %s\n", e->message);
+					_g_error_free0 (e);
+					_g_object_unref0 (pixbuf);
+					continue;
+				}
+				__finally50:
+				if (_inner_error_ != NULL) {
+					_g_object_unref0 (pixbuf);
+					sizes = (g_free (sizes), NULL);
+					_gtk_icon_set_unref0 (icon_set);
+					_g_object_unref0 (theme);
+					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+					g_clear_error (&_inner_error_);
+					return;
+				}
+				_tmp6_ = gtk_icon_source_new ();
+				icon_source = _tmp6_;
+				gtk_icon_source_set_pixbuf (icon_source, pixbuf);
+				gtk_icon_source_set_size (icon_source, size);
+				gtk_icon_set_add_source (icon_set, icon_source);
+				_gtk_icon_source_free0 (icon_source);
+				_g_object_unref0 (pixbuf);
+			}
+		}
+	}
+	_tmp7_ = gtk_icon_factory_new ();
+	icon_factory = _tmp7_;
+	gtk_icon_factory_add (icon_factory, stock_id, icon_set);
+	gtk_icon_factory_add_default (icon_factory);
+	_g_object_unref0 (icon_factory);
+	sizes = (g_free (sizes), NULL);
+	_gtk_icon_set_unref0 (icon_set);
+	_g_object_unref0 (theme);
+}
+
+
 GList* application_get_windows (Application* self) {
 	GList* result;
 	g_return_val_if_fail (self != NULL, NULL);
diff --git a/src/C/build_tool_dialog.c b/src/C/build_tool_dialog.c
index 2798301..4b67572 100644
--- a/src/C/build_tool_dialog.c
+++ b/src/C/build_tool_dialog.c
@@ -1,4 +1,4 @@
-/* build_tool_dialog.c generated by valac 0.12.0, the Vala compiler
+/* build_tool_dialog.c generated by valac 0.12.1, the Vala compiler
  * generated from build_tool_dialog.vala, do not modify */
 
 /*
@@ -153,29 +153,29 @@ static void build_tool_dialog_init_icon_treeview (BuildToolDialog* self);
 static void build_tool_dialog_init_jobs_treeview (BuildToolDialog* self);
 static void build_tool_dialog_init_actions (BuildToolDialog* self);
 gboolean build_tool_dialog_show_me (GtkWindow* parent, gint num);
-static void _lambda110_ (void);
-static void __lambda110__gtk_object_destroy (GtkObject* _sender, gpointer self);
+static void _lambda124_ (void);
+static void __lambda124__gtk_object_destroy (GtkObject* _sender, gpointer self);
 static void build_tool_dialog_init (BuildToolDialog* self, gint num);
 static gboolean build_tool_dialog_run_me (BuildToolDialog* self, gint num);
 GType post_processor_type_get_type (void) G_GNUC_CONST;
 gchar* build_tools_get_post_processor_name_from_type (PostProcessorType type);
-static void _lambda104_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self);
-static void __lambda104__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
-static void _lambda105_ (const gchar* path_string, BuildToolDialog* self);
-static void __lambda105__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
-static void _lambda106_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self);
-static void __lambda106__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
+static void _lambda118_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self);
+static void __lambda118__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
+static void _lambda119_ (const gchar* path_string, BuildToolDialog* self);
+static void __lambda119__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
+static void _lambda120_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self);
+static void __lambda120__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self);
 static void build_tool_dialog_on_command_add (BuildToolDialog* self);
 static void _build_tool_dialog_on_command_add_gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _build_tool_dialog_on_command_add_gtk_entry_activate (GtkEntry* _sender, gpointer self);
-static void _lambda107_ (BuildToolDialog* self);
-gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set);
-static void __lambda107__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda108_ (BuildToolDialog* self);
+static void _lambda121_ (BuildToolDialog* self);
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
+static void __lambda121__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda122_ (BuildToolDialog* self);
 gboolean utils_tree_model_iter_prev (GtkTreeModel* model, GtkTreeIter* iter);
-static void __lambda108__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda109_ (BuildToolDialog* self);
-static void __lambda109__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda122__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda123_ (BuildToolDialog* self);
+static void __lambda123__gtk_button_clicked (GtkButton* _sender, gpointer self);
 void utils_set_entry_error (GtkWidget* entry, gboolean _error_);
 static void build_tool_dialog_init_new_build_tool (BuildToolDialog* self);
 GType build_tool_get_type (void) G_GNUC_CONST;
@@ -272,7 +272,7 @@ static BuildToolDialog* build_tool_dialog_construct (GType object_type) {
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (builder);
 		_g_free0 (path);
-		goto __catch50_g_error;
+		goto __catch53_g_error;
 	}
 	_tmp3_ = gtk_builder_get_object (builder, "main_vbox");
 	_tmp4_ = _g_object_ref0 (GTK_VBOX (_tmp3_));
@@ -330,8 +330,8 @@ static BuildToolDialog* build_tool_dialog_construct (GType object_type) {
 	_g_object_unref0 (main_vbox);
 	_g_object_unref0 (builder);
 	_g_free0 (path);
-	goto __finally50;
-	__catch50_g_error:
+	goto __finally53;
+	__catch53_g_error:
 	{
 		GError * e;
 		gchar* _tmp27_ = NULL;
@@ -359,7 +359,7 @@ static BuildToolDialog* build_tool_dialog_construct (GType object_type) {
 		_g_free0 (message);
 		_g_error_free0 (e);
 	}
-	__finally50:
+	__finally53:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -374,7 +374,7 @@ static BuildToolDialog* build_tool_dialog_new (void) {
 }
 
 
-static void _lambda110_ (void) {
+static void _lambda124_ (void) {
 	if (build_tool_dialog_instance != NULL) {
 		_g_object_unref0 (build_tool_dialog_instance);
 		build_tool_dialog_instance = NULL;
@@ -382,8 +382,8 @@ static void _lambda110_ (void) {
 }
 
 
-static void __lambda110__gtk_object_destroy (GtkObject* _sender, gpointer self) {
-	_lambda110_ ();
+static void __lambda124__gtk_object_destroy (GtkObject* _sender, gpointer self) {
+	_lambda124_ ();
 }
 
 
@@ -397,7 +397,7 @@ gboolean build_tool_dialog_show_me (GtkWindow* parent, gint num) {
 		_tmp0_ = build_tool_dialog_new ();
 		_g_object_unref0 (build_tool_dialog_instance);
 		build_tool_dialog_instance = g_object_ref_sink (_tmp0_);
-		g_signal_connect ((GtkObject*) build_tool_dialog_instance, "destroy", (GCallback) __lambda110__gtk_object_destroy, NULL);
+		g_signal_connect ((GtkObject*) build_tool_dialog_instance, "destroy", (GCallback) __lambda124__gtk_object_destroy, NULL);
 	}
 	_tmp1_ = gtk_window_get_transient_for ((GtkWindow*) build_tool_dialog_instance);
 	if (parent != _tmp1_) {
@@ -461,7 +461,7 @@ static void build_tool_dialog_init_icon_treeview (BuildToolDialog* self) {
 }
 
 
-static void _lambda104_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self) {
+static void _lambda118_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	g_return_if_fail (path_string != NULL);
@@ -472,12 +472,12 @@ static void _lambda104_ (const gchar* path_string, const gchar* new_text, BuildT
 }
 
 
-static void __lambda104__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
-	_lambda104_ (path, new_text, self);
+static void __lambda118__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
+	_lambda118_ (path, new_text, self);
 }
 
 
-static void _lambda105_ (const gchar* path_string, BuildToolDialog* self) {
+static void _lambda119_ (const gchar* path_string, BuildToolDialog* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gboolean val = FALSE;
@@ -494,12 +494,12 @@ static void _lambda105_ (const gchar* path_string, BuildToolDialog* self) {
 }
 
 
-static void __lambda105__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
-	_lambda105_ (path, self);
+static void __lambda119__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
+	_lambda119_ (path, self);
 }
 
 
-static void _lambda106_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self) {
+static void _lambda120_ (const gchar* path_string, const gchar* new_text, BuildToolDialog* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	g_return_if_fail (path_string != NULL);
@@ -510,8 +510,8 @@ static void _lambda106_ (const gchar* path_string, const gchar* new_text, BuildT
 }
 
 
-static void __lambda106__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
-	_lambda106_ (path, new_text, self);
+static void __lambda120__gtk_cell_renderer_text_edited (GtkCellRendererText* _sender, const gchar* path, const gchar* new_text, gpointer self) {
+	_lambda120_ (path, new_text, self);
 }
 
 
@@ -522,12 +522,14 @@ static void build_tool_dialog_init_jobs_treeview (BuildToolDialog* self) {
 	GtkCellRendererText* _tmp6_ = NULL;
 	GtkCellRendererText* text_renderer;
 	const gchar* _tmp7_ = NULL;
-	GtkCellRendererToggle* _tmp8_ = NULL;
+	GtkTreeViewColumn* _tmp8_ = NULL;
+	GtkTreeViewColumn* column;
+	GtkCellRendererToggle* _tmp9_ = NULL;
 	GtkCellRendererToggle* toggle_renderer;
-	const gchar* _tmp9_ = NULL;
-	GtkCellRendererCombo* _tmp10_ = NULL;
+	const gchar* _tmp10_ = NULL;
+	GtkCellRendererCombo* _tmp11_ = NULL;
 	GtkCellRendererCombo* combo_renderer;
-	const gchar* _tmp11_ = NULL;
+	const gchar* _tmp12_ = NULL;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = gtk_list_store_new ((gint) BUILD_TOOL_DIALOG_JOB_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
 	_g_object_unref0 (self->priv->jobs_store);
@@ -566,25 +568,29 @@ static void build_tool_dialog_init_jobs_treeview (BuildToolDialog* self) {
 	text_renderer = g_object_ref_sink (_tmp6_);
 	g_object_set (text_renderer, "editable", TRUE, NULL);
 	_tmp7_ = _ ("Commands");
-	gtk_tree_view_insert_column_with_attributes (self->priv->treeview_jobs, -1, _tmp7_, (GtkCellRenderer*) text_renderer, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, NULL, NULL);
-	_tmp8_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
-	toggle_renderer = g_object_ref_sink (_tmp8_);
+	_tmp8_ = gtk_tree_view_column_new_with_attributes (_tmp7_, (GtkCellRenderer*) text_renderer, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_COMMAND, NULL, NULL);
+	column = g_object_ref_sink (_tmp8_);
+	gtk_tree_view_column_set_resizable (column, TRUE);
+	gtk_tree_view_append_column (self->priv->treeview_jobs, column);
+	_tmp9_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
+	toggle_renderer = g_object_ref_sink (_tmp9_);
 	gtk_cell_renderer_toggle_set_activatable (toggle_renderer, TRUE);
-	_tmp9_ = _ ("Must Succeed");
-	gtk_tree_view_insert_column_with_attributes (self->priv->treeview_jobs, -1, _tmp9_, (GtkCellRenderer*) toggle_renderer, "active", BUILD_TOOL_DIALOG_JOB_COLUMN_MUST_SUCCEED, NULL, NULL);
-	_tmp10_ = (GtkCellRendererCombo*) gtk_cell_renderer_combo_new ();
-	combo_renderer = g_object_ref_sink (_tmp10_);
+	_tmp10_ = _ ("Must Succeed");
+	gtk_tree_view_insert_column_with_attributes (self->priv->treeview_jobs, -1, _tmp10_, (GtkCellRenderer*) toggle_renderer, "active", BUILD_TOOL_DIALOG_JOB_COLUMN_MUST_SUCCEED, NULL, NULL);
+	_tmp11_ = (GtkCellRendererCombo*) gtk_cell_renderer_combo_new ();
+	combo_renderer = g_object_ref_sink (_tmp11_);
 	g_object_set ((GtkCellRendererText*) combo_renderer, "editable", TRUE, NULL);
 	g_object_set (combo_renderer, "model", (GtkTreeModel*) post_processor_store, NULL);
 	g_object_set (combo_renderer, "text-column", 0, NULL);
 	g_object_set (combo_renderer, "has-entry", FALSE, NULL);
-	_tmp11_ = _ ("Post Processor");
-	gtk_tree_view_insert_column_with_attributes (self->priv->treeview_jobs, -1, _tmp11_, (GtkCellRenderer*) combo_renderer, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, NULL, NULL);
-	g_signal_connect_object (text_renderer, "edited", (GCallback) __lambda104__gtk_cell_renderer_text_edited, self, 0);
-	g_signal_connect_object (toggle_renderer, "toggled", (GCallback) __lambda105__gtk_cell_renderer_toggle_toggled, self, 0);
-	g_signal_connect_object ((GtkCellRendererText*) combo_renderer, "edited", (GCallback) __lambda106__gtk_cell_renderer_text_edited, self, 0);
+	_tmp12_ = _ ("Post Processor");
+	gtk_tree_view_insert_column_with_attributes (self->priv->treeview_jobs, -1, _tmp12_, (GtkCellRenderer*) combo_renderer, "text", BUILD_TOOL_DIALOG_JOB_COLUMN_POST_PROCESSOR, NULL, NULL);
+	g_signal_connect_object (text_renderer, "edited", (GCallback) __lambda118__gtk_cell_renderer_text_edited, self, 0);
+	g_signal_connect_object (toggle_renderer, "toggled", (GCallback) __lambda119__gtk_cell_renderer_toggle_toggled, self, 0);
+	g_signal_connect_object ((GtkCellRendererText*) combo_renderer, "edited", (GCallback) __lambda120__gtk_cell_renderer_text_edited, self, 0);
 	_g_object_unref0 (combo_renderer);
 	_g_object_unref0 (toggle_renderer);
+	_g_object_unref0 (column);
 	_g_object_unref0 (text_renderer);
 	_g_object_unref0 (post_processor_store);
 }
@@ -600,7 +606,7 @@ static void _build_tool_dialog_on_command_add_gtk_entry_activate (GtkEntry* _sen
 }
 
 
-static void _lambda107_ (BuildToolDialog* self) {
+static void _lambda121_ (BuildToolDialog* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gint _tmp1_;
@@ -614,12 +620,12 @@ static void _lambda107_ (BuildToolDialog* self) {
 }
 
 
-static void __lambda107__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda107_ (self);
+static void __lambda121__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda121_ (self);
 }
 
 
-static void _lambda108_ (BuildToolDialog* self) {
+static void _lambda122_ (BuildToolDialog* self) {
 	GtkTreeIter iter1 = {0};
 	GtkTreeIter iter2 = {0};
 	GtkTreeIter _tmp0_ = {0};
@@ -645,12 +651,12 @@ static void _lambda108_ (BuildToolDialog* self) {
 }
 
 
-static void __lambda108__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda108_ (self);
+static void __lambda122__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda122_ (self);
 }
 
 
-static void _lambda109_ (BuildToolDialog* self) {
+static void _lambda123_ (BuildToolDialog* self) {
 	GtkTreeIter iter1 = {0};
 	GtkTreeIter iter2 = {0};
 	GtkTreeIter _tmp0_ = {0};
@@ -670,8 +676,8 @@ static void _lambda109_ (BuildToolDialog* self) {
 }
 
 
-static void __lambda109__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda109_ (self);
+static void __lambda123__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda123_ (self);
 }
 
 
@@ -679,9 +685,9 @@ static void build_tool_dialog_init_actions (BuildToolDialog* self) {
 	g_return_if_fail (self != NULL);
 	g_signal_connect_object (self->priv->button_add, "clicked", (GCallback) _build_tool_dialog_on_command_add_gtk_button_clicked, self, 0);
 	g_signal_connect_object (self->priv->entry_command, "activate", (GCallback) _build_tool_dialog_on_command_add_gtk_entry_activate, self, 0);
-	g_signal_connect_object (self->priv->button_delete, "clicked", (GCallback) __lambda107__gtk_button_clicked, self, 0);
-	g_signal_connect_object (self->priv->button_up, "clicked", (GCallback) __lambda108__gtk_button_clicked, self, 0);
-	g_signal_connect_object (self->priv->button_down, "clicked", (GCallback) __lambda109__gtk_button_clicked, self, 0);
+	g_signal_connect_object (self->priv->button_delete, "clicked", (GCallback) __lambda121__gtk_button_clicked, self, 0);
+	g_signal_connect_object (self->priv->button_up, "clicked", (GCallback) __lambda122__gtk_button_clicked, self, 0);
+	g_signal_connect_object (self->priv->button_down, "clicked", (GCallback) __lambda123__gtk_button_clicked, self, 0);
 }
 
 
diff --git a/src/C/build_tool_runner.c b/src/C/build_tool_runner.c
index a107a0a..c39acb8 100644
--- a/src/C/build_tool_runner.c
+++ b/src/C/build_tool_runner.c
@@ -1,4 +1,4 @@
-/* build_tool_runner.c generated by valac 0.12.0, the Vala compiler
+/* build_tool_runner.c generated by valac 0.12.1, the Vala compiler
  * generated from build_tool_runner.vala, do not modify */
 
 /*
@@ -262,12 +262,12 @@ static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gc
 void build_view_clear (BuildView* self);
 GType partition_state_get_type (void) G_GNUC_CONST;
 void build_view_add_partition (BuildView* self, const gchar* msg, PartitionState state, GtkTreeIter* parent, gboolean bold, GtkTreeIter* result);
-static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* build_job, gboolean basename, int* result_length1);
+static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* build_job, gboolean basename, gboolean for_printing, int* result_length1);
 static void _vala_array_add2 (GtkTreeIter** array, int* length, int* size, const GtkTreeIter* value);
 static void build_tool_runner_proceed (BuildToolRunner* self);
 static void build_tool_runner_execute (BuildToolRunner* self, gchar** command, int command_length1, const gchar* working_directory, GError** error);
-static void _lambda51_ (BuildToolRunner* self);
-static void __lambda51__gspawn_child_setup_func (gpointer self);
+static void _lambda58_ (BuildToolRunner* self);
+static void __lambda58__gspawn_child_setup_func (gpointer self);
 static GPid* _g_pid_dup (GPid* self);
 static void build_tool_runner_on_exit (BuildToolRunner* self, GPid pid, gint status);
 static void _build_tool_runner_on_exit_gchild_watch_func (GPid pid, gint status, gpointer self);
@@ -315,6 +315,7 @@ static void _vala_PostProcessorIssues_array_free (PostProcessorIssues* array, gi
 static gchar** _vala_array_dup1 (gchar** self, int length);
 static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value);
 static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value);
+static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value);
 static gchar** _vala_array_dup2 (gchar** self, int length);
 static void build_tool_runner_finalize (GObject* obj);
 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
@@ -451,7 +452,7 @@ BuildToolRunner* build_tool_runner_construct (GType object_type, GFile* file, Bu
 				gchar* _tmp24_;
 				GtkTreeIter _tmp25_ = {0};
 				GtkTreeIter _tmp26_ = {0};
-				_tmp22_ = build_tool_runner_get_command (self, &job, TRUE, &_tmp21_);
+				_tmp22_ = build_tool_runner_get_command (self, &job, TRUE, TRUE, &_tmp21_);
 				command = _tmp22_;
 				command_length1 = _tmp21_;
 				_command_size_ = _tmp21_;
@@ -479,13 +480,13 @@ BuildToolRunner* build_tool_runner_new (GFile* file, BuildTool* tool, BuildView*
 }
 
 
-static void _lambda51_ (BuildToolRunner* self) {
+static void _lambda58_ (BuildToolRunner* self) {
 	dup2 (STDOUT_FILENO, STDERR_FILENO);
 }
 
 
-static void __lambda51__gspawn_child_setup_func (gpointer self) {
-	_lambda51_ (self);
+static void __lambda58__gspawn_child_setup_func (gpointer self) {
+	_lambda58_ (self);
 }
 
 
@@ -547,13 +548,13 @@ static void build_tool_runner_execute (BuildToolRunner* self, gchar** command, i
 	guint _tmp5_;
 	GError * _inner_error_ = NULL;
 	g_return_if_fail (self != NULL);
-	g_spawn_async_with_pipes (working_directory, command, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, __lambda51__gspawn_child_setup_func, self, &_tmp0_, NULL, &_tmp1_, NULL, &_inner_error_);
+	g_spawn_async_with_pipes (working_directory, command, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, __lambda58__gspawn_child_setup_func, self, &_tmp0_, NULL, &_tmp1_, NULL, &_inner_error_);
 	_g_free0 (self->priv->child_pid);
 	_tmp2_ = __g_pid_dup0 (&_tmp0_);
 	self->priv->child_pid = _tmp2_;
 	std_out = _tmp1_;
 	if (_inner_error_ != NULL) {
-		goto __catch15_g_error;
+		goto __catch16_g_error;
 	}
 	_tmp3_ = g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, *self->priv->child_pid, _build_tool_runner_on_exit_gchild_watch_func, g_object_ref (self), g_object_unref);
 	_vala_array_add3 (&self->priv->handlers, &self->priv->handlers_length1, &self->priv->_handlers_size_, _tmp3_);
@@ -562,16 +563,16 @@ static void build_tool_runner_execute (BuildToolRunner* self, gchar** command, i
 	self->priv->out_channel = _tmp4_;
 	g_io_channel_set_flags (self->priv->out_channel, G_IO_FLAG_NONBLOCK, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		goto __catch15_g_error;
+		goto __catch16_g_error;
 	}
 	g_io_channel_set_encoding (self->priv->out_channel, NULL, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		goto __catch15_g_error;
+		goto __catch16_g_error;
 	}
 	_tmp5_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) BUILD_TOOL_RUNNER_POLL_INTERVAL, _build_tool_runner_on_output_gsource_func, g_object_ref (self), g_object_unref);
 	_vala_array_add4 (&self->priv->handlers, &self->priv->handlers_length1, &self->priv->_handlers_size_, _tmp5_);
-	goto __finally15;
-	__catch15_g_error:
+	goto __finally16;
+	__catch16_g_error:
 	{
 		GError * e;
 		GError* _tmp6_;
@@ -580,9 +581,9 @@ static void build_tool_runner_execute (BuildToolRunner* self, gchar** command, i
 		_tmp6_ = _g_error_copy0 (e);
 		_inner_error_ = _tmp6_;
 		_g_error_free0 (e);
-		goto __finally15;
+		goto __finally16;
 	}
-	__finally15:
+	__finally16:
 	if (_inner_error_ != NULL) {
 		g_propagate_error (error, _inner_error_);
 		return;
@@ -611,12 +612,12 @@ static void build_tool_runner_execute_without_output (BuildToolRunner* self, gch
 	_tmp1_ = __g_pid_dup0 (&_tmp0_);
 	self->priv->child_pid = _tmp1_;
 	if (_inner_error_ != NULL) {
-		goto __catch16_g_error;
+		goto __catch17_g_error;
 	}
 	_tmp2_ = g_child_watch_add_full (G_PRIORITY_DEFAULT_IDLE, *self->priv->child_pid, _build_tool_runner_on_exit_gchild_watch_func, g_object_ref (self), g_object_unref);
 	_vala_array_add5 (&self->priv->handlers, &self->priv->handlers_length1, &self->priv->_handlers_size_, _tmp2_);
-	goto __finally16;
-	__catch16_g_error:
+	goto __finally17;
+	__catch17_g_error:
 	{
 		GError * e;
 		GError* _tmp3_;
@@ -625,9 +626,9 @@ static void build_tool_runner_execute_without_output (BuildToolRunner* self, gch
 		_tmp3_ = _g_error_copy0 (e);
 		_inner_error_ = _tmp3_;
 		_g_error_free0 (e);
-		goto __finally16;
+		goto __finally17;
 	}
-	__finally16:
+	__finally17:
 	if (_inner_error_ != NULL) {
 		g_propagate_error (error, _inner_error_);
 		return;
@@ -702,18 +703,18 @@ static gboolean build_tool_runner_on_output (BuildToolRunner* self) {
 	length = _tmp1_;
 	if (_inner_error_ != NULL) {
 		if (_inner_error_->domain == G_CONVERT_ERROR) {
-			goto __catch17_g_convert_error;
+			goto __catch18_g_convert_error;
 		}
 		if (_inner_error_->domain == G_IO_CHANNEL_ERROR) {
-			goto __catch17_g_io_channel_error;
+			goto __catch18_g_io_channel_error;
 		}
 		_g_free0 (text);
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
 		return FALSE;
 	}
-	goto __finally17;
-	__catch17_g_convert_error:
+	goto __finally18;
+	__catch18_g_convert_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -721,8 +722,8 @@ static gboolean build_tool_runner_on_output (BuildToolRunner* self) {
 		fprintf (stderr, "Read output: convert error: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	goto __finally17;
-	__catch17_g_io_channel_error:
+	goto __finally18;
+	__catch18_g_io_channel_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -730,7 +731,7 @@ static gboolean build_tool_runner_on_output (BuildToolRunner* self) {
 		fprintf (stderr, "Read output: IO channel error: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally17:
+	__finally18:
 	if (_inner_error_ != NULL) {
 		_g_free0 (text);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -780,7 +781,7 @@ static gboolean build_tool_runner_on_output (BuildToolRunner* self) {
 					_tmp9_ = _tmp8_;
 					if (_inner_error_ != NULL) {
 						if (_inner_error_->domain == G_CONVERT_ERROR) {
-							goto __catch18_g_convert_error;
+							goto __catch19_g_convert_error;
 						}
 						_g_free0 (line_utf8);
 						_g_free0 (line);
@@ -792,15 +793,15 @@ static gboolean build_tool_runner_on_output (BuildToolRunner* self) {
 					}
 					_g_free0 (line_utf8);
 					line_utf8 = _tmp9_;
-					goto __finally18;
-					__catch18_g_convert_error:
+					goto __finally19;
+					__catch19_g_convert_error:
 					{
 						GError * e;
 						e = _inner_error_;
 						_inner_error_ = NULL;
 						_g_error_free0 (e);
 					}
-					__finally18:
+					__finally19:
 					if (_inner_error_ != NULL) {
 						_g_free0 (line_utf8);
 						_g_free0 (line);
@@ -1027,7 +1028,7 @@ static void build_tool_runner_proceed (BuildToolRunner* self) {
 	self->priv->output = _tmp1_;
 	_tmp2_ = g_list_nth_data (self->priv->jobs, (guint) self->priv->job_num);
 	self->priv->current_job = *((BuildJob*) _tmp2_);
-	_tmp4_ = build_tool_runner_get_command (self, &self->priv->current_job, FALSE, &_tmp3_);
+	_tmp4_ = build_tool_runner_get_command (self, &self->priv->current_job, FALSE, FALSE, &_tmp3_);
 	command = _tmp4_;
 	command_length1 = _tmp3_;
 	_command_size_ = _tmp3_;
@@ -1066,16 +1067,16 @@ static void build_tool_runner_proceed (BuildToolRunner* self) {
 	if (self->priv->current_job.post_processor == POST_PROCESSOR_TYPE_NO_OUTPUT) {
 		build_tool_runner_execute_without_output (self, command, command_length1, self->priv->directory, &_inner_error_);
 		if (_inner_error_ != NULL) {
-			goto __catch19_g_error;
+			goto __catch20_g_error;
 		}
 	} else {
 		build_tool_runner_execute (self, command, command_length1, self->priv->directory, &_inner_error_);
 		if (_inner_error_ != NULL) {
-			goto __catch19_g_error;
+			goto __catch20_g_error;
 		}
 	}
-	goto __finally19;
-	__catch19_g_error:
+	goto __finally20;
+	__catch20_g_error:
 	{
 		GError * e;
 		GtkTreeIter _tmp12_;
@@ -1096,7 +1097,7 @@ static void build_tool_runner_proceed (BuildToolRunner* self) {
 		}
 		_g_error_free0 (e);
 	}
-	__finally19:
+	__finally20:
 	if (_inner_error_ != NULL) {
 		command = (_vala_array_free (command, command_length1, (GDestroyNotify) g_free), NULL);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1118,6 +1119,16 @@ static gchar** _vala_array_dup1 (gchar** self, int length) {
 }
 
 
+static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
+	if ((*length) == (*size)) {
+		*size = (*size) ? (2 * (*size)) : 4;
+		*array = g_renew (gchar*, *array, (*size) + 1);
+	}
+	(*array)[(*length)++] = value;
+	(*array)[*length] = NULL;
+}
+
+
 static gchar* string_slice (const gchar* self, glong start, glong end) {
 	gchar* result = NULL;
 	gint _tmp0_;
@@ -1153,7 +1164,7 @@ static gchar* string_slice (const gchar* self, glong start, glong end) {
 }
 
 
-static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
+static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (gchar*, *array, (*size) + 1);
@@ -1171,7 +1182,7 @@ static gchar string_get (const gchar* self, glong index) {
 }
 
 
-static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
+static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (gchar*, *array, (*size) + 1);
@@ -1213,7 +1224,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	regex = _tmp3_;
 	if (_inner_error_ != NULL) {
 		if (_inner_error_->domain == G_REGEX_ERROR) {
-			goto __catch20_g_regex_error;
+			goto __catch21_g_regex_error;
 		}
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -1224,7 +1235,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	if (_inner_error_ != NULL) {
 		_g_regex_unref0 (regex);
 		if (_inner_error_->domain == G_REGEX_ERROR) {
-			goto __catch20_g_regex_error;
+			goto __catch21_g_regex_error;
 		}
 		_g_regex_unref0 (regex);
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1235,8 +1246,8 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	_g_regex_unref0 (regex);
 	return result;
 	_g_regex_unref0 (regex);
-	goto __finally20;
-	__catch20_g_regex_error:
+	goto __finally21;
+	__catch21_g_regex_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1244,7 +1255,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 		g_assert_not_reached ();
 		_g_error_free0 (e);
 	}
-	__finally20:
+	__finally21:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -1253,7 +1264,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 }
 
 
-static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* build_job, gboolean basename, int* result_length1) {
+static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* build_job, gboolean basename, gboolean for_printing, int* result_length1) {
 	gchar** result = NULL;
 	gchar* base_filename;
 	gchar* base_shortname;
@@ -1261,7 +1272,7 @@ static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* b
 	gchar** command;
 	gint command_length1;
 	gint _command_size_;
-	gchar** _tmp44_;
+	gchar** _tmp45_;
 	g_return_val_if_fail (self != NULL, NULL);
 	base_filename = NULL;
 	base_shortname = NULL;
@@ -1296,8 +1307,8 @@ static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* b
 		gchar* _tmp7_;
 		gchar* arg_buf;
 		gchar* delimiter;
-		gchar** _tmp26_;
 		gchar** _tmp27_;
+		gchar** _tmp28_;
 		_tmp6_ = _tmp5_ = g_strsplit ((*build_job).command, " ", 0);
 		args = _tmp6_;
 		args_length1 = _vala_array_length (_tmp5_);
@@ -1317,10 +1328,10 @@ static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* b
 				_tmp8_ = g_strdup (arg_collection[arg_it]);
 				arg = _tmp8_;
 				{
-					gboolean _tmp15_ = FALSE;
 					gboolean _tmp16_ = FALSE;
-					gboolean _tmp17_;
-					gchar* _tmp25_;
+					gboolean _tmp17_ = FALSE;
+					gboolean _tmp18_;
+					gchar* _tmp26_;
 					if (delimiter != NULL) {
 						gchar* _tmp9_;
 						gchar* _tmp10_;
@@ -1333,64 +1344,72 @@ static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* b
 						arg_buf = _tmp11_;
 						_g_free0 (_tmp10_);
 						_tmp12_ = g_str_has_suffix (arg, delimiter);
-						if (_tmp12_) {
-							gint _tmp13_;
-							gchar* _tmp14_ = NULL;
-							_g_free0 (delimiter);
-							delimiter = NULL;
-							_tmp13_ = strlen (arg_buf);
-							_tmp14_ = string_slice (arg_buf, (glong) 1, (glong) (_tmp13_ - 1));
-							_vala_array_add6 (&command, &command_length1, &_command_size_, _tmp14_);
+						if (!_tmp12_) {
+							_g_free0 (arg);
+							continue;
+						}
+						_g_free0 (delimiter);
+						delimiter = NULL;
+						if (for_printing) {
+							gchar* _tmp13_;
+							_tmp13_ = g_strdup (arg_buf);
+							_vala_array_add6 (&command, &command_length1, &_command_size_, _tmp13_);
+						} else {
+							gint _tmp14_;
+							gchar* _tmp15_ = NULL;
+							_tmp14_ = strlen (arg_buf);
+							_tmp15_ = string_slice (arg_buf, (glong) 1, (glong) (_tmp14_ - 1));
+							_vala_array_add7 (&command, &command_length1, &_command_size_, _tmp15_);
 						}
 						_g_free0 (arg);
 						continue;
 					}
-					_tmp17_ = g_str_has_prefix (arg, "'");
-					if (_tmp17_) {
-						gboolean _tmp18_;
-						_tmp18_ = g_str_has_suffix (arg, "'");
-						_tmp16_ = !_tmp18_;
+					_tmp18_ = g_str_has_prefix (arg, "'");
+					if (_tmp18_) {
+						gboolean _tmp19_;
+						_tmp19_ = g_str_has_suffix (arg, "'");
+						_tmp17_ = !_tmp19_;
 					} else {
-						_tmp16_ = FALSE;
+						_tmp17_ = FALSE;
 					}
-					if (_tmp16_) {
-						_tmp15_ = TRUE;
+					if (_tmp17_) {
+						_tmp16_ = TRUE;
 					} else {
-						gboolean _tmp19_ = FALSE;
-						gboolean _tmp20_;
-						_tmp20_ = g_str_has_prefix (arg, "\"");
-						if (_tmp20_) {
-							gboolean _tmp21_;
-							_tmp21_ = g_str_has_suffix (arg, "\"");
-							_tmp19_ = !_tmp21_;
+						gboolean _tmp20_ = FALSE;
+						gboolean _tmp21_;
+						_tmp21_ = g_str_has_prefix (arg, "\"");
+						if (_tmp21_) {
+							gboolean _tmp22_;
+							_tmp22_ = g_str_has_suffix (arg, "\"");
+							_tmp20_ = !_tmp22_;
 						} else {
-							_tmp19_ = FALSE;
+							_tmp20_ = FALSE;
 						}
-						_tmp15_ = _tmp19_;
+						_tmp16_ = _tmp20_;
 					}
-					if (_tmp15_) {
-						gchar _tmp22_;
-						gchar* _tmp23_ = NULL;
-						gchar* _tmp24_;
-						_tmp22_ = string_get (arg, (glong) 0);
-						_tmp23_ = g_strdup_printf ("%c", _tmp22_);
+					if (_tmp16_) {
+						gchar _tmp23_;
+						gchar* _tmp24_ = NULL;
+						gchar* _tmp25_;
+						_tmp23_ = string_get (arg, (glong) 0);
+						_tmp24_ = g_strdup_printf ("%c", _tmp23_);
 						_g_free0 (delimiter);
-						delimiter = _tmp23_;
-						_tmp24_ = g_strdup (arg);
+						delimiter = _tmp24_;
+						_tmp25_ = g_strdup (arg);
 						_g_free0 (arg_buf);
-						arg_buf = _tmp24_;
+						arg_buf = _tmp25_;
 						_g_free0 (arg);
 						continue;
 					}
-					_tmp25_ = g_strdup (arg);
-					_vala_array_add7 (&command, &command_length1, &_command_size_, _tmp25_);
+					_tmp26_ = g_strdup (arg);
+					_vala_array_add8 (&command, &command_length1, &_command_size_, _tmp26_);
 					_g_free0 (arg);
 				}
 			}
 		}
-		_tmp26_ = (_tmp27_ = command, (_tmp27_ == NULL) ? ((gpointer) _tmp27_) : _vala_array_dup2 (_tmp27_, command_length1));
+		_tmp27_ = (_tmp28_ = command, (_tmp28_ == NULL) ? ((gpointer) _tmp28_) : _vala_array_dup2 (_tmp28_, command_length1));
 		(*build_job).command_args = (_vala_array_free ((*build_job).command_args, (*build_job).command_args_length1, (GDestroyNotify) g_free), NULL);
-		(*build_job).command_args = _tmp26_;
+		(*build_job).command_args = _tmp27_;
 		(*build_job).command_args_length1 = command_length1;
 		_g_free0 (delimiter);
 		_g_free0 (arg_buf);
@@ -1400,77 +1419,79 @@ static gchar** build_tool_runner_get_command (BuildToolRunner* self, BuildJob* b
 		gint i;
 		i = 0;
 		{
-			gboolean _tmp28_;
-			_tmp28_ = TRUE;
+			gboolean _tmp29_;
+			_tmp29_ = TRUE;
 			while (TRUE) {
-				gboolean _tmp29_;
-				gboolean _tmp32_;
-				gboolean _tmp38_;
-				if (!_tmp28_) {
+				gboolean _tmp30_;
+				gboolean _tmp33_;
+				gboolean _tmp39_;
+				if (!_tmp29_) {
 					i++;
 				}
-				_tmp28_ = FALSE;
+				_tmp29_ = FALSE;
 				if (!(i < command_length1)) {
 					break;
 				}
-				_tmp29_ = string_contains (command[i], "$view");
-				if (_tmp29_) {
-					gchar* _tmp30_ = NULL;
-					gchar* _tmp31_;
-					_tmp30_ = string_replace (command[i], "$view", self->priv->document_view_program);
-					_tmp31_ = _tmp30_;
+				_tmp30_ = string_contains (command[i], "$view");
+				if (_tmp30_) {
+					gchar* _tmp31_ = NULL;
+					gchar* _tmp32_;
+					_tmp31_ = string_replace (command[i], "$view", self->priv->document_view_program);
+					_tmp32_ = _tmp31_;
 					_g_free0 (command[i]);
-					command[i] = _tmp31_;
+					command[i] = _tmp32_;
 					continue;
 				}
-				_tmp32_ = string_contains (command[i], "$filename");
-				if (_tmp32_) {
-					gchar* _tmp33_;
+				_tmp33_ = string_contains (command[i], "$filename");
+				if (_tmp33_) {
 					gchar* _tmp34_;
-					gchar* _tmp36_ = NULL;
-					gchar* _tmp37_;
-					_tmp33_ = g_strdup (base_filename);
-					_tmp34_ = _tmp33_;
-					if (_tmp34_ == NULL) {
-						gchar* _tmp35_;
-						_tmp35_ = g_strdup (self->priv->filename);
-						_g_free0 (_tmp34_);
-						_tmp34_ = _tmp35_;
+					gchar* _tmp35_;
+					gchar* _tmp37_ = NULL;
+					gchar* _tmp38_;
+					_tmp34_ = g_strdup (base_filename);
+					_tmp35_ = _tmp34_;
+					if (_tmp35_ == NULL) {
+						gchar* _tmp36_;
+						_tmp36_ = g_strdup (self->priv->filename);
+						_g_free0 (_tmp35_);
+						_tmp35_ = _tmp36_;
 					}
-					_tmp36_ = string_replace (command[i], "$filename", _tmp34_);
-					_tmp37_ = _tmp36_;
+					_tmp37_ = string_replace (command[i], "$filename", _tmp35_);
+					_tmp38_ = _tmp37_;
 					_g_free0 (command[i]);
-					command[i] = _tmp37_;
-					_g_free0 (_tmp34_);
+					command[i] = _tmp38_;
+					_g_free0 (_tmp35_);
 					continue;
 				}
-				_tmp38_ = string_contains (command[i], "$shortname");
-				if (_tmp38_) {
-					gchar* _tmp39_;
+				_tmp39_ = string_contains (command[i], "$shortname");
+				if (_tmp39_) {
 					gchar* _tmp40_;
-					gchar* _tmp42_ = NULL;
-					gchar* _tmp43_;
-					_tmp39_ = g_strdup (base_shortname);
-					_tmp40_ = _tmp39_;
-					if (_tmp40_ == NULL) {
-						gchar* _tmp41_;
-						_tmp41_ = g_strdup (self->priv->shortname);
-						_g_free0 (_tmp40_);
-						_tmp40_ = _tmp41_;
+					gchar* _tmp41_;
+					gchar* _tmp43_ = NULL;
+					gchar* _tmp44_;
+					_tmp40_ = g_strdup (base_shortname);
+					_tmp41_ = _tmp40_;
+					if (_tmp41_ == NULL) {
+						gchar* _tmp42_;
+						_tmp42_ = g_strdup (self->priv->shortname);
+						_g_free0 (_tmp41_);
+						_tmp41_ = _tmp42_;
 					}
-					_tmp42_ = string_replace (command[i], "$shortname", _tmp40_);
-					_tmp43_ = _tmp42_;
+					_tmp43_ = string_replace (command[i], "$shortname", _tmp41_);
+					_tmp44_ = _tmp43_;
 					_g_free0 (command[i]);
-					command[i] = _tmp43_;
-					_g_free0 (_tmp40_);
+					command[i] = _tmp44_;
+					_g_free0 (_tmp41_);
 					continue;
 				}
 			}
 		}
 	}
-	_tmp44_ = command;
-	*result_length1 = command_length1;
-	result = _tmp44_;
+	_tmp45_ = command;
+	if (result_length1) {
+		*result_length1 = command_length1;
+	}
+	result = _tmp45_;
 	_g_free0 (base_shortname);
 	_g_free0 (base_filename);
 	return result;
diff --git a/src/C/build_tools.c b/src/C/build_tools.c
index 8a5dc20..3be1fef 100644
--- a/src/C/build_tools.c
+++ b/src/C/build_tools.c
@@ -1,4 +1,4 @@
-/* build_tools.c generated by valac 0.12.0, the Vala compiler
+/* build_tools.c generated by valac 0.12.1, the Vala compiler
  * generated from build_tools.vala, do not modify */
 
 /*
@@ -153,7 +153,7 @@ BuildJob* build_job_dup (const BuildJob* self);
 void build_job_free (BuildJob* self);
 void build_job_copy (const BuildJob* self, BuildJob* dest);
 void build_job_destroy (BuildJob* self);
-static gchar** _vala_array_dup8 (gchar** self, int length);
+static gchar** _vala_array_dup9 (gchar** self, int length);
 GType build_tool_get_type (void) G_GNUC_CONST;
 BuildTool* build_tool_dup (const BuildTool* self);
 void build_tool_free (BuildTool* self);
@@ -185,6 +185,7 @@ void build_tools_move_down (BuildTools* self, gint num);
 static void build_tools_update_all_menus (BuildTools* self);
 void build_tools_delete (BuildTools* self, gint num);
 void build_tools_add (BuildTools* self, BuildTool* tool);
+void build_tools_insert (BuildTools* self, gint pos, BuildTool* tool);
 static gboolean build_tools_is_compilation (BuildTools* self, const gchar* icon);
 void build_tools_update (BuildTools* self, gint num, BuildTool* tool, gboolean keep_show);
 static gboolean build_tools_is_equal (BuildTools* self, BuildTool* tool1, BuildTool* tool2);
@@ -196,9 +197,9 @@ Application* application_get_default (void);
 GType main_window_get_type (void) G_GNUC_CONST;
 GList* application_get_windows (Application* self);
 void main_window_update_build_tools_menu (MainWindow* self);
-static void _vala_array_add11 (GFile*** array, int* length, int* size, GFile* value);
-static void _vala_array_add12 (GFile*** array, int* length, int* size, GFile* value);
 static void _vala_array_add13 (GFile*** array, int* length, int* size, GFile* value);
+static void _vala_array_add14 (GFile*** array, int* length, int* size, GFile* value);
+static void _vala_array_add15 (GFile*** array, int* length, int* size, GFile* value);
 static void build_tools_parser_start (BuildTools* self, GMarkupParseContext* context, const gchar* name, gchar** attr_names, int attr_names_length1, gchar** attr_values, int attr_values_length1, GError** error);
 static void _build_tools_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context, const gchar* element_name, gchar** attribute_names, gchar** attribute_values, gpointer self, GError** error);
 static void build_tools_parser_end (BuildTools* self, GMarkupParseContext* context, const gchar* name, GError** error);
@@ -227,7 +228,7 @@ GType post_processor_type_get_type (void) {
 }
 
 
-static gchar** _vala_array_dup8 (gchar** self, int length) {
+static gchar** _vala_array_dup9 (gchar** self, int length) {
 	gchar** result;
 	int i;
 	result = g_new0 (gchar*, length + 1);
@@ -243,7 +244,7 @@ void build_job_copy (const BuildJob* self, BuildJob* dest) {
 	dest->must_succeed = self->must_succeed;
 	dest->post_processor = self->post_processor;
 	dest->command = g_strdup (self->command);
-	dest->command_args = (_tmp0_ = self->command_args, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup8 (_tmp0_, (*self).command_args_length1));
+	dest->command_args = (_tmp0_ = self->command_args, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup9 (_tmp0_, (*self).command_args_length1));
 	dest->command_args_length1 = self->command_args_length1;
 }
 
@@ -563,12 +564,30 @@ void build_tools_delete (BuildTools* self, gint num) {
 
 
 void build_tools_add (BuildTools* self, BuildTool* tool) {
-	gboolean _tmp0_;
+	gint _tmp0_;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->build_tools != NULL);
+	_tmp0_ = gee_collection_get_size ((GeeCollection*) self->priv->build_tools);
+	build_tools_insert (self, _tmp0_, tool);
+}
+
+
+void build_tools_insert (BuildTools* self, gint pos, BuildTool* tool) {
+	gboolean _tmp0_ = FALSE;
+	gboolean _tmp2_;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (self->priv->build_tools != NULL);
-	_tmp0_ = build_tools_is_compilation (self, (*tool).icon);
-	(*tool).compilation = _tmp0_;
-	gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->build_tools, tool);
+	if (0 <= pos) {
+		gint _tmp1_;
+		_tmp1_ = gee_collection_get_size ((GeeCollection*) self->priv->build_tools);
+		_tmp0_ = pos <= _tmp1_;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	g_return_if_fail (_tmp0_);
+	_tmp2_ = build_tools_is_compilation (self, (*tool).icon);
+	(*tool).compilation = _tmp2_;
+	gee_abstract_list_insert ((GeeAbstractList*) self->priv->build_tools, pos, tool);
 	build_tools_update_all_menus (self);
 }
 
@@ -801,7 +820,7 @@ static gboolean build_tools_is_compilation (BuildTools* self, const gchar* icon)
 }
 
 
-static void _vala_array_add11 (GFile*** array, int* length, int* size, GFile* value) {
+static void _vala_array_add13 (GFile*** array, int* length, int* size, GFile* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (GFile*, *array, (*size) + 1);
@@ -811,7 +830,7 @@ static void _vala_array_add11 (GFile*** array, int* length, int* size, GFile* va
 }
 
 
-static void _vala_array_add12 (GFile*** array, int* length, int* size, GFile* value) {
+static void _vala_array_add14 (GFile*** array, int* length, int* size, GFile* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (GFile*, *array, (*size) + 1);
@@ -821,7 +840,7 @@ static void _vala_array_add12 (GFile*** array, int* length, int* size, GFile* va
 }
 
 
-static void _vala_array_add13 (GFile*** array, int* length, int* size, GFile* value) {
+static void _vala_array_add15 (GFile*** array, int* length, int* size, GFile* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (GFile*, *array, (*size) + 1);
@@ -873,12 +892,12 @@ static void build_tools_load (BuildTools* self) {
 	files_length1 = 0;
 	_files_size_ = 0;
 	_tmp2_ = build_tools_get_user_config_file (self);
-	_vala_array_add11 (&files, &files_length1, &_files_size_, _tmp2_);
+	_vala_array_add13 (&files, &files_length1, &_files_size_, _tmp2_);
 	_tmp3_ = _ ("build_tools-en.xml");
 	_tmp4_ = g_build_filename (DATA_DIR, "build_tools", _tmp3_, NULL, NULL);
 	_tmp5_ = _tmp4_;
 	_tmp6_ = g_file_new_for_path (_tmp5_);
-	_vala_array_add12 (&files, &files_length1, &_files_size_, _tmp6_);
+	_vala_array_add14 (&files, &files_length1, &_files_size_, _tmp6_);
 	_g_free0 (_tmp5_);
 	_tmp7_ = g_build_filename (DATA_DIR, "build_tools", "build_tools-en.xml", NULL, NULL);
 	_tmp8_ = _tmp7_;
@@ -890,7 +909,7 @@ static void build_tools_load (BuildTools* self) {
 	if (!_tmp11_) {
 		GFile* _tmp12_;
 		_tmp12_ = _g_object_ref0 (default_file);
-		_vala_array_add13 (&files, &files_length1, &_files_size_, _tmp12_);
+		_vala_array_add15 (&files, &files_length1, &_files_size_, _tmp12_);
 	}
 	{
 		GFile** file_collection;
@@ -921,7 +940,7 @@ static void build_tools_load (BuildTools* self) {
 				contents = _tmp15_;
 				if (_inner_error_ != NULL) {
 					_g_free0 (contents);
-					goto __catch35_g_error;
+					goto __catch37_g_error;
 				}
 				_tmp16_.start_element = _build_tools_parser_start_gmarkup_parser_start_element_func;
 				_tmp16_.end_element = _build_tools_parser_end_gmarkup_parser_end_element_func;
@@ -935,7 +954,7 @@ static void build_tools_load (BuildTools* self) {
 				if (_inner_error_ != NULL) {
 					_g_markup_parse_context_free0 (context);
 					_g_free0 (contents);
-					goto __catch35_g_error;
+					goto __catch37_g_error;
 				}
 				_g_markup_parse_context_free0 (context);
 				_g_free0 (contents);
@@ -943,8 +962,8 @@ static void build_tools_load (BuildTools* self) {
 				break;
 				_g_markup_parse_context_free0 (context);
 				_g_free0 (contents);
-				goto __finally35;
-				__catch35_g_error:
+				goto __finally37;
+				__catch37_g_error:
 				{
 					GError * e;
 					e = _inner_error_;
@@ -952,7 +971,7 @@ static void build_tools_load (BuildTools* self) {
 					fprintf (stderr, "Warning: impossible to load build tools: %s\n", e->message);
 					_g_error_free0 (e);
 				}
-				__finally35:
+				__finally37:
 				if (_inner_error_ != NULL) {
 					_g_object_unref0 (file);
 					_g_object_unref0 (default_file);
@@ -1541,7 +1560,7 @@ void build_tools_save (BuildTools* self) {
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (parent);
 			_g_object_unref0 (file);
-			goto __catch36_g_error;
+			goto __catch38_g_error;
 		}
 	}
 	_tmp37_ = strlen (content);
@@ -1549,12 +1568,12 @@ void build_tools_save (BuildTools* self) {
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (parent);
 		_g_object_unref0 (file);
-		goto __catch36_g_error;
+		goto __catch38_g_error;
 	}
 	_g_object_unref0 (parent);
 	_g_object_unref0 (file);
-	goto __finally36;
-	__catch36_g_error:
+	goto __finally38;
+	__catch38_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1562,7 +1581,7 @@ void build_tools_save (BuildTools* self) {
 		fprintf (stderr, "Warning: impossible to save build tools: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally36:
+	__finally38:
 	if (_inner_error_ != NULL) {
 		_g_free0 (content);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
diff --git a/src/C/build_view.c b/src/C/build_view.c
index e9a8d2f..7549fbc 100644
--- a/src/C/build_view.c
+++ b/src/C/build_view.c
@@ -1,4 +1,4 @@
-/* build_view.c generated by valac 0.12.0, the Vala compiler
+/* build_view.c generated by valac 0.12.1, the Vala compiler
  * generated from build_view.vala, do not modify */
 
 /*
@@ -161,25 +161,29 @@ enum  {
 static GType build_view_build_info_get_type (void) G_GNUC_UNUSED;
 BuildView* build_view_new (MainWindow* main_window, GtkToolbar* toolbar, GtkToggleAction* view_bottom_panel);
 BuildView* build_view_construct (GType object_type, MainWindow* main_window, GtkToolbar* toolbar, GtkToggleAction* view_bottom_panel);
-static gboolean _lambda42_ (GtkTreeModel* model, GtkTreeIter* iter, BuildView* self);
+static gboolean _lambda48_ (GtkTreeModel* model, GtkTreeIter* iter, BuildView* self);
 gboolean build_view_get_show_errors (BuildView* self);
 gboolean build_view_get_show_warnings (BuildView* self);
 gboolean build_view_get_show_badboxes (BuildView* self);
-static gboolean __lambda42__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self);
-static void _lambda43_ (BuildView* self);
-static void __lambda43__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda44_ (BuildView* self);
-static void __lambda44__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda45_ (BuildView* self);
-static void __lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static gboolean build_view_on_row_selection (BuildView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
-static gboolean _build_view_on_row_selection_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
-static void _lambda63_ (BuildView* self);
-static void __lambda63__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static gboolean __lambda48__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self);
+static void _lambda49_ (BuildView* self);
+static void __lambda49__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda50_ (BuildView* self);
+static void __lambda50__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda51_ (BuildView* self);
+static void __lambda51__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static gboolean _lambda52_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, BuildView* self);
+static gboolean build_view_select_row (BuildView* self, GtkTreeModel* model, GtkTreePath* path);
+static gboolean __lambda52__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
+static void _lambda72_ (GtkTreePath* path, BuildView* self);
+static void __lambda72__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
+static void _lambda73_ (BuildView* self);
+static void __lambda73__gtk_button_clicked (GtkButton* _sender, gpointer self);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
 static void build_view_jump_to_file (BuildView* self, const gchar* filename, gint start_line, gint end_line);
 GType document_tab_get_type (void) G_GNUC_CONST;
 DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
+void utils_flush_queue (void);
 GType document_get_type (void) G_GNUC_CONST;
 Document* document_tab_get_document (DocumentTab* self);
 void document_select_lines (Document* self, gint start, gint end);
@@ -274,7 +278,7 @@ static GType build_view_build_info_get_type (void) {
 }
 
 
-static gboolean _lambda42_ (GtkTreeModel* model, GtkTreeIter* iter, BuildView* self) {
+static gboolean _lambda48_ (GtkTreeModel* model, GtkTreeIter* iter, BuildView* self) {
 	gboolean result = FALSE;
 	BuildMessageType msg_type = 0;
 	g_return_val_if_fail (model != NULL, FALSE);
@@ -304,40 +308,40 @@ static gboolean _lambda42_ (GtkTreeModel* model, GtkTreeIter* iter, BuildView* s
 }
 
 
-static gboolean __lambda42__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self) {
+static gboolean __lambda48__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self) {
 	gboolean result;
-	result = _lambda42_ (model, iter, self);
+	result = _lambda48_ (model, iter, self);
 	return result;
 }
 
 
-static void _lambda43_ (BuildView* self) {
+static void _lambda49_ (BuildView* self) {
 	gtk_tree_model_filter_refilter (self->priv->filtered_model);
 }
 
 
-static void __lambda43__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda43_ (self);
+static void __lambda49__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda49_ (self);
 }
 
 
-static void _lambda44_ (BuildView* self) {
+static void _lambda50_ (BuildView* self) {
 	gtk_tree_model_filter_refilter (self->priv->filtered_model);
 }
 
 
-static void __lambda44__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda44_ (self);
+static void __lambda50__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda50_ (self);
 }
 
 
-static void _lambda45_ (BuildView* self) {
+static void _lambda51_ (BuildView* self) {
 	gtk_tree_model_filter_refilter (self->priv->filtered_model);
 }
 
 
-static void __lambda45__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda45_ (self);
+static void __lambda51__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda51_ (self);
 }
 
 
@@ -346,21 +350,48 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static gboolean _build_view_on_row_selection_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
+static gboolean _lambda52_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, BuildView* self) {
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	g_return_val_if_fail (select != NULL, FALSE);
+	g_return_val_if_fail (model != NULL, FALSE);
+	g_return_val_if_fail (path != NULL, FALSE);
+	if (path_currently_selected) {
+		result = TRUE;
+		return result;
+	}
+	_tmp0_ = build_view_select_row (self, model, path);
+	result = _tmp0_;
+	return result;
+}
+
+
+static gboolean __lambda52__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
 	gboolean result;
-	result = build_view_on_row_selection (self, selection, model, path, path_currently_selected);
+	result = _lambda52_ (selection, model, path, path_currently_selected, self);
 	return result;
 }
 
 
-static void _lambda63_ (BuildView* self) {
+static void _lambda72_ (GtkTreePath* path, BuildView* self) {
+	g_return_if_fail (path != NULL);
+	build_view_select_row (self, (GtkTreeModel*) self->priv->filtered_model, path);
+}
+
+
+static void __lambda72__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+	_lambda72_ (path, self);
+}
+
+
+static void _lambda73_ (BuildView* self) {
 	gtk_widget_hide ((GtkWidget*) self);
 	gtk_toggle_action_set_active (self->priv->action_view_bottom_panel, FALSE);
 }
 
 
-static void __lambda63__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda63_ (self);
+static void __lambda73__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda73_ (self);
 }
 
 
@@ -406,10 +437,10 @@ BuildView* build_view_construct (GType object_type, MainWindow* main_window, Gtk
 	_tmp1_ = (GtkTreeModelFilter*) gtk_tree_model_filter_new ((GtkTreeModel*) self->priv->store, NULL);
 	_g_object_unref0 (self->priv->filtered_model);
 	self->priv->filtered_model = _tmp1_;
-	gtk_tree_model_filter_set_visible_func (self->priv->filtered_model, __lambda42__gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
-	g_signal_connect_object ((GObject*) self, "notify::show-errors", (GCallback) __lambda43__g_object_notify, self, 0);
-	g_signal_connect_object ((GObject*) self, "notify::show-warnings", (GCallback) __lambda44__g_object_notify, self, 0);
-	g_signal_connect_object ((GObject*) self, "notify::show-badboxes", (GCallback) __lambda45__g_object_notify, self, 0);
+	gtk_tree_model_filter_set_visible_func (self->priv->filtered_model, __lambda48__gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
+	g_signal_connect_object ((GObject*) self, "notify::show-errors", (GCallback) __lambda49__g_object_notify, self, 0);
+	g_signal_connect_object ((GObject*) self, "notify::show-warnings", (GCallback) __lambda50__g_object_notify, self, 0);
+	g_signal_connect_object ((GObject*) self, "notify::show-badboxes", (GCallback) __lambda51__g_object_notify, self, 0);
 	_tmp2_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) self->priv->filtered_model);
 	_g_object_unref0 (self->priv->view);
 	self->priv->view = g_object_ref_sink (_tmp2_);
@@ -424,6 +455,8 @@ BuildView* build_view_construct (GType object_type, MainWindow* main_window, Gtk
 	_tmp6_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
 	renderer_text = g_object_ref_sink (_tmp6_);
 	g_object_set (renderer_text, "weight-set", TRUE, NULL);
+	g_object_set (renderer_text, "editable", TRUE, NULL);
+	g_object_set (renderer_text, "editable-set", TRUE, NULL);
 	gtk_cell_layout_pack_start ((GtkCellLayout*) column_job, (GtkCellRenderer*) renderer_text, TRUE);
 	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_job, (GtkCellRenderer*) renderer_text, "text", (gint) BUILD_VIEW_BUILD_INFO_MESSAGE);
 	gtk_cell_layout_add_attribute ((GtkCellLayout*) column_job, (GtkCellRenderer*) renderer_text, "weight", (gint) BUILD_VIEW_BUILD_INFO_WEIGHT);
@@ -443,7 +476,8 @@ BuildView* build_view_construct (GType object_type, MainWindow* main_window, Gtk
 	_tmp14_ = _g_object_ref0 (_tmp13_);
 	select = _tmp14_;
 	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
-	gtk_tree_selection_set_select_function (select, _build_view_on_row_selection_gtk_tree_selection_func, g_object_ref (self), g_object_unref);
+	gtk_tree_selection_set_select_function (select, __lambda52__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
+	g_signal_connect_object (self->priv->view, "row-activated", (GCallback) __lambda72__gtk_tree_view_row_activated, self, 0);
 	_tmp15_ = (GtkButton*) gtk_button_new ();
 	close_button = g_object_ref_sink (_tmp15_);
 	gtk_button_set_relief (close_button, GTK_RELIEF_NONE);
@@ -454,7 +488,7 @@ BuildView* build_view_construct (GType object_type, MainWindow* main_window, Gtk
 	_tmp18_ = g_object_ref_sink (_tmp17_);
 	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) _tmp18_);
 	_g_object_unref0 (_tmp18_);
-	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda63__gtk_button_clicked, self, 0);
+	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda73__gtk_button_clicked, self, 0);
 	_tmp19_ = utils_add_scrollbar ((GtkWidget*) self->priv->view);
 	sw = _tmp19_;
 	gtk_box_pack_start ((GtkBox*) self, sw, TRUE, TRUE, (guint) 0);
@@ -479,7 +513,7 @@ BuildView* build_view_new (MainWindow* main_window, GtkToolbar* toolbar, GtkTogg
 }
 
 
-static gboolean build_view_on_row_selection (BuildView* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
+static gboolean build_view_select_row (BuildView* self, GtkTreeModel* model, GtkTreePath* path) {
 	gboolean result = FALSE;
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
@@ -491,7 +525,6 @@ static gboolean build_view_on_row_selection (BuildView* self, GtkTreeSelection*
 	gboolean _tmp2_ = FALSE;
 	gboolean _tmp3_ = FALSE;
 	g_return_val_if_fail (self != NULL, FALSE);
-	g_return_val_if_fail (selection != NULL, FALSE);
 	g_return_val_if_fail (model != NULL, FALSE);
 	g_return_val_if_fail (path != NULL, FALSE);
 	_tmp1_ = gtk_tree_model_get_iter (model, &_tmp0_, path);
@@ -530,10 +563,13 @@ static gboolean build_view_on_row_selection (BuildView* self, GtkTreeSelection*
 				} else {
 					gtk_tree_view_expand_to_path (self->priv->view, path);
 				}
+				result = FALSE;
+				_g_free0 (filename);
+				return result;
 			}
 		}
 	}
-	result = FALSE;
+	result = TRUE;
 	_g_free0 (filename);
 	return result;
 }
@@ -550,6 +586,7 @@ static void build_view_jump_to_file (BuildView* self, const gchar* filename, gin
 	file = _tmp0_;
 	_tmp1_ = main_window_open_document (self->priv->main_window, file, TRUE);
 	tab = _tmp1_;
+	utils_flush_queue ();
 	if (start_line != (-1)) {
 		gint _tmp2_ = 0;
 		gint end;
diff --git a/src/C/clean_build_files.c b/src/C/clean_build_files.c
new file mode 100644
index 0000000..1e23f6b
--- /dev/null
+++ b/src/C/clean_build_files.c
@@ -0,0 +1,943 @@
+/* clean_build_files.c generated by valac 0.12.1, the Vala compiler
+ * generated from clean_build_files.vala, do not modify */
+
+/*
+ * This file is part of LaTeXila.
+ *
+ * Copyright  2011 SÃbastien Wilmet
+ *
+ * LaTeXila is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * LaTeXila is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gtksourceview/gtksourceview.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gio/gio.h>
+#include <gee.h>
+#include <stdio.h>
+#include <float.h>
+#include <math.h>
+#include <glib/gi18n-lib.h>
+
+
+#define TYPE_CLEAN_BUILD_FILES (clean_build_files_get_type ())
+#define CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFiles))
+#define CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+#define IS_CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLEAN_BUILD_FILES))
+#define IS_CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLEAN_BUILD_FILES))
+#define CLEAN_BUILD_FILES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+
+typedef struct _CleanBuildFiles CleanBuildFiles;
+typedef struct _CleanBuildFilesClass CleanBuildFilesClass;
+typedef struct _CleanBuildFilesPrivate CleanBuildFilesPrivate;
+
+#define TYPE_MAIN_WINDOW (main_window_get_type ())
+#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
+#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
+#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
+#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
+#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))
+
+typedef struct _MainWindow MainWindow;
+typedef struct _MainWindowClass MainWindowClass;
+
+#define TYPE_DOCUMENT (document_get_type ())
+#define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
+#define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
+#define IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT))
+#define IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT))
+#define DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT, DocumentClass))
+
+typedef struct _Document Document;
+typedef struct _DocumentClass DocumentClass;
+
+#define CLEAN_BUILD_FILES_TYPE_CLEAN_FILE_COLUMN (clean_build_files_clean_file_column_get_type ())
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+#define TYPE_PROJECT (project_get_type ())
+typedef struct _Project Project;
+#define _project_free0(var) ((var == NULL) ? NULL : (var = (project_free (var), NULL)))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+typedef struct _Block22Data Block22Data;
+#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
+
+struct _CleanBuildFiles {
+	GObject parent_instance;
+	CleanBuildFilesPrivate * priv;
+};
+
+struct _CleanBuildFilesClass {
+	GObjectClass parent_class;
+};
+
+struct _CleanBuildFilesPrivate {
+	MainWindow* _main_window;
+	Document* _doc;
+	gchar** _extensions;
+	gint _extensions_length1;
+	gint __extensions_size_;
+	gboolean _no_confirm;
+};
+
+typedef enum  {
+	CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE,
+	CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME,
+	CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_FILE,
+	CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_N_COLUMNS
+} CleanBuildFilesCleanFileColumn;
+
+struct _Project {
+	GFile* directory;
+	GFile* main_file;
+};
+
+struct _Block22Data {
+	int _ref_count_;
+	CleanBuildFiles * self;
+	GtkListStore* store;
+};
+
+
+static gpointer clean_build_files_parent_class = NULL;
+
+GType clean_build_files_get_type (void) G_GNUC_CONST;
+GType main_window_get_type (void) G_GNUC_CONST;
+GType document_get_type (void) G_GNUC_CONST;
+#define CLEAN_BUILD_FILES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesPrivate))
+enum  {
+	CLEAN_BUILD_FILES_DUMMY_PROPERTY
+};
+static GType clean_build_files_clean_file_column_get_type (void) G_GNUC_UNUSED;
+CleanBuildFiles* clean_build_files_new (MainWindow* main_window, Document* doc);
+CleanBuildFiles* clean_build_files_construct (GType object_type, MainWindow* main_window, Document* doc);
+gboolean clean_build_files_clean (CleanBuildFiles* self);
+gboolean document_is_main_file_a_tex_file (Document* self);
+GType project_get_type (void) G_GNUC_CONST;
+Project* project_dup (const Project* self);
+void project_free (Project* self);
+void project_copy (const Project* self, Project* dest);
+void project_destroy (Project* self);
+Project* document_get_project (Document* self);
+static GeeArrayList* clean_build_files_get_build_files_in_directory (CleanBuildFiles* self, GFile* directory);
+GFile* document_get_location (Document* self);
+static GeeArrayList* clean_build_files_get_build_files_simple (CleanBuildFiles* self);
+static void clean_build_files_show_info_no_file (CleanBuildFiles* self);
+void utils_delete_file (GFile* file);
+static gboolean clean_build_files_confirm_cleanup (CleanBuildFiles* self, GeeArrayList* files_to_delete, GFile* directory);
+gchar* utils_get_shortname (const gchar* path);
+gchar* utils_get_extension (const gchar* path);
+static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
+static GtkTreeView* clean_build_files_get_list_files (CleanBuildFiles* self, GeeArrayList* files_to_delete, GFile* directory);
+static GtkDialog* clean_build_files_get_dialog (CleanBuildFiles* self, GtkTreeView* list_files);
+static gboolean clean_build_files_run_dialog (CleanBuildFiles* self, GtkDialog* dialog, GtkTreeModel* list_store);
+static Block22Data* block22_data_ref (Block22Data* _data22_);
+static void block22_data_unref (Block22Data* _data22_);
+static gint clean_build_files_on_sort_list_files (CleanBuildFiles* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b);
+static gint _clean_build_files_on_sort_list_files_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self);
+gchar* utils_get_relative_path (GFile* origin, GFile* target, GFile* common_dir);
+static void _lambda33_ (const gchar* path_str, Block22Data* _data22_);
+static void __lambda33__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
+GtkWidget* utils_add_scrollbar (GtkWidget* child);
+static void _vala_array_add18 (GFile*** array, int* length, int* size, GFile* value);
+static void clean_build_files_finalize (GObject* obj);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static gint _vala_array_length (gpointer array);
+
+
+static GType clean_build_files_clean_file_column_get_type (void) {
+	static volatile gsize clean_build_files_clean_file_column_type_id__volatile = 0;
+	if (g_once_init_enter (&clean_build_files_clean_file_column_type_id__volatile)) {
+		static const GEnumValue values[] = {{CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, "CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE", "delete"}, {CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME, "CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME", "name"}, {CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_FILE, "CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_FILE", "file"}, {CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_N_COLUMNS, "CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
+		GType clean_build_files_clean_file_column_type_id;
+		clean_build_files_clean_file_column_type_id = g_enum_register_static ("CleanBuildFilesCleanFileColumn", values);
+		g_once_init_leave (&clean_build_files_clean_file_column_type_id__volatile, clean_build_files_clean_file_column_type_id);
+	}
+	return clean_build_files_clean_file_column_type_id__volatile;
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+	return self ? g_object_ref (self) : NULL;
+}
+
+
+CleanBuildFiles* clean_build_files_construct (GType object_type, MainWindow* main_window, Document* doc) {
+	CleanBuildFiles * self = NULL;
+	Document* _tmp0_;
+	GSettings* _tmp1_ = NULL;
+	GSettings* settings;
+	gchar* _tmp2_ = NULL;
+	gchar* exts;
+	gchar** _tmp3_;
+	gchar** _tmp4_ = NULL;
+	gboolean _tmp5_;
+	g_return_val_if_fail (main_window != NULL, NULL);
+	g_return_val_if_fail (doc != NULL, NULL);
+	self = (CleanBuildFiles*) g_object_new (object_type, NULL);
+	self->priv->_main_window = main_window;
+	_tmp0_ = _g_object_ref0 (doc);
+	_g_object_unref0 (self->priv->_doc);
+	self->priv->_doc = _tmp0_;
+	_tmp1_ = g_settings_new ("org.gnome.latexila.preferences.latex");
+	settings = _tmp1_;
+	_tmp2_ = g_settings_get_string (settings, "clean-extensions");
+	exts = _tmp2_;
+	_tmp4_ = _tmp3_ = g_strsplit (exts, " ", 0);
+	self->priv->_extensions = (_vala_array_free (self->priv->_extensions, self->priv->_extensions_length1, (GDestroyNotify) g_free), NULL);
+	self->priv->_extensions = _tmp4_;
+	self->priv->_extensions_length1 = _vala_array_length (_tmp3_);
+	self->priv->__extensions_size_ = _vala_array_length (_tmp3_);
+	_tmp5_ = g_settings_get_boolean (settings, "no-confirm-clean");
+	self->priv->_no_confirm = _tmp5_;
+	_g_free0 (exts);
+	_g_object_unref0 (settings);
+	return self;
+}
+
+
+CleanBuildFiles* clean_build_files_new (MainWindow* main_window, Document* doc) {
+	return clean_build_files_construct (TYPE_CLEAN_BUILD_FILES, main_window, doc);
+}
+
+
+gboolean clean_build_files_clean (CleanBuildFiles* self) {
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	GeeArrayList* files_to_delete = NULL;
+	GFile* directory = NULL;
+	Project* _tmp1_ = NULL;
+	Project* project;
+	gint _tmp7_;
+	gboolean _tmp11_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	_tmp0_ = document_is_main_file_a_tex_file (self->priv->_doc);
+	if (!_tmp0_) {
+		result = FALSE;
+		return result;
+	}
+	_tmp1_ = document_get_project (self->priv->_doc);
+	project = _tmp1_;
+	if (project != NULL) {
+		GFile* _tmp2_;
+		GeeArrayList* _tmp3_ = NULL;
+		_tmp2_ = _g_object_ref0 ((*project).directory);
+		_g_object_unref0 (directory);
+		directory = _tmp2_;
+		_tmp3_ = clean_build_files_get_build_files_in_directory (self, directory);
+		_g_object_unref0 (files_to_delete);
+		files_to_delete = _tmp3_;
+	} else {
+		GFile* _tmp4_ = NULL;
+		GFile* _tmp5_ = NULL;
+		GeeArrayList* _tmp6_ = NULL;
+		_tmp4_ = document_get_location (self->priv->_doc);
+		_tmp5_ = g_file_get_parent (_tmp4_);
+		_g_object_unref0 (directory);
+		directory = _tmp5_;
+		_tmp6_ = clean_build_files_get_build_files_simple (self);
+		_g_object_unref0 (files_to_delete);
+		files_to_delete = _tmp6_;
+	}
+	_tmp7_ = gee_collection_get_size ((GeeCollection*) files_to_delete);
+	if (_tmp7_ == 0) {
+		if (!self->priv->_no_confirm) {
+			clean_build_files_show_info_no_file (self);
+		}
+		result = FALSE;
+		_project_free0 (project);
+		_g_object_unref0 (directory);
+		_g_object_unref0 (files_to_delete);
+		return result;
+	}
+	if (self->priv->_no_confirm) {
+		{
+			GeeArrayList* _tmp8_;
+			GeeArrayList* _file_to_delete_list;
+			gint _tmp9_;
+			gint _file_to_delete_size;
+			gint _file_to_delete_index;
+			_tmp8_ = _g_object_ref0 (files_to_delete);
+			_file_to_delete_list = _tmp8_;
+			_tmp9_ = gee_collection_get_size ((GeeCollection*) _file_to_delete_list);
+			_file_to_delete_size = _tmp9_;
+			_file_to_delete_index = -1;
+			while (TRUE) {
+				gpointer _tmp10_ = NULL;
+				GFile* file_to_delete;
+				_file_to_delete_index = _file_to_delete_index + 1;
+				if (!(_file_to_delete_index < _file_to_delete_size)) {
+					break;
+				}
+				_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _file_to_delete_list, _file_to_delete_index);
+				file_to_delete = (GFile*) _tmp10_;
+				utils_delete_file (file_to_delete);
+				_g_object_unref0 (file_to_delete);
+			}
+			_g_object_unref0 (_file_to_delete_list);
+		}
+		result = TRUE;
+		_project_free0 (project);
+		_g_object_unref0 (directory);
+		_g_object_unref0 (files_to_delete);
+		return result;
+	}
+	_tmp11_ = clean_build_files_confirm_cleanup (self, files_to_delete, directory);
+	result = _tmp11_;
+	_project_free0 (project);
+	_g_object_unref0 (directory);
+	_g_object_unref0 (files_to_delete);
+	return result;
+}
+
+
+static GeeArrayList* clean_build_files_get_build_files_simple (CleanBuildFiles* self) {
+	GeeArrayList* result = NULL;
+	GFile* _tmp0_ = NULL;
+	GFile* _tmp1_;
+	GFile* location;
+	GFile* _tmp2_ = NULL;
+	GFile* directory;
+	gchar* _tmp3_ = NULL;
+	gchar* _tmp4_;
+	gchar* _tmp5_ = NULL;
+	gchar* _tmp6_;
+	gchar* shortname;
+	GeeArrayList* _tmp7_ = NULL;
+	GeeArrayList* files_to_delete;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = document_get_location (self->priv->_doc);
+	_tmp1_ = _g_object_ref0 (_tmp0_);
+	location = _tmp1_;
+	_tmp2_ = g_file_get_parent (location);
+	directory = _tmp2_;
+	_tmp3_ = g_file_get_basename (location);
+	_tmp4_ = _tmp3_;
+	_tmp5_ = utils_get_shortname (_tmp4_);
+	_tmp6_ = _tmp5_;
+	_g_free0 (_tmp4_);
+	shortname = _tmp6_;
+	_tmp7_ = gee_array_list_new (G_TYPE_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
+	files_to_delete = _tmp7_;
+	{
+		gchar** extension_collection;
+		int extension_collection_length1;
+		int extension_it;
+		extension_collection = self->priv->_extensions;
+		extension_collection_length1 = self->priv->_extensions_length1;
+		for (extension_it = 0; extension_it < self->priv->_extensions_length1; extension_it = extension_it + 1) {
+			gchar* _tmp8_;
+			gchar* extension;
+			_tmp8_ = g_strdup (extension_collection[extension_it]);
+			extension = _tmp8_;
+			{
+				gchar* _tmp9_;
+				gchar* basename;
+				GFile* _tmp10_ = NULL;
+				GFile* file;
+				gboolean _tmp11_;
+				_tmp9_ = g_strconcat (shortname, extension, NULL);
+				basename = _tmp9_;
+				_tmp10_ = g_file_get_child (directory, basename);
+				file = _tmp10_;
+				_tmp11_ = g_file_query_exists (file, NULL);
+				if (_tmp11_) {
+					gee_abstract_collection_add ((GeeAbstractCollection*) files_to_delete, file);
+				}
+				_g_object_unref0 (file);
+				_g_free0 (basename);
+				_g_free0 (extension);
+			}
+		}
+	}
+	result = files_to_delete;
+	_g_free0 (shortname);
+	_g_object_unref0 (directory);
+	_g_object_unref0 (location);
+	return result;
+}
+
+
+static gchar string_get (const gchar* self, glong index) {
+	gchar result = '\0';
+	g_return_val_if_fail (self != NULL, '\0');
+	result = ((gchar*) self)[index];
+	return result;
+}
+
+
+static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle) {
+	int i;
+	for (i = 0; i < stack_length; i++) {
+		if (g_strcmp0 (stack[i], needle) == 0) {
+			return TRUE;
+		}
+	}
+	return FALSE;
+}
+
+
+static GeeArrayList* clean_build_files_get_build_files_in_directory (CleanBuildFiles* self, GFile* directory) {
+	GeeArrayList* result = NULL;
+	GeeArrayList* _tmp0_ = NULL;
+	GeeArrayList* files_to_delete;
+	GFileEnumerator* enumerator = NULL;
+	GFileEnumerator* _tmp1_ = NULL;
+	GFileEnumerator* _tmp2_;
+	GError * _inner_error_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (directory != NULL, NULL);
+	_tmp0_ = gee_array_list_new (G_TYPE_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
+	files_to_delete = _tmp0_;
+	_tmp1_ = g_file_enumerate_children (directory, "standard::type,standard::name", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
+	_tmp2_ = _tmp1_;
+	if (_inner_error_ != NULL) {
+		goto __catch54_g_error;
+	}
+	_g_object_unref0 (enumerator);
+	enumerator = _tmp2_;
+	goto __finally54;
+	__catch54_g_error:
+	{
+		GError * e;
+		e = _inner_error_;
+		_inner_error_ = NULL;
+		fprintf (stderr, "Error: clean build files: %s\n", e->message);
+		result = files_to_delete;
+		_g_error_free0 (e);
+		_g_object_unref0 (enumerator);
+		return result;
+	}
+	__finally54:
+	if (_inner_error_ != NULL) {
+		_g_object_unref0 (enumerator);
+		_g_object_unref0 (files_to_delete);
+		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return NULL;
+	}
+	while (TRUE) {
+		GFileInfo* info;
+		GFileInfo* _tmp3_ = NULL;
+		GFileInfo* _tmp4_;
+		const gchar* _tmp5_ = NULL;
+		gchar* _tmp6_;
+		gchar* name;
+		gchar _tmp7_;
+		GFile* _tmp8_ = NULL;
+		GFile* file;
+		GFileType _tmp9_;
+		GFileType type;
+		gchar* _tmp11_ = NULL;
+		gchar* extension;
+		info = NULL;
+		_tmp3_ = g_file_enumerator_next_file (enumerator, NULL, &_inner_error_);
+		_tmp4_ = _tmp3_;
+		if (_inner_error_ != NULL) {
+			goto __catch55_g_error;
+		}
+		_g_object_unref0 (info);
+		info = _tmp4_;
+		goto __finally55;
+		__catch55_g_error:
+		{
+			GError * e;
+			e = _inner_error_;
+			_inner_error_ = NULL;
+			fprintf (stderr, "Error: clean build files: %s\n", e->message);
+			_g_error_free0 (e);
+			_g_object_unref0 (info);
+			break;
+		}
+		__finally55:
+		if (_inner_error_ != NULL) {
+			_g_object_unref0 (info);
+			_g_object_unref0 (enumerator);
+			_g_object_unref0 (files_to_delete);
+			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return NULL;
+		}
+		if (info == NULL) {
+			_g_object_unref0 (info);
+			break;
+		}
+		_tmp5_ = g_file_info_get_name (info);
+		_tmp6_ = g_strdup (_tmp5_);
+		name = _tmp6_;
+		_tmp7_ = string_get (name, (glong) 0);
+		if (_tmp7_ == '.') {
+			_g_free0 (name);
+			_g_object_unref0 (info);
+			continue;
+		}
+		_tmp8_ = g_file_get_child (directory, name);
+		file = _tmp8_;
+		_tmp9_ = g_file_info_get_file_type (info);
+		type = _tmp9_;
+		if (type == G_FILE_TYPE_DIRECTORY) {
+			GeeArrayList* _tmp10_ = NULL;
+			GeeArrayList* files_to_delete_in_dir;
+			_tmp10_ = clean_build_files_get_build_files_in_directory (self, file);
+			files_to_delete_in_dir = _tmp10_;
+			gee_abstract_collection_add_all ((GeeAbstractCollection*) files_to_delete, (GeeCollection*) files_to_delete_in_dir);
+			_g_object_unref0 (files_to_delete_in_dir);
+			_g_object_unref0 (file);
+			_g_free0 (name);
+			_g_object_unref0 (info);
+			continue;
+		}
+		_tmp11_ = utils_get_extension (name);
+		extension = _tmp11_;
+		if (_vala_string_array_contains (self->priv->_extensions, self->priv->_extensions_length1, extension)) {
+			gee_abstract_collection_add ((GeeAbstractCollection*) files_to_delete, file);
+		}
+		_g_free0 (extension);
+		_g_object_unref0 (file);
+		_g_free0 (name);
+		_g_object_unref0 (info);
+	}
+	result = files_to_delete;
+	_g_object_unref0 (enumerator);
+	return result;
+}
+
+
+static gboolean clean_build_files_confirm_cleanup (CleanBuildFiles* self, GeeArrayList* files_to_delete, GFile* directory) {
+	gboolean result = FALSE;
+	gint _tmp0_;
+	GtkTreeView* _tmp1_ = NULL;
+	GtkTreeView* list_files;
+	GtkDialog* _tmp2_ = NULL;
+	GtkDialog* dialog;
+	GtkTreeModel* _tmp3_ = NULL;
+	gboolean _tmp4_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (files_to_delete != NULL, FALSE);
+	g_return_val_if_fail (directory != NULL, FALSE);
+	_tmp0_ = gee_collection_get_size ((GeeCollection*) files_to_delete);
+	g_return_val_if_fail (0 < _tmp0_, FALSE);
+	_tmp1_ = clean_build_files_get_list_files (self, files_to_delete, directory);
+	list_files = _tmp1_;
+	_tmp2_ = clean_build_files_get_dialog (self, list_files);
+	dialog = _tmp2_;
+	_tmp3_ = gtk_tree_view_get_model (list_files);
+	_tmp4_ = clean_build_files_run_dialog (self, dialog, _tmp3_);
+	result = _tmp4_;
+	_g_object_unref0 (dialog);
+	_g_object_unref0 (list_files);
+	return result;
+}
+
+
+static Block22Data* block22_data_ref (Block22Data* _data22_) {
+	g_atomic_int_inc (&_data22_->_ref_count_);
+	return _data22_;
+}
+
+
+static void block22_data_unref (Block22Data* _data22_) {
+	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
+		_g_object_unref0 (_data22_->self);
+		_g_object_unref0 (_data22_->store);
+		g_slice_free (Block22Data, _data22_);
+	}
+}
+
+
+static gint _clean_build_files_on_sort_list_files_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self) {
+	gint result;
+	result = clean_build_files_on_sort_list_files (self, model, a, b);
+	return result;
+}
+
+
+static void _lambda33_ (const gchar* path_str, Block22Data* _data22_) {
+	CleanBuildFiles * self;
+	GtkTreePath* _tmp0_ = NULL;
+	GtkTreePath* path;
+	GtkTreeIter iter = {0};
+	gboolean active = FALSE;
+	GtkTreeIter _tmp1_ = {0};
+	self = _data22_->self;
+	g_return_if_fail (path_str != NULL);
+	_tmp0_ = gtk_tree_path_new_from_string (path_str);
+	path = _tmp0_;
+	gtk_tree_model_get_iter ((GtkTreeModel*) _data22_->store, &_tmp1_, path);
+	iter = _tmp1_;
+	gtk_tree_model_get ((GtkTreeModel*) _data22_->store, &iter, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, &active, -1, -1);
+	gtk_list_store_set (_data22_->store, &iter, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, !active, -1, -1);
+	_gtk_tree_path_free0 (path);
+}
+
+
+static void __lambda33__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
+	_lambda33_ (path, self);
+}
+
+
+static GtkTreeView* clean_build_files_get_list_files (CleanBuildFiles* self, GeeArrayList* files_to_delete, GFile* directory) {
+	GtkTreeView* result = NULL;
+	Block22Data* _data22_;
+	GtkTreeView* _tmp0_ = NULL;
+	GtkTreeView* treeview;
+	GtkListStore* _tmp1_ = NULL;
+	GtkCellRendererToggle* _tmp7_ = NULL;
+	GtkCellRendererToggle* toggle_renderer;
+	GtkTreeViewColumn* _tmp8_ = NULL;
+	GtkTreeViewColumn* column;
+	GtkCellRendererText* _tmp9_ = NULL;
+	GtkCellRendererText* text_renderer;
+	GtkTreeViewColumn* _tmp10_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (files_to_delete != NULL, NULL);
+	g_return_val_if_fail (directory != NULL, NULL);
+	_data22_ = g_slice_new0 (Block22Data);
+	_data22_->_ref_count_ = 1;
+	_data22_->self = g_object_ref (self);
+	_tmp0_ = (GtkTreeView*) gtk_tree_view_new ();
+	treeview = g_object_ref_sink (_tmp0_);
+	gtk_widget_set_size_request ((GtkWidget*) treeview, 260, 120);
+	gtk_tree_view_set_headers_visible (treeview, FALSE);
+	gtk_tree_view_set_enable_search (treeview, FALSE);
+	_tmp1_ = gtk_list_store_new ((gint) CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_N_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_FILE);
+	_data22_->store = _tmp1_;
+	gtk_tree_sortable_set_sort_func ((GtkTreeSortable*) _data22_->store, 0, _clean_build_files_on_sort_list_files_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
+	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _data22_->store, 0, GTK_SORT_ASCENDING);
+	{
+		GeeArrayList* _tmp2_;
+		GeeArrayList* _file_to_delete_list;
+		gint _tmp3_;
+		gint _file_to_delete_size;
+		gint _file_to_delete_index;
+		_tmp2_ = _g_object_ref0 (files_to_delete);
+		_file_to_delete_list = _tmp2_;
+		_tmp3_ = gee_collection_get_size ((GeeCollection*) _file_to_delete_list);
+		_file_to_delete_size = _tmp3_;
+		_file_to_delete_index = -1;
+		while (TRUE) {
+			gpointer _tmp4_ = NULL;
+			GFile* file_to_delete;
+			gchar* _tmp5_ = NULL;
+			gchar* relative_path;
+			GtkTreeIter iter = {0};
+			GtkTreeIter _tmp6_ = {0};
+			_file_to_delete_index = _file_to_delete_index + 1;
+			if (!(_file_to_delete_index < _file_to_delete_size)) {
+				break;
+			}
+			_tmp4_ = gee_abstract_list_get ((GeeAbstractList*) _file_to_delete_list, _file_to_delete_index);
+			file_to_delete = (GFile*) _tmp4_;
+			_tmp5_ = utils_get_relative_path (directory, file_to_delete, directory);
+			relative_path = _tmp5_;
+			gtk_list_store_append (_data22_->store, &_tmp6_);
+			iter = _tmp6_;
+			gtk_list_store_set (_data22_->store, &iter, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, TRUE, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME, relative_path, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_FILE, file_to_delete, -1, -1);
+			_g_free0 (relative_path);
+			_g_object_unref0 (file_to_delete);
+		}
+		_g_object_unref0 (_file_to_delete_list);
+	}
+	gtk_tree_view_set_model (treeview, (GtkTreeModel*) _data22_->store);
+	_tmp7_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
+	toggle_renderer = g_object_ref_sink (_tmp7_);
+	g_signal_connect_data (toggle_renderer, "toggled", (GCallback) __lambda33__gtk_cell_renderer_toggle_toggled, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
+	_tmp8_ = gtk_tree_view_column_new_with_attributes ("Delete?", (GtkCellRenderer*) toggle_renderer, "active", CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, NULL, NULL);
+	column = g_object_ref_sink (_tmp8_);
+	gtk_tree_view_append_column (treeview, column);
+	_tmp9_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+	text_renderer = g_object_ref_sink (_tmp9_);
+	_tmp10_ = gtk_tree_view_column_new_with_attributes ("Name", (GtkCellRenderer*) text_renderer, "text", CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME, NULL, NULL);
+	_g_object_unref0 (column);
+	column = g_object_ref_sink (_tmp10_);
+	gtk_tree_view_append_column (treeview, column);
+	result = treeview;
+	_g_object_unref0 (text_renderer);
+	_g_object_unref0 (column);
+	_g_object_unref0 (toggle_renderer);
+	block22_data_unref (_data22_);
+	_data22_ = NULL;
+	return result;
+}
+
+
+static GtkDialog* clean_build_files_get_dialog (CleanBuildFiles* self, GtkTreeView* list_files) {
+	GtkDialog* result = NULL;
+	GtkDialog* _tmp0_ = NULL;
+	GtkDialog* dialog;
+	GtkHBox* _tmp1_ = NULL;
+	GtkHBox* hbox;
+	GtkWidget* _tmp2_ = NULL;
+	GtkWidget* _tmp3_;
+	GtkVBox* _tmp4_;
+	GtkVBox* content_area;
+	GtkImage* _tmp5_ = NULL;
+	GtkImage* image;
+	GtkVBox* _tmp6_ = NULL;
+	GtkVBox* vbox;
+	GtkLabel* _tmp7_ = NULL;
+	GtkLabel* primary_label;
+	const gchar* _tmp8_ = NULL;
+	gchar* _tmp9_;
+	gchar* _tmp10_;
+	gchar* _tmp11_;
+	gchar* _tmp12_;
+	GtkVBox* _tmp13_ = NULL;
+	GtkVBox* vbox2;
+	const gchar* _tmp14_ = NULL;
+	GtkLabel* _tmp15_ = NULL;
+	GtkLabel* select_label;
+	GtkWidget* _tmp16_ = NULL;
+	GtkWidget* _tmp17_;
+	GtkScrolledWindow* sw;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (list_files != NULL, NULL);
+	_tmp0_ = (GtkDialog*) gtk_dialog_new_with_buttons (NULL, (GtkWindow*) self->priv->_main_window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT, NULL, NULL);
+	dialog = g_object_ref_sink (_tmp0_);
+	gtk_dialog_set_has_separator (dialog, FALSE);
+	_tmp1_ = (GtkHBox*) gtk_hbox_new (FALSE, 12);
+	hbox = g_object_ref_sink (_tmp1_);
+	gtk_container_set_border_width ((GtkContainer*) hbox, (guint) 5);
+	_tmp2_ = gtk_dialog_get_content_area (dialog);
+	_tmp3_ = _tmp2_;
+	_tmp4_ = _g_object_ref0 (GTK_IS_VBOX (_tmp3_) ? ((GtkVBox*) _tmp3_) : NULL);
+	content_area = _tmp4_;
+	gtk_box_pack_start ((GtkBox*) content_area, (GtkWidget*) hbox, TRUE, TRUE, (guint) 0);
+	_tmp5_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
+	image = g_object_ref_sink (_tmp5_);
+	gtk_misc_set_alignment ((GtkMisc*) image, (gfloat) 0.5, (gfloat) 0.0);
+	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) image, FALSE, FALSE, (guint) 0);
+	_tmp6_ = (GtkVBox*) gtk_vbox_new (FALSE, 12);
+	vbox = g_object_ref_sink (_tmp6_);
+	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) vbox, TRUE, TRUE, (guint) 0);
+	_tmp7_ = (GtkLabel*) gtk_label_new (NULL);
+	primary_label = g_object_ref_sink (_tmp7_);
+	gtk_label_set_line_wrap (primary_label, TRUE);
+	gtk_label_set_use_markup (primary_label, TRUE);
+	gtk_misc_set_alignment ((GtkMisc*) primary_label, (gfloat) 0.0, (gfloat) 0.5);
+	gtk_label_set_selectable (primary_label, TRUE);
+	_tmp8_ = _ ("Do you really want to delete these files?");
+	_tmp9_ = g_strconcat ("<span weight=\"bold\" size=\"larger\">", _tmp8_, NULL);
+	_tmp10_ = _tmp9_;
+	_tmp11_ = g_strconcat (_tmp10_, "</span>", NULL);
+	_tmp12_ = _tmp11_;
+	gtk_label_set_markup (primary_label, _tmp12_);
+	_g_free0 (_tmp12_);
+	_g_free0 (_tmp10_);
+	gtk_box_pack_start ((GtkBox*) vbox, (GtkWidget*) primary_label, FALSE, FALSE, (guint) 0);
+	_tmp13_ = (GtkVBox*) gtk_vbox_new (FALSE, 8);
+	vbox2 = g_object_ref_sink (_tmp13_);
+	gtk_box_pack_start ((GtkBox*) vbox, (GtkWidget*) vbox2, TRUE, TRUE, (guint) 0);
+	_tmp14_ = _ ("Select the files you want to delete:");
+	_tmp15_ = (GtkLabel*) gtk_label_new (_tmp14_);
+	select_label = g_object_ref_sink (_tmp15_);
+	gtk_label_set_line_wrap (select_label, TRUE);
+	gtk_misc_set_alignment ((GtkMisc*) select_label, (gfloat) 0.0, (gfloat) 0.5);
+	gtk_box_pack_start ((GtkBox*) vbox2, (GtkWidget*) select_label, FALSE, FALSE, (guint) 0);
+	_tmp16_ = utils_add_scrollbar ((GtkWidget*) list_files);
+	_tmp17_ = _tmp16_;
+	sw = GTK_IS_SCROLLED_WINDOW (_tmp17_) ? ((GtkScrolledWindow*) _tmp17_) : NULL;
+	gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_IN);
+	gtk_box_pack_start ((GtkBox*) vbox2, (GtkWidget*) sw, TRUE, TRUE, (guint) 0);
+	gtk_widget_show_all ((GtkWidget*) hbox);
+	result = dialog;
+	_g_object_unref0 (sw);
+	_g_object_unref0 (select_label);
+	_g_object_unref0 (vbox2);
+	_g_object_unref0 (primary_label);
+	_g_object_unref0 (vbox);
+	_g_object_unref0 (image);
+	_g_object_unref0 (content_area);
+	_g_object_unref0 (hbox);
+	return result;
+}
+
+
+static void _vala_array_add18 (GFile*** array, int* length, int* size, GFile* value) {
+	if ((*length) == (*size)) {
+		*size = (*size) ? (2 * (*size)) : 4;
+		*array = g_renew (GFile*, *array, (*size) + 1);
+	}
+	(*array)[(*length)++] = value;
+	(*array)[*length] = NULL;
+}
+
+
+static gboolean clean_build_files_run_dialog (CleanBuildFiles* self, GtkDialog* dialog, GtkTreeModel* list_store) {
+	gboolean result = FALSE;
+	gboolean ret;
+	gint _tmp0_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (dialog != NULL, FALSE);
+	g_return_val_if_fail (list_store != NULL, FALSE);
+	ret = FALSE;
+	_tmp0_ = gtk_dialog_run (dialog);
+	if (_tmp0_ == GTK_RESPONSE_ACCEPT) {
+		GFile** _tmp1_ = NULL;
+		GFile** selected_files;
+		gint selected_files_length1;
+		gint _selected_files_size_;
+		GtkTreeIter iter = {0};
+		GtkTreeIter _tmp2_ = {0};
+		gboolean _tmp3_;
+		gboolean valid;
+		_tmp1_ = g_new0 (GFile*, 0 + 1);
+		selected_files = _tmp1_;
+		selected_files_length1 = 0;
+		_selected_files_size_ = 0;
+		_tmp3_ = gtk_tree_model_get_iter_first (list_store, &_tmp2_);
+		iter = _tmp2_;
+		valid = _tmp3_;
+		while (TRUE) {
+			gboolean selected = FALSE;
+			GFile* file_to_delete = NULL;
+			gboolean _tmp5_;
+			if (!valid) {
+				break;
+			}
+			gtk_tree_model_get (list_store, &iter, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_DELETE, &selected, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_FILE, &file_to_delete, -1, -1);
+			if (selected) {
+				GFile* _tmp4_;
+				_tmp4_ = _g_object_ref0 (file_to_delete);
+				_vala_array_add18 (&selected_files, &selected_files_length1, &_selected_files_size_, _tmp4_);
+			}
+			_tmp5_ = gtk_tree_model_iter_next (list_store, &iter);
+			valid = _tmp5_;
+			_g_object_unref0 (file_to_delete);
+		}
+		ret = 0 < selected_files_length1;
+		{
+			GFile** file_to_delete_collection;
+			int file_to_delete_collection_length1;
+			int file_to_delete_it;
+			file_to_delete_collection = selected_files;
+			file_to_delete_collection_length1 = selected_files_length1;
+			for (file_to_delete_it = 0; file_to_delete_it < selected_files_length1; file_to_delete_it = file_to_delete_it + 1) {
+				GFile* _tmp6_;
+				GFile* file_to_delete;
+				_tmp6_ = _g_object_ref0 (file_to_delete_collection[file_to_delete_it]);
+				file_to_delete = _tmp6_;
+				{
+					utils_delete_file (file_to_delete);
+					_g_object_unref0 (file_to_delete);
+				}
+			}
+		}
+		selected_files = (_vala_array_free (selected_files, selected_files_length1, (GDestroyNotify) g_object_unref), NULL);
+	}
+	gtk_object_destroy ((GtkObject*) dialog);
+	result = ret;
+	return result;
+}
+
+
+static gint clean_build_files_on_sort_list_files (CleanBuildFiles* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b) {
+	gint result = 0;
+	gchar* name_a = NULL;
+	gchar* name_b = NULL;
+	gint _tmp0_;
+	g_return_val_if_fail (self != NULL, 0);
+	g_return_val_if_fail (model != NULL, 0);
+	gtk_tree_model_get (model, a, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME, &name_a, -1, -1);
+	gtk_tree_model_get (model, b, CLEAN_BUILD_FILES_CLEAN_FILE_COLUMN_NAME, &name_b, -1, -1);
+	_tmp0_ = g_utf8_collate (name_a, name_b);
+	result = _tmp0_;
+	_g_free0 (name_b);
+	_g_free0 (name_a);
+	return result;
+}
+
+
+static void clean_build_files_show_info_no_file (CleanBuildFiles* self) {
+	const gchar* _tmp0_ = NULL;
+	GtkMessageDialog* _tmp1_ = NULL;
+	GtkDialog* dialog;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = _ ("No build file to clean up.");
+	_tmp1_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self->priv->_main_window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, _tmp0_);
+	dialog = (GtkDialog*) g_object_ref_sink (_tmp1_);
+	gtk_dialog_run (dialog);
+	gtk_object_destroy ((GtkObject*) dialog);
+	_g_object_unref0 (dialog);
+}
+
+
+static void clean_build_files_class_init (CleanBuildFilesClass * klass) {
+	clean_build_files_parent_class = g_type_class_peek_parent (klass);
+	g_type_class_add_private (klass, sizeof (CleanBuildFilesPrivate));
+	G_OBJECT_CLASS (klass)->finalize = clean_build_files_finalize;
+}
+
+
+static void clean_build_files_instance_init (CleanBuildFiles * self) {
+	self->priv = CLEAN_BUILD_FILES_GET_PRIVATE (self);
+}
+
+
+static void clean_build_files_finalize (GObject* obj) {
+	CleanBuildFiles * self;
+	self = CLEAN_BUILD_FILES (obj);
+	_g_object_unref0 (self->priv->_doc);
+	self->priv->_extensions = (_vala_array_free (self->priv->_extensions, self->priv->_extensions_length1, (GDestroyNotify) g_free), NULL);
+	G_OBJECT_CLASS (clean_build_files_parent_class)->finalize (obj);
+}
+
+
+GType clean_build_files_get_type (void) {
+	static volatile gsize clean_build_files_type_id__volatile = 0;
+	if (g_once_init_enter (&clean_build_files_type_id__volatile)) {
+		static const GTypeInfo g_define_type_info = { sizeof (CleanBuildFilesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) clean_build_files_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CleanBuildFiles), 0, (GInstanceInitFunc) clean_build_files_instance_init, NULL };
+		GType clean_build_files_type_id;
+		clean_build_files_type_id = g_type_register_static (G_TYPE_OBJECT, "CleanBuildFiles", &g_define_type_info, 0);
+		g_once_init_leave (&clean_build_files_type_id__volatile, clean_build_files_type_id);
+	}
+	return clean_build_files_type_id__volatile;
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	if ((array != NULL) && (destroy_func != NULL)) {
+		int i;
+		for (i = 0; i < array_length; i = i + 1) {
+			if (((gpointer*) array)[i] != NULL) {
+				destroy_func (((gpointer*) array)[i]);
+			}
+		}
+	}
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	_vala_array_destroy (array, array_length, destroy_func);
+	g_free (array);
+}
+
+
+static gint _vala_array_length (gpointer array) {
+	int length;
+	length = 0;
+	if (array) {
+		while (((gpointer*) array)[length]) {
+			length++;
+		}
+	}
+	return length;
+}
+
+
+
diff --git a/src/C/completion.c b/src/C/completion.c
index 9223ab0..121facc 100644
--- a/src/C/completion.c
+++ b/src/C/completion.c
@@ -1,4 +1,4 @@
-/* completion.c generated by valac 0.12.0, the Vala compiler
+/* completion.c generated by valac 0.12.1, the Vala compiler
  * generated from completion.vala, do not modify */
 
 /*
@@ -91,6 +91,7 @@ typedef struct _DocumentTabClass DocumentTabClass;
 
 typedef struct _DocumentView DocumentView;
 typedef struct _DocumentViewClass DocumentViewClass;
+#define _completion_provider_completion_choice_free0(var) ((var == NULL) ? NULL : (var = (completion_provider_completion_choice_free (var), NULL)))
 
 #define TYPE_APPLICATION (application_get_type ())
 #define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
@@ -125,6 +126,8 @@ struct _CompletionProviderClass {
 struct _CompletionProviderCompletionChoice {
 	gchar* name;
 	gchar* package;
+	gchar* insert;
+	gchar* insert_after;
 };
 
 struct _CompletionProviderCompletionArgument {
@@ -146,9 +149,11 @@ struct _CompletionProviderCompletionCommand {
 struct _CompletionProviderPrivate {
 	GList* proposals;
 	GeeHashMap* commands;
+	GeeHashMap* environments;
 	GSettings* settings;
 	CompletionProviderCompletionCommand current_command;
 	CompletionProviderCompletionArgument current_arg;
+	CompletionProviderCompletionChoice current_choice;
 	gboolean show_all_proposals;
 	GdkPixbuf* icon_normal_cmd;
 	GdkPixbuf* icon_normal_choice;
@@ -204,6 +209,8 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 static void _completion_provider_parser_start_gmarkup_parser_start_element_func (GMarkupParseContext* context, const gchar* element_name, gchar** attribute_names, gchar** attribute_values, gpointer self, GError** error);
 static void completion_provider_parser_end (CompletionProvider* self, GMarkupParseContext* context, const gchar* name, GError** error);
 static void _completion_provider_parser_end_gmarkup_parser_end_element_func (GMarkupParseContext* context, const gchar* element_name, gpointer self, GError** error);
+static void completion_provider_parser_text (CompletionProvider* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error);
+static void _completion_provider_parser_text_gmarkup_parser_text_func (GMarkupParseContext* context, const gchar* text, gsize text_len, gpointer self, GError** error);
 static gint completion_provider_compare_proposals (GtkSourceCompletionItem* a, GtkSourceCompletionItem* b);
 CompletionProvider* completion_provider_get_default (void);
 static gchar* completion_provider_real_get_name (GtkSourceCompletionProvider* base);
@@ -220,7 +227,7 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 static void completion_provider_real_populate (GtkSourceCompletionProvider* base, GtkSourceCompletionContext* context);
 static void completion_provider_clear_context (CompletionProvider* self, GtkSourceCompletionContext* context);
 static GList* completion_provider_get_argument_proposals (CompletionProvider* self, CompletionProviderCompletionCommand* cmd, GeeArrayList* arguments);
-static void completion_provider_hide_calltip_window (CompletionProvider* self);
+void completion_provider_hide_calltip_window (CompletionProvider* self);
 static gint completion_provider_get_argument_num (CompletionProvider* self, CompletionProviderCompletionArgument* all_args, int all_args_length1, GeeArrayList* args);
 static gchar* completion_provider_get_command_info (CompletionProvider* self, CompletionProviderCompletionCommand* cmd, gint num);
 static void completion_provider_show_calltip_info (CompletionProvider* self, const gchar* markup);
@@ -243,14 +250,14 @@ MainWindow* application_get_active_window (Application* self);
 DocumentView* main_window_get_active_view (MainWindow* self);
 static gchar* completion_provider_get_text_line_at_iter (CompletionProvider* self, GtkTextIter* iter);
 gboolean utils_char_is_escaped (const gchar* text, glong index);
-static void _vala_array_add9 (CompletionProviderCompletionChoice** array, int* length, int* size, const CompletionProviderCompletionChoice* value);
 static gchar* completion_provider_get_command_text (CompletionProvider* self, CompletionProviderCompletionCommand* cmd);
-static void _vala_array_add10 (CompletionProviderCompletionArgument** array, int* length, int* size, const CompletionProviderCompletionArgument* value);
+static void _vala_array_add11 (CompletionProviderCompletionArgument** array, int* length, int* size, const CompletionProviderCompletionArgument* value);
+static void _vala_array_add12 (CompletionProviderCompletionChoice** array, int* length, int* size, const CompletionProviderCompletionChoice* value);
 static gchar* completion_provider_get_latex_command_at_index (CompletionProvider* self, const gchar* text, glong index);
 static void _vala_CompletionProviderCompletionArgument_array_free (CompletionProviderCompletionArgument* array, gint array_length);
-static CompletionProviderCompletionArgument* _vala_array_dup6 (CompletionProviderCompletionArgument* self, int length);
+static CompletionProviderCompletionArgument* _vala_array_dup7 (CompletionProviderCompletionArgument* self, int length);
 static void _vala_CompletionProviderCompletionChoice_array_free (CompletionProviderCompletionChoice* array, gint array_length);
-static CompletionProviderCompletionChoice* _vala_array_dup7 (CompletionProviderCompletionChoice* self, int length);
+static CompletionProviderCompletionChoice* _vala_array_dup8 (CompletionProviderCompletionChoice* self, int length);
 static void completion_provider_finalize (GObject* obj);
 static gint _vala_array_length (gpointer array);
 
@@ -276,20 +283,26 @@ static void _completion_provider_parser_end_gmarkup_parser_end_element_func (GMa
 }
 
 
+static void _completion_provider_parser_text_gmarkup_parser_text_func (GMarkupParseContext* context, const gchar* text, gsize text_len, gpointer self, GError** error) {
+	completion_provider_parser_text (self, context, text, text_len, error);
+}
+
+
 static CompletionProvider* completion_provider_construct (GType object_type) {
 	CompletionProvider * self = NULL;
 	GSettings* _tmp0_ = NULL;
 	GeeHashMap* _tmp1_ = NULL;
-	GdkPixbuf* _tmp2_ = NULL;
+	GeeHashMap* _tmp2_ = NULL;
 	GdkPixbuf* _tmp3_ = NULL;
 	GdkPixbuf* _tmp4_ = NULL;
-	GFile* _tmp5_ = NULL;
+	GdkPixbuf* _tmp5_ = NULL;
+	GFile* _tmp6_ = NULL;
 	GFile* file;
 	gchar* contents = NULL;
-	gchar* _tmp6_ = NULL;
-	GMarkupParser _tmp7_ = {0};
+	gchar* _tmp7_ = NULL;
+	GMarkupParser _tmp8_ = {0};
 	GMarkupParser parser;
-	GMarkupParseContext* _tmp8_ = NULL;
+	GMarkupParseContext* _tmp9_ = NULL;
 	GMarkupParseContext* context;
 	GError * _inner_error_ = NULL;
 	self = (CompletionProvider*) g_object_new (object_type, NULL);
@@ -299,46 +312,49 @@ static CompletionProvider* completion_provider_construct (GType object_type) {
 	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, COMPLETION_PROVIDER_TYPE_COMPLETION_COMMAND, (GBoxedCopyFunc) completion_provider_completion_command_dup, completion_provider_completion_command_free, NULL, NULL, NULL);
 	_g_object_unref0 (self->priv->commands);
 	self->priv->commands = _tmp1_;
-	_tmp2_ = utils_get_pixbuf_from_stock ("completion_cmd", GTK_ICON_SIZE_MENU);
+	_tmp2_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, COMPLETION_PROVIDER_TYPE_COMPLETION_CHOICE, (GBoxedCopyFunc) completion_provider_completion_choice_dup, completion_provider_completion_choice_free, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->environments);
+	self->priv->environments = _tmp2_;
+	_tmp3_ = utils_get_pixbuf_from_stock ("completion_cmd", GTK_ICON_SIZE_MENU);
 	_g_object_unref0 (self->priv->icon_normal_cmd);
-	self->priv->icon_normal_cmd = _tmp2_;
-	_tmp3_ = utils_get_pixbuf_from_stock ("completion_choice", GTK_ICON_SIZE_MENU);
+	self->priv->icon_normal_cmd = _tmp3_;
+	_tmp4_ = utils_get_pixbuf_from_stock ("completion_choice", GTK_ICON_SIZE_MENU);
 	_g_object_unref0 (self->priv->icon_normal_choice);
-	self->priv->icon_normal_choice = _tmp3_;
-	_tmp4_ = utils_get_pixbuf_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
+	self->priv->icon_normal_choice = _tmp4_;
+	_tmp5_ = utils_get_pixbuf_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
 	_g_object_unref0 (self->priv->icon_package_required);
-	self->priv->icon_package_required = _tmp4_;
-	_tmp5_ = g_file_new_for_path (DATA_DIR "/completion.xml");
-	file = _tmp5_;
-	g_file_load_contents (file, NULL, &_tmp6_, NULL, NULL, &_inner_error_);
+	self->priv->icon_package_required = _tmp5_;
+	_tmp6_ = g_file_new_for_path (DATA_DIR "/completion.xml");
+	file = _tmp6_;
+	g_file_load_contents (file, NULL, &_tmp7_, NULL, NULL, &_inner_error_);
 	_g_free0 (contents);
-	contents = _tmp6_;
+	contents = _tmp7_;
 	if (_inner_error_ != NULL) {
 		_g_free0 (contents);
 		_g_object_unref0 (file);
-		goto __catch31_g_error;
-	}
-	_tmp7_.start_element = _completion_provider_parser_start_gmarkup_parser_start_element_func;
-	_tmp7_.end_element = _completion_provider_parser_end_gmarkup_parser_end_element_func;
-	_tmp7_.text = NULL;
-	_tmp7_.passthrough = NULL;
-	_tmp7_.error = NULL;
-	parser = _tmp7_;
-	_tmp8_ = g_markup_parse_context_new (&parser, 0, self, NULL);
-	context = _tmp8_;
+		goto __catch33_g_error;
+	}
+	_tmp8_.start_element = _completion_provider_parser_start_gmarkup_parser_start_element_func;
+	_tmp8_.end_element = _completion_provider_parser_end_gmarkup_parser_end_element_func;
+	_tmp8_.text = _completion_provider_parser_text_gmarkup_parser_text_func;
+	_tmp8_.passthrough = NULL;
+	_tmp8_.error = NULL;
+	parser = _tmp8_;
+	_tmp9_ = g_markup_parse_context_new (&parser, 0, self, NULL);
+	context = _tmp9_;
 	g_markup_parse_context_parse (context, contents, (gssize) (-1), &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_markup_parse_context_free0 (context);
 		_g_free0 (contents);
 		_g_object_unref0 (file);
-		goto __catch31_g_error;
+		goto __catch33_g_error;
 	}
 	self->priv->proposals = g_list_sort (self->priv->proposals, (GCompareFunc) completion_provider_compare_proposals);
 	_g_markup_parse_context_free0 (context);
 	_g_free0 (contents);
 	_g_object_unref0 (file);
-	goto __finally31;
-	__catch31_g_error:
+	goto __finally33;
+	__catch33_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -346,7 +362,7 @@ static CompletionProvider* completion_provider_construct (GType object_type) {
 		fprintf (stderr, "Warning: impossible to load completion data: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally31:
+	__finally33:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -1085,26 +1101,30 @@ static void completion_provider_close_environment (CompletionProvider* self, con
 	glong i = 0L;
 	gchar* _tmp10_ = NULL;
 	gchar* current_indent;
-	Document* _tmp11_;
+	gpointer _tmp11_ = NULL;
+	CompletionProviderCompletionChoice* environment;
+	Document* _tmp12_;
 	Document* document;
-	DocumentView* _tmp12_ = NULL;
-	gchar* _tmp13_ = NULL;
+	DocumentView* _tmp13_ = NULL;
+	gchar* _tmp14_ = NULL;
 	gchar* indent;
-	const gchar* _tmp14_ = NULL;
 	const gchar* _tmp15_ = NULL;
-	gchar* _tmp16_ = NULL;
-	gchar* _tmp17_;
-	GtkTextMark* _tmp18_ = NULL;
-	GtkTextMark* _tmp19_;
+	const gchar* _tmp16_ = NULL;
+	gchar* _tmp17_ = NULL;
+	gchar* _tmp18_;
+	gboolean _tmp19_ = FALSE;
+	GtkTextMark* _tmp20_ = NULL;
+	GtkTextMark* _tmp21_;
 	GtkTextMark* cursor_pos;
-	const gchar* _tmp20_ = NULL;
-	gchar* _tmp21_ = NULL;
-	gchar* _tmp22_;
-	gchar* _tmp23_;
-	gchar* _tmp24_;
+	gboolean _tmp22_ = FALSE;
+	const gchar* _tmp23_ = NULL;
+	gchar* _tmp24_ = NULL;
 	gchar* _tmp25_;
 	gchar* _tmp26_;
-	GtkTextIter _tmp27_ = {0};
+	gchar* _tmp27_;
+	gchar* _tmp28_;
+	gchar* _tmp29_;
+	GtkTextIter _tmp30_ = {0};
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (env_name != NULL);
 	_tmp0_ = gtk_text_iter_get_line (iter);
@@ -1154,37 +1174,56 @@ static void completion_provider_close_environment (CompletionProvider* self, con
 	}
 	_tmp10_ = document_get_current_indentation (doc, line);
 	current_indent = _tmp10_;
-	_tmp11_ = _g_object_ref0 (DOCUMENT (doc));
-	document = _tmp11_;
-	_tmp12_ = document_tab_get_view (document->tab);
-	_tmp13_ = document_view_get_indentation_style (_tmp12_);
-	indent = _tmp13_;
-	_tmp14_ = string_to_string (current_indent);
-	_tmp15_ = string_to_string (indent);
-	_tmp16_ = g_strconcat ("\n", _tmp14_, _tmp15_, NULL);
-	_tmp17_ = _tmp16_;
-	document_insert (doc, iter, _tmp17_, -1);
-	_g_free0 (_tmp17_);
-	_tmp18_ = gtk_text_buffer_create_mark ((GtkTextBuffer*) doc, NULL, iter, TRUE);
-	_tmp19_ = _g_object_ref0 (_tmp18_);
-	cursor_pos = _tmp19_;
-	_tmp20_ = string_to_string (current_indent);
-	_tmp21_ = g_strconcat ("\n", _tmp20_, "\\end{", NULL);
-	_tmp22_ = _tmp21_;
-	_tmp23_ = g_strconcat (_tmp22_, env_name, NULL);
-	_tmp24_ = _tmp23_;
-	_tmp25_ = g_strconcat (_tmp24_, "}", NULL);
-	_tmp26_ = _tmp25_;
-	document_insert (doc, iter, _tmp26_, -1);
-	_g_free0 (_tmp26_);
-	_g_free0 (_tmp24_);
-	_g_free0 (_tmp22_);
-	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) doc, &_tmp27_, cursor_pos);
-	*iter = _tmp27_;
+	_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) self->priv->environments, env_name);
+	environment = (CompletionProviderCompletionChoice*) _tmp11_;
+	_tmp12_ = _g_object_ref0 (DOCUMENT (doc));
+	document = _tmp12_;
+	_tmp13_ = document_tab_get_view (document->tab);
+	_tmp14_ = document_view_get_indentation_style (_tmp13_);
+	indent = _tmp14_;
+	_tmp15_ = string_to_string (current_indent);
+	_tmp16_ = string_to_string (indent);
+	_tmp17_ = g_strconcat ("\n", _tmp15_, _tmp16_, NULL);
+	_tmp18_ = _tmp17_;
+	document_insert (doc, iter, _tmp18_, -1);
+	_g_free0 (_tmp18_);
+	if (environment != NULL) {
+		_tmp19_ = (*environment).insert != NULL;
+	} else {
+		_tmp19_ = FALSE;
+	}
+	if (_tmp19_) {
+		document_insert (doc, iter, (*environment).insert, -1);
+	}
+	_tmp20_ = gtk_text_buffer_create_mark ((GtkTextBuffer*) doc, NULL, iter, TRUE);
+	_tmp21_ = _g_object_ref0 (_tmp20_);
+	cursor_pos = _tmp21_;
+	if (environment != NULL) {
+		_tmp22_ = (*environment).insert_after != NULL;
+	} else {
+		_tmp22_ = FALSE;
+	}
+	if (_tmp22_) {
+		document_insert (doc, iter, (*environment).insert_after, -1);
+	}
+	_tmp23_ = string_to_string (current_indent);
+	_tmp24_ = g_strconcat ("\n", _tmp23_, "\\end{", NULL);
+	_tmp25_ = _tmp24_;
+	_tmp26_ = g_strconcat (_tmp25_, env_name, NULL);
+	_tmp27_ = _tmp26_;
+	_tmp28_ = g_strconcat (_tmp27_, "}", NULL);
+	_tmp29_ = _tmp28_;
+	document_insert (doc, iter, _tmp29_, -1);
+	_g_free0 (_tmp29_);
+	_g_free0 (_tmp27_);
+	_g_free0 (_tmp25_);
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) doc, &_tmp30_, cursor_pos);
+	*iter = _tmp30_;
 	gtk_text_buffer_place_cursor ((GtkTextBuffer*) doc, iter);
 	_g_object_unref0 (cursor_pos);
 	_g_free0 (indent);
 	_g_object_unref0 (document);
+	_completion_provider_completion_choice_free0 (environment);
 	_g_free0 (current_indent);
 	_g_free0 (text);
 	_g_object_unref0 (doc);
@@ -1303,7 +1342,7 @@ static void completion_provider_show_calltip_info (CompletionProvider* self, con
 }
 
 
-static void completion_provider_hide_calltip_window (CompletionProvider* self) {
+void completion_provider_hide_calltip_window (CompletionProvider* self) {
 	g_return_if_fail (self != NULL);
 	if (self->priv->calltip_window == NULL) {
 		return;
@@ -1312,15 +1351,6 @@ static void completion_provider_hide_calltip_window (CompletionProvider* self) {
 }
 
 
-static void _vala_array_add9 (CompletionProviderCompletionChoice** array, int* length, int* size, const CompletionProviderCompletionChoice* value) {
-	if ((*length) == (*size)) {
-		*size = (*size) ? (2 * (*size)) : 4;
-		*array = g_renew (CompletionProviderCompletionChoice, *array, *size);
-	}
-	(*array)[(*length)++] = *value;
-}
-
-
 static void completion_provider_parser_start (CompletionProvider* self, GMarkupParseContext* context, const gchar* name, gchar** attr_names, int attr_names_length1, gchar** attr_values, int attr_values_length1, GError** error) {
 	const gchar* _tmp0_;
 	GQuark _tmp1_;
@@ -1330,6 +1360,8 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 	static GQuark _tmp1__label3 = 0;
 	static GQuark _tmp1__label4 = 0;
 	static GQuark _tmp1__label5 = 0;
+	static GQuark _tmp1__label6 = 0;
+	static GQuark _tmp1__label7 = 0;
 	GError * _inner_error_ = NULL;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (context != NULL);
@@ -1529,49 +1561,51 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 		switch (0) {
 			default:
 			{
-				CompletionProviderCompletionChoice choice = {0};
-				CompletionProviderCompletionChoice _tmp38_;
-				CompletionProviderCompletionChoice _tmp39_ = {0};
-				memset (&choice, 0, sizeof (CompletionProviderCompletionChoice));
+				CompletionProviderCompletionChoice _tmp27_ = {0};
+				CompletionProviderCompletionChoice _tmp28_ = {0};
+				memset (&_tmp27_, 0, sizeof (CompletionProviderCompletionChoice));
+				_tmp28_ = _tmp27_;
+				completion_provider_completion_choice_destroy (&self->priv->current_choice);
+				self->priv->current_choice = _tmp28_;
 				{
 					gint i;
 					i = 0;
 					{
-						gboolean _tmp27_;
-						_tmp27_ = TRUE;
+						gboolean _tmp29_;
+						_tmp29_ = TRUE;
 						while (TRUE) {
-							const gchar* _tmp28_;
-							GQuark _tmp29_;
-							static GQuark _tmp29__label0 = 0;
-							static GQuark _tmp29__label1 = 0;
-							if (!_tmp27_) {
+							const gchar* _tmp30_;
+							GQuark _tmp31_;
+							static GQuark _tmp31__label0 = 0;
+							static GQuark _tmp31__label1 = 0;
+							if (!_tmp29_) {
 								i++;
 							}
-							_tmp27_ = FALSE;
+							_tmp29_ = FALSE;
 							if (!(i < attr_names_length1)) {
 								break;
 							}
-							_tmp28_ = attr_names[i];
-							_tmp29_ = (NULL == _tmp28_) ? 0 : g_quark_from_string (_tmp28_);
-							if (_tmp29_ == ((0 != _tmp29__label0) ? _tmp29__label0 : (_tmp29__label0 = g_quark_from_static_string ("name")))) {
+							_tmp30_ = attr_names[i];
+							_tmp31_ = (NULL == _tmp30_) ? 0 : g_quark_from_string (_tmp30_);
+							if (_tmp31_ == ((0 != _tmp31__label0) ? _tmp31__label0 : (_tmp31__label0 = g_quark_from_static_string ("name")))) {
 								switch (0) {
 									default:
 									{
-										gchar* _tmp30_;
-										_tmp30_ = g_strdup (attr_values[i]);
-										_g_free0 (choice.name);
-										choice.name = _tmp30_;
+										gchar* _tmp32_;
+										_tmp32_ = g_strdup (attr_values[i]);
+										_g_free0 (self->priv->current_choice.name);
+										self->priv->current_choice.name = _tmp32_;
 										break;
 									}
 								}
-							} else if (_tmp29_ == ((0 != _tmp29__label1) ? _tmp29__label1 : (_tmp29__label1 = g_quark_from_static_string ("package")))) {
+							} else if (_tmp31_ == ((0 != _tmp31__label1) ? _tmp31__label1 : (_tmp31__label1 = g_quark_from_static_string ("package")))) {
 								switch (0) {
 									default:
 									{
-										gchar* _tmp31_;
-										_tmp31_ = g_strdup (attr_values[i]);
-										_g_free0 (choice.package);
-										choice.package = _tmp31_;
+										gchar* _tmp33_;
+										_tmp33_ = g_strdup (attr_values[i]);
+										_g_free0 (self->priv->current_choice.package);
+										self->priv->current_choice.package = _tmp33_;
 										break;
 									}
 								}
@@ -1579,27 +1613,25 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 								switch (0) {
 									default:
 									{
-										gchar* _tmp32_;
-										gchar* _tmp33_;
 										gchar* _tmp34_;
 										gchar* _tmp35_;
-										GError* _tmp36_ = NULL;
-										GError* _tmp37_;
-										_tmp32_ = g_strconcat ("unknown choice attribute \"", attr_names[i], NULL);
-										_tmp33_ = _tmp32_;
-										_tmp34_ = g_strconcat (_tmp33_, "\"", NULL);
+										gchar* _tmp36_;
+										gchar* _tmp37_;
+										GError* _tmp38_ = NULL;
+										GError* _tmp39_;
+										_tmp34_ = g_strconcat ("unknown choice attribute \"", attr_names[i], NULL);
 										_tmp35_ = _tmp34_;
-										_tmp36_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp35_);
+										_tmp36_ = g_strconcat (_tmp35_, "\"", NULL);
 										_tmp37_ = _tmp36_;
+										_tmp38_ = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE, _tmp37_);
+										_tmp39_ = _tmp38_;
+										_g_free0 (_tmp37_);
 										_g_free0 (_tmp35_);
-										_g_free0 (_tmp33_);
-										_inner_error_ = _tmp37_;
+										_inner_error_ = _tmp39_;
 										if (_inner_error_->domain == G_MARKUP_ERROR) {
 											g_propagate_error (error, _inner_error_);
-											completion_provider_completion_choice_destroy (&choice);
 											return;
 										} else {
-											completion_provider_completion_choice_destroy (&choice);
 											g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 											g_clear_error (&_inner_error_);
 											return;
@@ -1610,14 +1642,17 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 						}
 					}
 				}
-				completion_provider_completion_choice_copy (&choice, &_tmp39_);
-				_tmp38_ = _tmp39_;
-				_vala_array_add9 (&self->priv->current_arg.choices, &self->priv->current_arg.choices_length1, &self->priv->current_arg._choices_size_, &_tmp38_);
-				completion_provider_completion_choice_destroy (&choice);
 				break;
 			}
 		}
-	} else if ((_tmp1_ == ((0 != _tmp1__label4) ? _tmp1__label4 : (_tmp1__label4 = g_quark_from_static_string ("placeholder")))) || (_tmp1_ == ((0 != _tmp1__label5) ? _tmp1__label5 : (_tmp1__label5 = g_quark_from_static_string ("component"))))) {
+	} else if ((_tmp1_ == ((0 != _tmp1__label4) ? _tmp1__label4 : (_tmp1__label4 = g_quark_from_static_string ("insert")))) || (_tmp1_ == ((0 != _tmp1__label5) ? _tmp1__label5 : (_tmp1__label5 = g_quark_from_static_string ("insert_after"))))) {
+		switch (0) {
+			default:
+			{
+				break;
+			}
+		}
+	} else if ((_tmp1_ == ((0 != _tmp1__label6) ? _tmp1__label6 : (_tmp1__label6 = g_quark_from_static_string ("placeholder")))) || (_tmp1_ == ((0 != _tmp1__label7) ? _tmp1__label7 : (_tmp1__label7 = g_quark_from_static_string ("component"))))) {
 		switch (0) {
 			default:
 			{
@@ -1657,7 +1692,7 @@ static void completion_provider_parser_start (CompletionProvider* self, GMarkupP
 }
 
 
-static void _vala_array_add10 (CompletionProviderCompletionArgument** array, int* length, int* size, const CompletionProviderCompletionArgument* value) {
+static void _vala_array_add11 (CompletionProviderCompletionArgument** array, int* length, int* size, const CompletionProviderCompletionArgument* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (CompletionProviderCompletionArgument, *array, *size);
@@ -1666,11 +1701,21 @@ static void _vala_array_add10 (CompletionProviderCompletionArgument** array, int
 }
 
 
+static void _vala_array_add12 (CompletionProviderCompletionChoice** array, int* length, int* size, const CompletionProviderCompletionChoice* value) {
+	if ((*length) == (*size)) {
+		*size = (*size) ? (2 * (*size)) : 4;
+		*array = g_renew (CompletionProviderCompletionChoice, *array, *size);
+	}
+	(*array)[(*length)++] = *value;
+}
+
+
 static void completion_provider_parser_end (CompletionProvider* self, GMarkupParseContext* context, const gchar* name, GError** error) {
 	const gchar* _tmp0_;
 	GQuark _tmp1_;
 	static GQuark _tmp1__label0 = 0;
 	static GQuark _tmp1__label1 = 0;
+	static GQuark _tmp1__label2 = 0;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (context != NULL);
 	g_return_if_fail (name != NULL);
@@ -1725,7 +1770,66 @@ static void completion_provider_parser_end (CompletionProvider* self, GMarkupPar
 				CompletionProviderCompletionArgument _tmp12_ = {0};
 				completion_provider_completion_argument_copy (&self->priv->current_arg, &_tmp12_);
 				_tmp11_ = _tmp12_;
-				_vala_array_add10 (&self->priv->current_command.args, &self->priv->current_command.args_length1, &self->priv->current_command._args_size_, &_tmp11_);
+				_vala_array_add11 (&self->priv->current_command.args, &self->priv->current_command.args_length1, &self->priv->current_command._args_size_, &_tmp11_);
+				break;
+			}
+		}
+	} else if (_tmp1_ == ((0 != _tmp1__label2) ? _tmp1__label2 : (_tmp1__label2 = g_quark_from_static_string ("choice")))) {
+		switch (0) {
+			default:
+			{
+				CompletionProviderCompletionChoice _tmp13_;
+				CompletionProviderCompletionChoice _tmp14_ = {0};
+				gboolean _tmp15_ = FALSE;
+				completion_provider_completion_choice_copy (&self->priv->current_choice, &_tmp14_);
+				_tmp13_ = _tmp14_;
+				_vala_array_add12 (&self->priv->current_arg.choices, &self->priv->current_arg.choices_length1, &self->priv->current_arg._choices_size_, &_tmp13_);
+				if (self->priv->current_choice.insert != NULL) {
+					_tmp15_ = TRUE;
+				} else {
+					_tmp15_ = self->priv->current_choice.insert_after != NULL;
+				}
+				if (_tmp15_) {
+					gee_abstract_map_set ((GeeAbstractMap*) self->priv->environments, self->priv->current_choice.name, &self->priv->current_choice);
+				}
+				break;
+			}
+		}
+	}
+}
+
+
+static void completion_provider_parser_text (CompletionProvider* self, GMarkupParseContext* context, const gchar* text, gsize text_len, GError** error) {
+	const gchar* _tmp0_ = NULL;
+	const gchar* _tmp1_;
+	GQuark _tmp2_;
+	static GQuark _tmp2__label0 = 0;
+	static GQuark _tmp2__label1 = 0;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (context != NULL);
+	g_return_if_fail (text != NULL);
+	_tmp0_ = g_markup_parse_context_get_element (context);
+	_tmp1_ = _tmp0_;
+	_tmp2_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
+	if (_tmp2_ == ((0 != _tmp2__label0) ? _tmp2__label0 : (_tmp2__label0 = g_quark_from_static_string ("insert")))) {
+		switch (0) {
+			default:
+			{
+				gchar* _tmp3_;
+				_tmp3_ = g_strdup (text);
+				_g_free0 (self->priv->current_choice.insert);
+				self->priv->current_choice.insert = _tmp3_;
+				break;
+			}
+		}
+	} else if (_tmp2_ == ((0 != _tmp2__label1) ? _tmp2__label1 : (_tmp2__label1 = g_quark_from_static_string ("insert_after")))) {
+		switch (0) {
+			default:
+			{
+				gchar* _tmp4_;
+				_tmp4_ = g_strdup (text);
+				_g_free0 (self->priv->current_choice.insert_after);
+				self->priv->current_choice.insert_after = _tmp4_;
 				break;
 			}
 		}
@@ -2127,6 +2231,7 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 	glong index_start_argument_contents;
 	gboolean in_other_argument;
 	gchar other_argument_opening_bracket;
+	GeeArrayList* _tmp1_ = NULL;
 	g_return_val_if_fail (self != NULL, FALSE);
 	_tmp0_ = completion_provider_get_text_line_at_iter (self, iter);
 	text = _tmp0_;
@@ -2134,15 +2239,10 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 	index_start_argument_contents = (glong) (-1);
 	in_other_argument = FALSE;
 	other_argument_opening_bracket = '{';
-	if ((&_arguments) != NULL) {
-		GeeArrayList* _tmp1_ = NULL;
-		_tmp1_ = gee_array_list_new (G_TYPE_BOOLEAN, NULL, NULL, NULL);
-		_g_object_unref0 (_arguments);
-		_arguments = _tmp1_;
-	}
-	if ((&_valid_arg_contents) != NULL) {
-		_valid_arg_contents = TRUE;
-	}
+	_tmp1_ = gee_array_list_new (G_TYPE_BOOLEAN, NULL, NULL, NULL);
+	_g_object_unref0 (_arguments);
+	_arguments = _tmp1_;
+	_valid_arg_contents = TRUE;
 	{
 		gint _tmp2_;
 		glong i;
@@ -2163,8 +2263,9 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 					gboolean _tmp4_ = FALSE;
 					gboolean _tmp5_ = FALSE;
 					gchar _tmp6_;
-					gboolean _tmp13_ = FALSE;
-					gboolean _tmp14_ = FALSE;
+					gboolean _tmp12_ = FALSE;
+					gchar _tmp13_;
+					gboolean _tmp14_;
 					_tmp6_ = string_get (text, i);
 					if (_tmp6_ == '{') {
 						_tmp5_ = TRUE;
@@ -2181,93 +2282,71 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 						_tmp4_ = FALSE;
 					}
 					if (_tmp4_) {
-						gboolean _tmp10_ = FALSE;
-						if ((&_arguments) != NULL) {
-							gchar _tmp9_;
-							_tmp9_ = string_get (text, i);
-							gee_abstract_list_insert ((GeeAbstractList*) _arguments, 0, GINT_TO_POINTER (_tmp9_ == '['));
-						}
-						if ((&_argument_contents) != NULL) {
-							_tmp10_ = index_start_argument_contents != (-1);
-						} else {
-							_tmp10_ = FALSE;
-						}
-						if (_tmp10_) {
-							gint _tmp11_;
-							gchar* _tmp12_ = NULL;
-							_tmp11_ = strlen (text);
-							_tmp12_ = string_slice (text, index_start_argument_contents, (glong) _tmp11_);
+						gchar _tmp9_;
+						_tmp9_ = string_get (text, i);
+						gee_abstract_list_insert ((GeeAbstractList*) _arguments, 0, GINT_TO_POINTER (_tmp9_ == '['));
+						if (index_start_argument_contents != (-1)) {
+							gint _tmp10_;
+							gchar* _tmp11_ = NULL;
+							_tmp10_ = strlen (text);
+							_tmp11_ = string_slice (text, index_start_argument_contents, (glong) _tmp10_);
 							_g_free0 (_argument_contents);
-							_argument_contents = _tmp12_;
+							_argument_contents = _tmp11_;
 						}
 						fetch_argument_contents = FALSE;
 						continue;
 					}
-					if ((&_valid_arg_contents) != NULL) {
+					_tmp13_ = string_get (text, i);
+					_tmp14_ = g_ascii_isalpha (_tmp13_);
+					if (!_tmp14_) {
 						gchar _tmp15_;
-						gboolean _tmp16_;
 						_tmp15_ = string_get (text, i);
-						_tmp16_ = g_ascii_isalpha (_tmp15_);
-						_tmp14_ = !_tmp16_;
+						_tmp12_ = _tmp15_ != '*';
 					} else {
-						_tmp14_ = FALSE;
+						_tmp12_ = FALSE;
 					}
-					if (_tmp14_) {
-						gchar _tmp17_;
-						_tmp17_ = string_get (text, i);
-						_tmp13_ = _tmp17_ != '*';
-					} else {
-						_tmp13_ = FALSE;
-					}
-					if (_tmp13_) {
+					if (_tmp12_) {
 						_valid_arg_contents = FALSE;
 					}
 					index_start_argument_contents = i;
 				} else {
 					if (in_other_argument) {
-						gchar _tmp18_;
-						_tmp18_ = string_get (text, i);
-						if (_tmp18_ == other_argument_opening_bracket) {
-							gboolean _tmp19_;
-							_tmp19_ = utils_char_is_escaped (text, i);
-							in_other_argument = _tmp19_;
+						gchar _tmp16_;
+						_tmp16_ = string_get (text, i);
+						if (_tmp16_ == other_argument_opening_bracket) {
+							gboolean _tmp17_;
+							_tmp17_ = utils_char_is_escaped (text, i);
+							in_other_argument = _tmp17_;
 						}
 						continue;
 					} else {
-						gchar _tmp20_;
-						gboolean _tmp21_;
-						gboolean _tmp22_ = FALSE;
-						gchar _tmp23_;
-						gboolean _tmp24_;
-						gboolean _tmp28_ = FALSE;
-						gchar _tmp29_;
-						_tmp20_ = string_get (text, i);
-						_tmp21_ = g_ascii_isspace (_tmp20_);
-						if (_tmp21_) {
+						gchar _tmp18_;
+						gboolean _tmp19_;
+						gboolean _tmp20_ = FALSE;
+						gchar _tmp21_;
+						gboolean _tmp22_;
+						gboolean _tmp25_ = FALSE;
+						gchar _tmp26_;
+						_tmp18_ = string_get (text, i);
+						_tmp19_ = g_ascii_isspace (_tmp18_);
+						if (_tmp19_) {
 							continue;
 						}
-						_tmp23_ = string_get (text, i);
-						_tmp24_ = g_ascii_isalpha (_tmp23_);
-						if (_tmp24_) {
-							_tmp22_ = TRUE;
+						_tmp21_ = string_get (text, i);
+						_tmp22_ = g_ascii_isalpha (_tmp21_);
+						if (_tmp22_) {
+							_tmp20_ = TRUE;
 						} else {
-							gchar _tmp25_;
-							_tmp25_ = string_get (text, i);
-							_tmp22_ = _tmp25_ == '*';
+							gchar _tmp23_;
+							_tmp23_ = string_get (text, i);
+							_tmp20_ = _tmp23_ == '*';
 						}
-						if (_tmp22_) {
-							gchar* _tmp26_ = NULL;
-							gchar* tmp;
-							_tmp26_ = completion_provider_get_latex_command_at_index (self, text, i);
-							tmp = _tmp26_;
-							if ((&_cmd_name) != NULL) {
-								gchar* _tmp27_;
-								_tmp27_ = g_strdup (tmp);
-								_g_free0 (_cmd_name);
-								_cmd_name = _tmp27_;
-							}
-							result = tmp != NULL;
-							_g_free0 (tmp);
+						if (_tmp20_) {
+							gchar* _tmp24_ = NULL;
+							_tmp24_ = completion_provider_get_latex_command_at_index (self, text, i);
+							_g_free0 (_cmd_name);
+							_cmd_name = _tmp24_;
+							result = _cmd_name != NULL;
 							_g_free0 (text);
 							if (cmd_name) {
 								*cmd_name = _cmd_name;
@@ -2289,20 +2368,21 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 							}
 							return result;
 						}
-						_tmp29_ = string_get (text, i);
-						if (_tmp29_ == '}') {
-							_tmp28_ = TRUE;
+						_tmp26_ = string_get (text, i);
+						if (_tmp26_ == '}') {
+							_tmp25_ = TRUE;
 						} else {
-							gchar _tmp30_;
-							_tmp30_ = string_get (text, i);
-							_tmp28_ = _tmp30_ == ']';
+							gchar _tmp27_;
+							_tmp27_ = string_get (text, i);
+							_tmp25_ = _tmp27_ == ']';
 						}
-						if (_tmp28_) {
-							gboolean _tmp31_;
-							gchar _tmp32_ = '\0';
-							gchar _tmp33_;
-							_tmp31_ = utils_char_is_escaped (text, i);
-							if (_tmp31_) {
+						if (_tmp25_) {
+							gboolean _tmp28_;
+							gchar _tmp29_ = '\0';
+							gchar _tmp30_;
+							gchar _tmp31_;
+							_tmp28_ = utils_char_is_escaped (text, i);
+							if (_tmp28_) {
 								result = FALSE;
 								_g_free0 (text);
 								if (cmd_name) {
@@ -2326,18 +2406,15 @@ static gboolean completion_provider_in_latex_command_argument (CompletionProvide
 								return result;
 							}
 							in_other_argument = TRUE;
-							_tmp33_ = string_get (text, i);
-							if (_tmp33_ == '}') {
-								_tmp32_ = '{';
+							_tmp30_ = string_get (text, i);
+							if (_tmp30_ == '}') {
+								_tmp29_ = '{';
 							} else {
-								_tmp32_ = '[';
-							}
-							other_argument_opening_bracket = _tmp32_;
-							if ((&_arguments) != NULL) {
-								gchar _tmp34_;
-								_tmp34_ = string_get (text, i);
-								gee_abstract_list_insert ((GeeAbstractList*) _arguments, 0, GINT_TO_POINTER (_tmp34_ == ']'));
+								_tmp29_ = '[';
 							}
+							other_argument_opening_bracket = _tmp29_;
+							_tmp31_ = string_get (text, i);
+							gee_abstract_list_insert ((GeeAbstractList*) _arguments, 0, GINT_TO_POINTER (_tmp31_ == ']'));
 							continue;
 						}
 						result = FALSE;
@@ -2434,7 +2511,7 @@ static void _vala_CompletionProviderCompletionArgument_array_free (CompletionPro
 }
 
 
-static CompletionProviderCompletionArgument* _vala_array_dup6 (CompletionProviderCompletionArgument* self, int length) {
+static CompletionProviderCompletionArgument* _vala_array_dup7 (CompletionProviderCompletionArgument* self, int length) {
 	CompletionProviderCompletionArgument* result;
 	int i;
 	result = g_new0 (CompletionProviderCompletionArgument, length);
@@ -2451,7 +2528,7 @@ static void completion_provider_completion_command_copy (const CompletionProvide
 	CompletionProviderCompletionArgument* _tmp0_;
 	dest->name = g_strdup (self->name);
 	dest->package = g_strdup (self->package);
-	dest->args = (_tmp0_ = self->args, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup6 (_tmp0_, (*self).args_length1));
+	dest->args = (_tmp0_ = self->args, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup7 (_tmp0_, (*self).args_length1));
 	dest->args_length1 = self->args_length1;
 }
 
@@ -2499,7 +2576,7 @@ static void _vala_CompletionProviderCompletionChoice_array_free (CompletionProvi
 }
 
 
-static CompletionProviderCompletionChoice* _vala_array_dup7 (CompletionProviderCompletionChoice* self, int length) {
+static CompletionProviderCompletionChoice* _vala_array_dup8 (CompletionProviderCompletionChoice* self, int length) {
 	CompletionProviderCompletionChoice* result;
 	int i;
 	result = g_new0 (CompletionProviderCompletionChoice, length);
@@ -2516,7 +2593,7 @@ static void completion_provider_completion_argument_copy (const CompletionProvid
 	CompletionProviderCompletionChoice* _tmp0_;
 	dest->label = g_strdup (self->label);
 	dest->optional = self->optional;
-	dest->choices = (_tmp0_ = self->choices, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup7 (_tmp0_, (*self).choices_length1));
+	dest->choices = (_tmp0_ = self->choices, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup8 (_tmp0_, (*self).choices_length1));
 	dest->choices_length1 = self->choices_length1;
 }
 
@@ -2555,12 +2632,16 @@ static GType completion_provider_completion_argument_get_type (void) {
 static void completion_provider_completion_choice_copy (const CompletionProviderCompletionChoice* self, CompletionProviderCompletionChoice* dest) {
 	dest->name = g_strdup (self->name);
 	dest->package = g_strdup (self->package);
+	dest->insert = g_strdup (self->insert);
+	dest->insert_after = g_strdup (self->insert_after);
 }
 
 
 static void completion_provider_completion_choice_destroy (CompletionProviderCompletionChoice* self) {
 	_g_free0 ((*self).name);
 	_g_free0 ((*self).package);
+	_g_free0 ((*self).insert);
+	_g_free0 ((*self).insert_after);
 }
 
 
@@ -2627,9 +2708,11 @@ static void completion_provider_finalize (GObject* obj) {
 	self = COMPLETION_PROVIDER (obj);
 	__g_list_free__g_object_unref0_0 (self->priv->proposals);
 	_g_object_unref0 (self->priv->commands);
+	_g_object_unref0 (self->priv->environments);
 	_g_object_unref0 (self->priv->settings);
 	completion_provider_completion_command_destroy (&self->priv->current_command);
 	completion_provider_completion_argument_destroy (&self->priv->current_arg);
+	completion_provider_completion_choice_destroy (&self->priv->current_choice);
 	_g_object_unref0 (self->priv->icon_normal_cmd);
 	_g_object_unref0 (self->priv->icon_normal_choice);
 	_g_object_unref0 (self->priv->icon_package_required);
diff --git a/src/C/custom_statusbar.c b/src/C/custom_statusbar.c
index 21905cf..2ee185a 100644
--- a/src/C/custom_statusbar.c
+++ b/src/C/custom_statusbar.c
@@ -1,4 +1,4 @@
-/* custom_statusbar.c generated by valac 0.12.0, the Vala compiler
+/* custom_statusbar.c generated by valac 0.12.1, the Vala compiler
  * generated from custom_statusbar.vala, do not modify */
 
 /*
diff --git a/src/C/dialogs.c b/src/C/dialogs.c
index 5829142..0417ae3 100644
--- a/src/C/dialogs.c
+++ b/src/C/dialogs.c
@@ -1,4 +1,4 @@
-/* dialogs.c generated by valac 0.12.0, the Vala compiler
+/* dialogs.c generated by valac 0.12.1, the Vala compiler
  * generated from dialogs.vala, do not modify */
 
 /*
@@ -29,7 +29,6 @@
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
-#include <gio/gio.h>
 
 
 #define DIALOGS_TYPE_UNSAVED_DOC_COLUMN (dialogs_unsaved_doc_column_get_type ())
@@ -53,7 +52,7 @@ typedef struct _MainWindowClass MainWindowClass;
 
 typedef struct _Document Document;
 typedef struct _DocumentClass DocumentClass;
-typedef struct _Block20Data Block20Data;
+typedef struct _Block19Data Block19Data;
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 #define _g_free0(var) (var = (g_free (var), NULL))
 typedef struct _DocumentPrivate DocumentPrivate;
@@ -70,9 +69,6 @@ typedef struct _DocumentTabClass DocumentTabClass;
 #define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
 
-#define DIALOGS_TYPE_CLEAN_FILE_COLUMN (dialogs_clean_file_column_get_type ())
-typedef struct _Block21Data Block21Data;
-
 typedef enum  {
 	DIALOGS_UNSAVED_DOC_COLUMN_SAVE,
 	DIALOGS_UNSAVED_DOC_COLUMN_NAME,
@@ -80,7 +76,7 @@ typedef enum  {
 	DIALOGS_UNSAVED_DOC_COLUMN_N_COLUMNS
 } DialogsUnsavedDocColumn;
 
-struct _Block20Data {
+struct _Block19Data {
 	int _ref_count_;
 	GtkListStore* store;
 };
@@ -96,29 +92,18 @@ struct _DocumentClass {
 	GtkSourceBufferClass parent_class;
 };
 
-typedef enum  {
-	DIALOGS_CLEAN_FILE_COLUMN_DELETE,
-	DIALOGS_CLEAN_FILE_COLUMN_NAME,
-	DIALOGS_CLEAN_FILE_COLUMN_N_COLUMNS
-} DialogsCleanFileColumn;
-
-struct _Block21Data {
-	int _ref_count_;
-	GtkListStore* store;
-};
-
 
 
 GType dialogs_unsaved_doc_column_get_type (void) G_GNUC_CONST;
 GType main_window_get_type (void) G_GNUC_CONST;
 GType document_get_type (void) G_GNUC_CONST;
 void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved_docs);
-static Block20Data* block20_data_ref (Block20Data* _data20_);
-static void block20_data_unref (Block20Data* _data20_);
+static Block19Data* block19_data_ref (Block19Data* _data19_);
+static void block19_data_unref (Block19Data* _data19_);
 GType document_tab_get_type (void) G_GNUC_CONST;
 const gchar* document_tab_get_label_text (DocumentTab* self);
-static void _lambda72_ (const gchar* path_str, Block20Data* _data20_);
-static void __lambda72__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
+static void _lambda84_ (const gchar* path_str, Block19Data* _data19_);
+static void __lambda84__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
 void main_window_remove_all_tabs (MainWindow* self);
 GList* main_window_get_documents (MainWindow* self);
@@ -127,16 +112,6 @@ gboolean main_window_close_tab (MainWindow* self, DocumentTab* tab, gboolean for
 static void _g_object_unref0_ (gpointer var);
 static void _g_list_free__g_object_unref0_ (GList* self);
 gboolean main_window_save_document (MainWindow* self, Document* doc, gboolean force_save_as);
-GType dialogs_clean_file_column_get_type (void) G_GNUC_CONST;
-gboolean dialogs_confirm_clean_build_files (MainWindow* window, GFile* directory, gchar** basenames, int basenames_length1);
-static Block21Data* block21_data_ref (Block21Data* _data21_);
-static void block21_data_unref (Block21Data* _data21_);
-static void _lambda19_ (const gchar* path_str, Block21Data* _data21_);
-static void __lambda19__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
-static void _vala_array_add17 (gchar*** array, int* length, int* size, gchar* value);
-void utils_delete_file (GFile* file);
-static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
-static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
 
 GType dialogs_unsaved_doc_column_get_type (void) {
@@ -151,16 +126,16 @@ GType dialogs_unsaved_doc_column_get_type (void) {
 }
 
 
-static Block20Data* block20_data_ref (Block20Data* _data20_) {
-	g_atomic_int_inc (&_data20_->_ref_count_);
-	return _data20_;
+static Block19Data* block19_data_ref (Block19Data* _data19_) {
+	g_atomic_int_inc (&_data19_->_ref_count_);
+	return _data19_;
 }
 
 
-static void block20_data_unref (Block20Data* _data20_) {
-	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
-		_g_object_unref0 (_data20_->store);
-		g_slice_free (Block20Data, _data20_);
+static void block19_data_unref (Block19Data* _data19_) {
+	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
+		_g_object_unref0 (_data19_->store);
+		g_slice_free (Block19Data, _data19_);
 	}
 }
 
@@ -170,7 +145,7 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda72_ (const gchar* path_str, Block20Data* _data20_) {
+static void _lambda84_ (const gchar* path_str, Block19Data* _data19_) {
 	GtkTreePath* _tmp0_ = NULL;
 	GtkTreePath* path;
 	GtkTreeIter iter = {0};
@@ -179,16 +154,16 @@ static void _lambda72_ (const gchar* path_str, Block20Data* _data20_) {
 	g_return_if_fail (path_str != NULL);
 	_tmp0_ = gtk_tree_path_new_from_string (path_str);
 	path = _tmp0_;
-	gtk_tree_model_get_iter ((GtkTreeModel*) _data20_->store, &_tmp1_, path);
+	gtk_tree_model_get_iter ((GtkTreeModel*) _data19_->store, &_tmp1_, path);
 	iter = _tmp1_;
-	gtk_tree_model_get ((GtkTreeModel*) _data20_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, &active, -1, -1);
-	gtk_list_store_set (_data20_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, !active, -1, -1);
+	gtk_tree_model_get ((GtkTreeModel*) _data19_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, &active, -1, -1);
+	gtk_list_store_set (_data19_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, !active, -1, -1);
 	_gtk_tree_path_free0 (path);
 }
 
 
-static void __lambda72__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
-	_lambda72_ (path, self);
+static void __lambda84__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
+	_lambda84_ (path, self);
 }
 
 
@@ -204,7 +179,7 @@ static void _g_list_free__g_object_unref0_ (GList* self) {
 
 
 void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved_docs) {
-	Block20Data* _data20_;
+	Block19Data* _data19_;
 	guint _tmp0_;
 	const gchar* _tmp1_ = NULL;
 	GtkDialog* _tmp2_ = NULL;
@@ -251,8 +226,8 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 	gint _tmp32_;
 	gint resp;
 	g_return_if_fail (window != NULL);
-	_data20_ = g_slice_new0 (Block20Data);
-	_data20_->_ref_count_ = 1;
+	_data19_ = g_slice_new0 (Block19Data);
+	_data19_->_ref_count_ = 1;
 	_tmp0_ = g_list_length (unsaved_docs);
 	g_return_if_fail (_tmp0_ >= 2);
 	_tmp1_ = _ ("Close without Saving");
@@ -308,7 +283,7 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 	gtk_tree_view_set_headers_visible (treeview, FALSE);
 	gtk_tree_view_set_enable_search (treeview, FALSE);
 	_tmp21_ = gtk_list_store_new ((gint) DIALOGS_UNSAVED_DOC_COLUMN_N_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, TYPE_DOCUMENT);
-	_data20_->store = _tmp21_;
+	_data19_->store = _tmp21_;
 	{
 		GList* doc_collection;
 		GList* doc_it;
@@ -322,18 +297,18 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 				GtkTreeIter iter = {0};
 				GtkTreeIter _tmp23_ = {0};
 				const gchar* _tmp24_ = NULL;
-				gtk_list_store_append (_data20_->store, &_tmp23_);
+				gtk_list_store_append (_data19_->store, &_tmp23_);
 				iter = _tmp23_;
 				_tmp24_ = document_tab_get_label_text (doc->tab);
-				gtk_list_store_set (_data20_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, TRUE, DIALOGS_UNSAVED_DOC_COLUMN_NAME, _tmp24_, DIALOGS_UNSAVED_DOC_COLUMN_DOC, doc, -1, -1);
+				gtk_list_store_set (_data19_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, TRUE, DIALOGS_UNSAVED_DOC_COLUMN_NAME, _tmp24_, DIALOGS_UNSAVED_DOC_COLUMN_DOC, doc, -1, -1);
 				_g_object_unref0 (doc);
 			}
 		}
 	}
-	gtk_tree_view_set_model (treeview, (GtkTreeModel*) _data20_->store);
+	gtk_tree_view_set_model (treeview, (GtkTreeModel*) _data19_->store);
 	_tmp25_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
 	renderer1 = g_object_ref_sink (_tmp25_);
-	g_signal_connect_data (renderer1, "toggled", (GCallback) __lambda72__gtk_cell_renderer_toggle_toggled, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
+	g_signal_connect_data (renderer1, "toggled", (GCallback) __lambda84__gtk_cell_renderer_toggle_toggled, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
 	_tmp26_ = gtk_tree_view_column_new_with_attributes ("Save?", (GtkCellRenderer*) renderer1, "active", DIALOGS_UNSAVED_DOC_COLUMN_SAVE, NULL, NULL);
 	column = g_object_ref_sink (_tmp26_);
 	gtk_tree_view_append_column (treeview, column);
@@ -389,7 +364,7 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 				__g_list_free__g_object_unref0_0 (doc_collection);
 			}
 			selected_docs = NULL;
-			_tmp37_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _data20_->store, &_tmp36_);
+			_tmp37_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _data19_->store, &_tmp36_);
 			iter = _tmp36_;
 			valid = _tmp37_;
 			while (TRUE) {
@@ -399,7 +374,7 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 				if (!valid) {
 					break;
 				}
-				gtk_tree_model_get ((GtkTreeModel*) _data20_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, &selected, DIALOGS_UNSAVED_DOC_COLUMN_DOC, &doc, -1, -1);
+				gtk_tree_model_get ((GtkTreeModel*) _data19_->store, &iter, DIALOGS_UNSAVED_DOC_COLUMN_SAVE, &selected, DIALOGS_UNSAVED_DOC_COLUMN_DOC, &doc, -1, -1);
 				if (selected) {
 					Document* _tmp38_;
 					_tmp38_ = _g_object_ref0 (doc);
@@ -407,7 +382,7 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 				} else {
 					main_window_close_tab (window, doc->tab, TRUE);
 				}
-				_tmp39_ = gtk_tree_model_iter_next ((GtkTreeModel*) _data20_->store, &iter);
+				_tmp39_ = gtk_tree_model_iter_next ((GtkTreeModel*) _data19_->store, &iter);
 				valid = _tmp39_;
 				_g_object_unref0 (doc);
 			}
@@ -449,297 +424,8 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 	_g_object_unref0 (content_area);
 	_g_object_unref0 (hbox);
 	_g_object_unref0 (dialog);
-	block20_data_unref (_data20_);
-	_data20_ = NULL;
-}
-
-
-GType dialogs_clean_file_column_get_type (void) {
-	static volatile gsize dialogs_clean_file_column_type_id__volatile = 0;
-	if (g_once_init_enter (&dialogs_clean_file_column_type_id__volatile)) {
-		static const GEnumValue values[] = {{DIALOGS_CLEAN_FILE_COLUMN_DELETE, "DIALOGS_CLEAN_FILE_COLUMN_DELETE", "delete"}, {DIALOGS_CLEAN_FILE_COLUMN_NAME, "DIALOGS_CLEAN_FILE_COLUMN_NAME", "name"}, {DIALOGS_CLEAN_FILE_COLUMN_N_COLUMNS, "DIALOGS_CLEAN_FILE_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
-		GType dialogs_clean_file_column_type_id;
-		dialogs_clean_file_column_type_id = g_enum_register_static ("DialogsCleanFileColumn", values);
-		g_once_init_leave (&dialogs_clean_file_column_type_id__volatile, dialogs_clean_file_column_type_id);
-	}
-	return dialogs_clean_file_column_type_id__volatile;
-}
-
-
-static Block21Data* block21_data_ref (Block21Data* _data21_) {
-	g_atomic_int_inc (&_data21_->_ref_count_);
-	return _data21_;
-}
-
-
-static void block21_data_unref (Block21Data* _data21_) {
-	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
-		_g_object_unref0 (_data21_->store);
-		g_slice_free (Block21Data, _data21_);
-	}
-}
-
-
-static void _lambda19_ (const gchar* path_str, Block21Data* _data21_) {
-	GtkTreePath* _tmp0_ = NULL;
-	GtkTreePath* path;
-	GtkTreeIter iter = {0};
-	gboolean active = FALSE;
-	GtkTreeIter _tmp1_ = {0};
-	g_return_if_fail (path_str != NULL);
-	_tmp0_ = gtk_tree_path_new_from_string (path_str);
-	path = _tmp0_;
-	gtk_tree_model_get_iter ((GtkTreeModel*) _data21_->store, &_tmp1_, path);
-	iter = _tmp1_;
-	gtk_tree_model_get ((GtkTreeModel*) _data21_->store, &iter, DIALOGS_CLEAN_FILE_COLUMN_DELETE, &active, -1, -1);
-	gtk_list_store_set (_data21_->store, &iter, DIALOGS_CLEAN_FILE_COLUMN_DELETE, !active, -1, -1);
-	_gtk_tree_path_free0 (path);
-}
-
-
-static void __lambda19__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
-	_lambda19_ (path, self);
-}
-
-
-static void _vala_array_add17 (gchar*** array, int* length, int* size, gchar* value) {
-	if ((*length) == (*size)) {
-		*size = (*size) ? (2 * (*size)) : 4;
-		*array = g_renew (gchar*, *array, (*size) + 1);
-	}
-	(*array)[(*length)++] = value;
-	(*array)[*length] = NULL;
-}
-
-
-gboolean dialogs_confirm_clean_build_files (MainWindow* window, GFile* directory, gchar** basenames, int basenames_length1) {
-	gboolean result = FALSE;
-	Block21Data* _data21_;
-	GtkDialog* _tmp0_ = NULL;
-	GtkDialog* dialog;
-	GtkHBox* _tmp1_ = NULL;
-	GtkHBox* hbox;
-	GtkWidget* _tmp2_ = NULL;
-	GtkVBox* _tmp3_;
-	GtkVBox* content_area;
-	GtkImage* _tmp4_ = NULL;
-	GtkImage* image;
-	GtkVBox* _tmp5_ = NULL;
-	GtkVBox* vbox;
-	GtkLabel* _tmp6_ = NULL;
-	GtkLabel* primary_label;
-	const gchar* _tmp7_ = NULL;
-	gchar* _tmp8_;
-	gchar* _tmp9_;
-	gchar* _tmp10_;
-	gchar* _tmp11_;
-	GtkVBox* _tmp12_ = NULL;
-	GtkVBox* vbox2;
-	const gchar* _tmp13_ = NULL;
-	GtkLabel* _tmp14_ = NULL;
-	GtkLabel* select_label;
-	GtkTreeView* _tmp15_ = NULL;
-	GtkTreeView* treeview;
-	GtkListStore* _tmp16_ = NULL;
-	GtkCellRendererToggle* _tmp19_ = NULL;
-	GtkCellRendererToggle* renderer1;
-	GtkTreeViewColumn* _tmp20_ = NULL;
-	GtkTreeViewColumn* column;
-	GtkCellRendererText* _tmp21_ = NULL;
-	GtkCellRendererText* renderer2;
-	GtkTreeViewColumn* _tmp22_ = NULL;
-	GtkWidget* _tmp23_ = NULL;
-	GtkScrolledWindow* sw;
-	gboolean ret;
-	gint _tmp24_;
-	g_return_val_if_fail (window != NULL, FALSE);
-	g_return_val_if_fail (directory != NULL, FALSE);
-	_data21_ = g_slice_new0 (Block21Data);
-	_data21_->_ref_count_ = 1;
-	g_return_if_fail (basenames_length1 > 0);
-	_tmp0_ = (GtkDialog*) gtk_dialog_new_with_buttons (NULL, (GtkWindow*) window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT, NULL, NULL);
-	dialog = g_object_ref_sink (_tmp0_);
-	gtk_dialog_set_has_separator (dialog, FALSE);
-	_tmp1_ = (GtkHBox*) gtk_hbox_new (FALSE, 12);
-	hbox = g_object_ref_sink (_tmp1_);
-	gtk_container_set_border_width ((GtkContainer*) hbox, (guint) 5);
-	_tmp2_ = gtk_dialog_get_content_area (dialog);
-	_tmp3_ = _g_object_ref0 (GTK_VBOX (_tmp2_));
-	content_area = _tmp3_;
-	gtk_box_pack_start ((GtkBox*) content_area, (GtkWidget*) hbox, TRUE, TRUE, (guint) 0);
-	_tmp4_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
-	image = g_object_ref_sink (_tmp4_);
-	gtk_misc_set_alignment ((GtkMisc*) image, (gfloat) 0.5, (gfloat) 0.0);
-	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) image, FALSE, FALSE, (guint) 0);
-	_tmp5_ = (GtkVBox*) gtk_vbox_new (FALSE, 12);
-	vbox = g_object_ref_sink (_tmp5_);
-	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) vbox, TRUE, TRUE, (guint) 0);
-	_tmp6_ = (GtkLabel*) gtk_label_new (NULL);
-	primary_label = g_object_ref_sink (_tmp6_);
-	gtk_label_set_line_wrap (primary_label, TRUE);
-	gtk_label_set_use_markup (primary_label, TRUE);
-	gtk_misc_set_alignment ((GtkMisc*) primary_label, (gfloat) 0.0, (gfloat) 0.5);
-	gtk_label_set_selectable (primary_label, TRUE);
-	_tmp7_ = _ ("Do you really want to delete these files?");
-	_tmp8_ = g_strconcat ("<span weight=\"bold\" size=\"larger\">", _tmp7_, NULL);
-	_tmp9_ = _tmp8_;
-	_tmp10_ = g_strconcat (_tmp9_, "</span>", NULL);
-	_tmp11_ = _tmp10_;
-	gtk_label_set_markup (primary_label, _tmp11_);
-	_g_free0 (_tmp11_);
-	_g_free0 (_tmp9_);
-	gtk_box_pack_start ((GtkBox*) vbox, (GtkWidget*) primary_label, FALSE, FALSE, (guint) 0);
-	_tmp12_ = (GtkVBox*) gtk_vbox_new (FALSE, 8);
-	vbox2 = g_object_ref_sink (_tmp12_);
-	gtk_box_pack_start ((GtkBox*) vbox, (GtkWidget*) vbox2, FALSE, FALSE, (guint) 0);
-	_tmp13_ = _ ("Select the files you want to delete:");
-	_tmp14_ = (GtkLabel*) gtk_label_new (_tmp13_);
-	select_label = g_object_ref_sink (_tmp14_);
-	gtk_label_set_line_wrap (select_label, TRUE);
-	gtk_misc_set_alignment ((GtkMisc*) select_label, (gfloat) 0.0, (gfloat) 0.5);
-	gtk_box_pack_start ((GtkBox*) vbox2, (GtkWidget*) select_label, FALSE, FALSE, (guint) 0);
-	_tmp15_ = (GtkTreeView*) gtk_tree_view_new ();
-	treeview = g_object_ref_sink (_tmp15_);
-	gtk_widget_set_size_request ((GtkWidget*) treeview, 260, 120);
-	gtk_tree_view_set_headers_visible (treeview, FALSE);
-	gtk_tree_view_set_enable_search (treeview, FALSE);
-	_tmp16_ = gtk_list_store_new ((gint) DIALOGS_CLEAN_FILE_COLUMN_N_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING);
-	_data21_->store = _tmp16_;
-	{
-		gchar** basename_collection;
-		int basename_collection_length1;
-		int basename_it;
-		basename_collection = basenames;
-		basename_collection_length1 = basenames_length1;
-		for (basename_it = 0; basename_it < basenames_length1; basename_it = basename_it + 1) {
-			gchar* _tmp17_;
-			gchar* basename;
-			_tmp17_ = g_strdup (basename_collection[basename_it]);
-			basename = _tmp17_;
-			{
-				GtkTreeIter iter = {0};
-				GtkTreeIter _tmp18_ = {0};
-				gtk_list_store_append (_data21_->store, &_tmp18_);
-				iter = _tmp18_;
-				gtk_list_store_set (_data21_->store, &iter, DIALOGS_CLEAN_FILE_COLUMN_DELETE, TRUE, DIALOGS_CLEAN_FILE_COLUMN_NAME, basename, -1, -1);
-				_g_free0 (basename);
-			}
-		}
-	}
-	gtk_tree_view_set_model (treeview, (GtkTreeModel*) _data21_->store);
-	_tmp19_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
-	renderer1 = g_object_ref_sink (_tmp19_);
-	g_signal_connect_data (renderer1, "toggled", (GCallback) __lambda19__gtk_cell_renderer_toggle_toggled, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
-	_tmp20_ = gtk_tree_view_column_new_with_attributes ("Delete?", (GtkCellRenderer*) renderer1, "active", DIALOGS_CLEAN_FILE_COLUMN_DELETE, NULL, NULL);
-	column = g_object_ref_sink (_tmp20_);
-	gtk_tree_view_append_column (treeview, column);
-	_tmp21_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
-	renderer2 = g_object_ref_sink (_tmp21_);
-	_tmp22_ = gtk_tree_view_column_new_with_attributes ("Name", (GtkCellRenderer*) renderer2, "text", DIALOGS_CLEAN_FILE_COLUMN_NAME, NULL, NULL);
-	_g_object_unref0 (column);
-	column = g_object_ref_sink (_tmp22_);
-	gtk_tree_view_append_column (treeview, column);
-	_tmp23_ = utils_add_scrollbar ((GtkWidget*) treeview);
-	sw = GTK_SCROLLED_WINDOW (_tmp23_);
-	gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_IN);
-	gtk_box_pack_start ((GtkBox*) vbox2, (GtkWidget*) sw, TRUE, TRUE, (guint) 0);
-	gtk_widget_show_all ((GtkWidget*) hbox);
-	ret = FALSE;
-	_tmp24_ = gtk_dialog_run (dialog);
-	if (_tmp24_ == GTK_RESPONSE_ACCEPT) {
-		gchar** _tmp25_ = NULL;
-		gchar** selected_files;
-		gint selected_files_length1;
-		gint _selected_files_size_;
-		GtkTreeIter iter = {0};
-		GtkTreeIter _tmp26_ = {0};
-		gboolean _tmp27_;
-		gboolean valid;
-		_tmp25_ = g_new0 (gchar*, 0 + 1);
-		selected_files = _tmp25_;
-		selected_files_length1 = 0;
-		_selected_files_size_ = 0;
-		_tmp27_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _data21_->store, &_tmp26_);
-		iter = _tmp26_;
-		valid = _tmp27_;
-		while (TRUE) {
-			gboolean selected = FALSE;
-			gchar* basename = NULL;
-			gboolean _tmp29_;
-			if (!valid) {
-				break;
-			}
-			gtk_tree_model_get ((GtkTreeModel*) _data21_->store, &iter, DIALOGS_CLEAN_FILE_COLUMN_DELETE, &selected, DIALOGS_CLEAN_FILE_COLUMN_NAME, &basename, -1, -1);
-			if (selected) {
-				gchar* _tmp28_;
-				_tmp28_ = g_strdup (basename);
-				_vala_array_add17 (&selected_files, &selected_files_length1, &_selected_files_size_, _tmp28_);
-			}
-			_tmp29_ = gtk_tree_model_iter_next ((GtkTreeModel*) _data21_->store, &iter);
-			valid = _tmp29_;
-			_g_free0 (basename);
-		}
-		{
-			gchar** selected_file_collection;
-			int selected_file_collection_length1;
-			int selected_file_it;
-			selected_file_collection = selected_files;
-			selected_file_collection_length1 = selected_files_length1;
-			for (selected_file_it = 0; selected_file_it < selected_files_length1; selected_file_it = selected_file_it + 1) {
-				gchar* _tmp30_;
-				gchar* selected_file;
-				_tmp30_ = g_strdup (selected_file_collection[selected_file_it]);
-				selected_file = _tmp30_;
-				{
-					GFile* _tmp31_ = NULL;
-					GFile* file;
-					ret = TRUE;
-					_tmp31_ = g_file_get_child (directory, selected_file);
-					file = _tmp31_;
-					utils_delete_file (file);
-					_g_object_unref0 (file);
-					_g_free0 (selected_file);
-				}
-			}
-		}
-		selected_files = (_vala_array_free (selected_files, selected_files_length1, (GDestroyNotify) g_free), NULL);
-	}
-	gtk_object_destroy ((GtkObject*) dialog);
-	result = ret;
-	_g_object_unref0 (sw);
-	_g_object_unref0 (renderer2);
-	_g_object_unref0 (column);
-	_g_object_unref0 (renderer1);
-	_g_object_unref0 (treeview);
-	_g_object_unref0 (select_label);
-	_g_object_unref0 (vbox2);
-	_g_object_unref0 (primary_label);
-	_g_object_unref0 (vbox);
-	_g_object_unref0 (image);
-	_g_object_unref0 (content_area);
-	_g_object_unref0 (hbox);
-	_g_object_unref0 (dialog);
-	block21_data_unref (_data21_);
-	_data21_ = NULL;
-	return result;
-}
-
-
-static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
-	if ((array != NULL) && (destroy_func != NULL)) {
-		int i;
-		for (i = 0; i < array_length; i = i + 1) {
-			if (((gpointer*) array)[i] != NULL) {
-				destroy_func (((gpointer*) array)[i]);
-			}
-		}
-	}
-}
-
-
-static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
-	_vala_array_destroy (array, array_length, destroy_func);
-	g_free (array);
+	block19_data_unref (_data19_);
+	_data19_ = NULL;
 }
 
 
diff --git a/src/C/document.c b/src/C/document.c
index 2620780..fb85945 100644
--- a/src/C/document.c
+++ b/src/C/document.c
@@ -1,4 +1,4 @@
-/* document.c generated by valac 0.12.0, the Vala compiler
+/* document.c generated by valac 0.12.1, the Vala compiler
  * generated from document.vala, do not modify */
 
 /*
@@ -82,7 +82,7 @@ typedef struct _DocumentStructureClass DocumentStructureClass;
 
 typedef struct _CompletionProvider CompletionProvider;
 typedef struct _CompletionProviderClass CompletionProviderClass;
-typedef struct _Block18Data Block18Data;
+typedef struct _Block16Data Block16Data;
 typedef struct _CompletionProviderPrivate CompletionProviderPrivate;
 
 #define TYPE_TAB_INFO_BAR (tab_info_bar_get_type ())
@@ -95,7 +95,7 @@ typedef struct _CompletionProviderPrivate CompletionProviderPrivate;
 typedef struct _TabInfoBar TabInfoBar;
 typedef struct _TabInfoBarClass TabInfoBarClass;
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-typedef struct _Block19Data Block19Data;
+typedef struct _Block17Data Block17Data;
 
 #define TYPE_PROJECTS (projects_get_type ())
 #define PROJECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROJECTS, Projects))
@@ -133,16 +133,6 @@ typedef struct _ApplicationClass ApplicationClass;
 typedef struct _DocumentView DocumentView;
 typedef struct _DocumentViewClass DocumentViewClass;
 
-#define TYPE_MAIN_WINDOW (main_window_get_type ())
-#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
-#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
-#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
-#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
-#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))
-
-typedef struct _MainWindow MainWindow;
-typedef struct _MainWindowClass MainWindowClass;
-
 typedef enum  {
 	SELECTION_TYPE_NO_SELECTION,
 	SELECTION_TYPE_ONE_LINE,
@@ -179,7 +169,7 @@ struct _DocumentPrivate {
 	gboolean stop_cursor_moved_emission;
 };
 
-struct _Block18Data {
+struct _Block16Data {
 	int _ref_count_;
 	Document * self;
 	CompletionProvider* provider;
@@ -195,7 +185,7 @@ struct _CompletionProviderClass {
 	GObjectClass parent_class;
 };
 
-struct _Block19Data {
+struct _Block17Data {
 	int _ref_count_;
 	Document * self;
 	TabInfoBar* infobar;
@@ -222,25 +212,25 @@ enum  {
 };
 Document* document_new (void);
 Document* document_construct (GType object_type);
-static void _lambda13_ (Document* self);
+static void _lambda19_ (Document* self);
 static void document_update_syntax_highlighting (Document* self);
 static void document_update_project_id (Document* self);
-static void __lambda13__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda14_ (GtkTextIter* location, GtkTextMark* mark, Document* self);
+static void __lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda20_ (GtkTextIter* location, GtkTextMark* mark, Document* self);
 static void document_emit_cursor_moved (Document* self);
-static void __lambda14__gtk_text_buffer_mark_set (GtkTextBuffer* _sender, GtkTextIter* location, GtkTextMark* mark, gpointer self);
-static void _lambda15_ (Document* self);
-static void __lambda15__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self);
+static void __lambda20__gtk_text_buffer_mark_set (GtkTextBuffer* _sender, GtkTextIter* location, GtkTextMark* mark, gpointer self);
+static void _lambda21_ (Document* self);
+static void __lambda21__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self);
 static void document_sync_found_tags (Document* self);
 static void _document_sync_found_tags_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 gboolean document_get_modified (Document* self);
 void document_insert (Document* self, GtkTextIter* iter, const gchar* text, gint len);
 GType completion_provider_get_type (void) G_GNUC_CONST;
-static Block18Data* block18_data_ref (Block18Data* _data18_);
-static void block18_data_unref (Block18Data* _data18_);
+static Block16Data* block16_data_ref (Block16Data* _data16_);
+static void block16_data_unref (Block16Data* _data16_);
 CompletionProvider* completion_provider_get_default (void);
-static gboolean _lambda16_ (Block18Data* _data18_);
-static gboolean __lambda16__gsource_func (gpointer self);
+static gboolean _lambda17_ (Block16Data* _data16_);
+static gboolean __lambda17__gsource_func (gpointer self);
 void document_load (Document* self, GFile* location);
 void document_set_location (Document* self, GFile* value);
 void document_set_contents (Document* self, const gchar* contents);
@@ -249,11 +239,11 @@ GType tab_info_bar_get_type (void) G_GNUC_CONST;
 TabInfoBar* document_tab_add_message (DocumentTab* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
 void document_save (Document* self, gboolean check_file_changed_on_disk, gboolean force);
 GFile* document_get_location (Document* self);
-static Block19Data* block19_data_ref (Block19Data* _data19_);
-static void block19_data_unref (Block19Data* _data19_);
+static Block17Data* block17_data_ref (Block17Data* _data17_);
+static void block17_data_unref (Block17Data* _data17_);
 void tab_info_bar_add_stock_button_with_text (TabInfoBar* self, const gchar* text, const gchar* stock_id, gint response_id);
-static void _lambda18_ (gint response_id, Block19Data* _data19_);
-static void __lambda18__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
+static void _lambda23_ (gint response_id, Block17Data* _data17_);
+static void __lambda23__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
 void tab_info_bar_add_ok_button (TabInfoBar* self);
 gpointer projects_ref (gpointer instance);
 void projects_unref (gpointer instance);
@@ -278,7 +268,7 @@ static guint document_get_unsaved_document_num (Document* self);
 GType application_get_type (void) G_GNUC_CONST;
 Application* application_get_default (void);
 GList* application_get_documents (Application* self);
-static void _vala_array_add15 (guint** array, int* length, int* size, guint value);
+static void _vala_array_add17 (guint** array, int* length, int* size, guint value);
 static void _g_object_unref0_ (gpointer var);
 static void _g_list_free__g_object_unref0_ (GList* self);
 static gboolean _vala_uint_array_contains (guint* stack, int stack_length, guint needle);
@@ -293,21 +283,16 @@ GType document_view_get_type (void) G_GNUC_CONST;
 DocumentView* document_tab_get_view (DocumentTab* self);
 void document_view_scroll_to_cursor (DocumentView* self, gdouble margin);
 SelectionType document_get_selection_type (Document* self);
-gboolean document_is_tex_document (Document* self);
-GType main_window_get_type (void) G_GNUC_CONST;
-gboolean document_clean_build_files (Document* self, MainWindow* window);
-GFile* document_get_main_file (Document* self);
-gchar* utils_get_shortname (const gchar* path);
-void utils_delete_file (GFile* file);
-static void _vala_array_add16 (gchar*** array, int* length, int* size, gchar* value);
-gboolean dialogs_confirm_clean_build_files (MainWindow* window, GFile* directory, gchar** basenames, int basenames_length1);
 gboolean document_goto_line (Document* self, gint line);
+Project* document_get_project (Document* self);
 gint document_get_project_id (Document* self);
 Project* projects_get (Projects* self, gint id);
+GFile* document_get_main_file (Document* self);
+gboolean document_is_main_file_a_tex_file (Document* self);
 gchar* document_get_current_indentation (Document* self, gint line);
 DocumentStructure* document_get_structure (Document* self);
-DocumentStructure* document_structure_new (GtkTextBuffer* doc);
-DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffer* doc);
+DocumentStructure* document_structure_new (Document* doc);
+DocumentStructure* document_structure_construct (GType object_type, Document* doc);
 void document_structure_parse (DocumentStructure* self);
 void document_set_search_text (Document* self, const gchar* text, gboolean case_sensitive, gboolean entire_word, guint* nb_matches, guint* num_match, gboolean select);
 static void document_search_cursor_moved_handler (Document* self);
@@ -325,6 +310,7 @@ void document_clear_search (Document* self, gboolean disconnect_signals);
 static gboolean document_iter_forward_search (Document* self, GtkTextIter* start, GtkTextIter* end, GtkTextIter* match_start, GtkTextIter* match_end);
 static void document_move_search_marks (Document* self, GtkTextIter* start, GtkTextIter* end, gboolean move_cursor);
 static void document_clear_search_tags (Document* self);
+void document_select_selected_search_text (Document* self);
 void document_search_forward (Document* self);
 static void document_replace_found_tag_selected (Document* self);
 static void document_find_num_match (Document* self);
@@ -341,9 +327,6 @@ static void g_cclosure_user_marshal_VOID__BOOLEAN_UINT_UINT (GClosure * closure,
 static void document_finalize (GObject* obj);
 static void _vala_document_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 static void _vala_document_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
-static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
-static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
-static gint _vala_array_length (gpointer array);
 
 extern const gchar* ENCODINGS_CHARSETS[60];
 
@@ -364,18 +347,18 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda13_ (Document* self) {
+static void _lambda19_ (Document* self) {
 	document_update_syntax_highlighting (self);
 	document_update_project_id (self);
 }
 
 
-static void __lambda13__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda13_ (self);
+static void __lambda19__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda19_ (self);
 }
 
 
-static void _lambda14_ (GtkTextIter* location, GtkTextMark* mark, Document* self) {
+static void _lambda20_ (GtkTextIter* location, GtkTextMark* mark, Document* self) {
 	GtkTextMark* _tmp0_ = NULL;
 	g_return_if_fail (mark != NULL);
 	_tmp0_ = gtk_text_buffer_get_insert ((GtkTextBuffer*) self);
@@ -385,19 +368,19 @@ static void _lambda14_ (GtkTextIter* location, GtkTextMark* mark, Document* self
 }
 
 
-static void __lambda14__gtk_text_buffer_mark_set (GtkTextBuffer* _sender, GtkTextIter* location, GtkTextMark* mark, gpointer self) {
-	_lambda14_ (location, mark, self);
+static void __lambda20__gtk_text_buffer_mark_set (GtkTextBuffer* _sender, GtkTextIter* location, GtkTextMark* mark, gpointer self) {
+	_lambda20_ (location, mark, self);
 }
 
 
-static void _lambda15_ (Document* self) {
+static void _lambda21_ (Document* self) {
 	self->priv->new_file = FALSE;
 	document_emit_cursor_moved (self);
 }
 
 
-static void __lambda15__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self) {
-	_lambda15_ (self);
+static void __lambda21__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self) {
+	_lambda21_ (self);
 }
 
 
@@ -425,9 +408,9 @@ Document* document_construct (GType object_type) {
 	lm = _tmp1_;
 	_tmp2_ = gtk_source_language_manager_get_language (lm, "latex");
 	gtk_source_buffer_set_language ((GtkSourceBuffer*) self, _tmp2_);
-	g_signal_connect_object ((GObject*) self, "notify::location", (GCallback) __lambda13__g_object_notify, self, 0);
-	g_signal_connect_object ((GtkTextBuffer*) self, "mark-set", (GCallback) __lambda14__gtk_text_buffer_mark_set, self, 0);
-	g_signal_connect_object ((GtkTextBuffer*) self, "changed", (GCallback) __lambda15__gtk_text_buffer_changed, self, 0);
+	g_signal_connect_object ((GObject*) self, "notify::location", (GCallback) __lambda19__g_object_notify, self, 0);
+	g_signal_connect_object ((GtkTextBuffer*) self, "mark-set", (GCallback) __lambda20__gtk_text_buffer_mark_set, self, 0);
+	g_signal_connect_object ((GtkTextBuffer*) self, "changed", (GCallback) __lambda21__gtk_text_buffer_changed, self, 0);
 	_tmp3_ = gtk_text_tag_new ("found");
 	_g_object_unref0 (self->priv->found_tag);
 	self->priv->found_tag = _tmp3_;
@@ -470,53 +453,53 @@ gboolean document_get_modified (Document* self) {
 }
 
 
-static Block18Data* block18_data_ref (Block18Data* _data18_) {
-	g_atomic_int_inc (&_data18_->_ref_count_);
-	return _data18_;
+static Block16Data* block16_data_ref (Block16Data* _data16_) {
+	g_atomic_int_inc (&_data16_->_ref_count_);
+	return _data16_;
 }
 
 
-static void block18_data_unref (Block18Data* _data18_) {
-	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
-		_g_object_unref0 (_data18_->self);
-		_g_object_unref0 (_data18_->provider);
-		g_slice_free (Block18Data, _data18_);
+static void block16_data_unref (Block16Data* _data16_) {
+	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
+		_g_object_unref0 (_data16_->self);
+		_g_object_unref0 (_data16_->provider);
+		g_slice_free (Block16Data, _data16_);
 	}
 }
 
 
-static gboolean _lambda16_ (Block18Data* _data18_) {
+static gboolean _lambda17_ (Block16Data* _data16_) {
 	Document * self;
 	gboolean result = FALSE;
-	self = _data18_->self;
-	_data18_->provider->locked = FALSE;
+	self = _data16_->self;
+	_data16_->provider->locked = FALSE;
 	result = FALSE;
 	return result;
 }
 
 
-static gboolean __lambda16__gsource_func (gpointer self) {
+static gboolean __lambda17__gsource_func (gpointer self) {
 	gboolean result;
-	result = _lambda16_ (self);
+	result = _lambda17_ (self);
 	return result;
 }
 
 
 void document_insert (Document* self, GtkTextIter* iter, const gchar* text, gint len) {
-	Block18Data* _data18_;
+	Block16Data* _data16_;
 	CompletionProvider* _tmp0_ = NULL;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (text != NULL);
-	_data18_ = g_slice_new0 (Block18Data);
-	_data18_->_ref_count_ = 1;
-	_data18_->self = g_object_ref (self);
+	_data16_ = g_slice_new0 (Block16Data);
+	_data16_->_ref_count_ = 1;
+	_data16_->self = g_object_ref (self);
 	_tmp0_ = completion_provider_get_default ();
-	_data18_->provider = _tmp0_;
-	_data18_->provider->locked = TRUE;
+	_data16_->provider = _tmp0_;
+	_data16_->provider->locked = TRUE;
 	gtk_text_buffer_insert ((GtkTextBuffer*) GTK_SOURCE_BUFFER (self), iter, text, len);
-	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda16__gsource_func, block18_data_ref (_data18_), block18_data_unref);
-	block18_data_unref (_data18_);
-	_data18_ = NULL;
+	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda17__gsource_func, block16_data_ref (_data16_), block16_data_unref);
+	block16_data_unref (_data16_);
+	_data16_ = NULL;
 }
 
 
@@ -539,7 +522,7 @@ void document_load (Document* self, GFile* location) {
 	self->priv->_etag = _tmp1_;
 	if (_inner_error_ != NULL) {
 		_g_free0 (text);
-		goto __catch38_g_error;
+		goto __catch40_g_error;
 	}
 	_tmp2_ = g_utf8_validate (text, (gssize) (-1), NULL);
 	if (_tmp2_) {
@@ -551,7 +534,7 @@ void document_load (Document* self, GFile* location) {
 		utf8_text = _tmp3_;
 		if (_inner_error_ != NULL) {
 			_g_free0 (text);
-			goto __catch38_g_error;
+			goto __catch40_g_error;
 		}
 		document_set_contents (self, utf8_text);
 		_g_free0 (utf8_text);
@@ -563,8 +546,8 @@ void document_load (Document* self, GFile* location) {
 	gtk_recent_manager_add_item (_tmp4_, _tmp6_);
 	_g_free0 (_tmp6_);
 	_g_free0 (text);
-	goto __finally38;
-	__catch38_g_error:
+	goto __finally40;
+	__catch40_g_error:
 	{
 		GError * e;
 		const gchar* _tmp7_ = NULL;
@@ -591,7 +574,7 @@ void document_load (Document* self, GFile* location) {
 		_g_free0 (primary_msg);
 		_g_error_free0 (e);
 	}
-	__finally38:
+	__finally40:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -691,33 +674,33 @@ static const gchar* string_to_string (const gchar* self) {
 }
 
 
-static Block19Data* block19_data_ref (Block19Data* _data19_) {
-	g_atomic_int_inc (&_data19_->_ref_count_);
-	return _data19_;
+static Block17Data* block17_data_ref (Block17Data* _data17_) {
+	g_atomic_int_inc (&_data17_->_ref_count_);
+	return _data17_;
 }
 
 
-static void block19_data_unref (Block19Data* _data19_) {
-	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
-		_g_object_unref0 (_data19_->self);
-		_g_object_unref0 (_data19_->infobar);
-		g_slice_free (Block19Data, _data19_);
+static void block17_data_unref (Block17Data* _data17_) {
+	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
+		_g_object_unref0 (_data17_->self);
+		_g_object_unref0 (_data17_->infobar);
+		g_slice_free (Block17Data, _data17_);
 	}
 }
 
 
-static void _lambda18_ (gint response_id, Block19Data* _data19_) {
+static void _lambda23_ (gint response_id, Block17Data* _data17_) {
 	Document * self;
-	self = _data19_->self;
+	self = _data17_->self;
 	if (response_id == GTK_RESPONSE_YES) {
 		document_save (self, FALSE, FALSE);
 	}
-	gtk_object_destroy ((GtkObject*) _data19_->infobar);
+	gtk_object_destroy ((GtkObject*) _data17_->infobar);
 }
 
 
-static void __lambda18__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
-	_lambda18_ (response_id, self);
+static void __lambda23__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
+	_lambda23_ (response_id, self);
 }
 
 
@@ -807,7 +790,7 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 		if (_inner_error_ != NULL) {
 			_g_free0 (etag);
 			_g_object_unref0 (settings);
-			goto __catch39_g_error;
+			goto __catch41_g_error;
 		}
 		_g_free0 (text);
 		text = _tmp17_;
@@ -821,7 +804,7 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 		if (_inner_error_ != NULL) {
 			_g_free0 (etag);
 			_g_object_unref0 (settings);
-			goto __catch39_g_error;
+			goto __catch41_g_error;
 		}
 		_g_free0 (text);
 		text = _tmp20_;
@@ -841,7 +824,7 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 			_g_object_unref0 (parent);
 			_g_free0 (etag);
 			_g_object_unref0 (settings);
-			goto __catch39_g_error;
+			goto __catch41_g_error;
 		}
 	}
 	_tmp24_ = strlen (text);
@@ -852,7 +835,7 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 		_g_object_unref0 (parent);
 		_g_free0 (etag);
 		_g_object_unref0 (settings);
-		goto __catch39_g_error;
+		goto __catch41_g_error;
 	}
 	gtk_text_buffer_set_modified ((GtkTextBuffer*) self, FALSE);
 	_tmp26_ = gtk_recent_manager_get_default ();
@@ -864,14 +847,14 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 	_g_object_unref0 (parent);
 	_g_free0 (etag);
 	_g_object_unref0 (settings);
-	goto __finally39;
-	__catch39_g_error:
+	goto __finally41;
+	__catch41_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
 		_inner_error_ = NULL;
 		if (g_error_matches (e, G_IO_ERROR, G_IO_ERROR_WRONG_ETAG)) {
-			Block19Data* _data19_;
+			Block17Data* _data17_;
 			const gchar* _tmp29_ = NULL;
 			gchar* _tmp30_ = NULL;
 			gchar* _tmp31_;
@@ -884,9 +867,9 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 			TabInfoBar* _tmp36_ = NULL;
 			const gchar* _tmp37_ = NULL;
 			const gchar* _tmp38_ = NULL;
-			_data19_ = g_slice_new0 (Block19Data);
-			_data19_->_ref_count_ = 1;
-			_data19_->self = g_object_ref (self);
+			_data17_ = g_slice_new0 (Block17Data);
+			_data17_->_ref_count_ = 1;
+			_data17_->self = g_object_ref (self);
 			_tmp29_ = _ ("The file %s has been modified since reading it.");
 			_tmp30_ = g_file_get_parse_name (self->priv->_location);
 			_tmp31_ = _tmp30_;
@@ -899,16 +882,16 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 			_tmp35_ = g_strdup (_tmp34_);
 			secondary_msg = _tmp35_;
 			_tmp36_ = document_tab_add_message (self->tab, primary_msg, secondary_msg, GTK_MESSAGE_WARNING);
-			_data19_->infobar = _tmp36_;
+			_data17_->infobar = _tmp36_;
 			_tmp37_ = _ ("Save Anyway");
-			tab_info_bar_add_stock_button_with_text (_data19_->infobar, _tmp37_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
+			tab_info_bar_add_stock_button_with_text (_data17_->infobar, _tmp37_, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_YES);
 			_tmp38_ = _ ("Don't Save");
-			gtk_info_bar_add_button ((GtkInfoBar*) _data19_->infobar, _tmp38_, (gint) GTK_RESPONSE_CANCEL);
-			g_signal_connect_data ((GtkInfoBar*) _data19_->infobar, "response", (GCallback) __lambda18__gtk_info_bar_response, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
+			gtk_info_bar_add_button ((GtkInfoBar*) _data17_->infobar, _tmp38_, (gint) GTK_RESPONSE_CANCEL);
+			g_signal_connect_data ((GtkInfoBar*) _data17_->infobar, "response", (GCallback) __lambda23__gtk_info_bar_response, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
 			_g_free0 (secondary_msg);
 			_g_free0 (primary_msg);
-			block19_data_unref (_data19_);
-			_data19_ = NULL;
+			block17_data_unref (_data17_);
+			_data17_ = NULL;
 		} else {
 			const gchar* _tmp39_ = NULL;
 			gchar* _tmp40_;
@@ -927,7 +910,7 @@ void document_save (Document* self, gboolean check_file_changed_on_disk, gboolea
 		}
 		_g_error_free0 (e);
 	}
-	__finally39:
+	__finally41:
 	if (_inner_error_ != NULL) {
 		_g_free0 (text);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -966,7 +949,7 @@ static gchar* document_to_utf8 (Document* self, const gchar* text, GError** erro
 				utf8_text = _tmp2_;
 				if (_inner_error_ != NULL) {
 					if (_inner_error_->domain == G_CONVERT_ERROR) {
-						goto __catch40_g_convert_error;
+						goto __catch42_g_convert_error;
 					}
 					_g_free0 (charset);
 					g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -980,8 +963,8 @@ static gchar* document_to_utf8 (Document* self, const gchar* text, GError** erro
 				_g_free0 (charset);
 				return result;
 				_g_free0 (utf8_text);
-				goto __finally40;
-				__catch40_g_convert_error:
+				goto __finally42;
+				__catch42_g_convert_error:
 				{
 					GError * e;
 					e = _inner_error_;
@@ -990,7 +973,7 @@ static gchar* document_to_utf8 (Document* self, const gchar* text, GError** erro
 					_g_free0 (charset);
 					continue;
 				}
-				__finally40:
+				__finally42:
 				if (_inner_error_->domain == G_CONVERT_ERROR) {
 					g_propagate_error (error, _inner_error_);
 					_g_free0 (charset);
@@ -1043,22 +1026,22 @@ static void document_update_syntax_highlighting (Document* self) {
 	_tmp2_ = g_file_query_info (self->priv->_location, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
 	info = _tmp2_;
 	if (_inner_error_ != NULL) {
-		goto __catch41_g_error;
+		goto __catch43_g_error;
 	}
 	_tmp3_ = g_file_info_get_content_type (info);
 	_tmp4_ = g_strdup (_tmp3_);
 	_g_free0 (content_type);
 	content_type = _tmp4_;
 	_g_object_unref0 (info);
-	goto __finally41;
-	__catch41_g_error:
+	goto __finally43;
+	__catch43_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
 		_inner_error_ = NULL;
 		_g_error_free0 (e);
 	}
-	__finally41:
+	__finally43:
 	if (_inner_error_ != NULL) {
 		_g_free0 (content_type);
 		_g_object_unref0 (lm);
@@ -1199,7 +1182,7 @@ static gchar* document_get_unsaved_document_name (Document* self) {
 }
 
 
-static void _vala_array_add15 (guint** array, int* length, int* size, guint value) {
+static void _vala_array_add17 (guint** array, int* length, int* size, guint value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (guint, *array, *size);
@@ -1273,7 +1256,7 @@ static guint document_get_unsaved_document_num (Document* self) {
 				if (doc->priv->_location == NULL) {
 					guint _tmp6_;
 					_tmp6_ = document_get_unsaved_document_num (doc);
-					_vala_array_add15 (&all_nums, &all_nums_length1, &_all_nums_size_, _tmp6_);
+					_vala_array_add17 (&all_nums, &all_nums_length1, &_all_nums_size_, _tmp6_);
 				}
 				_g_object_unref0 (doc);
 			}
@@ -1333,15 +1316,15 @@ gboolean document_is_externally_modified (Document* self) {
 	_tmp0_ = g_file_query_info (self->priv->_location, G_FILE_ATTRIBUTE_ETAG_VALUE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
 	file_info = _tmp0_;
 	if (_inner_error_ != NULL) {
-		goto __catch42_g_error;
+		goto __catch44_g_error;
 	}
 	_tmp1_ = g_file_info_get_etag (file_info);
 	_tmp2_ = g_strdup (_tmp1_);
 	_g_free0 (current_etag);
 	current_etag = _tmp2_;
 	_g_object_unref0 (file_info);
-	goto __finally42;
-	__catch42_g_error:
+	goto __finally44;
+	__catch44_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1351,7 +1334,7 @@ gboolean document_is_externally_modified (Document* self) {
 		_g_free0 (current_etag);
 		return result;
 	}
-	__finally42:
+	__finally44:
 	if (_inner_error_ != NULL) {
 		_g_free0 (current_etag);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1601,176 +1584,6 @@ SelectionType document_get_selection_type (Document* self) {
 }
 
 
-gboolean document_is_tex_document (Document* self) {
-	gboolean result = FALSE;
-	gchar* _tmp0_ = NULL;
-	gchar* path;
-	gboolean _tmp1_;
-	g_return_val_if_fail (self != NULL, FALSE);
-	if (self->priv->_location == NULL) {
-		result = FALSE;
-		return result;
-	}
-	_tmp0_ = g_file_get_parse_name (self->priv->_location);
-	path = _tmp0_;
-	_tmp1_ = g_str_has_suffix (path, ".tex");
-	result = _tmp1_;
-	_g_free0 (path);
-	return result;
-}
-
-
-static void _vala_array_add16 (gchar*** array, int* length, int* size, gchar* value) {
-	if ((*length) == (*size)) {
-		*size = (*size) ? (2 * (*size)) : 4;
-		*array = g_renew (gchar*, *array, (*size) + 1);
-	}
-	(*array)[(*length)++] = value;
-	(*array)[*length] = NULL;
-}
-
-
-gboolean document_clean_build_files (Document* self, MainWindow* window) {
-	gboolean result = FALSE;
-	gboolean _tmp0_ = FALSE;
-	gboolean ret;
-	GSettings* _tmp2_ = NULL;
-	GSettings* settings;
-	gchar* _tmp3_ = NULL;
-	gchar* exts;
-	gchar** _tmp4_;
-	gchar** _tmp5_ = NULL;
-	gchar** extensions;
-	gint extensions_length1;
-	gint _extensions_size_;
-	gboolean _tmp6_;
-	gboolean no_confirm;
-	GFile* _tmp7_ = NULL;
-	GFile* mainfile;
-	GFile* _tmp8_ = NULL;
-	GFile* directory;
-	gchar* _tmp9_ = NULL;
-	gchar* _tmp10_;
-	gchar* _tmp11_ = NULL;
-	gchar* _tmp12_;
-	gchar* shortname;
-	gchar** _tmp13_ = NULL;
-	gchar** basenames;
-	gint basenames_length1;
-	gint _basenames_size_;
-	g_return_val_if_fail (self != NULL, FALSE);
-	g_return_val_if_fail (window != NULL, FALSE);
-	if (self->priv->_location == NULL) {
-		_tmp0_ = TRUE;
-	} else {
-		gboolean _tmp1_;
-		_tmp1_ = document_is_tex_document (self);
-		_tmp0_ = !_tmp1_;
-	}
-	if (_tmp0_) {
-		result = FALSE;
-		return result;
-	}
-	ret = FALSE;
-	_tmp2_ = g_settings_new ("org.gnome.latexila.preferences.latex");
-	settings = _tmp2_;
-	_tmp3_ = g_settings_get_string (settings, "clean-extensions");
-	exts = _tmp3_;
-	_tmp5_ = _tmp4_ = g_strsplit (exts, " ", 0);
-	extensions = _tmp5_;
-	extensions_length1 = _vala_array_length (_tmp4_);
-	_extensions_size_ = _vala_array_length (_tmp4_);
-	_tmp6_ = g_settings_get_boolean (settings, "no-confirm-clean");
-	no_confirm = _tmp6_;
-	_tmp7_ = document_get_main_file (self);
-	mainfile = _tmp7_;
-	_tmp8_ = g_file_get_parent (mainfile);
-	directory = _tmp8_;
-	_tmp9_ = g_file_get_basename (mainfile);
-	_tmp10_ = _tmp9_;
-	_tmp11_ = utils_get_shortname (_tmp10_);
-	_tmp12_ = _tmp11_;
-	_g_free0 (_tmp10_);
-	shortname = _tmp12_;
-	_tmp13_ = g_new0 (gchar*, 0 + 1);
-	basenames = _tmp13_;
-	basenames_length1 = 0;
-	_basenames_size_ = 0;
-	{
-		gchar** extension_collection;
-		int extension_collection_length1;
-		int extension_it;
-		extension_collection = extensions;
-		extension_collection_length1 = extensions_length1;
-		for (extension_it = 0; extension_it < extensions_length1; extension_it = extension_it + 1) {
-			gchar* _tmp14_;
-			gchar* extension;
-			_tmp14_ = g_strdup (extension_collection[extension_it]);
-			extension = _tmp14_;
-			{
-				gchar* _tmp15_;
-				gchar* basename;
-				GFile* _tmp16_ = NULL;
-				GFile* file;
-				gboolean _tmp17_;
-				_tmp15_ = g_strconcat (shortname, extension, NULL);
-				basename = _tmp15_;
-				_tmp16_ = g_file_get_child (directory, basename);
-				file = _tmp16_;
-				_tmp17_ = g_file_query_exists (file, NULL);
-				if (_tmp17_) {
-					ret = TRUE;
-					if (no_confirm) {
-						utils_delete_file (file);
-					} else {
-						gchar* _tmp18_;
-						_tmp18_ = g_strdup (basename);
-						_vala_array_add16 (&basenames, &basenames_length1, &_basenames_size_, _tmp18_);
-					}
-				}
-				_g_object_unref0 (file);
-				_g_free0 (basename);
-				_g_free0 (extension);
-			}
-		}
-	}
-	if (no_confirm) {
-		result = ret;
-		basenames = (_vala_array_free (basenames, basenames_length1, (GDestroyNotify) g_free), NULL);
-		_g_free0 (shortname);
-		_g_object_unref0 (directory);
-		_g_object_unref0 (mainfile);
-		extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
-		_g_free0 (exts);
-		_g_object_unref0 (settings);
-		return result;
-	} else {
-		if (basenames_length1 > 0) {
-			gboolean _tmp19_;
-			_tmp19_ = dialogs_confirm_clean_build_files (window, directory, basenames, basenames_length1);
-			result = _tmp19_;
-			basenames = (_vala_array_free (basenames, basenames_length1, (GDestroyNotify) g_free), NULL);
-			_g_free0 (shortname);
-			_g_object_unref0 (directory);
-			_g_object_unref0 (mainfile);
-			extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
-			_g_free0 (exts);
-			_g_object_unref0 (settings);
-			return result;
-		}
-	}
-	result = FALSE;
-	basenames = (_vala_array_free (basenames, basenames_length1, (GDestroyNotify) g_free), NULL);
-	_g_free0 (shortname);
-	_g_object_unref0 (directory);
-	_g_object_unref0 (mainfile);
-	extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
-	_g_free0 (exts);
-	_g_object_unref0 (settings);
-	return result;
-}
-
-
 gboolean document_goto_line (Document* self, gint line) {
 	gboolean result = FALSE;
 	gboolean ret;
@@ -1796,45 +1609,78 @@ gboolean document_goto_line (Document* self, gint line) {
 }
 
 
+Project* document_get_project (Document* self) {
+	Project* result = NULL;
+	Projects* _tmp0_ = NULL;
+	Projects* _tmp1_;
+	Project* _tmp2_ = NULL;
+	Project* _tmp3_;
+	g_return_val_if_fail (self != NULL, NULL);
+	if (self->priv->_project_id == (-1)) {
+		result = NULL;
+		return result;
+	}
+	_tmp0_ = projects_get_default ();
+	_tmp1_ = _tmp0_;
+	_tmp2_ = projects_get (_tmp1_, self->priv->_project_id);
+	_tmp3_ = _tmp2_;
+	_projects_unref0 (_tmp1_);
+	result = _tmp3_;
+	return result;
+}
+
+
 GFile* document_get_main_file (Document* self) {
 	GFile* result = NULL;
-	Projects* _tmp1_ = NULL;
-	Projects* _tmp2_;
-	Project* _tmp3_ = NULL;
-	Project* _tmp4_;
+	Project* _tmp0_ = NULL;
 	Project* project;
-	GFile* _tmp6_;
+	GFile* _tmp2_;
 	g_return_val_if_fail (self != NULL, NULL);
 	if (self->priv->_location == NULL) {
 		result = NULL;
 		return result;
 	}
-	if (self->priv->_project_id == (-1)) {
-		GFile* _tmp0_;
-		_tmp0_ = _g_object_ref0 (self->priv->_location);
-		result = _tmp0_;
-		return result;
-	}
-	_tmp1_ = projects_get_default ();
-	_tmp2_ = _tmp1_;
-	_tmp3_ = projects_get (_tmp2_, self->priv->_project_id);
-	_tmp4_ = _tmp3_;
-	_projects_unref0 (_tmp2_);
-	project = _tmp4_;
+	_tmp0_ = document_get_project (self);
+	project = _tmp0_;
 	if (project == NULL) {
-		GFile* _tmp5_;
-		_tmp5_ = _g_object_ref0 (self->priv->_location);
-		result = _tmp5_;
+		GFile* _tmp1_;
+		_tmp1_ = _g_object_ref0 (self->priv->_location);
+		result = _tmp1_;
 		_project_free0 (project);
 		return result;
 	}
-	_tmp6_ = _g_object_ref0 ((*project).main_file);
-	result = _tmp6_;
+	_tmp2_ = _g_object_ref0 ((*project).main_file);
+	result = _tmp2_;
 	_project_free0 (project);
 	return result;
 }
 
 
+gboolean document_is_main_file_a_tex_file (Document* self) {
+	gboolean result = FALSE;
+	GFile* _tmp0_ = NULL;
+	GFile* main_file;
+	gchar* _tmp1_ = NULL;
+	gchar* path;
+	gboolean _tmp2_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	_tmp0_ = document_get_main_file (self);
+	main_file = _tmp0_;
+	if (main_file == NULL) {
+		result = FALSE;
+		_g_object_unref0 (main_file);
+		return result;
+	}
+	_tmp1_ = g_file_get_parse_name (main_file);
+	path = _tmp1_;
+	_tmp2_ = g_str_has_suffix (path, ".tex");
+	result = _tmp2_;
+	_g_free0 (path);
+	_g_object_unref0 (main_file);
+	return result;
+}
+
+
 gchar* document_get_current_indentation (Document* self, gint line) {
 	gchar* result = NULL;
 	GtkTextIter start_iter = {0};
@@ -1910,7 +1756,7 @@ DocumentStructure* document_get_structure (Document* self) {
 	g_return_val_if_fail (self != NULL, NULL);
 	if (self->priv->_structure == NULL) {
 		DocumentStructure* _tmp0_ = NULL;
-		_tmp0_ = document_structure_new ((GtkTextBuffer*) self);
+		_tmp0_ = document_structure_new (self);
 		_g_object_unref0 (self->priv->_structure);
 		self->priv->_structure = _tmp0_;
 		document_structure_parse (self->priv->_structure);
@@ -1955,16 +1801,24 @@ void document_set_search_text (Document* self, const gchar* text, gboolean case_
 	gboolean _tmp0_ = FALSE;
 	gboolean _tmp1_ = FALSE;
 	gchar* _tmp2_;
-	GtkTextIter start = {0};
-	GtkTextIter match_start = {0};
-	GtkTextIter match_end = {0};
-	GtkTextIter insert = {0};
 	GtkTextIter _tmp3_ = {0};
-	GtkTextMark* _tmp4_ = NULL;
+	GtkTextIter start;
+	GtkTextIter _tmp4_ = {0};
+	GtkTextIter match_start;
 	GtkTextIter _tmp5_ = {0};
+	GtkTextIter match_end;
+	GtkTextIter _tmp6_ = {0};
+	GtkTextIter insert;
+	GtkTextIter _tmp7_ = {0};
+	GtkTextIter try_match_start;
+	GtkTextIter _tmp8_ = {0};
+	GtkTextIter try_match_end;
+	GtkTextIter _tmp9_ = {0};
+	GtkTextMark* _tmp10_ = NULL;
+	GtkTextIter _tmp11_ = {0};
 	gboolean next_match_after_cursor_found;
 	guint i;
-	gboolean _tmp11_ = FALSE;
+	gboolean _tmp17_ = FALSE;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (text != NULL);
 	if (self->priv->search_text == NULL) {
@@ -2002,33 +1856,40 @@ void document_set_search_text (Document* self, const gchar* text, gboolean case_
 	self->priv->search_text = _tmp2_;
 	self->priv->search_case_sensitive = case_sensitive;
 	self->priv->search_entire_word = entire_word;
-	gtk_text_buffer_get_start_iter ((GtkTextBuffer*) self, &_tmp3_);
 	start = _tmp3_;
-	_tmp4_ = gtk_text_buffer_get_insert ((GtkTextBuffer*) self);
-	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp5_, _tmp4_);
-	insert = _tmp5_;
+	match_start = _tmp4_;
+	match_end = _tmp5_;
+	insert = _tmp6_;
+	try_match_start = _tmp7_;
+	try_match_end = _tmp8_;
+	gtk_text_buffer_get_start_iter ((GtkTextBuffer*) self, &_tmp9_);
+	start = _tmp9_;
+	_tmp10_ = gtk_text_buffer_get_insert ((GtkTextBuffer*) self);
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp11_, _tmp10_);
+	insert = _tmp11_;
 	next_match_after_cursor_found = !select;
 	i = (guint) 0;
 	while (TRUE) {
-		GtkTextIter _tmp6_ = {0};
-		GtkTextIter _tmp7_ = {0};
-		gboolean _tmp8_;
-		gboolean _tmp9_ = FALSE;
-		_tmp8_ = document_iter_forward_search (self, &start, NULL, &_tmp6_, &_tmp7_);
-		match_start = _tmp6_;
-		match_end = _tmp7_;
-		if (!_tmp8_) {
+		GtkTextIter _tmp12_ = {0};
+		GtkTextIter _tmp13_ = {0};
+		gboolean _tmp14_;
+		gboolean _tmp15_ = FALSE;
+		_tmp14_ = document_iter_forward_search (self, &start, NULL, &_tmp12_, &_tmp13_);
+		try_match_start = _tmp12_;
+		try_match_end = _tmp13_;
+		if (!_tmp14_) {
 			break;
 		}
-		i++;
+		match_start = try_match_start;
+		match_end = try_match_end;
 		if (!next_match_after_cursor_found) {
-			gint _tmp10_;
-			_tmp10_ = gtk_text_iter_compare (&insert, &match_end);
-			_tmp9_ = _tmp10_ <= 0;
+			gint _tmp16_;
+			_tmp16_ = gtk_text_iter_compare (&insert, &match_end);
+			_tmp15_ = _tmp16_ <= 0;
 		} else {
-			_tmp9_ = FALSE;
+			_tmp15_ = FALSE;
 		}
-		if (_tmp9_) {
+		if (_tmp15_) {
 			next_match_after_cursor_found = TRUE;
 			_num_match = i;
 			self->priv->search_num_match = _num_match;
@@ -2037,13 +1898,14 @@ void document_set_search_text (Document* self, const gchar* text, gboolean case_
 			gtk_text_buffer_apply_tag ((GtkTextBuffer*) self, self->priv->found_tag, &match_start, &match_end);
 		}
 		start = match_end;
+		i++;
 	}
 	if (!next_match_after_cursor_found) {
-		_tmp11_ = i > 0;
+		_tmp17_ = i > 0;
 	} else {
-		_tmp11_ = FALSE;
+		_tmp17_ = FALSE;
 	}
-	if (_tmp11_) {
+	if (_tmp17_) {
 		_num_match = i;
 		self->priv->search_num_match = _num_match;
 		document_move_search_marks (self, &match_start, &match_end, TRUE);
@@ -2062,6 +1924,27 @@ void document_set_search_text (Document* self, const gchar* text, gboolean case_
 }
 
 
+void document_select_selected_search_text (Document* self) {
+	GtkTextIter start = {0};
+	GtkTextIter end = {0};
+	GtkTextMark* _tmp0_ = NULL;
+	GtkTextIter _tmp1_ = {0};
+	GtkTextMark* _tmp2_ = NULL;
+	GtkTextIter _tmp3_ = {0};
+	GtkTextMark* _tmp4_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = gtk_text_buffer_get_mark ((GtkTextBuffer*) self, "search_selected_start");
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp1_, _tmp0_);
+	start = _tmp1_;
+	_tmp2_ = gtk_text_buffer_get_mark ((GtkTextBuffer*) self, "search_selected_end");
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self, &_tmp3_, _tmp2_);
+	end = _tmp3_;
+	gtk_text_buffer_place_cursor ((GtkTextBuffer*) self, &start);
+	_tmp4_ = gtk_text_buffer_get_mark ((GtkTextBuffer*) self, "selection_bound");
+	gtk_text_buffer_move_mark ((GtkTextBuffer*) self, _tmp4_, &end);
+}
+
+
 void document_search_forward (Document* self) {
 	GtkTextIter start_search = {0};
 	GtkTextIter start = {0};
@@ -3072,34 +2955,4 @@ static void _vala_document_set_property (GObject * object, guint property_id, co
 }
 
 
-static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
-	if ((array != NULL) && (destroy_func != NULL)) {
-		int i;
-		for (i = 0; i < array_length; i = i + 1) {
-			if (((gpointer*) array)[i] != NULL) {
-				destroy_func (((gpointer*) array)[i]);
-			}
-		}
-	}
-}
-
-
-static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
-	_vala_array_destroy (array, array_length, destroy_func);
-	g_free (array);
-}
-
-
-static gint _vala_array_length (gpointer array) {
-	int length;
-	length = 0;
-	if (array) {
-		while (((gpointer*) array)[length]) {
-			length++;
-		}
-	}
-	return length;
-}
-
-
 
diff --git a/src/C/document_structure.c b/src/C/document_structure.c
index bfe35ca..f81529a 100644
--- a/src/C/document_structure.c
+++ b/src/C/document_structure.c
@@ -1,4 +1,4 @@
-/* document_structure.c generated by valac 0.12.0, the Vala compiler
+/* document_structure.c generated by valac 0.12.1, the Vala compiler
  * generated from document_structure.vala, do not modify */
 
 /*
@@ -22,10 +22,13 @@
 
 #include <glib.h>
 #include <glib-object.h>
+#include <gtksourceview/gtksourceview.h>
 #include <gtk/gtk.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
 
 
 #define TYPE_DOCUMENT_STRUCTURE (document_structure_get_type ())
@@ -39,19 +42,43 @@ typedef struct _DocumentStructure DocumentStructure;
 typedef struct _DocumentStructureClass DocumentStructureClass;
 typedef struct _DocumentStructurePrivate DocumentStructurePrivate;
 
-#define DOCUMENT_STRUCTURE_TYPE_DATA_NODE (document_structure_data_node_get_type ())
+#define TYPE_DOCUMENT (document_get_type ())
+#define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
+#define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
+#define IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT))
+#define IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT))
+#define DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT, DocumentClass))
+
+typedef struct _Document Document;
+typedef struct _DocumentClass DocumentClass;
+
+#define TYPE_STRUCTURE_MODEL (structure_model_get_type ())
+#define STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE_MODEL, StructureModel))
+#define STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE_MODEL, StructureModelClass))
+#define IS_STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STRUCTURE_MODEL))
+#define IS_STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STRUCTURE_MODEL))
+#define STRUCTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STRUCTURE_MODEL, StructureModelClass))
+
+typedef struct _StructureModel StructureModel;
+typedef struct _StructureModelClass StructureModelClass;
+
+#define TYPE_STRUCT_DATA (struct_data_get_type ())
 
 #define TYPE_STRUCT_TYPE (struct_type_get_type ())
-typedef struct _DocumentStructureDataNode DocumentStructureDataNode;
-#define __g_node_destroy__document_structure_data_node_free0_0(var) ((var == NULL) ? NULL : (var = (_g_node_destroy__document_structure_data_node_free0_ (var), NULL)))
+typedef struct _StructData StructData;
+
+#define DOCUMENT_STRUCTURE_TYPE_LOW_LEVEL_TYPE (document_structure_low_level_type_get_type ())
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _struct_data_free0(var) ((var == NULL) ? NULL : (var = (struct_data_free (var), NULL)))
+#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
 #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 #define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
 #define _g_match_info_free0(var) ((var == NULL) ? NULL : (var = (g_match_info_free (var), NULL)))
-#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-typedef struct _Block24Data Block24Data;
 
-#define TYPE_STRUCT_ITEM (struct_item_get_type ())
+#define TYPE_STRUCT_ACTION (struct_action_get_type ())
+
+#define TYPE_STRUCT_COLUMN (struct_column_get_type ())
 
 struct _DocumentStructure {
 	GObject parent_instance;
@@ -63,7 +90,7 @@ struct _DocumentStructureClass {
 };
 
 typedef enum  {
-	STRUCT_TYPE_PART = 0,
+	STRUCT_TYPE_PART,
 	STRUCT_TYPE_CHAPTER,
 	STRUCT_TYPE_SECTION,
 	STRUCT_TYPE_SUBSECTION,
@@ -72,121 +99,190 @@ typedef enum  {
 	STRUCT_TYPE_SUBPARAGRAPH,
 	STRUCT_TYPE_LABEL,
 	STRUCT_TYPE_INCLUDE,
-	STRUCT_TYPE_TABLE,
-	STRUCT_TYPE_FIGURE,
+	STRUCT_TYPE_IMAGE,
 	STRUCT_TYPE_TODO,
 	STRUCT_TYPE_FIXME,
-	STRUCT_TYPE_N_TYPES
+	STRUCT_TYPE_NB_COMMON_TYPES,
+	STRUCT_TYPE_TABLE,
+	STRUCT_TYPE_FIGURE,
+	STRUCT_TYPE_NB_TYPES
 } StructType;
 
-struct _DocumentStructureDataNode {
+struct _StructData {
 	StructType type;
 	gchar* text;
-	GtkTextMark* mark;
+	GtkTextMark* start_mark;
+	GtkTextMark* end_mark;
 };
 
 struct _DocumentStructurePrivate {
-	GtkTextBuffer* _doc;
+	Document* _doc;
 	gint _nb_marks;
-	gboolean _insert_at_end;
-	GNode* _tree;
-	gboolean _in_figure_env;
-	gboolean _in_table_env;
+	GtkTextMark* _end_document_mark;
+	StructureModel* _model;
+	gboolean _in_verbatim_env;
+	StructData* _env_data;
 	gint _start_parsing_line;
+	GTimer* _timer;
+	gboolean _parsing_done;
 };
 
-struct _Block24Data {
-	int _ref_count_;
-	DocumentStructure * self;
-	GtkTreeIter* iter;
-	GtkTreeStore* store;
-};
+typedef enum  {
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PART,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CHAPTER,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SECTION,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSECTION,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSUBSECTION,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PARAGRAPH,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBPARAGRAPH,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_LABEL,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_INCLUDE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_IMAGE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_TODO,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_FIXME,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_NB_COMMON_TYPES,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_VERBATIM,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_VERBATIM,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_DOCUMENT,
+	DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CAPTION
+} DocumentStructureLowLevelType;
 
 typedef enum  {
-	STRUCT_ITEM_PIXBUF,
-	STRUCT_ITEM_TYPE,
-	STRUCT_ITEM_TEXT,
-	STRUCT_ITEM_TOOLTIP,
-	STRUCT_ITEM_MARK,
-	STRUCT_ITEM_N_COLUMNS
-} StructItem;
+	STRUCT_ACTION_CUT,
+	STRUCT_ACTION_COPY,
+	STRUCT_ACTION_DELETE,
+	STRUCT_ACTION_SELECT,
+	STRUCT_ACTION_COMMENT,
+	STRUCT_ACTION_SHIFT_LEFT,
+	STRUCT_ACTION_SHIFT_RIGHT,
+	STRUCT_ACTION_NB_ACTIONS
+} StructAction;
+
+typedef enum  {
+	STRUCT_ERROR_GENERAL,
+	STRUCT_ERROR_DATA_OUTDATED
+} StructError;
+#define STRUCT_ERROR struct_error_quark ()
+typedef enum  {
+	STRUCT_COLUMN_PIXBUF,
+	STRUCT_COLUMN_TEXT,
+	STRUCT_COLUMN_TOOLTIP,
+	STRUCT_COLUMN_START_MARK,
+	STRUCT_COLUMN_END_MARK,
+	STRUCT_COLUMN_TYPE,
+	STRUCT_COLUMN_N_COLUMNS
+} StructColumn;
 
 
 static gpointer document_structure_parent_class = NULL;
+static GRegex* document_structure__chars_regex;
+static GRegex* document_structure__chars_regex = NULL;
 static GRegex* document_structure__comment_regex;
 static GRegex* document_structure__comment_regex = NULL;
+static GRegex* document_structure__command_name_regex;
+static GRegex* document_structure__command_name_regex = NULL;
+static gchar** document_structure__section_names;
+static gint document_structure__section_names_length1;
+static gchar** document_structure__section_names = NULL;
+static gint document_structure__section_names_length1 = 0;
+static gint _document_structure__section_names_size_ = 0;
 
 GType document_structure_get_type (void) G_GNUC_CONST;
-static GType document_structure_data_node_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
+GType document_get_type (void) G_GNUC_CONST;
+GType structure_model_get_type (void) G_GNUC_CONST;
+GType struct_data_get_type (void) G_GNUC_CONST;
 GType struct_type_get_type (void) G_GNUC_CONST;
-static DocumentStructureDataNode* document_structure_data_node_dup (const DocumentStructureDataNode* self);
-static void document_structure_data_node_free (DocumentStructureDataNode* self);
-static void document_structure_data_node_copy (const DocumentStructureDataNode* self, DocumentStructureDataNode* dest);
-static void document_structure_data_node_destroy (DocumentStructureDataNode* self);
+StructData* struct_data_dup (const StructData* self);
+void struct_data_free (StructData* self);
+void struct_data_copy (const StructData* self, StructData* dest);
+void struct_data_destroy (StructData* self);
 #define DOCUMENT_STRUCTURE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DOCUMENT_STRUCTURE, DocumentStructurePrivate))
 enum  {
-	DOCUMENT_STRUCTURE_DUMMY_PROPERTY
+	DOCUMENT_STRUCTURE_DUMMY_PROPERTY,
+	DOCUMENT_STRUCTURE_PARSING_DONE
 };
-static void _document_structure_data_node_free0_ (gpointer var);
-static void _g_node_destroy__document_structure_data_node_free0_ (GNode* self);
-static void _g_node_destroy__document_structure_data_node_free0_ (GNode* self);
+static GType document_structure_low_level_type_get_type (void) G_GNUC_UNUSED;
 #define DOCUMENT_STRUCTURE_MARK_NAME_PREFIX "struct_item_"
-#define DOCUMENT_STRUCTURE_MAX_NB_LINES_TO_PARSE 500
-DocumentStructure* document_structure_new (GtkTextBuffer* doc);
-DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffer* doc);
+#define DOCUMENT_STRUCTURE_CAPTION_MAX_LENGTH 60
+#define DOCUMENT_STRUCTURE_MAX_NB_LINES_TO_PARSE 2000
+#define DOCUMENT_STRUCTURE__measure_parsing_time FALSE
+DocumentStructure* document_structure_new (Document* doc);
+DocumentStructure* document_structure_construct (GType object_type, Document* doc);
 void document_structure_parse (DocumentStructure* self);
+static void document_structure_set_parsing_done (DocumentStructure* self, gboolean value);
+StructureModel* structure_model_new (void);
+StructureModel* structure_model_construct (GType object_type);
 static void document_structure_clear_all_structure_marks (DocumentStructure* self);
-static gboolean _lambda4_ (DocumentStructure* self);
+static gboolean _lambda5_ (DocumentStructure* self);
 static gboolean document_structure_parse_impl (DocumentStructure* self);
-static gboolean __lambda4__gsource_func (gpointer self);
-static GtkTextIter* _gtk_text_iter_dup (GtkTextIter* self);
-static gboolean document_structure_search_simple_command (DocumentStructure* self, GtkTextIter* begin_name_iter);
-static void document_structure_search_figure_or_table (DocumentStructure* self, GtkTextIter* after_backslash);
-static gboolean document_structure_search_comment (DocumentStructure* self, GtkTextIter* after_percent);
-static StructType* document_structure_get_simple_command_type (DocumentStructure* self, GtkTextIter* after_backslash, GtkTextIter* begin_contents_iter);
-static StructType* document_structure_get_type_from_simple_command_name (DocumentStructure* self, const gchar* name);
-static gchar* document_structure_get_command_contents (DocumentStructure* self, const gchar* text);
+static gboolean __lambda5__gsource_func (gpointer self);
+StructureModel* document_structure_get_model (DocumentStructure* self);
+static gchar* document_structure_get_document_line_contents (DocumentStructure* self, gint line_num);
+static gboolean document_structure_search_low_level_item (DocumentStructure* self, const gchar* line, gint start_index, DocumentStructureLowLevelType** type, gchar** contents, gint** start_match_index, gint** end_match_index);
+static void document_structure_handle_item (DocumentStructure* self, DocumentStructureLowLevelType type, const gchar* contents, GtkTextIter* iter);
+static gint* _int_dup (gint* self);
 gboolean utils_char_is_escaped (const gchar* text, glong index);
-static void document_structure_add_item (DocumentStructure* self, StructType type, const gchar* text, GtkTextIter* iter);
-static gchar* document_structure_get_text_to_line_end (DocumentStructure* self, GtkTextIter* start);
+static gboolean document_structure_search_markup (DocumentStructure* self, const gchar* line, gint after_backslash_index, DocumentStructureLowLevelType** type, gchar** contents, gint** end_match_index);
+static gboolean document_structure_search_comment (DocumentStructure* self, const gchar* line, gint after_percent_index, DocumentStructureLowLevelType** type, gchar** contents, gint** end_match_index);
+static gchar* document_structure_get_markup_name (DocumentStructure* self, const gchar* line, gint after_backslash_index, gint** begin_contents_index);
+static gboolean document_structure_search_env (DocumentStructure* self, const gchar* line, gint begin_contents_index, gboolean is_begin_env, DocumentStructureLowLevelType** type, gint** end_match_index);
+static DocumentStructureLowLevelType* document_structure_get_markup_low_level_type (DocumentStructure* self, const gchar* markup_name);
+static gchar* document_structure_get_markup_contents (DocumentStructure* self, const gchar* line, gint begin_contents_index, gint** end_match_index);
+static DocumentStructureLowLevelType* _document_structure_low_level_type_dup (DocumentStructureLowLevelType* self);
+static void document_structure_add_item (DocumentStructure* self, StructType type, const gchar* text, GtkTextIter* start_iter);
+static void document_structure_create_new_environment (DocumentStructure* self, DocumentStructureLowLevelType type, GtkTextIter* start_iter);
+static gboolean document_structure_verify_end_environment_type (DocumentStructure* self, DocumentStructureLowLevelType type);
 static GtkTextMark* document_structure_create_text_mark_from_iter (DocumentStructure* self, GtkTextIter* iter);
-static void document_structure_add_item_at_end (DocumentStructure* self, DocumentStructureDataNode* item);
-static void document_structure_add_item_in_middle (DocumentStructure* self, DocumentStructureDataNode* item);
-static gint document_structure_get_position_from_mark (GtkTextMark* mark);
-static void document_structure_insert_item_at_position (DocumentStructure* self, DocumentStructureDataNode* item, GNode* parent, gint pos);
-void document_structure_populate_tree_store (DocumentStructure* self, GtkTreeStore* store);
-static void document_structure_populate_tree_store_at_node (DocumentStructure* self, GtkTreeStore* store, GNode* node, GtkTreeIter* parent, gboolean root_node);
-static Block24Data* block24_data_ref (Block24Data* _data24_);
-static void block24_data_unref (Block24Data* _data24_);
-static void document_structure_add_item_to_tree_store (DocumentStructure* self, GtkTreeStore* store, GtkTreeIter* parent, DocumentStructureDataNode* data, GtkTreeIter* result);
-static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self);
-static void _lambda12_ (GNode* child_node, Block24Data* _data24_);
-static void __lambda12__gnode_foreach_func (GNode* node, gpointer self);
-GType struct_item_get_type (void) G_GNUC_CONST;
-gchar* structure_get_icon_from_type (StructType type);
-gchar* structure_get_type_name (StructType type);
-static StructType* _struct_type_dup (StructType* self);
+static void document_structure_add_item_data (DocumentStructure* self, StructData* data, gboolean insert_in_middle);
+void structure_model_add_item_in_middle (StructureModel* self, StructData* item);
+void structure_model_add_item_at_end (StructureModel* self, StructData* item);
+GType struct_action_get_type (void) G_GNUC_CONST;
+GQuark struct_error_quark (void);
+void document_structure_do_action (DocumentStructure* self, StructAction action_type, GtkTreeIter* tree_iter, gboolean* refresh_simple_list, GError** error);
+static gboolean document_structure_comment_item (DocumentStructure* self, GtkTreeIter* tree_iter);
+void structure_model_delete (StructureModel* self, GtkTreeIter* iter);
+gboolean structure_model_item_contains_subparagraph (StructureModel* self, GtkTreeIter* iter);
+static gboolean document_structure_shift_item (DocumentStructure* self, GtkTreeIter* tree_iter, gboolean shift_right, gboolean* doc_modified);
+void structure_model_shift_right (StructureModel* self, GtkTreeIter* iter);
+void structure_model_shift_left (StructureModel* self, GtkTreeIter* iter);
+static gboolean document_structure_get_exact_item_bounds (DocumentStructure* self, GtkTreeIter* tree_iter, GtkTextIter** start_iter, GtkTextIter** end_iter);
+static void document_structure_backward_indentation (DocumentStructure* self, GtkTextIter** iter);
+GType struct_column_get_type (void) G_GNUC_CONST;
+static GtkTextIter* _gtk_text_iter_dup (GtkTextIter* self);
+gboolean structure_is_section (StructType type);
+static void document_structure_comment_between (DocumentStructure* self, GtkTextIter* start_iter, GtkTextIter* end_iter);
+GtkTreeIter* structure_model_get_next_sibling_or_parent (StructureModel* self, GtkTreeIter* section_iter, GError** error);
+static void document_structure_get_end_document_iter (DocumentStructure* self, gboolean* end_of_file, GtkTextIter* result);
+void document_insert (Document* self, GtkTextIter* iter, const gchar* text, gint len);
+static gboolean document_structure_get_low_level_item_bounds (DocumentStructure* self, StructType item_type, const gchar* item_contents, GtkTextIter* start_match_iter, gboolean is_start, GtkTextIter** end_match_iter);
+static gboolean _int_equal (const gint* s1, const gint* s2);
+static gboolean document_structure_same_items (DocumentStructure* self, StructType item_type, const gchar* item_contents, DocumentStructureLowLevelType item_found_type, const gchar* item_found_contents, gboolean start);
+static gchar* document_structure_get_section_name_from_type (DocumentStructure* self, StructType type);
+gboolean document_structure_get_parsing_done (DocumentStructure* self);
 static void document_structure_finalize (GObject* obj);
-
-
-static void _document_structure_data_node_free0_ (gpointer var) {
-	(var == NULL) ? NULL : (var = (document_structure_data_node_free (var), NULL));
-}
-
-
-static gboolean _g_node_destroy__document_structure_data_node_free0__node (GNode* node, gpointer unused) {
-	_document_structure_data_node_free0_ (node->data);
-	return FALSE;
-}
-
-
-static void _g_node_destroy__document_structure_data_node_free0_ (GNode* self) {
-	g_node_traverse (self, G_POST_ORDER, G_TRAVERSE_ALL, -1, _g_node_destroy__document_structure_data_node_free0__node, NULL);
-	g_node_destroy (self);
+static void _vala_document_structure_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void _vala_document_structure_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+
+
+static GType document_structure_low_level_type_get_type (void) {
+	static volatile gsize document_structure_low_level_type_type_id__volatile = 0;
+	if (g_once_init_enter (&document_structure_low_level_type_type_id__volatile)) {
+		static const GEnumValue values[] = {{DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PART, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PART", "part"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CHAPTER, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CHAPTER", "chapter"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SECTION, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SECTION", "section"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSECTION, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSECTION", "subsection"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSUBSECTION, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSUBSECTION", "subsubsection"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PARAGRAPH, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PARAGRAPH", "paragraph"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBPARAGRAPH, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBPARAGRAPH", "subparagraph"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_LABEL, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_LABEL", "label"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_INCLUDE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_INCLUDE", "include"}, {DOCUMENT
 _STRUCTURE_LOW_LEVEL_TYPE_IMAGE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_IMAGE", "image"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_TODO, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_TODO", "todo"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_FIXME, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_FIXME", "fixme"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_NB_COMMON_TYPES, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_NB_COMMON_TYPES", "nb-common-types"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE", "begin-figure"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE", "end-figure"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE", "begin-table"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE", "end-table"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_VERBATIM, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_VERBATIM", "begin-verbatim"}, {DOCUMENT_STRUCTURE_LOW
 _LEVEL_TYPE_END_VERBATIM, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_VERBATIM", "end-verbatim"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_DOCUMENT, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_DOCUMENT", "end-document"}, {DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CAPTION, "DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CAPTION", "caption"}, {0, NULL, NULL}};
+		GType document_structure_low_level_type_type_id;
+		document_structure_low_level_type_type_id = g_enum_register_static ("DocumentStructureLowLevelType", values);
+		g_once_init_leave (&document_structure_low_level_type_type_id__volatile, document_structure_low_level_type_type_id);
+	}
+	return document_structure_low_level_type_type_id__volatile;
 }
 
 
-DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffer* doc) {
+DocumentStructure* document_structure_construct (GType object_type, Document* doc) {
 	DocumentStructure * self = NULL;
 	GError * _inner_error_ = NULL;
 	g_return_val_if_fail (doc != NULL, NULL);
@@ -195,20 +291,48 @@ DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffe
 	if (document_structure__comment_regex == NULL) {
 		GRegex* _tmp0_ = NULL;
 		GRegex* _tmp1_;
-		_tmp0_ = g_regex_new ("^(?P<type>TODO|FIXME)[[:space:]:]*(?P<text>.*)$", 0, 0, &_inner_error_);
+		GRegex* _tmp2_ = NULL;
+		GRegex* _tmp3_;
+		GRegex* _tmp4_ = NULL;
+		GRegex* _tmp5_;
+		_tmp0_ = g_regex_new ("\\\\|%", 0, 0, &_inner_error_);
 		_tmp1_ = _tmp0_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch51_g_regex_error;
+				goto __catch56_g_regex_error;
+			}
+			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return NULL;
+		}
+		_g_regex_unref0 (document_structure__chars_regex);
+		document_structure__chars_regex = _tmp1_;
+		_tmp2_ = g_regex_new ("^(?P<type>TODO|FIXME)[[:space:]:]*(?P<text>.*)$", 0, 0, &_inner_error_);
+		_tmp3_ = _tmp2_;
+		if (_inner_error_ != NULL) {
+			if (_inner_error_->domain == G_REGEX_ERROR) {
+				goto __catch56_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
 			return NULL;
 		}
 		_g_regex_unref0 (document_structure__comment_regex);
-		document_structure__comment_regex = _tmp1_;
-		goto __finally51;
-		__catch51_g_regex_error:
+		document_structure__comment_regex = _tmp3_;
+		_tmp4_ = g_regex_new ("^(?P<name>[a-z]+\\*?)[[:space:]]*(\\[[^\\]]*\\][[:space:]]*)*{", 0, 0, &_inner_error_);
+		_tmp5_ = _tmp4_;
+		if (_inner_error_ != NULL) {
+			if (_inner_error_->domain == G_REGEX_ERROR) {
+				goto __catch56_g_regex_error;
+			}
+			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return NULL;
+		}
+		_g_regex_unref0 (document_structure__command_name_regex);
+		document_structure__command_name_regex = _tmp5_;
+		goto __finally56;
+		__catch56_g_regex_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -216,7 +340,7 @@ DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffe
 			fprintf (stderr, "Structure: %s\n", e->message);
 			_g_error_free0 (e);
 		}
-		__finally51:
+		__finally56:
 		if (_inner_error_ != NULL) {
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -227,17 +351,12 @@ DocumentStructure* document_structure_construct (GType object_type, GtkTextBuffe
 }
 
 
-DocumentStructure* document_structure_new (GtkTextBuffer* doc) {
+DocumentStructure* document_structure_new (Document* doc) {
 	return document_structure_construct (TYPE_DOCUMENT_STRUCTURE, doc);
 }
 
 
-static gpointer _document_structure_data_node_dup0 (gpointer self) {
-	return self ? document_structure_data_node_dup (self) : NULL;
-}
-
-
-static gboolean _lambda4_ (DocumentStructure* self) {
+static gboolean _lambda5_ (DocumentStructure* self) {
 	gboolean result = FALSE;
 	gboolean _tmp0_;
 	_tmp0_ = document_structure_parse_impl (self);
@@ -246,230 +365,857 @@ static gboolean _lambda4_ (DocumentStructure* self) {
 }
 
 
-static gboolean __lambda4__gsource_func (gpointer self) {
+static gboolean __lambda5__gsource_func (gpointer self) {
 	gboolean result;
-	result = _lambda4_ (self);
+	result = _lambda5_ (self);
 	return result;
 }
 
 
 void document_structure_parse (DocumentStructure* self) {
-	DocumentStructureDataNode _tmp0_ = {0};
-	DocumentStructureDataNode empty_data;
-	DocumentStructureDataNode* _tmp1_;
-	GNode* _tmp2_ = NULL;
+	StructureModel* _tmp0_ = NULL;
 	g_return_if_fail (self != NULL);
-	empty_data = _tmp0_;
-	_tmp1_ = _document_structure_data_node_dup0 (&empty_data);
-	_tmp2_ = g_node_new (_tmp1_);
-	__g_node_destroy__document_structure_data_node_free0_0 (self->priv->_tree);
-	self->priv->_tree = _tmp2_;
-	self->priv->_in_figure_env = FALSE;
-	self->priv->_in_table_env = FALSE;
-	document_structure_clear_all_structure_marks (self);
+	document_structure_set_parsing_done (self, FALSE);
+	_tmp0_ = structure_model_new ();
+	_g_object_unref0 (self->priv->_model);
+	self->priv->_model = _tmp0_;
+	_struct_data_free0 (self->priv->_env_data);
+	self->priv->_env_data = NULL;
 	self->priv->_start_parsing_line = 0;
-	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda4__gsource_func, g_object_ref (self), g_object_unref);
-	document_structure_data_node_destroy (&empty_data);
+	_g_object_unref0 (self->priv->_end_document_mark);
+	self->priv->_end_document_mark = NULL;
+	document_structure_clear_all_structure_marks (self);
+	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda5__gsource_func, g_object_ref (self), g_object_unref);
 }
 
 
-static GtkTextIter* _gtk_text_iter_dup (GtkTextIter* self) {
-	GtkTextIter* dup;
-	dup = g_new0 (GtkTextIter, 1);
-	memcpy (dup, self, sizeof (GtkTextIter));
-	return dup;
+static gpointer _g_object_ref0 (gpointer self) {
+	return self ? g_object_ref (self) : NULL;
 }
 
 
-static gpointer __gtk_text_iter_dup0 (gpointer self) {
-	return self ? _gtk_text_iter_dup (self) : NULL;
+StructureModel* document_structure_get_model (DocumentStructure* self) {
+	StructureModel* result = NULL;
+	StructureModel* _tmp0_;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = _g_object_ref0 (self->priv->_model);
+	result = _tmp0_;
+	return result;
 }
 
 
+/*************************************************************************/
 static gboolean document_structure_parse_impl (DocumentStructure* self) {
 	gboolean result = FALSE;
-	GtkTextIter iter = {0};
-	GtkTextIter _tmp0_ = {0};
-	GtkTextIter* limit;
+	gint cur_line;
 	gint _tmp1_;
 	gint nb_lines;
-	gint end_parsing_line;
-	gboolean limit_parsing;
+	gint stop_parsing_line;
 	g_return_val_if_fail (self != NULL, FALSE);
-	self->priv->_insert_at_end = TRUE;
-	gtk_text_buffer_get_iter_at_line (self->priv->_doc, &_tmp0_, self->priv->_start_parsing_line);
-	iter = _tmp0_;
-	limit = NULL;
-	_tmp1_ = gtk_text_buffer_get_line_count (self->priv->_doc);
-	nb_lines = _tmp1_;
-	end_parsing_line = self->priv->_start_parsing_line + DOCUMENT_STRUCTURE_MAX_NB_LINES_TO_PARSE;
-	limit_parsing = nb_lines > end_parsing_line;
-	if (limit_parsing) {
-		GtkTextIter _tmp2_ = {0};
-		GtkTextIter* _tmp3_;
-		gtk_text_buffer_get_iter_at_line (self->priv->_doc, &_tmp2_, end_parsing_line);
-		_g_free0 (limit);
-		_tmp3_ = __gtk_text_iter_dup0 (&_tmp2_);
-		limit = _tmp3_;
+	if (DOCUMENT_STRUCTURE__measure_parsing_time) {
+		if (self->priv->_timer == NULL) {
+			GTimer* _tmp0_ = NULL;
+			_tmp0_ = g_timer_new ();
+			_g_timer_destroy0 (self->priv->_timer);
+			self->priv->_timer = _tmp0_;
+		} else {
+			g_timer_continue (self->priv->_timer);
+		}
 	}
+	cur_line = self->priv->_start_parsing_line;
+	_tmp1_ = gtk_text_buffer_get_line_count ((GtkTextBuffer*) self->priv->_doc);
+	nb_lines = _tmp1_;
+	stop_parsing_line = self->priv->_start_parsing_line + DOCUMENT_STRUCTURE_MAX_NB_LINES_TO_PARSE;
 	while (TRUE) {
-		GtkTextIter _tmp4_ = {0};
-		gboolean _tmp5_;
-		gboolean _tmp6_;
-		_tmp5_ = gtk_text_iter_forward_search (&iter, "\\", GTK_TEXT_SEARCH_TEXT_ONLY | GTK_TEXT_SEARCH_VISIBLE_ONLY, NULL, &_tmp4_, limit);
-		iter = _tmp4_;
-		if (!_tmp5_) {
+		gchar* _tmp2_ = NULL;
+		gchar* line;
+		gint start_index;
+		gint _tmp3_;
+		gint line_length;
+		if (!(cur_line < nb_lines)) {
 			break;
 		}
-		_tmp6_ = document_structure_search_simple_command (self, &iter);
-		if (_tmp6_) {
-			continue;
+		if (cur_line == stop_parsing_line) {
+			self->priv->_start_parsing_line = cur_line;
+			if (DOCUMENT_STRUCTURE__measure_parsing_time) {
+				g_timer_stop (self->priv->_timer);
+			}
+			result = TRUE;
+			return result;
 		}
-		document_structure_search_figure_or_table (self, &iter);
-	}
-	self->priv->_insert_at_end = FALSE;
-	{
-		GtkTextIter _tmp7_ = {0};
-		gboolean _tmp8_;
-		gtk_text_buffer_get_iter_at_line (self->priv->_doc, &_tmp7_, self->priv->_start_parsing_line);
-		iter = _tmp7_;
-		_tmp8_ = TRUE;
+		_tmp2_ = document_structure_get_document_line_contents (self, cur_line);
+		line = _tmp2_;
+		start_index = 0;
+		_tmp3_ = strlen (line);
+		line_length = _tmp3_;
 		while (TRUE) {
+			DocumentStructureLowLevelType* type = NULL;
+			gchar* contents = NULL;
+			gint* start_match_index = NULL;
+			gint* end_match_index = NULL;
+			DocumentStructureLowLevelType* _tmp4_ = NULL;
+			gchar* _tmp5_ = NULL;
+			gint* _tmp6_ = NULL;
+			gint* _tmp7_ = NULL;
+			gboolean _tmp8_;
+			gboolean item_found;
+			GtkTextIter iter = {0};
 			GtkTextIter _tmp9_ = {0};
-			gboolean _tmp10_;
-			if (!_tmp8_) {
-				gtk_text_iter_forward_visible_line (&iter);
+			if (!(start_index < line_length)) {
+				break;
 			}
-			_tmp8_ = FALSE;
-			_tmp10_ = gtk_text_iter_forward_search (&iter, "%", GTK_TEXT_SEARCH_TEXT_ONLY | GTK_TEXT_SEARCH_VISIBLE_ONLY, NULL, &_tmp9_, limit);
-			iter = _tmp9_;
-			if (!_tmp10_) {
+			_tmp8_ = document_structure_search_low_level_item (self, line, start_index, &_tmp4_, &_tmp5_, &_tmp6_, &_tmp7_);
+			_g_free0 (type);
+			type = _tmp4_;
+			_g_free0 (contents);
+			contents = _tmp5_;
+			_g_free0 (start_match_index);
+			start_match_index = _tmp6_;
+			_g_free0 (end_match_index);
+			end_match_index = _tmp7_;
+			item_found = _tmp8_;
+			if (!item_found) {
+				_g_free0 (end_match_index);
+				_g_free0 (start_match_index);
+				_g_free0 (contents);
+				_g_free0 (type);
 				break;
 			}
-			document_structure_search_comment (self, &iter);
+			gtk_text_buffer_get_iter_at_line_index ((GtkTextBuffer*) self->priv->_doc, &_tmp9_, cur_line, *start_match_index);
+			iter = _tmp9_;
+			document_structure_handle_item (self, *type, contents, &iter);
+			start_index = *end_match_index;
+			_g_free0 (end_match_index);
+			_g_free0 (start_match_index);
+			_g_free0 (contents);
+			_g_free0 (type);
 		}
+		cur_line++;
+		_g_free0 (line);
 	}
-	if (limit_parsing) {
-		self->priv->_start_parsing_line = end_parsing_line;
-		result = TRUE;
-		_g_free0 (limit);
-		return result;
+	if (DOCUMENT_STRUCTURE__measure_parsing_time) {
+		gdouble _tmp10_;
+		g_timer_stop (self->priv->_timer);
+		_tmp10_ = g_timer_elapsed (self->priv->_timer, NULL);
+		fprintf (stdout, "Structure parsing took %f seconds\n", _tmp10_);
+		g_timer_reset (self->priv->_timer);
 	}
+	document_structure_set_parsing_done (self, TRUE);
 	result = FALSE;
-	_g_free0 (limit);
 	return result;
 }
 
 
-static StructType* document_structure_get_simple_command_type (DocumentStructure* self, GtkTextIter* after_backslash, GtkTextIter* begin_contents_iter) {
-	GtkTextIter _begin_contents_iter = {0};
-	StructType* result = NULL;
-	GtkTextIter limit;
-	GtkTextIter end_name_iter = {0};
-	GtkTextIter _tmp0_ = {0};
-	GtkTextIter _tmp1_ = {0};
-	gboolean _tmp2_;
-	gchar* _tmp3_ = NULL;
-	gchar* name;
-	StructType* _tmp4_ = NULL;
-	g_return_val_if_fail (self != NULL, NULL);
-	limit = *after_backslash;
-	gtk_text_iter_forward_to_line_end (&limit);
-	_tmp2_ = gtk_text_iter_forward_search (after_backslash, "{", GTK_TEXT_SEARCH_TEXT_ONLY | GTK_TEXT_SEARCH_VISIBLE_ONLY, &_tmp0_, &_tmp1_, &limit);
-	end_name_iter = _tmp0_;
-	_begin_contents_iter = _tmp1_;
-	if (!_tmp2_) {
-		result = NULL;
-		if (begin_contents_iter) {
-			*begin_contents_iter = _begin_contents_iter;
+static gint* _int_dup (gint* self) {
+	gint* dup;
+	dup = g_new0 (gint, 1);
+	memcpy (dup, self, sizeof (gint));
+	return dup;
+}
+
+
+static gpointer __int_dup0 (gpointer self) {
+	return self ? _int_dup (self) : NULL;
+}
+
+
+static gboolean document_structure_search_low_level_item (DocumentStructure* self, const gchar* line, gint start_index, DocumentStructureLowLevelType** type, gchar** contents, gint** start_match_index, gint** end_match_index) {
+	DocumentStructureLowLevelType* _type = NULL;
+	gchar* _contents = NULL;
+	gint* _start_match_index = NULL;
+	gint* _end_match_index = NULL;
+	gboolean result = FALSE;
+	GMatchInfo* match_info = NULL;
+	GMatchInfo* _tmp0_ = NULL;
+	gboolean _tmp1_;
+	gint after_char_index = 0;
+	gint _tmp2_;
+	gint _tmp3_;
+	gboolean _tmp4_;
+	gint* _tmp5_;
+	gboolean _tmp6_;
+	gchar* _tmp7_ = NULL;
+	gchar* char_matched;
+	DocumentStructureLowLevelType* _tmp12_ = NULL;
+	gchar* _tmp13_ = NULL;
+	gint* _tmp14_ = NULL;
+	gboolean _tmp15_;
+	GError * _inner_error_ = NULL;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (line != NULL, FALSE);
+	g_regex_match_full (document_structure__chars_regex, line, (gssize) (-1), start_index, 0, &_tmp0_, &_inner_error_);
+	_g_match_info_free0 (match_info);
+	match_info = _tmp0_;
+	if (_inner_error_ != NULL) {
+		goto __catch57_g_error;
+	}
+	goto __finally57;
+	__catch57_g_error:
+	{
+		GError * e;
+		e = _inner_error_;
+		_inner_error_ = NULL;
+		fprintf (stderr, "Structure parsing: chars regex: %s\n", e->message);
+		result = FALSE;
+		_g_error_free0 (e);
+		_g_match_info_free0 (match_info);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (start_match_index) {
+			*start_match_index = _start_match_index;
+		} else {
+			_g_free0 (_start_match_index);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
 		}
 		return result;
 	}
-	_tmp3_ = gtk_text_buffer_get_text (self->priv->_doc, after_backslash, &end_name_iter, FALSE);
-	name = _tmp3_;
-	_tmp4_ = document_structure_get_type_from_simple_command_name (self, name);
-	result = _tmp4_;
-	_g_free0 (name);
-	if (begin_contents_iter) {
-		*begin_contents_iter = _begin_contents_iter;
+	__finally57:
+	if (_inner_error_ != NULL) {
+		_g_match_info_free0 (match_info);
+		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return FALSE;
+	}
+	_tmp1_ = g_match_info_matches (match_info);
+	if (!_tmp1_) {
+		result = FALSE;
+		_g_match_info_free0 (match_info);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (start_match_index) {
+			*start_match_index = _start_match_index;
+		} else {
+			_g_free0 (_start_match_index);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp4_ = g_match_info_fetch_pos (match_info, 0, &_tmp2_, &_tmp3_);
+	_g_free0 (_start_match_index);
+	_tmp5_ = __int_dup0 (&_tmp2_);
+	_start_match_index = _tmp5_;
+	after_char_index = _tmp3_;
+	if (!_tmp4_) {
+		fprintf (stderr, "Structure parsing: position can not be fetched\n");
+		result = FALSE;
+		_g_match_info_free0 (match_info);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (start_match_index) {
+			*start_match_index = _start_match_index;
+		} else {
+			_g_free0 (_start_match_index);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp6_ = utils_char_is_escaped (line, *_start_match_index);
+	if (_tmp6_) {
+		result = FALSE;
+		_g_match_info_free0 (match_info);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (start_match_index) {
+			*start_match_index = _start_match_index;
+		} else {
+			_g_free0 (_start_match_index);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp7_ = g_match_info_fetch (match_info, 0);
+	char_matched = _tmp7_;
+	if (g_strcmp0 (char_matched, "\\") == 0) {
+		DocumentStructureLowLevelType* _tmp8_ = NULL;
+		gchar* _tmp9_ = NULL;
+		gint* _tmp10_ = NULL;
+		gboolean _tmp11_;
+		_tmp11_ = document_structure_search_markup (self, line, after_char_index, &_tmp8_, &_tmp9_, &_tmp10_);
+		_g_free0 (_type);
+		_type = _tmp8_;
+		_g_free0 (_contents);
+		_contents = _tmp9_;
+		_g_free0 (_end_match_index);
+		_end_match_index = _tmp10_;
+		result = _tmp11_;
+		_g_free0 (char_matched);
+		_g_match_info_free0 (match_info);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (start_match_index) {
+			*start_match_index = _start_match_index;
+		} else {
+			_g_free0 (_start_match_index);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp15_ = document_structure_search_comment (self, line, after_char_index, &_tmp12_, &_tmp13_, &_tmp14_);
+	_g_free0 (_type);
+	_type = _tmp12_;
+	_g_free0 (_contents);
+	_contents = _tmp13_;
+	_g_free0 (_end_match_index);
+	_end_match_index = _tmp14_;
+	result = _tmp15_;
+	_g_free0 (char_matched);
+	_g_match_info_free0 (match_info);
+	if (type) {
+		*type = _type;
+	} else {
+		_g_free0 (_type);
+	}
+	if (contents) {
+		*contents = _contents;
+	} else {
+		_g_free0 (_contents);
+	}
+	if (start_match_index) {
+		*start_match_index = _start_match_index;
+	} else {
+		_g_free0 (_start_match_index);
+	}
+	if (end_match_index) {
+		*end_match_index = _end_match_index;
+	} else {
+		_g_free0 (_end_match_index);
 	}
 	return result;
 }
 
 
-static gchar string_get (const gchar* self, glong index) {
-	gchar result = '\0';
-	g_return_val_if_fail (self != NULL, '\0');
-	result = ((gchar*) self)[index];
-	return result;
-}
-
-
-static gchar* string_slice (const gchar* self, glong start, glong end) {
-	gchar* result = NULL;
-	gint _tmp0_;
-	glong string_length;
-	gboolean _tmp1_ = FALSE;
+static gboolean document_structure_search_markup (DocumentStructure* self, const gchar* line, gint after_backslash_index, DocumentStructureLowLevelType** type, gchar** contents, gint** end_match_index) {
+	DocumentStructureLowLevelType* _type = NULL;
+	gchar* _contents = NULL;
+	gint* _end_match_index = NULL;
+	gboolean result = FALSE;
+	gint* begin_contents_index = NULL;
+	gint* _tmp0_ = NULL;
+	gchar* _tmp1_ = NULL;
+	gchar* name;
+	gboolean is_begin_env;
 	gboolean _tmp2_ = FALSE;
-	gchar* _tmp3_ = NULL;
-	g_return_val_if_fail (self != NULL, NULL);
-	_tmp0_ = strlen (self);
-	string_length = (glong) _tmp0_;
-	if (start < 0) {
-		start = string_length + start;
+	DocumentStructureLowLevelType* _tmp6_ = NULL;
+	gint* _tmp7_ = NULL;
+	gchar* _tmp8_ = NULL;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (line != NULL, FALSE);
+	_tmp1_ = document_structure_get_markup_name (self, line, after_backslash_index, &_tmp0_);
+	_g_free0 (begin_contents_index);
+	begin_contents_index = _tmp0_;
+	name = _tmp1_;
+	if (name == NULL) {
+		result = FALSE;
+		_g_free0 (name);
+		_g_free0 (begin_contents_index);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
 	}
-	if (end < 0) {
-		end = string_length + end;
+	is_begin_env = g_strcmp0 (name, "begin") == 0;
+	if (is_begin_env) {
+		_tmp2_ = TRUE;
+	} else {
+		_tmp2_ = g_strcmp0 (name, "end") == 0;
 	}
-	if (start >= 0) {
-		_tmp1_ = start <= string_length;
+	if (_tmp2_) {
+		DocumentStructureLowLevelType* _tmp3_ = NULL;
+		gint* _tmp4_ = NULL;
+		gboolean _tmp5_;
+		_g_free0 (_contents);
+		_contents = NULL;
+		_tmp5_ = document_structure_search_env (self, line, *begin_contents_index, is_begin_env, &_tmp3_, &_tmp4_);
+		_g_free0 (_type);
+		_type = _tmp3_;
+		_g_free0 (_end_match_index);
+		_end_match_index = _tmp4_;
+		result = _tmp5_;
+		_g_free0 (name);
+		_g_free0 (begin_contents_index);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp6_ = document_structure_get_markup_low_level_type (self, name);
+	_g_free0 (_type);
+	_type = _tmp6_;
+	if (_type == NULL) {
+		result = FALSE;
+		_g_free0 (name);
+		_g_free0 (begin_contents_index);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	_tmp8_ = document_structure_get_markup_contents (self, line, *begin_contents_index, &_tmp7_);
+	_g_free0 (_end_match_index);
+	_end_match_index = _tmp7_;
+	_g_free0 (_contents);
+	_contents = _tmp8_;
+	result = _contents != NULL;
+	_g_free0 (name);
+	_g_free0 (begin_contents_index);
+	if (type) {
+		*type = _type;
 	} else {
-		_tmp1_ = FALSE;
+		_g_free0 (_type);
 	}
-	g_return_val_if_fail (_tmp1_, NULL);
-	if (end >= 0) {
-		_tmp2_ = end <= string_length;
+	if (contents) {
+		*contents = _contents;
 	} else {
-		_tmp2_ = FALSE;
+		_g_free0 (_contents);
+	}
+	if (end_match_index) {
+		*end_match_index = _end_match_index;
+	} else {
+		_g_free0 (_end_match_index);
 	}
-	g_return_val_if_fail (_tmp2_, NULL);
-	g_return_val_if_fail (start <= end, NULL);
-	_tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
-	result = _tmp3_;
 	return result;
 }
 
 
-static gchar* document_structure_get_command_contents (DocumentStructure* self, const gchar* text) {
-	gchar* result = NULL;
-	gint brace_level;
-	g_return_val_if_fail (self != NULL, NULL);
-	g_return_val_if_fail (text != NULL, NULL);
-	brace_level = 0;
-	{
-		glong i;
-		i = (glong) 0;
-		{
-			gboolean _tmp0_;
-			_tmp0_ = TRUE;
-			while (TRUE) {
-				gint _tmp1_;
-				gboolean _tmp2_ = FALSE;
-				gchar _tmp3_;
-				gboolean _tmp5_ = FALSE;
-				gchar _tmp6_;
-				if (!_tmp0_) {
-					i++;
-				}
-				_tmp0_ = FALSE;
-				_tmp1_ = strlen (text);
-				if (!(i < _tmp1_)) {
+static DocumentStructureLowLevelType* _document_structure_low_level_type_dup (DocumentStructureLowLevelType* self) {
+	DocumentStructureLowLevelType* dup;
+	dup = g_new0 (DocumentStructureLowLevelType, 1);
+	memcpy (dup, self, sizeof (DocumentStructureLowLevelType));
+	return dup;
+}
+
+
+static gpointer __document_structure_low_level_type_dup0 (gpointer self) {
+	return self ? _document_structure_low_level_type_dup (self) : NULL;
+}
+
+
+static gboolean document_structure_search_env (DocumentStructure* self, const gchar* line, gint begin_contents_index, gboolean is_begin_env, DocumentStructureLowLevelType** type, gint** end_match_index) {
+	DocumentStructureLowLevelType* _type = NULL;
+	gint* _end_match_index = NULL;
+	gboolean result = FALSE;
+	gint* _tmp0_ = NULL;
+	gchar* _tmp1_ = NULL;
+	gchar* contents;
+	gboolean _tmp2_ = FALSE;
+	gboolean _tmp9_ = FALSE;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (line != NULL, FALSE);
+	_tmp1_ = document_structure_get_markup_contents (self, line, begin_contents_index, &_tmp0_);
+	_g_free0 (_end_match_index);
+	_end_match_index = _tmp0_;
+	contents = _tmp1_;
+	if (contents == NULL) {
+		result = FALSE;
+		_g_free0 (contents);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	if (g_strcmp0 (contents, "verbatim") == 0) {
+		_tmp2_ = TRUE;
+	} else {
+		_tmp2_ = g_strcmp0 (contents, "verbatim*") == 0;
+	}
+	if (_tmp2_) {
+		DocumentStructureLowLevelType _tmp3_ = 0;
+		DocumentStructureLowLevelType* _tmp4_;
+		if (is_begin_env) {
+			_tmp3_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_VERBATIM;
+		} else {
+			_tmp3_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_VERBATIM;
+		}
+		_tmp4_ = __document_structure_low_level_type_dup0 (&_tmp3_);
+		_g_free0 (_type);
+		_type = _tmp4_;
+		result = TRUE;
+		_g_free0 (contents);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	if (g_strcmp0 (contents, "figure") == 0) {
+		DocumentStructureLowLevelType _tmp5_ = 0;
+		DocumentStructureLowLevelType* _tmp6_;
+		if (is_begin_env) {
+			_tmp5_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE;
+		} else {
+			_tmp5_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE;
+		}
+		_tmp6_ = __document_structure_low_level_type_dup0 (&_tmp5_);
+		_g_free0 (_type);
+		_type = _tmp6_;
+		result = TRUE;
+		_g_free0 (contents);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	if (g_strcmp0 (contents, "table") == 0) {
+		DocumentStructureLowLevelType _tmp7_ = 0;
+		DocumentStructureLowLevelType* _tmp8_;
+		if (is_begin_env) {
+			_tmp7_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE;
+		} else {
+			_tmp7_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE;
+		}
+		_tmp8_ = __document_structure_low_level_type_dup0 (&_tmp7_);
+		_g_free0 (_type);
+		_type = _tmp8_;
+		result = TRUE;
+		_g_free0 (contents);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	if (g_strcmp0 (contents, "document") == 0) {
+		_tmp9_ = !is_begin_env;
+	} else {
+		_tmp9_ = FALSE;
+	}
+	if (_tmp9_) {
+		DocumentStructureLowLevelType _tmp10_;
+		DocumentStructureLowLevelType* _tmp11_;
+		_tmp10_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_DOCUMENT;
+		_tmp11_ = __document_structure_low_level_type_dup0 (&_tmp10_);
+		_g_free0 (_type);
+		_type = _tmp11_;
+		result = TRUE;
+		_g_free0 (contents);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
+		return result;
+	}
+	result = FALSE;
+	_g_free0 (contents);
+	if (type) {
+		*type = _type;
+	} else {
+		_g_free0 (_type);
+	}
+	if (end_match_index) {
+		*end_match_index = _end_match_index;
+	} else {
+		_g_free0 (_end_match_index);
+	}
+	return result;
+}
+
+
+static glong string_strnlen (gchar* str, glong maxlen) {
+	glong result = 0L;
+	gchar* _tmp0_ = NULL;
+	gchar* end;
+	_tmp0_ = memchr (str, 0, (gsize) maxlen);
+	end = _tmp0_;
+	if (end == NULL) {
+		result = maxlen;
+		return result;
+	} else {
+		result = (glong) (end - str);
+		return result;
+	}
+}
+
+
+static gchar* string_substring (const gchar* self, glong offset, glong len) {
+	gchar* result = NULL;
+	glong string_length = 0L;
+	gboolean _tmp0_ = FALSE;
+	gchar* _tmp3_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	if (offset >= 0) {
+		_tmp0_ = len >= 0;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	if (_tmp0_) {
+		glong _tmp1_;
+		_tmp1_ = string_strnlen ((gchar*) self, offset + len);
+		string_length = _tmp1_;
+	} else {
+		gint _tmp2_;
+		_tmp2_ = strlen (self);
+		string_length = (glong) _tmp2_;
+	}
+	if (offset < 0) {
+		offset = string_length + offset;
+		g_return_val_if_fail (offset >= 0, NULL);
+	} else {
+		g_return_val_if_fail (offset <= string_length, NULL);
+	}
+	if (len < 0) {
+		len = string_length - offset;
+	}
+	g_return_val_if_fail ((offset + len) <= string_length, NULL);
+	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
+	result = _tmp3_;
+	return result;
+}
+
+
+static gchar* document_structure_get_markup_name (DocumentStructure* self, const gchar* line, gint after_backslash_index, gint** begin_contents_index) {
+	gint* _begin_contents_index = NULL;
+	gchar* result = NULL;
+	gchar* _tmp0_ = NULL;
+	gchar* after_backslash_text;
+	GMatchInfo* match_info = NULL;
+	GMatchInfo* _tmp1_ = NULL;
+	gboolean _tmp2_;
+	gint pos = 0;
+	gint _tmp3_;
+	gint _tmp4_;
+	gint* _tmp5_;
+	gchar* _tmp6_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (line != NULL, NULL);
+	_tmp0_ = string_substring (line, (glong) after_backslash_index, (glong) (-1));
+	after_backslash_text = _tmp0_;
+	_tmp2_ = g_regex_match (document_structure__command_name_regex, after_backslash_text, 0, &_tmp1_);
+	_g_match_info_free0 (match_info);
+	match_info = _tmp1_;
+	if (!_tmp2_) {
+		result = NULL;
+		_g_match_info_free0 (match_info);
+		_g_free0 (after_backslash_text);
+		if (begin_contents_index) {
+			*begin_contents_index = _begin_contents_index;
+		} else {
+			_g_free0 (_begin_contents_index);
+		}
+		return result;
+	}
+	g_match_info_fetch_pos (match_info, 0, NULL, &_tmp3_);
+	pos = _tmp3_;
+	_tmp4_ = pos + after_backslash_index;
+	_tmp5_ = __int_dup0 (&_tmp4_);
+	_g_free0 (_begin_contents_index);
+	_begin_contents_index = _tmp5_;
+	_tmp6_ = g_match_info_fetch_named (match_info, "name");
+	result = _tmp6_;
+	_g_match_info_free0 (match_info);
+	_g_free0 (after_backslash_text);
+	if (begin_contents_index) {
+		*begin_contents_index = _begin_contents_index;
+	} else {
+		_g_free0 (_begin_contents_index);
+	}
+	return result;
+}
+
+
+static gchar string_get (const gchar* self, glong index) {
+	gchar result = '\0';
+	g_return_val_if_fail (self != NULL, '\0');
+	result = ((gchar*) self)[index];
+	return result;
+}
+
+
+static gchar* string_slice (const gchar* self, glong start, glong end) {
+	gchar* result = NULL;
+	gint _tmp0_;
+	glong string_length;
+	gboolean _tmp1_ = FALSE;
+	gboolean _tmp2_ = FALSE;
+	gchar* _tmp3_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = strlen (self);
+	string_length = (glong) _tmp0_;
+	if (start < 0) {
+		start = string_length + start;
+	}
+	if (end < 0) {
+		end = string_length + end;
+	}
+	if (start >= 0) {
+		_tmp1_ = start <= string_length;
+	} else {
+		_tmp1_ = FALSE;
+	}
+	g_return_val_if_fail (_tmp1_, NULL);
+	if (end >= 0) {
+		_tmp2_ = end <= string_length;
+	} else {
+		_tmp2_ = FALSE;
+	}
+	g_return_val_if_fail (_tmp2_, NULL);
+	g_return_val_if_fail (start <= end, NULL);
+	_tmp3_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
+	result = _tmp3_;
+	return result;
+}
+
+
+static gchar* document_structure_get_markup_contents (DocumentStructure* self, const gchar* line, gint begin_contents_index, gint** end_match_index) {
+	gint* _end_match_index = NULL;
+	gchar* result = NULL;
+	gint brace_level;
+	gint _tmp0_;
+	gint line_length;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (line != NULL, NULL);
+	brace_level = 0;
+	_tmp0_ = strlen (line);
+	line_length = _tmp0_;
+	{
+		gint i;
+		i = begin_contents_index;
+		{
+			gboolean _tmp1_;
+			_tmp1_ = TRUE;
+			while (TRUE) {
+				gboolean _tmp2_ = FALSE;
+				gchar _tmp3_;
+				gboolean _tmp5_ = FALSE;
+				gchar _tmp6_;
+				if (!_tmp1_) {
+					i++;
+				}
+				_tmp1_ = FALSE;
+				if (!(i < line_length)) {
 					break;
 				}
-				_tmp3_ = string_get (text, i);
+				_tmp3_ = string_get (line, (glong) i);
 				if (_tmp3_ == '{') {
 					gboolean _tmp4_;
-					_tmp4_ = utils_char_is_escaped (text, i);
+					_tmp4_ = utils_char_is_escaped (line, (glong) i);
 					_tmp2_ = !_tmp4_;
 				} else {
 					_tmp2_ = FALSE;
@@ -478,10 +1224,10 @@ static gchar* document_structure_get_command_contents (DocumentStructure* self,
 					brace_level++;
 					continue;
 				}
-				_tmp6_ = string_get (text, i);
+				_tmp6_ = string_get (line, (glong) i);
 				if (_tmp6_ == '}') {
 					gboolean _tmp7_;
-					_tmp7_ = utils_char_is_escaped (text, i);
+					_tmp7_ = utils_char_is_escaped (line, (glong) i);
 					_tmp5_ = !_tmp7_;
 				} else {
 					_tmp5_ = FALSE;
@@ -490,104 +1236,45 @@ static gchar* document_structure_get_command_contents (DocumentStructure* self,
 					gchar* _tmp8_ = NULL;
 					gchar* contents;
 					gint _tmp9_;
+					gint* _tmp10_;
 					if (brace_level > 0) {
 						brace_level--;
 						continue;
 					}
-					_tmp8_ = string_slice (text, (glong) 0, i);
+					_tmp8_ = string_slice (line, (glong) begin_contents_index, (glong) i);
 					contents = _tmp8_;
-					_tmp9_ = strlen (contents);
-					if (_tmp9_ == 0) {
+					if (g_strcmp0 (contents, "") == 0) {
 						result = NULL;
 						_g_free0 (contents);
+						if (end_match_index) {
+							*end_match_index = _end_match_index;
+						} else {
+							_g_free0 (_end_match_index);
+						}
 						return result;
 					}
+					_tmp9_ = i + 1;
+					_tmp10_ = __int_dup0 (&_tmp9_);
+					_g_free0 (_end_match_index);
+					_end_match_index = _tmp10_;
 					result = contents;
+					if (end_match_index) {
+						*end_match_index = _end_match_index;
+					} else {
+						_g_free0 (_end_match_index);
+					}
 					return result;
 				}
 			}
 		}
 	}
 	result = NULL;
-	return result;
-}
-
-
-static gboolean document_structure_search_simple_command (DocumentStructure* self, GtkTextIter* begin_name_iter) {
-	gboolean result = FALSE;
-	GtkTextIter begin_contents_iter = {0};
-	GtkTextIter _tmp0_ = {0};
-	StructType* _tmp1_ = NULL;
-	StructType* type;
-	GtkTextIter limit;
-	gchar* _tmp2_ = NULL;
-	gchar* end_line;
-	gchar* _tmp3_ = NULL;
-	gchar* contents;
-	GtkTextIter mark_iter;
-	g_return_val_if_fail (self != NULL, FALSE);
-	_tmp1_ = document_structure_get_simple_command_type (self, begin_name_iter, &_tmp0_);
-	begin_contents_iter = _tmp0_;
-	type = _tmp1_;
-	if (type == NULL) {
-		result = FALSE;
-		_g_free0 (type);
-		return result;
-	}
-	limit = begin_contents_iter;
-	gtk_text_iter_forward_to_line_end (&limit);
-	_tmp2_ = gtk_text_buffer_get_text (self->priv->_doc, &begin_contents_iter, &limit, FALSE);
-	end_line = _tmp2_;
-	_tmp3_ = document_structure_get_command_contents (self, end_line);
-	contents = _tmp3_;
-	if (contents == NULL) {
-		result = FALSE;
-		_g_free0 (contents);
-		_g_free0 (end_line);
-		_g_free0 (type);
-		return result;
-	}
-	mark_iter = *begin_name_iter;
-	gtk_text_iter_backward_char (&mark_iter);
-	document_structure_add_item (self, *type, contents, &mark_iter);
-	result = TRUE;
-	_g_free0 (contents);
-	_g_free0 (end_line);
-	_g_free0 (type);
-	return result;
-}
-
-
-static void document_structure_search_figure_or_table (DocumentStructure* self, GtkTextIter* after_backslash) {
-	gchar* _tmp0_ = NULL;
-	gchar* text;
-	gboolean _tmp1_;
-	g_return_if_fail (self != NULL);
-	_tmp0_ = document_structure_get_text_to_line_end (self, after_backslash);
-	text = _tmp0_;
-	_tmp1_ = g_str_has_prefix (text, "begin{figure}");
-	if (_tmp1_) {
-		self->priv->_in_figure_env = TRUE;
+	if (end_match_index) {
+		*end_match_index = _end_match_index;
 	} else {
-		gboolean _tmp2_;
-		_tmp2_ = g_str_has_prefix (text, "end{figure}");
-		if (_tmp2_) {
-			self->priv->_in_figure_env = FALSE;
-		} else {
-			gboolean _tmp3_;
-			_tmp3_ = g_str_has_prefix (text, "begin{table}");
-			if (_tmp3_) {
-				self->priv->_in_table_env = TRUE;
-			} else {
-				gboolean _tmp4_;
-				_tmp4_ = g_str_has_prefix (text, "end{table}");
-				if (_tmp4_) {
-					self->priv->_in_table_env = FALSE;
-				}
-			}
-		}
+		_g_free0 (_end_match_index);
 	}
-	_g_free0 (text);
+	return result;
 }
 
 
@@ -604,256 +1291,279 @@ static gchar* string_strip (const gchar* self) {
 }
 
 
-static gboolean document_structure_search_comment (DocumentStructure* self, GtkTextIter* after_percent) {
+static gboolean document_structure_search_comment (DocumentStructure* self, const gchar* line, gint after_percent_index, DocumentStructureLowLevelType** type, gchar** contents, gint** end_match_index) {
+	DocumentStructureLowLevelType* _type = NULL;
+	gchar* _contents = NULL;
+	gint* _end_match_index = NULL;
 	gboolean result = FALSE;
-	GtkTextIter begin_line = {0};
-	gint _tmp0_;
-	GtkTextIter _tmp1_ = {0};
+	gchar* _tmp0_ = NULL;
+	gchar* _tmp1_;
 	gchar* _tmp2_ = NULL;
-	gchar* text_before;
-	gint _tmp3_;
-	gboolean _tmp4_;
-	gchar* _tmp5_ = NULL;
-	gchar* _tmp6_;
-	gchar* _tmp7_ = NULL;
-	gchar* _tmp8_;
+	gchar* _tmp3_;
 	gchar* text_after;
 	GMatchInfo* match_info = NULL;
-	GMatchInfo* _tmp9_ = NULL;
-	gboolean _tmp10_;
-	gchar* _tmp11_ = NULL;
+	GMatchInfo* _tmp4_ = NULL;
+	gboolean _tmp5_;
+	gchar* _tmp6_ = NULL;
 	gchar* type_str;
-	StructType type = 0;
-	gchar* _tmp12_ = NULL;
-	gchar* text;
-	GtkTextIter mark_iter;
+	DocumentStructureLowLevelType _tmp7_ = 0;
+	DocumentStructureLowLevelType* _tmp8_;
+	gchar* _tmp9_ = NULL;
+	gint _tmp10_;
+	gint* _tmp11_;
 	g_return_val_if_fail (self != NULL, FALSE);
-	_tmp0_ = gtk_text_iter_get_line (after_percent);
-	gtk_text_buffer_get_iter_at_line (self->priv->_doc, &_tmp1_, _tmp0_);
-	begin_line = _tmp1_;
-	_tmp2_ = gtk_text_buffer_get_text (self->priv->_doc, &begin_line, after_percent, FALSE);
-	text_before = _tmp2_;
-	_tmp3_ = strlen (text_before);
-	_tmp4_ = utils_char_is_escaped (text_before, (glong) (_tmp3_ - 1));
-	if (_tmp4_) {
-		result = FALSE;
-		_g_free0 (text_before);
-		return result;
-	}
-	_tmp5_ = document_structure_get_text_to_line_end (self, after_percent);
-	_tmp6_ = _tmp5_;
-	_tmp7_ = string_strip (_tmp6_);
-	_tmp8_ = _tmp7_;
-	_g_free0 (_tmp6_);
-	text_after = _tmp8_;
-	_tmp10_ = g_regex_match (document_structure__comment_regex, text_after, 0, &_tmp9_);
+	g_return_val_if_fail (line != NULL, FALSE);
+	_tmp0_ = string_substring (line, (glong) after_percent_index, (glong) (-1));
+	_tmp1_ = _tmp0_;
+	_tmp2_ = string_strip (_tmp1_);
+	_tmp3_ = _tmp2_;
+	_g_free0 (_tmp1_);
+	text_after = _tmp3_;
+	_tmp5_ = g_regex_match (document_structure__comment_regex, text_after, 0, &_tmp4_);
 	_g_match_info_free0 (match_info);
-	match_info = _tmp9_;
-	if (!_tmp10_) {
+	match_info = _tmp4_;
+	if (!_tmp5_) {
 		result = FALSE;
 		_g_match_info_free0 (match_info);
 		_g_free0 (text_after);
-		_g_free0 (text_before);
+		if (type) {
+			*type = _type;
+		} else {
+			_g_free0 (_type);
+		}
+		if (contents) {
+			*contents = _contents;
+		} else {
+			_g_free0 (_contents);
+		}
+		if (end_match_index) {
+			*end_match_index = _end_match_index;
+		} else {
+			_g_free0 (_end_match_index);
+		}
 		return result;
 	}
-	_tmp11_ = g_match_info_fetch_named (match_info, "type");
-	type_str = _tmp11_;
+	_tmp6_ = g_match_info_fetch_named (match_info, "type");
+	type_str = _tmp6_;
 	if (g_strcmp0 (type_str, "TODO") == 0) {
-		type = STRUCT_TYPE_TODO;
+		_tmp7_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_TODO;
 	} else {
-		type = STRUCT_TYPE_FIXME;
+		_tmp7_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_FIXME;
 	}
-	_tmp12_ = g_match_info_fetch_named (match_info, "text");
-	text = _tmp12_;
-	mark_iter = *after_percent;
-	gtk_text_iter_backward_char (&mark_iter);
-	document_structure_add_item (self, type, text, &mark_iter);
+	_tmp8_ = __document_structure_low_level_type_dup0 (&_tmp7_);
+	_g_free0 (_type);
+	_type = _tmp8_;
+	_tmp9_ = g_match_info_fetch_named (match_info, "text");
+	_g_free0 (_contents);
+	_contents = _tmp9_;
+	_tmp10_ = strlen (line);
+	_tmp11_ = __int_dup0 (&_tmp10_);
+	_g_free0 (_end_match_index);
+	_end_match_index = _tmp11_;
 	result = TRUE;
-	_g_free0 (text);
 	_g_free0 (type_str);
 	_g_match_info_free0 (match_info);
 	_g_free0 (text_after);
-	_g_free0 (text_before);
+	if (type) {
+		*type = _type;
+	} else {
+		_g_free0 (_type);
+	}
+	if (contents) {
+		*contents = _contents;
+	} else {
+		_g_free0 (_contents);
+	}
+	if (end_match_index) {
+		*end_match_index = _end_match_index;
+	} else {
+		_g_free0 (_end_match_index);
+	}
 	return result;
 }
 
 
-static gpointer _g_object_ref0 (gpointer self) {
-	return self ? g_object_ref (self) : NULL;
-}
-
-
-static gchar* document_structure_get_text_to_line_end (DocumentStructure* self, GtkTextIter* start) {
-	gchar* result = NULL;
-	GtkTextBuffer* _tmp0_ = NULL;
-	GtkTextBuffer* _tmp1_;
-	GtkTextBuffer* doc;
-	GtkTextIter line_end;
-	gchar* _tmp2_ = NULL;
-	g_return_val_if_fail (self != NULL, NULL);
-	_tmp0_ = gtk_text_iter_get_buffer (start);
-	_tmp1_ = _g_object_ref0 (_tmp0_);
-	doc = _tmp1_;
-	line_end = *start;
-	gtk_text_iter_forward_to_line_end (&line_end);
-	_tmp2_ = gtk_text_buffer_get_text (doc, start, &line_end, FALSE);
-	result = _tmp2_;
-	_g_object_unref0 (doc);
-	return result;
-}
-
-
-static void document_structure_add_item (DocumentStructure* self, StructType type, const gchar* text, GtkTextIter* iter) {
-	DocumentStructureDataNode _tmp0_ = {0};
-	DocumentStructureDataNode data;
-	gchar* _tmp1_;
-	GtkTextMark* _tmp2_ = NULL;
+static void document_structure_handle_item (DocumentStructure* self, DocumentStructureLowLevelType type, const gchar* contents, GtkTextIter* iter) {
 	g_return_if_fail (self != NULL);
-	g_return_if_fail (text != NULL);
-	data = _tmp0_;
-	data.type = type;
-	_tmp1_ = g_strdup (text);
-	_g_free0 (data.text);
-	data.text = _tmp1_;
-	_tmp2_ = document_structure_create_text_mark_from_iter (self, iter);
-	_g_object_unref0 (data.mark);
-	data.mark = _tmp2_;
-	if (self->priv->_insert_at_end) {
-		document_structure_add_item_at_end (self, &data);
+	if (self->priv->_in_verbatim_env) {
+		if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_VERBATIM) {
+			self->priv->_in_verbatim_env = FALSE;
+		}
+		return;
+	}
+	if (type < DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_NB_COMMON_TYPES) {
+		document_structure_add_item (self, (StructType) type, contents, iter);
 	} else {
-		document_structure_add_item_in_middle (self, &data);
+		if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_VERBATIM) {
+			self->priv->_in_verbatim_env = TRUE;
+		} else {
+			gboolean _tmp0_ = FALSE;
+			if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE) {
+				_tmp0_ = TRUE;
+			} else {
+				_tmp0_ = type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE;
+			}
+			if (_tmp0_) {
+				document_structure_create_new_environment (self, type, iter);
+			} else {
+				gboolean _tmp1_ = FALSE;
+				gboolean _tmp2_ = FALSE;
+				if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CAPTION) {
+					_tmp2_ = self->priv->_env_data != NULL;
+				} else {
+					_tmp2_ = FALSE;
+				}
+				if (_tmp2_) {
+					_tmp1_ = (*self->priv->_env_data).text == NULL;
+				} else {
+					_tmp1_ = FALSE;
+				}
+				if (_tmp1_) {
+					gchar* short_caption;
+					gint _tmp3_;
+					gchar* _tmp5_;
+					gchar* _tmp6_;
+					gchar* _tmp8_;
+					short_caption = NULL;
+					_tmp3_ = strlen (contents);
+					if (_tmp3_ > DOCUMENT_STRUCTURE_CAPTION_MAX_LENGTH) {
+						gchar* _tmp4_ = NULL;
+						_tmp4_ = string_substring (contents, (glong) 0, (glong) DOCUMENT_STRUCTURE_CAPTION_MAX_LENGTH);
+						_g_free0 (short_caption);
+						short_caption = _tmp4_;
+					}
+					_tmp5_ = g_strdup (short_caption);
+					_tmp6_ = _tmp5_;
+					if (_tmp6_ == NULL) {
+						gchar* _tmp7_;
+						_tmp7_ = g_strdup (contents);
+						_g_free0 (_tmp6_);
+						_tmp6_ = _tmp7_;
+					}
+					_tmp8_ = g_strdup (_tmp6_);
+					_g_free0 ((*self->priv->_env_data).text);
+					(*self->priv->_env_data).text = _tmp8_;
+					_g_free0 (_tmp6_);
+					_g_free0 (short_caption);
+				} else {
+					gboolean _tmp9_;
+					_tmp9_ = document_structure_verify_end_environment_type (self, type);
+					if (_tmp9_) {
+						GtkTextMark* _tmp10_ = NULL;
+						_tmp10_ = document_structure_create_text_mark_from_iter (self, iter);
+						_g_object_unref0 ((*self->priv->_env_data).end_mark);
+						(*self->priv->_env_data).end_mark = _tmp10_;
+						document_structure_add_item_data (self, self->priv->_env_data, TRUE);
+					} else {
+						if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_DOCUMENT) {
+							GtkTextMark* _tmp11_ = NULL;
+							_tmp11_ = document_structure_create_text_mark_from_iter (self, iter);
+							_g_object_unref0 (self->priv->_end_document_mark);
+							self->priv->_end_document_mark = _tmp11_;
+						}
+					}
+				}
+			}
+		}
 	}
-	document_structure_data_node_destroy (&data);
 }
 
 
-static void document_structure_add_item_at_end (DocumentStructure* self, DocumentStructureDataNode* item) {
-	GNode* parent;
-	gint item_depth;
-	DocumentStructureDataNode* _tmp2_;
+static gpointer _struct_data_dup0 (gpointer self) {
+	return self ? struct_data_dup (self) : NULL;
+}
+
+
+static void document_structure_create_new_environment (DocumentStructure* self, DocumentStructureLowLevelType type, GtkTextIter* start_iter) {
+	gboolean _tmp0_ = FALSE;
+	StructData _tmp1_ = {0};
+	StructData _tmp2_ = {0};
+	StructData _tmp3_;
+	StructData* _tmp4_;
+	GtkTextMark* _tmp5_ = NULL;
 	g_return_if_fail (self != NULL);
-	parent = self->priv->_tree;
-	item_depth = (gint) (*item).type;
-	while (TRUE) {
-		GNode* _tmp0_ = NULL;
-		GNode* last_child;
-		gint cur_depth;
-		gboolean _tmp1_ = FALSE;
-		_tmp0_ = g_node_last_child (parent);
-		last_child = _tmp0_;
-		if (last_child == NULL) {
-			break;
-		}
-		cur_depth = (gint) (*((DocumentStructureDataNode*) last_child->data)).type;
-		if (cur_depth >= item_depth) {
-			_tmp1_ = TRUE;
-		} else {
-			_tmp1_ = cur_depth > STRUCT_TYPE_SUBPARAGRAPH;
-		}
-		if (_tmp1_) {
-			break;
-		}
-		parent = last_child;
+	if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE) {
+		_tmp0_ = TRUE;
+	} else {
+		_tmp0_ = type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE;
+	}
+	g_return_if_fail (_tmp0_);
+	memset (&_tmp1_, 0, sizeof (StructData));
+	_tmp2_ = _tmp1_;
+	_tmp3_ = _tmp2_;
+	_tmp4_ = _struct_data_dup0 (&_tmp3_);
+	_struct_data_free0 (self->priv->_env_data);
+	self->priv->_env_data = _tmp4_;
+	struct_data_destroy (&_tmp3_);
+	_g_free0 ((*self->priv->_env_data).text);
+	(*self->priv->_env_data).text = NULL;
+	_tmp5_ = document_structure_create_text_mark_from_iter (self, start_iter);
+	_g_object_unref0 ((*self->priv->_env_data).start_mark);
+	(*self->priv->_env_data).start_mark = _tmp5_;
+	_g_object_unref0 ((*self->priv->_env_data).end_mark);
+	(*self->priv->_env_data).end_mark = NULL;
+	if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE) {
+		(*self->priv->_env_data).type = STRUCT_TYPE_TABLE;
+	} else {
+		(*self->priv->_env_data).type = STRUCT_TYPE_FIGURE;
 	}
-	_tmp2_ = _document_structure_data_node_dup0 (item);
-	g_node_append_data (parent, _tmp2_);
 }
 
 
-static void document_structure_add_item_in_middle (DocumentStructure* self, DocumentStructureDataNode* item) {
-	gboolean _tmp0_;
-	gint _tmp2_;
-	gint pos;
-	GNode* cur_parent;
-	g_return_if_fail (self != NULL);
-	_tmp0_ = G_NODE_IS_LEAF (self->priv->_tree);
-	if (_tmp0_) {
-		DocumentStructureDataNode* _tmp1_;
-		_tmp1_ = _document_structure_data_node_dup0 (item);
-		g_node_append_data (self->priv->_tree, _tmp1_);
-		return;
+static gboolean document_structure_verify_end_environment_type (DocumentStructure* self, DocumentStructureLowLevelType type) {
+	gboolean result = FALSE;
+	g_return_val_if_fail (self != NULL, FALSE);
+	if (self->priv->_env_data == NULL) {
+		result = FALSE;
+		return result;
 	}
-	_tmp2_ = document_structure_get_position_from_mark ((*item).mark);
-	pos = _tmp2_;
-	cur_parent = self->priv->_tree;
-	while (TRUE) {
-		GNode* _tmp3_ = NULL;
-		GNode* cur_child;
-		gint child_index;
-		_tmp3_ = g_node_first_child (cur_parent);
-		cur_child = _tmp3_;
-		child_index = 0;
-		while (TRUE) {
-			gint _tmp4_;
-			gint cur_pos;
-			GNode* _tmp7_ = NULL;
-			GNode* next_child;
-			_tmp4_ = document_structure_get_position_from_mark ((*((DocumentStructureDataNode*) cur_child->data)).mark);
-			cur_pos = _tmp4_;
-			if (cur_pos > pos) {
-				GNode* _tmp5_ = NULL;
-				GNode* prev_child;
-				gboolean _tmp6_;
-				if (child_index == 0) {
-					document_structure_insert_item_at_position (self, item, cur_parent, child_index);
-					return;
-				}
-				_tmp5_ = g_node_prev_sibling (cur_child);
-				prev_child = _tmp5_;
-				_tmp6_ = G_NODE_IS_LEAF (prev_child);
-				if (_tmp6_) {
-					document_structure_insert_item_at_position (self, item, cur_parent, child_index);
-					return;
-				}
-				cur_parent = prev_child;
-				break;
-			}
-			_tmp7_ = g_node_next_sibling (cur_child);
-			next_child = _tmp7_;
-			if (next_child == NULL) {
-				gboolean _tmp8_;
-				_tmp8_ = G_NODE_IS_LEAF (cur_child);
-				if (_tmp8_) {
-					document_structure_insert_item_at_position (self, item, cur_parent, child_index + 1);
-					return;
-				}
-				cur_parent = cur_child;
-				break;
-			}
-			cur_child = next_child;
-			child_index++;
-		}
+	if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE) {
+		result = (*self->priv->_env_data).type == STRUCT_TYPE_TABLE;
+		return result;
+	}
+	if (type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE) {
+		result = (*self->priv->_env_data).type == STRUCT_TYPE_FIGURE;
+		return result;
 	}
+	result = FALSE;
+	return result;
 }
 
 
-static void document_structure_insert_item_at_position (DocumentStructure* self, DocumentStructureDataNode* item, GNode* parent, gint pos) {
-	DocumentStructureDataNode* _tmp0_;
+static void document_structure_add_item (DocumentStructure* self, StructType type, const gchar* text, GtkTextIter* start_iter) {
+	StructData _tmp0_ = {0};
+	StructData data;
+	gchar* _tmp1_;
+	GtkTextMark* _tmp2_ = NULL;
 	g_return_if_fail (self != NULL);
-	g_return_if_fail (parent != NULL);
-	_tmp0_ = _document_structure_data_node_dup0 (item);
-	g_node_insert_data (parent, pos, _tmp0_);
+	data = _tmp0_;
+	data.type = type;
+	_tmp1_ = g_strdup (text);
+	_g_free0 (data.text);
+	data.text = _tmp1_;
+	_tmp2_ = document_structure_create_text_mark_from_iter (self, start_iter);
+	_g_object_unref0 (data.start_mark);
+	data.start_mark = _tmp2_;
+	_g_object_unref0 (data.end_mark);
+	data.end_mark = NULL;
+	document_structure_add_item_data (self, &data, FALSE);
+	struct_data_destroy (&data);
 }
 
 
-static gint document_structure_get_position_from_mark (GtkTextMark* mark) {
-	gint result = 0;
-	GtkTextIter iter = {0};
-	GtkTextBuffer* _tmp0_ = NULL;
-	GtkTextBuffer* _tmp1_;
-	GtkTextBuffer* doc;
-	GtkTextIter _tmp2_ = {0};
-	gint _tmp3_;
-	g_return_val_if_fail (mark != NULL, 0);
-	_tmp0_ = gtk_text_mark_get_buffer (mark);
-	_tmp1_ = _g_object_ref0 (_tmp0_);
-	doc = _tmp1_;
-	gtk_text_buffer_get_iter_at_mark (doc, &_tmp2_, mark);
-	iter = _tmp2_;
-	_tmp3_ = gtk_text_iter_get_offset (&iter);
-	result = _tmp3_;
-	_g_object_unref0 (doc);
-	return result;
+static void document_structure_add_item_data (DocumentStructure* self, StructData* data, gboolean insert_in_middle) {
+	g_return_if_fail (self != NULL);
+	if ((*data).text == NULL) {
+		gchar* _tmp0_;
+		_tmp0_ = g_strdup ("");
+		_g_free0 ((*data).text);
+		(*data).text = _tmp0_;
+	}
+	if (insert_in_middle) {
+		structure_model_add_item_in_middle (self->priv->_model, data);
+	} else {
+		structure_model_add_item_at_end (self->priv->_model, data);
+	}
 }
 
 
@@ -921,11 +1631,11 @@ static void document_structure_clear_all_structure_marks (DocumentStructure* sel
 				_tmp4_ = _tmp3_;
 				_g_free0 (_tmp2_);
 				mark_name = _tmp4_;
-				_tmp5_ = gtk_text_buffer_get_mark (self->priv->_doc, mark_name);
+				_tmp5_ = gtk_text_buffer_get_mark ((GtkTextBuffer*) self->priv->_doc, mark_name);
 				_tmp6_ = _g_object_ref0 (_tmp5_);
 				mark = _tmp6_;
 				if (mark != NULL) {
-					gtk_text_buffer_delete_mark (self->priv->_doc, mark);
+					gtk_text_buffer_delete_mark ((GtkTextBuffer*) self->priv->_doc, mark);
 				}
 				_g_object_unref0 (mark);
 				_g_free0 (mark_name);
@@ -936,119 +1646,8 @@ static void document_structure_clear_all_structure_marks (DocumentStructure* sel
 }
 
 
-void document_structure_populate_tree_store (DocumentStructure* self, GtkTreeStore* store) {
-	g_return_if_fail (self != NULL);
-	g_return_if_fail (store != NULL);
-	document_structure_populate_tree_store_at_node (self, store, self->priv->_tree, NULL, TRUE);
-}
-
-
-static Block24Data* block24_data_ref (Block24Data* _data24_) {
-	g_atomic_int_inc (&_data24_->_ref_count_);
-	return _data24_;
-}
-
-
-static void block24_data_unref (Block24Data* _data24_) {
-	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
-		_g_object_unref0 (_data24_->self);
-		_g_free0 (_data24_->iter);
-		_g_object_unref0 (_data24_->store);
-		g_slice_free (Block24Data, _data24_);
-	}
-}
-
-
-static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self) {
-	GtkTreeIter* dup;
-	dup = g_new0 (GtkTreeIter, 1);
-	memcpy (dup, self, sizeof (GtkTreeIter));
-	return dup;
-}
-
-
-static gpointer __gtk_tree_iter_dup0 (gpointer self) {
-	return self ? _gtk_tree_iter_dup (self) : NULL;
-}
-
-
-static void _lambda12_ (GNode* child_node, Block24Data* _data24_) {
-	DocumentStructure * self;
-	self = _data24_->self;
-	g_return_if_fail (child_node != NULL);
-	document_structure_populate_tree_store_at_node (self, _data24_->store, child_node, _data24_->iter, FALSE);
-}
-
-
-static void __lambda12__gnode_foreach_func (GNode* node, gpointer self) {
-	_lambda12_ (node, self);
-}
-
-
-static void document_structure_populate_tree_store_at_node (DocumentStructure* self, GtkTreeStore* store, GNode* node, GtkTreeIter* parent, gboolean root_node) {
-	Block24Data* _data24_;
-	g_return_if_fail (self != NULL);
-	g_return_if_fail (store != NULL);
-	g_return_if_fail (node != NULL);
-	_data24_ = g_slice_new0 (Block24Data);
-	_data24_->_ref_count_ = 1;
-	_data24_->self = g_object_ref (self);
-	_data24_->store = _g_object_ref0 (store);
-	_data24_->iter = NULL;
-	if (!root_node) {
-		GtkTreeIter _tmp0_ = {0};
-		GtkTreeIter _tmp1_ = {0};
-		GtkTreeIter* _tmp2_;
-		document_structure_add_item_to_tree_store (self, _data24_->store, parent, (DocumentStructureDataNode*) node->data, &_tmp0_);
-		_tmp1_ = _tmp0_;
-		_tmp2_ = __gtk_tree_iter_dup0 (&_tmp1_);
-		_g_free0 (_data24_->iter);
-		_data24_->iter = _tmp2_;
-	}
-	g_node_children_foreach (node, G_TRAVERSE_ALL, __lambda12__gnode_foreach_func, _data24_);
-	block24_data_unref (_data24_);
-	_data24_ = NULL;
-}
-
-
-static void document_structure_add_item_to_tree_store (DocumentStructure* self, GtkTreeStore* store, GtkTreeIter* parent, DocumentStructureDataNode* data, GtkTreeIter* result) {
-	GtkTreeIter iter = {0};
-	GtkTreeIter _tmp0_ = {0};
-	gchar* _tmp1_ = NULL;
-	gchar* _tmp2_;
-	gchar* _tmp3_ = NULL;
-	gchar* _tmp4_;
-	g_return_if_fail (self != NULL);
-	g_return_if_fail (store != NULL);
-	gtk_tree_store_append (store, &_tmp0_, parent);
-	iter = _tmp0_;
-	_tmp1_ = structure_get_icon_from_type ((*data).type);
-	_tmp2_ = _tmp1_;
-	_tmp3_ = structure_get_type_name ((*data).type);
-	_tmp4_ = _tmp3_;
-	gtk_tree_store_set (store, &iter, STRUCT_ITEM_PIXBUF, _tmp2_, STRUCT_ITEM_TYPE, (*data).type, STRUCT_ITEM_TEXT, (*data).text, STRUCT_ITEM_TOOLTIP, _tmp4_, STRUCT_ITEM_MARK, (*data).mark, -1, -1);
-	_g_free0 (_tmp4_);
-	_g_free0 (_tmp2_);
-	*result = iter;
-	return;
-}
-
-
-static StructType* _struct_type_dup (StructType* self) {
-	StructType* dup;
-	dup = g_new0 (StructType, 1);
-	memcpy (dup, self, sizeof (StructType));
-	return dup;
-}
-
-
-static gpointer __struct_type_dup0 (gpointer self) {
-	return self ? _struct_type_dup (self) : NULL;
-}
-
-
-static StructType* document_structure_get_type_from_simple_command_name (DocumentStructure* self, const gchar* name) {
-	StructType* result = NULL;
+static DocumentStructureLowLevelType* document_structure_get_markup_low_level_type (DocumentStructure* self, const gchar* markup_name) {
+	DocumentStructureLowLevelType* result = NULL;
 	const gchar* _tmp0_;
 	GQuark _tmp1_;
 	static GQuark _tmp1__label0 = 0;
@@ -1069,18 +1668,19 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 	static GQuark _tmp1__label15 = 0;
 	static GQuark _tmp1__label16 = 0;
 	static GQuark _tmp1__label17 = 0;
+	static GQuark _tmp1__label18 = 0;
 	g_return_val_if_fail (self != NULL, NULL);
-	g_return_val_if_fail (name != NULL, NULL);
-	_tmp0_ = name;
+	g_return_val_if_fail (markup_name != NULL, NULL);
+	_tmp0_ = markup_name;
 	_tmp1_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
 	if ((_tmp1_ == ((0 != _tmp1__label0) ? _tmp1__label0 : (_tmp1__label0 = g_quark_from_static_string ("part")))) || (_tmp1_ == ((0 != _tmp1__label1) ? _tmp1__label1 : (_tmp1__label1 = g_quark_from_static_string ("part*"))))) {
 		switch (0) {
 			default:
 			{
-				StructType _tmp2_;
-				StructType* _tmp3_;
-				_tmp2_ = STRUCT_TYPE_PART;
-				_tmp3_ = __struct_type_dup0 (&_tmp2_);
+				DocumentStructureLowLevelType _tmp2_;
+				DocumentStructureLowLevelType* _tmp3_;
+				_tmp2_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PART;
+				_tmp3_ = __document_structure_low_level_type_dup0 (&_tmp2_);
 				result = _tmp3_;
 				return result;
 			}
@@ -1089,10 +1689,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp4_;
-				StructType* _tmp5_;
-				_tmp4_ = STRUCT_TYPE_CHAPTER;
-				_tmp5_ = __struct_type_dup0 (&_tmp4_);
+				DocumentStructureLowLevelType _tmp4_;
+				DocumentStructureLowLevelType* _tmp5_;
+				_tmp4_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CHAPTER;
+				_tmp5_ = __document_structure_low_level_type_dup0 (&_tmp4_);
 				result = _tmp5_;
 				return result;
 			}
@@ -1101,10 +1701,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp6_;
-				StructType* _tmp7_;
-				_tmp6_ = STRUCT_TYPE_SECTION;
-				_tmp7_ = __struct_type_dup0 (&_tmp6_);
+				DocumentStructureLowLevelType _tmp6_;
+				DocumentStructureLowLevelType* _tmp7_;
+				_tmp6_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SECTION;
+				_tmp7_ = __document_structure_low_level_type_dup0 (&_tmp6_);
 				result = _tmp7_;
 				return result;
 			}
@@ -1113,10 +1713,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp8_;
-				StructType* _tmp9_;
-				_tmp8_ = STRUCT_TYPE_SUBSECTION;
-				_tmp9_ = __struct_type_dup0 (&_tmp8_);
+				DocumentStructureLowLevelType _tmp8_;
+				DocumentStructureLowLevelType* _tmp9_;
+				_tmp8_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSECTION;
+				_tmp9_ = __document_structure_low_level_type_dup0 (&_tmp8_);
 				result = _tmp9_;
 				return result;
 			}
@@ -1125,10 +1725,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp10_;
-				StructType* _tmp11_;
-				_tmp10_ = STRUCT_TYPE_SUBSUBSECTION;
-				_tmp11_ = __struct_type_dup0 (&_tmp10_);
+				DocumentStructureLowLevelType _tmp10_;
+				DocumentStructureLowLevelType* _tmp11_;
+				_tmp10_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBSUBSECTION;
+				_tmp11_ = __document_structure_low_level_type_dup0 (&_tmp10_);
 				result = _tmp11_;
 				return result;
 			}
@@ -1137,10 +1737,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp12_;
-				StructType* _tmp13_;
-				_tmp12_ = STRUCT_TYPE_PARAGRAPH;
-				_tmp13_ = __struct_type_dup0 (&_tmp12_);
+				DocumentStructureLowLevelType _tmp12_;
+				DocumentStructureLowLevelType* _tmp13_;
+				_tmp12_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_PARAGRAPH;
+				_tmp13_ = __document_structure_low_level_type_dup0 (&_tmp12_);
 				result = _tmp13_;
 				return result;
 			}
@@ -1149,10 +1749,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp14_;
-				StructType* _tmp15_;
-				_tmp14_ = STRUCT_TYPE_SUBPARAGRAPH;
-				_tmp15_ = __struct_type_dup0 (&_tmp14_);
+				DocumentStructureLowLevelType _tmp14_;
+				DocumentStructureLowLevelType* _tmp15_;
+				_tmp14_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_SUBPARAGRAPH;
+				_tmp15_ = __document_structure_low_level_type_dup0 (&_tmp14_);
 				result = _tmp15_;
 				return result;
 			}
@@ -1161,10 +1761,10 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp16_;
-				StructType* _tmp17_;
-				_tmp16_ = STRUCT_TYPE_LABEL;
-				_tmp17_ = __struct_type_dup0 (&_tmp16_);
+				DocumentStructureLowLevelType _tmp16_;
+				DocumentStructureLowLevelType* _tmp17_;
+				_tmp16_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_LABEL;
+				_tmp17_ = __document_structure_low_level_type_dup0 (&_tmp16_);
 				result = _tmp17_;
 				return result;
 			}
@@ -1173,36 +1773,35 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 		switch (0) {
 			default:
 			{
-				StructType _tmp18_;
-				StructType* _tmp19_;
-				_tmp18_ = STRUCT_TYPE_INCLUDE;
-				_tmp19_ = __struct_type_dup0 (&_tmp18_);
+				DocumentStructureLowLevelType _tmp18_;
+				DocumentStructureLowLevelType* _tmp19_;
+				_tmp18_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_INCLUDE;
+				_tmp19_ = __document_structure_low_level_type_dup0 (&_tmp18_);
 				result = _tmp19_;
 				return result;
 			}
 		}
-	} else if (_tmp1_ == ((0 != _tmp1__label17) ? _tmp1__label17 : (_tmp1__label17 = g_quark_from_static_string ("caption")))) {
+	} else if (_tmp1_ == ((0 != _tmp1__label17) ? _tmp1__label17 : (_tmp1__label17 = g_quark_from_static_string ("includegraphics")))) {
 		switch (0) {
 			default:
 			{
-				if (self->priv->_in_figure_env) {
-					StructType _tmp20_;
-					StructType* _tmp21_;
-					_tmp20_ = STRUCT_TYPE_FIGURE;
-					_tmp21_ = __struct_type_dup0 (&_tmp20_);
-					result = _tmp21_;
-					return result;
-				} else {
-					if (self->priv->_in_table_env) {
-						StructType _tmp22_;
-						StructType* _tmp23_;
-						_tmp22_ = STRUCT_TYPE_TABLE;
-						_tmp23_ = __struct_type_dup0 (&_tmp22_);
-						result = _tmp23_;
-						return result;
-					}
-				}
-				result = NULL;
+				DocumentStructureLowLevelType _tmp20_;
+				DocumentStructureLowLevelType* _tmp21_;
+				_tmp20_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_IMAGE;
+				_tmp21_ = __document_structure_low_level_type_dup0 (&_tmp20_);
+				result = _tmp21_;
+				return result;
+			}
+		}
+	} else if (_tmp1_ == ((0 != _tmp1__label18) ? _tmp1__label18 : (_tmp1__label18 = g_quark_from_static_string ("caption")))) {
+		switch (0) {
+			default:
+			{
+				DocumentStructureLowLevelType _tmp22_;
+				DocumentStructureLowLevelType* _tmp23_;
+				_tmp22_ = DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_CAPTION;
+				_tmp23_ = __document_structure_low_level_type_dup0 (&_tmp22_);
+				result = _tmp23_;
 				return result;
 			}
 		}
@@ -1218,65 +1817,1130 @@ static StructType* document_structure_get_type_from_simple_command_name (Documen
 }
 
 
-static void document_structure_data_node_copy (const DocumentStructureDataNode* self, DocumentStructureDataNode* dest) {
-	dest->type = self->type;
-	dest->text = g_strdup (self->text);
-	dest->mark = _g_object_ref0 (self->mark);
+/*************************************************************************/
+void document_structure_do_action (DocumentStructure* self, StructAction action_type, GtkTreeIter* tree_iter, gboolean* refresh_simple_list, GError** error) {
+	gboolean _refresh_simple_list = FALSE;
+	gboolean shift_right;
+	gboolean _tmp2_ = FALSE;
+	GtkTextIter* start_iter = NULL;
+	GtkTextIter* end_iter = NULL;
+	GtkTextIter* _tmp10_ = NULL;
+	GtkTextIter* _tmp11_ = NULL;
+	gboolean _tmp12_;
+	gboolean found;
+	gint _tmp14_;
+	gint _tmp15_;
+	gboolean _tmp16_ = FALSE;
+	gboolean _tmp20_ = FALSE;
+	GError * _inner_error_ = NULL;
+	g_return_if_fail (self != NULL);
+	_refresh_simple_list = FALSE;
+	if (action_type == STRUCT_ACTION_COMMENT) {
+		gboolean _tmp0_;
+		_tmp0_ = document_structure_comment_item (self, tree_iter);
+		if (!_tmp0_) {
+			GError* _tmp1_ = NULL;
+			_tmp1_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_DATA_OUTDATED, "");
+			_inner_error_ = _tmp1_;
+			if (_inner_error_->domain == STRUCT_ERROR) {
+				g_propagate_error (error, _inner_error_);
+				return;
+			} else {
+				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+				g_clear_error (&_inner_error_);
+				return;
+			}
+		}
+		structure_model_delete (self->priv->_model, tree_iter);
+		_refresh_simple_list = TRUE;
+		if (refresh_simple_list) {
+			*refresh_simple_list = _refresh_simple_list;
+		}
+		return;
+	}
+	shift_right = action_type == STRUCT_ACTION_SHIFT_RIGHT;
+	if (shift_right) {
+		_tmp2_ = TRUE;
+	} else {
+		_tmp2_ = action_type == STRUCT_ACTION_SHIFT_LEFT;
+	}
+	if (_tmp2_) {
+		gboolean _tmp3_ = FALSE;
+		gboolean doc_modified = FALSE;
+		gboolean _tmp7_;
+		gboolean _tmp8_;
+		gboolean success;
+		if (shift_right) {
+			gboolean _tmp4_;
+			_tmp4_ = structure_model_item_contains_subparagraph (self->priv->_model, tree_iter);
+			_tmp3_ = _tmp4_;
+		} else {
+			_tmp3_ = FALSE;
+		}
+		if (_tmp3_) {
+			const gchar* _tmp5_ = NULL;
+			GError* _tmp6_ = NULL;
+			_tmp5_ = _ ("The structure item already contains a sub-paragraph.");
+			_tmp6_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_GENERAL, _tmp5_);
+			_inner_error_ = _tmp6_;
+			if (_inner_error_->domain == STRUCT_ERROR) {
+				g_propagate_error (error, _inner_error_);
+				return;
+			} else {
+				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+				g_clear_error (&_inner_error_);
+				return;
+			}
+		}
+		gtk_text_buffer_begin_user_action ((GtkTextBuffer*) self->priv->_doc);
+		_tmp8_ = document_structure_shift_item (self, tree_iter, shift_right, &_tmp7_);
+		doc_modified = _tmp7_;
+		success = _tmp8_;
+		gtk_text_buffer_end_user_action ((GtkTextBuffer*) self->priv->_doc);
+		if (!success) {
+			GError* _tmp9_ = NULL;
+			if (doc_modified) {
+				gtk_source_buffer_undo ((GtkSourceBuffer*) self->priv->_doc);
+			}
+			_tmp9_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_DATA_OUTDATED, "");
+			_inner_error_ = _tmp9_;
+			if (_inner_error_->domain == STRUCT_ERROR) {
+				g_propagate_error (error, _inner_error_);
+				return;
+			} else {
+				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+				g_clear_error (&_inner_error_);
+				return;
+			}
+		}
+		if (shift_right) {
+			structure_model_shift_right (self->priv->_model, tree_iter);
+		} else {
+			structure_model_shift_left (self->priv->_model, tree_iter);
+		}
+		if (refresh_simple_list) {
+			*refresh_simple_list = _refresh_simple_list;
+		}
+		return;
+	}
+	_tmp12_ = document_structure_get_exact_item_bounds (self, tree_iter, &_tmp10_, &_tmp11_);
+	_g_free0 (start_iter);
+	start_iter = _tmp10_;
+	_g_free0 (end_iter);
+	end_iter = _tmp11_;
+	found = _tmp12_;
+	if (!found) {
+		GError* _tmp13_ = NULL;
+		_tmp13_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_DATA_OUTDATED, "");
+		_inner_error_ = _tmp13_;
+		if (_inner_error_->domain == STRUCT_ERROR) {
+			g_propagate_error (error, _inner_error_);
+			_g_free0 (end_iter);
+			_g_free0 (start_iter);
+			return;
+		} else {
+			_g_free0 (end_iter);
+			_g_free0 (start_iter);
+			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return;
+		}
+	}
+	_tmp14_ = gtk_text_iter_get_line (start_iter);
+	_tmp15_ = gtk_text_iter_get_line (end_iter);
+	if (_tmp14_ != _tmp15_) {
+		document_structure_backward_indentation (self, &start_iter);
+		document_structure_backward_indentation (self, &end_iter);
+	}
+	if (action_type == STRUCT_ACTION_SELECT) {
+		gtk_text_buffer_select_range ((GtkTextBuffer*) self->priv->_doc, start_iter, end_iter);
+		_g_free0 (end_iter);
+		_g_free0 (start_iter);
+		if (refresh_simple_list) {
+			*refresh_simple_list = _refresh_simple_list;
+		}
+		return;
+	}
+	if (action_type == STRUCT_ACTION_COPY) {
+		_tmp16_ = TRUE;
+	} else {
+		_tmp16_ = action_type == STRUCT_ACTION_CUT;
+	}
+	if (_tmp16_) {
+		gchar* _tmp17_ = NULL;
+		gchar* data;
+		GtkClipboard* _tmp18_ = NULL;
+		GtkClipboard* _tmp19_;
+		GtkClipboard* clipboard;
+		_tmp17_ = gtk_text_buffer_get_text ((GtkTextBuffer*) self->priv->_doc, start_iter, end_iter, FALSE);
+		data = _tmp17_;
+		_tmp18_ = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+		_tmp19_ = _g_object_ref0 (_tmp18_);
+		clipboard = _tmp19_;
+		gtk_clipboard_set_text (clipboard, data, -1);
+		_g_object_unref0 (clipboard);
+		_g_free0 (data);
+	}
+	if (action_type == STRUCT_ACTION_DELETE) {
+		_tmp20_ = TRUE;
+	} else {
+		_tmp20_ = action_type == STRUCT_ACTION_CUT;
+	}
+	if (_tmp20_) {
+		gtk_text_buffer_begin_user_action ((GtkTextBuffer*) self->priv->_doc);
+		gtk_text_buffer_delete ((GtkTextBuffer*) self->priv->_doc, start_iter, end_iter);
+		gtk_text_buffer_end_user_action ((GtkTextBuffer*) self->priv->_doc);
+		structure_model_delete (self->priv->_model, tree_iter);
+		_refresh_simple_list = TRUE;
+	}
+	_g_free0 (end_iter);
+	_g_free0 (start_iter);
+	if (refresh_simple_list) {
+		*refresh_simple_list = _refresh_simple_list;
+	}
+}
+
+
+static GtkTextIter* _gtk_text_iter_dup (GtkTextIter* self) {
+	GtkTextIter* dup;
+	dup = g_new0 (GtkTextIter, 1);
+	memcpy (dup, self, sizeof (GtkTextIter));
+	return dup;
 }
 
 
-static void document_structure_data_node_destroy (DocumentStructureDataNode* self) {
-	_g_free0 ((*self).text);
-	_g_object_unref0 ((*self).mark);
+static gpointer __gtk_text_iter_dup0 (gpointer self) {
+	return self ? _gtk_text_iter_dup (self) : NULL;
 }
 
 
-static DocumentStructureDataNode* document_structure_data_node_dup (const DocumentStructureDataNode* self) {
-	DocumentStructureDataNode* dup;
-	dup = g_new0 (DocumentStructureDataNode, 1);
-	document_structure_data_node_copy (self, dup);
-	return dup;
+static gboolean document_structure_comment_item (DocumentStructure* self, GtkTreeIter* tree_iter) {
+	gboolean result = FALSE;
+	StructType type = 0;
+	GtkTextMark* start_mark;
+	GtkTextMark* end_mark;
+	GtkTextIter start_iter = {0};
+	GtkTextIter* end_iter;
+	GtkTextIter _tmp0_ = {0};
+	gboolean _tmp3_;
+	GtkTreeIter* next_section_iter;
+	GtkTreeIter* _tmp4_ = NULL;
+	GtkTreeIter* _tmp5_;
+	gboolean go_one_line_backward;
+	GError * _inner_error_ = NULL;
+	g_return_val_if_fail (self != NULL, FALSE);
+	start_mark = NULL;
+	end_mark = NULL;
+	gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, tree_iter, STRUCT_COLUMN_TYPE, &type, STRUCT_COLUMN_START_MARK, &start_mark, STRUCT_COLUMN_END_MARK, &end_mark, -1, -1);
+	end_iter = NULL;
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp0_, start_mark);
+	start_iter = _tmp0_;
+	if (end_mark != NULL) {
+		GtkTextIter _tmp1_ = {0};
+		GtkTextIter* _tmp2_;
+		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp1_, end_mark);
+		_g_free0 (end_iter);
+		_tmp2_ = __gtk_text_iter_dup0 (&_tmp1_);
+		end_iter = _tmp2_;
+	}
+	_tmp3_ = structure_is_section (type);
+	if (!_tmp3_) {
+		document_structure_comment_between (self, &start_iter, end_iter);
+		result = TRUE;
+		_g_free0 (end_iter);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		return result;
+	}
+	next_section_iter = NULL;
+	_tmp4_ = structure_model_get_next_sibling_or_parent (self->priv->_model, tree_iter, &_inner_error_);
+	_tmp5_ = _tmp4_;
+	if (_inner_error_ != NULL) {
+		if (_inner_error_->domain == STRUCT_ERROR) {
+			goto __catch58_struct_error;
+		}
+		_g_free0 (next_section_iter);
+		_g_free0 (end_iter);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return FALSE;
+	}
+	_g_free0 (next_section_iter);
+	next_section_iter = _tmp5_;
+	goto __finally58;
+	__catch58_struct_error:
+	{
+		GError * e;
+		e = _inner_error_;
+		_inner_error_ = NULL;
+		fprintf (stderr, "Structure: get next sibling or parent: %s\n", e->message);
+		result = FALSE;
+		_g_error_free0 (e);
+		_g_free0 (next_section_iter);
+		_g_free0 (end_iter);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		return result;
+	}
+	__finally58:
+	if (_inner_error_ != NULL) {
+		_g_free0 (next_section_iter);
+		_g_free0 (end_iter);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return FALSE;
+	}
+	go_one_line_backward = TRUE;
+	if (next_section_iter == NULL) {
+		gboolean end_of_file = FALSE;
+		gboolean _tmp6_;
+		GtkTextIter _tmp7_ = {0};
+		GtkTextIter _tmp8_ = {0};
+		GtkTextIter* _tmp9_;
+		document_structure_get_end_document_iter (self, &_tmp6_, &_tmp7_);
+		_tmp8_ = _tmp7_;
+		end_of_file = _tmp6_;
+		_tmp9_ = __gtk_text_iter_dup0 (&_tmp8_);
+		_g_free0 (end_iter);
+		end_iter = _tmp9_;
+		go_one_line_backward = !end_of_file;
+	} else {
+		GtkTextIter _tmp10_ = {0};
+		GtkTextIter* _tmp11_;
+		gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, next_section_iter, STRUCT_COLUMN_START_MARK, &end_mark, -1, -1);
+		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp10_, end_mark);
+		_g_free0 (end_iter);
+		_tmp11_ = __gtk_text_iter_dup0 (&_tmp10_);
+		end_iter = _tmp11_;
+	}
+	if (go_one_line_backward) {
+		gboolean _tmp12_;
+		_tmp12_ = gtk_text_iter_backward_line (end_iter);
+		if (!_tmp12_) {
+			_g_free0 (end_iter);
+			end_iter = NULL;
+		}
+	}
+	document_structure_comment_between (self, &start_iter, end_iter);
+	result = TRUE;
+	_g_free0 (next_section_iter);
+	_g_free0 (end_iter);
+	_g_object_unref0 (end_mark);
+	_g_object_unref0 (start_mark);
+	return result;
+}
+
+
+static void document_structure_comment_between (DocumentStructure* self, GtkTextIter* start_iter, GtkTextIter* end_iter) {
+	gint _tmp0_;
+	gint start_line;
+	gint end_line;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = gtk_text_iter_get_line (start_iter);
+	start_line = _tmp0_;
+	end_line = start_line;
+	if (end_iter != NULL) {
+		gint _tmp1_;
+		_tmp1_ = gtk_text_iter_get_line (end_iter);
+		end_line = _tmp1_;
+	}
+	gtk_text_buffer_begin_user_action ((GtkTextBuffer*) self->priv->_doc);
+	{
+		gint line_index;
+		line_index = start_line;
+		{
+			gboolean _tmp2_;
+			_tmp2_ = TRUE;
+			while (TRUE) {
+				GtkTextIter iter = {0};
+				GtkTextIter _tmp3_ = {0};
+				if (!_tmp2_) {
+					line_index++;
+				}
+				_tmp2_ = FALSE;
+				if (!(line_index <= end_line)) {
+					break;
+				}
+				gtk_text_buffer_get_iter_at_line ((GtkTextBuffer*) self->priv->_doc, &_tmp3_, line_index);
+				iter = _tmp3_;
+				document_insert (self->priv->_doc, &iter, "% ", -1);
+			}
+		}
+	}
+	gtk_text_buffer_end_user_action ((GtkTextBuffer*) self->priv->_doc);
+}
+
+
+static gboolean document_structure_get_exact_item_bounds (DocumentStructure* self, GtkTreeIter* tree_iter, GtkTextIter** start_iter, GtkTextIter** end_iter) {
+	GtkTextIter* _start_iter = NULL;
+	GtkTextIter* _end_iter = NULL;
+	gboolean result = FALSE;
+	StructType item_type = 0;
+	GtkTextMark* start_mark;
+	GtkTextMark* end_mark;
+	gchar* item_contents;
+	GtkTextIter _tmp0_ = {0};
+	GtkTextIter* _tmp1_;
+	GtkTextIter* _tmp2_ = NULL;
+	gboolean _tmp3_;
+	gboolean found;
+	gboolean _tmp4_;
+	GtkTextIter end_env_iter = {0};
+	GtkTextIter _tmp13_ = {0};
+	GtkTextIter* _tmp14_ = NULL;
+	gboolean _tmp15_;
+	GError * _inner_error_ = NULL;
+	g_return_val_if_fail (self != NULL, FALSE);
+	start_mark = NULL;
+	end_mark = NULL;
+	item_contents = NULL;
+	gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, tree_iter, STRUCT_COLUMN_TYPE, &item_type, STRUCT_COLUMN_START_MARK, &start_mark, STRUCT_COLUMN_END_MARK, &end_mark, STRUCT_COLUMN_TEXT, &item_contents, -1, -1);
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp0_, start_mark);
+	_g_free0 (_start_iter);
+	_tmp1_ = __gtk_text_iter_dup0 (&_tmp0_);
+	_start_iter = _tmp1_;
+	_tmp3_ = document_structure_get_low_level_item_bounds (self, item_type, item_contents, _start_iter, TRUE, &_tmp2_);
+	_g_free0 (_end_iter);
+	_end_iter = _tmp2_;
+	found = _tmp3_;
+	if (!found) {
+		result = FALSE;
+		_g_free0 (item_contents);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		if (start_iter) {
+			*start_iter = _start_iter;
+		} else {
+			_g_free0 (_start_iter);
+		}
+		if (end_iter) {
+			*end_iter = _end_iter;
+		} else {
+			_g_free0 (_end_iter);
+		}
+		return result;
+	}
+	_tmp4_ = structure_is_section (item_type);
+	if (_tmp4_) {
+		GtkTreeIter* next_section_iter;
+		GtkTreeIter* _tmp5_ = NULL;
+		GtkTreeIter* _tmp6_;
+		GtkTextIter _tmp10_ = {0};
+		GtkTextIter* _tmp11_;
+		gboolean _tmp12_;
+		next_section_iter = NULL;
+		_tmp5_ = structure_model_get_next_sibling_or_parent (self->priv->_model, tree_iter, &_inner_error_);
+		_tmp6_ = _tmp5_;
+		if (_inner_error_ != NULL) {
+			if (_inner_error_->domain == STRUCT_ERROR) {
+				goto __catch59_struct_error;
+			}
+			_g_free0 (next_section_iter);
+			_g_free0 (item_contents);
+			_g_object_unref0 (end_mark);
+			_g_object_unref0 (start_mark);
+			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return FALSE;
+		}
+		_g_free0 (next_section_iter);
+		next_section_iter = _tmp6_;
+		goto __finally59;
+		__catch59_struct_error:
+		{
+			GError * e;
+			e = _inner_error_;
+			_inner_error_ = NULL;
+			fprintf (stderr, "Structure: get next sibling or parent: %s\n", e->message);
+			result = FALSE;
+			_g_error_free0 (e);
+			_g_free0 (next_section_iter);
+			_g_free0 (item_contents);
+			_g_object_unref0 (end_mark);
+			_g_object_unref0 (start_mark);
+			if (start_iter) {
+				*start_iter = _start_iter;
+			} else {
+				_g_free0 (_start_iter);
+			}
+			if (end_iter) {
+				*end_iter = _end_iter;
+			} else {
+				_g_free0 (_end_iter);
+			}
+			return result;
+		}
+		__finally59:
+		if (_inner_error_ != NULL) {
+			_g_free0 (next_section_iter);
+			_g_free0 (item_contents);
+			_g_object_unref0 (end_mark);
+			_g_object_unref0 (start_mark);
+			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return FALSE;
+		}
+		if (next_section_iter == NULL) {
+			GtkTextIter _tmp7_ = {0};
+			GtkTextIter _tmp8_ = {0};
+			GtkTextIter* _tmp9_;
+			document_structure_get_end_document_iter (self, NULL, &_tmp7_);
+			_tmp8_ = _tmp7_;
+			_tmp9_ = __gtk_text_iter_dup0 (&_tmp8_);
+			_g_free0 (_end_iter);
+			_end_iter = _tmp9_;
+			result = TRUE;
+			_g_free0 (next_section_iter);
+			_g_free0 (item_contents);
+			_g_object_unref0 (end_mark);
+			_g_object_unref0 (start_mark);
+			if (start_iter) {
+				*start_iter = _start_iter;
+			} else {
+				_g_free0 (_start_iter);
+			}
+			if (end_iter) {
+				*end_iter = _end_iter;
+			} else {
+				_g_free0 (_end_iter);
+			}
+			return result;
+		}
+		gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, next_section_iter, STRUCT_COLUMN_TYPE, &item_type, STRUCT_COLUMN_START_MARK, &start_mark, STRUCT_COLUMN_TEXT, &item_contents, -1, -1);
+		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp10_, start_mark);
+		_g_free0 (_end_iter);
+		_tmp11_ = __gtk_text_iter_dup0 (&_tmp10_);
+		_end_iter = _tmp11_;
+		_tmp12_ = document_structure_get_low_level_item_bounds (self, item_type, item_contents, _end_iter, TRUE, NULL);
+		result = _tmp12_;
+		_g_free0 (next_section_iter);
+		_g_free0 (item_contents);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		if (start_iter) {
+			*start_iter = _start_iter;
+		} else {
+			_g_free0 (_start_iter);
+		}
+		if (end_iter) {
+			*end_iter = _end_iter;
+		} else {
+			_g_free0 (_end_iter);
+		}
+		return result;
+	} else {
+		if (item_type < STRUCT_TYPE_NB_COMMON_TYPES) {
+			result = TRUE;
+			_g_free0 (item_contents);
+			_g_object_unref0 (end_mark);
+			_g_object_unref0 (start_mark);
+			if (start_iter) {
+				*start_iter = _start_iter;
+			} else {
+				_g_free0 (_start_iter);
+			}
+			if (end_iter) {
+				*end_iter = _end_iter;
+			} else {
+				_g_free0 (_end_iter);
+			}
+			return result;
+		}
+	}
+	if (end_mark == NULL) {
+		result = FALSE;
+		_g_free0 (item_contents);
+		_g_object_unref0 (end_mark);
+		_g_object_unref0 (start_mark);
+		if (start_iter) {
+			*start_iter = _start_iter;
+		} else {
+			_g_free0 (_start_iter);
+		}
+		if (end_iter) {
+			*end_iter = _end_iter;
+		} else {
+			_g_free0 (_end_iter);
+		}
+		return result;
+	}
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp13_, end_mark);
+	end_env_iter = _tmp13_;
+	_tmp15_ = document_structure_get_low_level_item_bounds (self, item_type, item_contents, &end_env_iter, FALSE, &_tmp14_);
+	_g_free0 (_end_iter);
+	_end_iter = _tmp14_;
+	result = _tmp15_;
+	_g_free0 (item_contents);
+	_g_object_unref0 (end_mark);
+	_g_object_unref0 (start_mark);
+	if (start_iter) {
+		*start_iter = _start_iter;
+	} else {
+		_g_free0 (_start_iter);
+	}
+	if (end_iter) {
+		*end_iter = _end_iter;
+	} else {
+		_g_free0 (_end_iter);
+	}
+	return result;
+}
+
+
+static gboolean _int_equal (const gint* s1, const gint* s2) {
+	if (s1 == s2) {
+		return TRUE;
+	}
+	if (s1 == NULL) {
+		return FALSE;
+	}
+	if (s2 == NULL) {
+		return FALSE;
+	}
+	return (*s1) == (*s2);
+}
+
+
+static gboolean document_structure_get_low_level_item_bounds (DocumentStructure* self, StructType item_type, const gchar* item_contents, GtkTextIter* start_match_iter, gboolean is_start, GtkTextIter** end_match_iter) {
+	GtkTextIter* _end_match_iter = NULL;
+	gboolean result = FALSE;
+	gint _tmp0_;
+	gint line_num;
+	gchar* _tmp1_ = NULL;
+	gchar* line;
+	gint _tmp2_;
+	gint start_index;
+	DocumentStructureLowLevelType* low_level_type = NULL;
+	gchar* contents = NULL;
+	gint* start_match_index = NULL;
+	gint* end_match_index = NULL;
+	DocumentStructureLowLevelType* _tmp3_ = NULL;
+	gchar* _tmp4_ = NULL;
+	gint* _tmp5_ = NULL;
+	gint* _tmp6_ = NULL;
+	gboolean _tmp7_;
+	gboolean found;
+	gboolean _tmp8_ = FALSE;
+	gboolean _tmp10_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (item_contents != NULL, FALSE);
+	_tmp0_ = gtk_text_iter_get_line (start_match_iter);
+	line_num = _tmp0_;
+	_tmp1_ = document_structure_get_document_line_contents (self, line_num);
+	line = _tmp1_;
+	_tmp2_ = gtk_text_iter_get_line_index (start_match_iter);
+	start_index = _tmp2_;
+	_tmp7_ = document_structure_search_low_level_item (self, line, start_index, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
+	_g_free0 (low_level_type);
+	low_level_type = _tmp3_;
+	_g_free0 (contents);
+	contents = _tmp4_;
+	_g_free0 (start_match_index);
+	start_match_index = _tmp5_;
+	_g_free0 (end_match_index);
+	end_match_index = _tmp6_;
+	found = _tmp7_;
+	if (!found) {
+		_tmp8_ = TRUE;
+	} else {
+		_tmp8_ = _int_equal (&start_index, start_match_index) != TRUE;
+	}
+	if (_tmp8_) {
+		result = FALSE;
+		_g_free0 (end_match_index);
+		_g_free0 (start_match_index);
+		_g_free0 (contents);
+		_g_free0 (low_level_type);
+		_g_free0 (line);
+		if (end_match_iter) {
+			*end_match_iter = _end_match_iter;
+		} else {
+			_g_free0 (_end_match_iter);
+		}
+		return result;
+	}
+	if (contents == NULL) {
+		gchar* _tmp9_;
+		_tmp9_ = g_strdup ("");
+		_g_free0 (contents);
+		contents = _tmp9_;
+	}
+	_tmp10_ = document_structure_same_items (self, item_type, item_contents, *low_level_type, contents, is_start);
+	if (_tmp10_) {
+		GtkTextIter _tmp11_ = {0};
+		GtkTextIter* _tmp12_;
+		gtk_text_buffer_get_iter_at_line_index ((GtkTextBuffer*) self->priv->_doc, &_tmp11_, line_num, *end_match_index);
+		_g_free0 (_end_match_iter);
+		_tmp12_ = __gtk_text_iter_dup0 (&_tmp11_);
+		_end_match_iter = _tmp12_;
+		result = TRUE;
+		_g_free0 (end_match_index);
+		_g_free0 (start_match_index);
+		_g_free0 (contents);
+		_g_free0 (low_level_type);
+		_g_free0 (line);
+		if (end_match_iter) {
+			*end_match_iter = _end_match_iter;
+		} else {
+			_g_free0 (_end_match_iter);
+		}
+		return result;
+	}
+	result = FALSE;
+	_g_free0 (end_match_index);
+	_g_free0 (start_match_index);
+	_g_free0 (contents);
+	_g_free0 (low_level_type);
+	_g_free0 (line);
+	if (end_match_iter) {
+		*end_match_iter = _end_match_iter;
+	} else {
+		_g_free0 (_end_match_iter);
+	}
+	return result;
+}
+
+
+static gboolean document_structure_same_items (DocumentStructure* self, StructType item_type, const gchar* item_contents, DocumentStructureLowLevelType item_found_type, const gchar* item_found_contents, gboolean start) {
+	gboolean result = FALSE;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (item_contents != NULL, FALSE);
+	g_return_val_if_fail (item_found_contents != NULL, FALSE);
+	if (item_found_type < DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_NB_COMMON_TYPES) {
+		gboolean same_type;
+		gboolean same_contents;
+		gboolean _tmp0_ = FALSE;
+		same_type = item_type == ((StructType) item_found_type);
+		same_contents = g_strcmp0 (item_contents, item_found_contents) == 0;
+		if (same_type) {
+			_tmp0_ = same_contents;
+		} else {
+			_tmp0_ = FALSE;
+		}
+		result = _tmp0_;
+		return result;
+	}
+	if (item_type == STRUCT_TYPE_FIGURE) {
+		if (start) {
+			result = item_found_type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_FIGURE;
+			return result;
+		} else {
+			result = item_found_type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_FIGURE;
+			return result;
+		}
+	}
+	if (item_type == STRUCT_TYPE_TABLE) {
+		if (start) {
+			result = item_found_type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_BEGIN_TABLE;
+			return result;
+		} else {
+			result = item_found_type == DOCUMENT_STRUCTURE_LOW_LEVEL_TYPE_END_TABLE;
+			return result;
+		}
+	}
+	result = FALSE;
+	return result;
 }
 
 
-static void document_structure_data_node_free (DocumentStructureDataNode* self) {
-	document_structure_data_node_destroy (self);
-	g_free (self);
+static gchar* document_structure_get_document_line_contents (DocumentStructure* self, gint line_num) {
+	gchar* result = NULL;
+	gint _tmp0_;
+	gint nb_lines;
+	gboolean _tmp1_ = FALSE;
+	GtkTextIter begin = {0};
+	GtkTextIter _tmp2_ = {0};
+	gboolean _tmp3_;
+	GtkTextIter end;
+	gchar* _tmp5_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = gtk_text_buffer_get_line_count ((GtkTextBuffer*) self->priv->_doc);
+	nb_lines = _tmp0_;
+	if (0 <= line_num) {
+		_tmp1_ = line_num < nb_lines;
+	} else {
+		_tmp1_ = FALSE;
+	}
+	g_return_val_if_fail (_tmp1_, NULL);
+	gtk_text_buffer_get_iter_at_line ((GtkTextBuffer*) self->priv->_doc, &_tmp2_, line_num);
+	begin = _tmp2_;
+	_tmp3_ = gtk_text_iter_ends_line (&begin);
+	if (_tmp3_) {
+		gchar* _tmp4_;
+		_tmp4_ = g_strdup ("");
+		result = _tmp4_;
+		return result;
+	}
+	end = begin;
+	gtk_text_iter_forward_to_line_end (&end);
+	_tmp5_ = gtk_text_buffer_get_text ((GtkTextBuffer*) self->priv->_doc, &begin, &end, FALSE);
+	result = _tmp5_;
+	return result;
 }
 
 
-static GType document_structure_data_node_get_type (void) {
-	static volatile gsize document_structure_data_node_type_id__volatile = 0;
-	if (g_once_init_enter (&document_structure_data_node_type_id__volatile)) {
-		GType document_structure_data_node_type_id;
-		document_structure_data_node_type_id = g_boxed_type_register_static ("DocumentStructureDataNode", (GBoxedCopyFunc) document_structure_data_node_dup, (GBoxedFreeFunc) document_structure_data_node_free);
-		g_once_init_leave (&document_structure_data_node_type_id__volatile, document_structure_data_node_type_id);
+static void document_structure_get_end_document_iter (DocumentStructure* self, gboolean* end_of_file, GtkTextIter* result) {
+	gboolean _end_of_file = FALSE;
+	GtkTextIter eof_iter = {0};
+	GtkTextIter _tmp1_ = {0};
+	g_return_if_fail (self != NULL);
+	if (self->priv->_end_document_mark != NULL) {
+		GtkTextIter end_document_iter = {0};
+		GtkTextIter _tmp0_ = {0};
+		_end_of_file = FALSE;
+		gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp0_, self->priv->_end_document_mark);
+		end_document_iter = _tmp0_;
+		*result = end_document_iter;
+		if (end_of_file) {
+			*end_of_file = _end_of_file;
+		}
+		return;
+	}
+	_end_of_file = TRUE;
+	gtk_text_buffer_get_end_iter ((GtkTextBuffer*) self->priv->_doc, &_tmp1_);
+	eof_iter = _tmp1_;
+	*result = eof_iter;
+	if (end_of_file) {
+		*end_of_file = _end_of_file;
 	}
-	return document_structure_data_node_type_id__volatile;
+	return;
+}
+
+
+static void document_structure_backward_indentation (DocumentStructure* self, GtkTextIter** iter) {
+	gboolean _tmp0_;
+	gint _tmp1_;
+	gint line_num;
+	GtkTextIter begin_line_iter = {0};
+	GtkTextIter _tmp2_ = {0};
+	gchar* _tmp3_ = NULL;
+	gchar* text_between;
+	gchar* _tmp4_ = NULL;
+	gchar* _tmp5_;
+	gboolean _tmp6_;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail ((*iter) != NULL);
+	_tmp0_ = gtk_text_iter_starts_line (*iter);
+	if (_tmp0_) {
+		return;
+	}
+	_tmp1_ = gtk_text_iter_get_line (*iter);
+	line_num = _tmp1_;
+	gtk_text_buffer_get_iter_at_line ((GtkTextBuffer*) self->priv->_doc, &_tmp2_, line_num);
+	begin_line_iter = _tmp2_;
+	_tmp3_ = gtk_text_buffer_get_text ((GtkTextBuffer*) self->priv->_doc, &begin_line_iter, *iter, FALSE);
+	text_between = _tmp3_;
+	_tmp4_ = string_strip (text_between);
+	_tmp5_ = _tmp4_;
+	_tmp6_ = g_strcmp0 (_tmp5_, "") == 0;
+	_g_free0 (_tmp5_);
+	if (_tmp6_) {
+		GtkTextIter* _tmp7_;
+		_tmp7_ = __gtk_text_iter_dup0 (&begin_line_iter);
+		_g_free0 (*iter);
+		*iter = _tmp7_;
+	}
+	_g_free0 (text_between);
+}
+
+
+static gboolean document_structure_shift_item (DocumentStructure* self, GtkTreeIter* tree_iter, gboolean shift_right, gboolean* doc_modified) {
+	gboolean _doc_modified = FALSE;
+	gboolean result = FALSE;
+	StructType type = 0;
+	GtkTextMark* mark = NULL;
+	gboolean _tmp0_;
+	GtkTextIter text_iter = {0};
+	GtkTextIter _tmp1_ = {0};
+	gint _tmp2_;
+	gint line_num;
+	gchar* _tmp3_ = NULL;
+	gchar* line;
+	gint _tmp4_;
+	gint backslash_index;
+	gchar _tmp5_;
+	gint after_backslash_index;
+	gchar* _tmp6_ = NULL;
+	gchar* markup_name;
+	DocumentStructureLowLevelType* _tmp7_ = NULL;
+	DocumentStructureLowLevelType* markup_type;
+	DocumentStructureLowLevelType markup_type_hack;
+	gboolean _tmp8_;
+	gboolean with_star;
+	StructType new_type = 0;
+	gchar* _tmp9_ = NULL;
+	gchar* new_markup_name;
+	GtkTextIter begin_markup_name_iter = {0};
+	GtkTextIter _tmp11_ = {0};
+	GtkTextIter end_markup_name_iter = {0};
+	gint _tmp12_;
+	GtkTextIter _tmp13_ = {0};
+	gint _tmp14_;
+	gint nb_children;
+	g_return_val_if_fail (self != NULL, FALSE);
+	_doc_modified = FALSE;
+	gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, tree_iter, STRUCT_COLUMN_TYPE, &type, STRUCT_COLUMN_START_MARK, &mark, -1, -1);
+	if (shift_right) {
+		g_return_val_if_fail (type != STRUCT_TYPE_SUBPARAGRAPH, FALSE);
+	} else {
+		g_return_val_if_fail (type != STRUCT_TYPE_PART, FALSE);
+	}
+	_tmp0_ = structure_is_section (type);
+	if (!_tmp0_) {
+		result = TRUE;
+		_g_object_unref0 (mark);
+		if (doc_modified) {
+			*doc_modified = _doc_modified;
+		}
+		return result;
+	}
+	gtk_text_buffer_get_iter_at_mark ((GtkTextBuffer*) self->priv->_doc, &_tmp1_, mark);
+	text_iter = _tmp1_;
+	_tmp2_ = gtk_text_iter_get_line (&text_iter);
+	line_num = _tmp2_;
+	_tmp3_ = document_structure_get_document_line_contents (self, line_num);
+	line = _tmp3_;
+	g_return_val_if_fail (line != NULL, FALSE);
+	_tmp4_ = gtk_text_iter_get_line_index (&text_iter);
+	backslash_index = _tmp4_;
+	_tmp5_ = string_get (line, (glong) backslash_index);
+	if (_tmp5_ != '\\') {
+		result = FALSE;
+		_g_free0 (line);
+		_g_object_unref0 (mark);
+		if (doc_modified) {
+			*doc_modified = _doc_modified;
+		}
+		return result;
+	}
+	after_backslash_index = backslash_index + 1;
+	_tmp6_ = document_structure_get_markup_name (self, line, after_backslash_index, NULL);
+	markup_name = _tmp6_;
+	if (markup_name == NULL) {
+		result = FALSE;
+		_g_free0 (markup_name);
+		_g_free0 (line);
+		_g_object_unref0 (mark);
+		if (doc_modified) {
+			*doc_modified = _doc_modified;
+		}
+		return result;
+	}
+	_tmp7_ = document_structure_get_markup_low_level_type (self, markup_name);
+	markup_type = _tmp7_;
+	if (markup_type == NULL) {
+		result = FALSE;
+		_g_free0 (markup_type);
+		_g_free0 (markup_name);
+		_g_free0 (line);
+		_g_object_unref0 (mark);
+		if (doc_modified) {
+			*doc_modified = _doc_modified;
+		}
+		return result;
+	}
+	markup_type_hack = *markup_type;
+	if (((gint) type) != ((gint) markup_type_hack)) {
+		result = FALSE;
+		_g_free0 (markup_type);
+		_g_free0 (markup_name);
+		_g_free0 (line);
+		_g_object_unref0 (mark);
+		if (doc_modified) {
+			*doc_modified = _doc_modified;
+		}
+		return result;
+	}
+	_tmp8_ = g_str_has_suffix (markup_name, "*");
+	with_star = _tmp8_;
+	if (shift_right) {
+		new_type = type + 1;
+	} else {
+		new_type = type - 1;
+	}
+	_tmp9_ = document_structure_get_section_name_from_type (self, new_type);
+	new_markup_name = _tmp9_;
+	g_return_val_if_fail (new_markup_name != NULL, FALSE);
+	if (with_star) {
+		gchar* _tmp10_;
+		_tmp10_ = g_strconcat (new_markup_name, "*", NULL);
+		_g_free0 (new_markup_name);
+		new_markup_name = _tmp10_;
+	}
+	gtk_text_buffer_get_iter_at_line_index ((GtkTextBuffer*) self->priv->_doc, &_tmp11_, line_num, after_backslash_index);
+	begin_markup_name_iter = _tmp11_;
+	_tmp12_ = strlen (markup_name);
+	gtk_text_buffer_get_iter_at_line_index ((GtkTextBuffer*) self->priv->_doc, &_tmp13_, line_num, after_backslash_index + _tmp12_);
+	end_markup_name_iter = _tmp13_;
+	gtk_text_buffer_delete ((GtkTextBuffer*) self->priv->_doc, &begin_markup_name_iter, &end_markup_name_iter);
+	document_insert (self->priv->_doc, &begin_markup_name_iter, new_markup_name, -1);
+	_doc_modified = TRUE;
+	_tmp14_ = gtk_tree_model_iter_n_children ((GtkTreeModel*) self->priv->_model, tree_iter);
+	nb_children = _tmp14_;
+	{
+		gint child_num;
+		child_num = 0;
+		{
+			gboolean _tmp15_;
+			_tmp15_ = TRUE;
+			while (TRUE) {
+				GtkTreeIter child_iter = {0};
+				GtkTreeIter _tmp16_ = {0};
+				gboolean _tmp17_;
+				gboolean child_iter_set;
+				gboolean _tmp18_;
+				if (!_tmp15_) {
+					child_num++;
+				}
+				_tmp15_ = FALSE;
+				if (!(child_num < nb_children)) {
+					break;
+				}
+				_tmp17_ = gtk_tree_model_iter_nth_child ((GtkTreeModel*) self->priv->_model, &_tmp16_, tree_iter, child_num);
+				child_iter = _tmp16_;
+				child_iter_set = _tmp17_;
+				g_return_val_if_fail (child_iter_set, FALSE);
+				_tmp18_ = document_structure_shift_item (self, &child_iter, shift_right, NULL);
+				if (!_tmp18_) {
+					result = FALSE;
+					_g_free0 (new_markup_name);
+					_g_free0 (markup_type);
+					_g_free0 (markup_name);
+					_g_free0 (line);
+					_g_object_unref0 (mark);
+					if (doc_modified) {
+						*doc_modified = _doc_modified;
+					}
+					return result;
+				}
+			}
+		}
+	}
+	result = TRUE;
+	_g_free0 (new_markup_name);
+	_g_free0 (markup_type);
+	_g_free0 (markup_name);
+	_g_free0 (line);
+	_g_object_unref0 (mark);
+	if (doc_modified) {
+		*doc_modified = _doc_modified;
+	}
+	return result;
+}
+
+
+static gchar* document_structure_get_section_name_from_type (DocumentStructure* self, StructType type) {
+	gchar* result = NULL;
+	gboolean _tmp15_;
+	gchar* _tmp16_;
+	g_return_val_if_fail (self != NULL, NULL);
+	if (document_structure__section_names == NULL) {
+		gchar** _tmp0_ = NULL;
+		gchar* _tmp1_;
+		gchar* _tmp2_;
+		gchar* _tmp3_;
+		gchar* _tmp4_;
+		gchar* _tmp5_;
+		gchar* _tmp6_;
+		gchar* _tmp7_;
+		gchar* _tmp8_;
+		gchar* _tmp9_;
+		gchar* _tmp10_;
+		gchar* _tmp11_;
+		gchar* _tmp12_;
+		gchar* _tmp13_;
+		gchar* _tmp14_;
+		_tmp0_ = g_new0 (gchar*, 7 + 1);
+		document_structure__section_names = (_vala_array_free (document_structure__section_names, document_structure__section_names_length1, (GDestroyNotify) g_free), NULL);
+		document_structure__section_names = _tmp0_;
+		document_structure__section_names_length1 = 7;
+		_document_structure__section_names_size_ = 7;
+		_tmp1_ = g_strdup ("part");
+		_tmp2_ = _tmp1_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_PART]);
+		document_structure__section_names[STRUCT_TYPE_PART] = _tmp2_;
+		_tmp3_ = g_strdup ("chapter");
+		_tmp4_ = _tmp3_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_CHAPTER]);
+		document_structure__section_names[STRUCT_TYPE_CHAPTER] = _tmp4_;
+		_tmp5_ = g_strdup ("section");
+		_tmp6_ = _tmp5_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_SECTION]);
+		document_structure__section_names[STRUCT_TYPE_SECTION] = _tmp6_;
+		_tmp7_ = g_strdup ("subsection");
+		_tmp8_ = _tmp7_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_SUBSECTION]);
+		document_structure__section_names[STRUCT_TYPE_SUBSECTION] = _tmp8_;
+		_tmp9_ = g_strdup ("subsubsection");
+		_tmp10_ = _tmp9_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_SUBSUBSECTION]);
+		document_structure__section_names[STRUCT_TYPE_SUBSUBSECTION] = _tmp10_;
+		_tmp11_ = g_strdup ("paragraph");
+		_tmp12_ = _tmp11_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_PARAGRAPH]);
+		document_structure__section_names[STRUCT_TYPE_PARAGRAPH] = _tmp12_;
+		_tmp13_ = g_strdup ("subparagraph");
+		_tmp14_ = _tmp13_;
+		_g_free0 (document_structure__section_names[STRUCT_TYPE_SUBPARAGRAPH]);
+		document_structure__section_names[STRUCT_TYPE_SUBPARAGRAPH] = _tmp14_;
+	}
+	_tmp15_ = structure_is_section (type);
+	g_return_val_if_fail (_tmp15_, NULL);
+	_tmp16_ = g_strdup (document_structure__section_names[type]);
+	result = _tmp16_;
+	return result;
+}
+
+
+gboolean document_structure_get_parsing_done (DocumentStructure* self) {
+	gboolean result;
+	g_return_val_if_fail (self != NULL, FALSE);
+	result = self->priv->_parsing_done;
+	return result;
+}
+
+
+static void document_structure_set_parsing_done (DocumentStructure* self, gboolean value) {
+	g_return_if_fail (self != NULL);
+	self->priv->_parsing_done = value;
+	g_object_notify ((GObject *) self, "parsing-done");
 }
 
 
 static void document_structure_class_init (DocumentStructureClass * klass) {
 	document_structure_parent_class = g_type_class_peek_parent (klass);
 	g_type_class_add_private (klass, sizeof (DocumentStructurePrivate));
+	G_OBJECT_CLASS (klass)->get_property = _vala_document_structure_get_property;
+	G_OBJECT_CLASS (klass)->set_property = _vala_document_structure_set_property;
 	G_OBJECT_CLASS (klass)->finalize = document_structure_finalize;
+	g_object_class_install_property (G_OBJECT_CLASS (klass), DOCUMENT_STRUCTURE_PARSING_DONE, g_param_spec_boolean ("parsing-done", "parsing-done", "parsing-done", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 }
 
 
 static void document_structure_instance_init (DocumentStructure * self) {
 	self->priv = DOCUMENT_STRUCTURE_GET_PRIVATE (self);
 	self->priv->_nb_marks = 0;
-	self->priv->_insert_at_end = TRUE;
-	self->priv->_in_figure_env = FALSE;
-	self->priv->_in_table_env = FALSE;
+	self->priv->_end_document_mark = NULL;
+	self->priv->_model = NULL;
+	self->priv->_in_verbatim_env = FALSE;
+	self->priv->_env_data = NULL;
 	self->priv->_start_parsing_line = 0;
+	self->priv->_timer = NULL;
+	self->priv->_parsing_done = FALSE;
 }
 
 
 static void document_structure_finalize (GObject* obj) {
 	DocumentStructure * self;
 	self = DOCUMENT_STRUCTURE (obj);
-	__g_node_destroy__document_structure_data_node_free0_0 (self->priv->_tree);
+	_g_object_unref0 (self->priv->_end_document_mark);
+	_g_object_unref0 (self->priv->_model);
+	_struct_data_free0 (self->priv->_env_data);
+	_g_timer_destroy0 (self->priv->_timer);
 	G_OBJECT_CLASS (document_structure_parent_class)->finalize (obj);
 }
 
@@ -1293,4 +2957,50 @@ GType document_structure_get_type (void) {
 }
 
 
+static void _vala_document_structure_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+	DocumentStructure * self;
+	self = DOCUMENT_STRUCTURE (object);
+	switch (property_id) {
+		case DOCUMENT_STRUCTURE_PARSING_DONE:
+		g_value_set_boolean (value, document_structure_get_parsing_done (self));
+		break;
+		default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+		break;
+	}
+}
+
+
+static void _vala_document_structure_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+	DocumentStructure * self;
+	self = DOCUMENT_STRUCTURE (object);
+	switch (property_id) {
+		case DOCUMENT_STRUCTURE_PARSING_DONE:
+		document_structure_set_parsing_done (self, g_value_get_boolean (value));
+		break;
+		default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+		break;
+	}
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	if ((array != NULL) && (destroy_func != NULL)) {
+		int i;
+		for (i = 0; i < array_length; i = i + 1) {
+			if (((gpointer*) array)[i] != NULL) {
+				destroy_func (((gpointer*) array)[i]);
+			}
+		}
+	}
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	_vala_array_destroy (array, array_length, destroy_func);
+	g_free (array);
+}
+
+
 
diff --git a/src/C/document_tab.c b/src/C/document_tab.c
index 618db21..1e6e5a7 100644
--- a/src/C/document_tab.c
+++ b/src/C/document_tab.c
@@ -1,4 +1,4 @@
-/* document_tab.c generated by valac 0.12.0, the Vala compiler
+/* document_tab.c generated by valac 0.12.1, the Vala compiler
  * generated from document_tab.vala, do not modify */
 
 /*
@@ -75,21 +75,10 @@ typedef struct _TabInfoBar TabInfoBar;
 typedef struct _TabInfoBarClass TabInfoBarClass;
 #define _g_free0(var) (var = (g_free (var), NULL))
 
-#define TYPE_PROJECTS (projects_get_type ())
-#define PROJECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROJECTS, Projects))
-#define PROJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROJECTS, ProjectsClass))
-#define IS_PROJECTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROJECTS))
-#define IS_PROJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROJECTS))
-#define PROJECTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROJECTS, ProjectsClass))
-
-typedef struct _Projects Projects;
-typedef struct _ProjectsClass ProjectsClass;
-
 #define TYPE_PROJECT (project_get_type ())
 typedef struct _Project Project;
-#define _projects_unref0(var) ((var == NULL) ? NULL : (var = (projects_unref (var), NULL)))
 #define _project_free0(var) ((var == NULL) ? NULL : (var = (project_free (var), NULL)))
-typedef struct _Block23Data Block23Data;
+typedef struct _Block21Data Block21Data;
 
 struct _DocumentTab {
 	GtkVBox parent_instance;
@@ -128,7 +117,7 @@ struct _Project {
 	GFile* main_file;
 };
 
-struct _Block23Data {
+struct _Block21Data {
 	int _ref_count_;
 	DocumentTab * self;
 	TabInfoBar* infobar;
@@ -165,25 +154,25 @@ DocumentTab* document_tab_construct_from_location (GType object_type, GFile* loc
 void document_load (Document* self, GFile* location);
 DocumentTab* document_tab_new_with_view (DocumentView* view);
 DocumentTab* document_tab_construct_with_view (GType object_type, DocumentView* view);
-static void _lambda21_ (DocumentTab* self);
+static void _lambda26_ (DocumentTab* self);
 static void document_tab_update_label_text (DocumentTab* self);
 static void document_tab_update_label_tooltip (DocumentTab* self);
-static void __lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void __lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static void _document_tab_update_label_tooltip_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static void _document_tab_update_label_text_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda22_ (GtkTextBuffer* s, DocumentTab* self);
+static void _lambda27_ (GtkTextBuffer* s, DocumentTab* self);
 gboolean document_get_modified (Document* self);
-static void __lambda22__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
+static void __lambda27__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
 DocumentView* document_tab_get_view (DocumentTab* self);
 static gboolean document_tab_view_focused_in (DocumentTab* self);
 static gboolean _document_tab_view_focused_in_gtk_widget_focus_in_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
-static void _lambda24_ (DocumentTab* self);
-static void __lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda29_ (DocumentTab* self);
+static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self);
 void document_tab_set_auto_save (DocumentTab* self, gboolean value);
 void document_tab_set_auto_save_interval (DocumentTab* self, guint value);
 static gboolean document_tab_install_auto_save_timeout_if_needed (DocumentTab* self);
-static void _lambda25_ (DocumentTab* self);
-static void __lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda30_ (DocumentTab* self);
+static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 GType tab_info_bar_get_type (void) G_GNUC_CONST;
 TabInfoBar* document_tab_add_message (DocumentTab* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
 TabInfoBar* tab_info_bar_new (const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
@@ -193,32 +182,24 @@ gchar* document_get_short_name_for_display (Document* self);
 static void document_tab_set_label_text (DocumentTab* self, const gchar* value);
 GFile* document_get_location (Document* self);
 gchar* document_get_uri_for_display (Document* self);
-gint document_get_project_id (Document* self);
-gpointer projects_ref (gpointer instance);
-void projects_unref (gpointer instance);
-GParamSpec* param_spec_projects (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_projects (GValue* value, gpointer v_object);
-void value_take_projects (GValue* value, gpointer v_object);
-gpointer value_get_projects (const GValue* value);
-GType projects_get_type (void) G_GNUC_CONST;
-Projects* projects_get_default (void);
 GType project_get_type (void) G_GNUC_CONST;
 Project* project_dup (const Project* self);
 void project_free (Project* self);
 void project_copy (const Project* self, Project* dest);
 void project_destroy (Project* self);
-Project* projects_get (Projects* self, gint id);
-gchar* utils_replace_home_dir_with_tilde (const gchar* uri);
+Project* document_get_project (Document* self);
+static gchar* document_tab_get_main_file_relative_path (DocumentTab* self);
+gchar* utils_get_relative_path (GFile* origin, GFile* target, GFile* common_dir);
 gchar* document_tab_get_name (DocumentTab* self);
 const gchar* document_tab_get_label_text (DocumentTab* self);
 gchar* document_tab_get_menu_tip (DocumentTab* self);
 gboolean document_is_local (Document* self);
 gboolean document_is_externally_modified (Document* self);
-static Block23Data* block23_data_ref (Block23Data* _data23_);
-static void block23_data_unref (Block23Data* _data23_);
+static Block21Data* block21_data_ref (Block21Data* _data21_);
+static void block21_data_unref (Block21Data* _data21_);
 void tab_info_bar_add_stock_button_with_text (TabInfoBar* self, const gchar* text, const gchar* stock_id, gint response_id);
-static void _lambda23_ (gint response_id, Block23Data* _data23_);
-static void __lambda23__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
+static void _lambda28_ (gint response_id, Block21Data* _data21_);
+static void __lambda28__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
 static void document_tab_install_auto_save_timeout (DocumentTab* self);
 gboolean document_tab_get_auto_save (DocumentTab* self);
 guint document_tab_get_auto_save_interval (DocumentTab* self);
@@ -295,14 +276,14 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda21_ (DocumentTab* self) {
+static void _lambda26_ (DocumentTab* self) {
 	document_tab_update_label_text (self);
 	document_tab_update_label_tooltip (self);
 }
 
 
-static void __lambda21__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda21_ (self);
+static void __lambda26__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda26_ (self);
 }
 
 
@@ -316,7 +297,7 @@ static void _document_tab_update_label_text_g_object_notify (GObject* _sender, G
 }
 
 
-static void _lambda22_ (GtkTextBuffer* s, DocumentTab* self) {
+static void _lambda27_ (GtkTextBuffer* s, DocumentTab* self) {
 	const gchar* _tmp0_ = NULL;
 	gboolean _tmp1_;
 	g_return_if_fail (s != NULL);
@@ -330,8 +311,8 @@ static void _lambda22_ (GtkTextBuffer* s, DocumentTab* self) {
 }
 
 
-static void __lambda22__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
-	_lambda22_ (_sender, self);
+static void __lambda27__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
+	_lambda27_ (_sender, self);
 }
 
 
@@ -342,25 +323,25 @@ static gboolean _document_tab_view_focused_in_gtk_widget_focus_in_event (GtkWidg
 }
 
 
-static void _lambda24_ (DocumentTab* self) {
+static void _lambda29_ (DocumentTab* self) {
 	g_signal_emit_by_name (self, "close-document");
 }
 
 
-static void __lambda24__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda24_ (self);
+static void __lambda29__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda29_ (self);
 }
 
 
-static void _lambda25_ (DocumentTab* self) {
+static void _lambda30_ (DocumentTab* self) {
 	if (self->priv->auto_save_timeout <= 0) {
 		document_tab_install_auto_save_timeout_if_needed (self);
 	}
 }
 
 
-static void __lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda25_ (self);
+static void __lambda30__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda30_ (self);
 }
 
 
@@ -384,10 +365,10 @@ static void document_tab_initialize (DocumentTab* self) {
 	_tmp0_ = _g_object_ref0 (self);
 	_g_object_unref0 (self->priv->_document->tab);
 	self->priv->_document->tab = _tmp0_;
-	g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda21__g_object_notify, self, 0);
+	g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda26__g_object_notify, self, 0);
 	g_signal_connect_object ((GObject*) self->priv->_document, "notify::project-id", (GCallback) _document_tab_update_label_tooltip_g_object_notify, self, 0);
 	g_signal_connect_object ((GObject*) self->priv->_document, "notify::unsaved-document-n", (GCallback) _document_tab_update_label_text_g_object_notify, self, 0);
-	g_signal_connect_object ((GtkTextBuffer*) self->priv->_document, "modified-changed", (GCallback) __lambda22__gtk_text_buffer_modified_changed, self, 0);
+	g_signal_connect_object ((GtkTextBuffer*) self->priv->_document, "modified-changed", (GCallback) __lambda27__gtk_text_buffer_modified_changed, self, 0);
 	g_signal_connect_object ((GtkWidget*) self->priv->_view, "focus-in-event", (GCallback) _document_tab_view_focused_in_gtk_widget_focus_in_event, self, 0);
 	_tmp1_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
 	sw = g_object_ref_sink (_tmp1_);
@@ -411,7 +392,7 @@ static void document_tab_initialize (DocumentTab* self) {
 	_tmp5_ = g_object_ref_sink (_tmp4_);
 	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) _tmp5_);
 	_g_object_unref0 (_tmp5_);
-	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda24__gtk_button_clicked, self, 0);
+	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda29__gtk_button_clicked, self, 0);
 	_tmp6_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
 	_g_object_unref0 (self->priv->_label);
 	self->priv->_label = g_object_ref_sink (_tmp6_);
@@ -427,7 +408,7 @@ static void document_tab_initialize (DocumentTab* self) {
 	g_settings_get (settings, "auto-save-interval", "u", &tmp);
 	document_tab_set_auto_save_interval (self, tmp);
 	document_tab_install_auto_save_timeout_if_needed (self);
-	g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda25__g_object_notify, self, 0);
+	g_signal_connect_object ((GObject*) self->priv->_document, "notify::location", (GCallback) __lambda30__g_object_notify, self, 0);
 	_g_object_unref0 (settings);
 	_g_object_unref0 (close_button);
 	_g_object_unref0 (sw);
@@ -467,102 +448,121 @@ static void document_tab_update_label_text (DocumentTab* self) {
 
 static void document_tab_update_label_tooltip (DocumentTab* self) {
 	GFile* _tmp0_ = NULL;
+	gchar* _tmp1_ = NULL;
+	gchar* _tmp2_;
+	Project* _tmp3_ = NULL;
+	Project* project;
+	GFile* _tmp4_ = NULL;
+	gboolean _tmp5_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = document_get_location (self->priv->_document);
 	if (_tmp0_ == NULL) {
 		gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, "");
+		return;
+	}
+	_tmp1_ = document_get_uri_for_display (self->priv->_document);
+	_tmp2_ = _tmp1_;
+	gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp2_);
+	_g_free0 (_tmp2_);
+	_tmp3_ = document_get_project (self->priv->_document);
+	project = _tmp3_;
+	if (project == NULL) {
+		_project_free0 (project);
+		return;
+	}
+	_tmp4_ = document_get_location (self->priv->_document);
+	_tmp5_ = g_file_equal ((*project).main_file, _tmp4_);
+	if (_tmp5_) {
+		const gchar* _tmp6_ = NULL;
+		const gchar* _tmp7_ = NULL;
+		gchar* _tmp8_;
+		gchar* _tmp9_;
+		gchar* _tmp10_;
+		gchar* _tmp11_;
+		gchar* _tmp12_;
+		gchar* _tmp13_;
+		_tmp6_ = gtk_widget_get_tooltip_markup ((GtkWidget*) self->priv->_label);
+		_tmp7_ = _ ("Main File");
+		_tmp8_ = g_strconcat ("\n<b>", _tmp7_, NULL);
+		_tmp9_ = _tmp8_;
+		_tmp10_ = g_strconcat (_tmp9_, "</b>", NULL);
+		_tmp11_ = _tmp10_;
+		_tmp12_ = g_strconcat (_tmp6_, _tmp11_, NULL);
+		_tmp13_ = _tmp12_;
+		gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp13_);
+		_g_free0 (_tmp13_);
+		_g_free0 (_tmp11_);
+		_g_free0 (_tmp9_);
 	} else {
-		gchar* _tmp1_ = NULL;
-		gchar* _tmp2_;
-		gint _tmp3_;
-		_tmp1_ = document_get_uri_for_display (self->priv->_document);
-		_tmp2_ = _tmp1_;
-		gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp2_);
-		_g_free0 (_tmp2_);
-		_tmp3_ = document_get_project_id (self->priv->_document);
-		if (_tmp3_ != (-1)) {
-			Projects* _tmp4_ = NULL;
-			Projects* _tmp5_;
-			gint _tmp6_;
-			Project* _tmp7_ = NULL;
-			Project* _tmp8_;
-			Project* project;
-			GFile* _tmp9_ = NULL;
-			gboolean _tmp10_;
-			_tmp4_ = projects_get_default ();
-			_tmp5_ = _tmp4_;
-			_tmp6_ = document_get_project_id (self->priv->_document);
-			_tmp7_ = projects_get (_tmp5_, _tmp6_);
-			_tmp8_ = _tmp7_;
-			_projects_unref0 (_tmp5_);
-			project = _tmp8_;
-			if (project == NULL) {
-				_project_free0 (project);
-				return;
-			}
-			_tmp9_ = document_get_location (self->priv->_document);
-			_tmp10_ = g_file_equal ((*project).main_file, _tmp9_);
-			if (_tmp10_) {
-				const gchar* _tmp11_ = NULL;
-				const gchar* _tmp12_ = NULL;
-				gchar* _tmp13_;
-				gchar* _tmp14_;
-				gchar* _tmp15_;
-				gchar* _tmp16_;
-				gchar* _tmp17_;
-				gchar* _tmp18_;
-				_tmp11_ = gtk_widget_get_tooltip_markup ((GtkWidget*) self->priv->_label);
-				_tmp12_ = _ ("Main File");
-				_tmp13_ = g_strconcat ("\n<b>", _tmp12_, NULL);
-				_tmp14_ = _tmp13_;
-				_tmp15_ = g_strconcat (_tmp14_, "</b>", NULL);
-				_tmp16_ = _tmp15_;
-				_tmp17_ = g_strconcat (_tmp11_, _tmp16_, NULL);
-				_tmp18_ = _tmp17_;
-				gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp18_);
-				_g_free0 (_tmp18_);
-				_g_free0 (_tmp16_);
-				_g_free0 (_tmp14_);
-			} else {
-				const gchar* _tmp19_ = NULL;
-				const gchar* _tmp20_ = NULL;
-				gchar* _tmp21_;
-				gchar* _tmp22_;
-				gchar* _tmp23_;
-				gchar* _tmp24_;
-				gchar* _tmp25_ = NULL;
-				gchar* _tmp26_;
-				gchar* _tmp27_ = NULL;
-				gchar* _tmp28_;
-				gchar* _tmp29_;
-				gchar* _tmp30_;
-				gchar* _tmp31_;
-				gchar* _tmp32_;
-				_tmp19_ = gtk_widget_get_tooltip_markup ((GtkWidget*) self->priv->_label);
-				_tmp20_ = _ ("Main File:");
-				_tmp21_ = g_strconcat ("\n<b>", _tmp20_, NULL);
-				_tmp22_ = _tmp21_;
-				_tmp23_ = g_strconcat (_tmp22_, "</b> ", NULL);
-				_tmp24_ = _tmp23_;
-				_tmp25_ = g_file_get_parse_name ((*project).main_file);
-				_tmp26_ = _tmp25_;
-				_tmp27_ = utils_replace_home_dir_with_tilde (_tmp26_);
-				_tmp28_ = _tmp27_;
-				_tmp29_ = g_strconcat (_tmp24_, _tmp28_, NULL);
-				_tmp30_ = _tmp29_;
-				_tmp31_ = g_strconcat (_tmp19_, _tmp30_, NULL);
-				_tmp32_ = _tmp31_;
-				gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp32_);
-				_g_free0 (_tmp32_);
-				_g_free0 (_tmp30_);
-				_g_free0 (_tmp28_);
-				_g_free0 (_tmp26_);
-				_g_free0 (_tmp24_);
-				_g_free0 (_tmp22_);
-			}
-			_project_free0 (project);
-		}
+		const gchar* _tmp14_ = NULL;
+		const gchar* _tmp15_ = NULL;
+		gchar* _tmp16_;
+		gchar* _tmp17_;
+		gchar* _tmp18_;
+		gchar* _tmp19_;
+		gchar* _tmp20_ = NULL;
+		gchar* _tmp21_;
+		gchar* _tmp22_;
+		gchar* _tmp23_;
+		gchar* _tmp24_;
+		gchar* _tmp25_;
+		_tmp14_ = gtk_widget_get_tooltip_markup ((GtkWidget*) self->priv->_label);
+		_tmp15_ = _ ("Main File:");
+		_tmp16_ = g_strconcat ("\n<b>", _tmp15_, NULL);
+		_tmp17_ = _tmp16_;
+		_tmp18_ = g_strconcat (_tmp17_, "</b> ", NULL);
+		_tmp19_ = _tmp18_;
+		_tmp20_ = document_tab_get_main_file_relative_path (self);
+		_tmp21_ = _tmp20_;
+		_tmp22_ = g_strconcat (_tmp19_, _tmp21_, NULL);
+		_tmp23_ = _tmp22_;
+		_tmp24_ = g_strconcat (_tmp14_, _tmp23_, NULL);
+		_tmp25_ = _tmp24_;
+		gtk_widget_set_tooltip_markup ((GtkWidget*) self->priv->_label, _tmp25_);
+		_g_free0 (_tmp25_);
+		_g_free0 (_tmp23_);
+		_g_free0 (_tmp21_);
+		_g_free0 (_tmp19_);
+		_g_free0 (_tmp17_);
 	}
+	_project_free0 (project);
+}
+
+
+static gchar* document_tab_get_main_file_relative_path (DocumentTab* self) {
+	gchar* result = NULL;
+	Project* _tmp0_ = NULL;
+	Project* project;
+	GFile* _tmp1_ = NULL;
+	GFile* _tmp2_;
+	GFile* origin;
+	GFile* _tmp3_;
+	GFile* target;
+	GFile* _tmp4_;
+	GFile* common_dir;
+	gchar* _tmp5_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = document_get_project (self->priv->_document);
+	project = _tmp0_;
+	if (project == NULL) {
+		result = NULL;
+		_project_free0 (project);
+		return result;
+	}
+	_tmp1_ = document_get_location (self->priv->_document);
+	_tmp2_ = _g_object_ref0 (_tmp1_);
+	origin = _tmp2_;
+	_tmp3_ = _g_object_ref0 ((*project).main_file);
+	target = _tmp3_;
+	_tmp4_ = _g_object_ref0 ((*project).directory);
+	common_dir = _tmp4_;
+	_tmp5_ = utils_get_relative_path (origin, target, common_dir);
+	result = _tmp5_;
+	_g_object_unref0 (common_dir);
+	_g_object_unref0 (target);
+	_g_object_unref0 (origin);
+	_project_free0 (project);
+	return result;
 }
 
 
@@ -599,37 +599,37 @@ gchar* document_tab_get_menu_tip (DocumentTab* self) {
 }
 
 
-static Block23Data* block23_data_ref (Block23Data* _data23_) {
-	g_atomic_int_inc (&_data23_->_ref_count_);
-	return _data23_;
+static Block21Data* block21_data_ref (Block21Data* _data21_) {
+	g_atomic_int_inc (&_data21_->_ref_count_);
+	return _data21_;
 }
 
 
-static void block23_data_unref (Block23Data* _data23_) {
-	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
-		_g_object_unref0 (_data23_->self);
-		_g_object_unref0 (_data23_->infobar);
-		g_slice_free (Block23Data, _data23_);
+static void block21_data_unref (Block21Data* _data21_) {
+	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
+		_g_object_unref0 (_data21_->self);
+		_g_object_unref0 (_data21_->infobar);
+		g_slice_free (Block21Data, _data21_);
 	}
 }
 
 
-static void _lambda23_ (gint response_id, Block23Data* _data23_) {
+static void _lambda28_ (gint response_id, Block21Data* _data21_) {
 	DocumentTab * self;
-	self = _data23_->self;
+	self = _data21_->self;
 	if (response_id == GTK_RESPONSE_OK) {
 		GFile* _tmp0_ = NULL;
 		_tmp0_ = document_get_location (self->priv->_document);
 		document_load (self->priv->_document, _tmp0_);
 		self->priv->ask_if_externally_modified = FALSE;
 	}
-	gtk_object_destroy ((GtkObject*) _data23_->infobar);
+	gtk_object_destroy ((GtkObject*) _data21_->infobar);
 	gtk_widget_grab_focus ((GtkWidget*) self->priv->_view);
 }
 
 
-static void __lambda23__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
-	_lambda23_ (response_id, self);
+static void __lambda28__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
+	_lambda28_ (response_id, self);
 }
 
 
@@ -649,7 +649,7 @@ static gboolean document_tab_view_focused_in (DocumentTab* self) {
 	}
 	_tmp1_ = document_is_externally_modified (self->priv->_document);
 	if (_tmp1_) {
-		Block23Data* _data23_;
+		Block21Data* _data21_;
 		const gchar* _tmp2_ = NULL;
 		GFile* _tmp3_ = NULL;
 		gchar* _tmp4_ = NULL;
@@ -661,9 +661,9 @@ static gboolean document_tab_view_focused_in (DocumentTab* self) {
 		gboolean _tmp8_;
 		TabInfoBar* _tmp13_ = NULL;
 		const gchar* _tmp14_ = NULL;
-		_data23_ = g_slice_new0 (Block23Data);
-		_data23_->_ref_count_ = 1;
-		_data23_->self = g_object_ref (self);
+		_data21_ = g_slice_new0 (Block21Data);
+		_data21_->_ref_count_ = 1;
+		_data21_->self = g_object_ref (self);
 		self->priv->ask_if_externally_modified = TRUE;
 		_tmp2_ = _ ("The file %s changed on disk.");
 		_tmp3_ = document_get_location (self->priv->_document);
@@ -690,15 +690,15 @@ static gboolean document_tab_view_focused_in (DocumentTab* self) {
 			secondary_msg = _tmp12_;
 		}
 		_tmp13_ = document_tab_add_message (self, primary_msg, secondary_msg, GTK_MESSAGE_WARNING);
-		_data23_->infobar = _tmp13_;
+		_data21_->infobar = _tmp13_;
 		_tmp14_ = _ ("Reload");
-		tab_info_bar_add_stock_button_with_text (_data23_->infobar, _tmp14_, GTK_STOCK_REFRESH, (gint) GTK_RESPONSE_OK);
-		gtk_info_bar_add_button ((GtkInfoBar*) _data23_->infobar, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
-		g_signal_connect_data ((GtkInfoBar*) _data23_->infobar, "response", (GCallback) __lambda23__gtk_info_bar_response, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
+		tab_info_bar_add_stock_button_with_text (_data21_->infobar, _tmp14_, GTK_STOCK_REFRESH, (gint) GTK_RESPONSE_OK);
+		gtk_info_bar_add_button ((GtkInfoBar*) _data21_->infobar, GTK_STOCK_CANCEL, (gint) GTK_RESPONSE_CANCEL);
+		g_signal_connect_data ((GtkInfoBar*) _data21_->infobar, "response", (GCallback) __lambda28__gtk_info_bar_response, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
 		_g_free0 (secondary_msg);
 		_g_free0 (primary_msg);
-		block23_data_unref (_data23_);
-		_data23_ = NULL;
+		block21_data_unref (_data21_);
+		_data21_ = NULL;
 	}
 	result = FALSE;
 	return result;
diff --git a/src/C/document_view.c b/src/C/document_view.c
index 6121639..0bb079f 100644
--- a/src/C/document_view.c
+++ b/src/C/document_view.c
@@ -1,4 +1,4 @@
-/* document_view.c generated by valac 0.12.0, the Vala compiler
+/* document_view.c generated by valac 0.12.1, the Vala compiler
  * generated from document_view.vala, do not modify */
 
 /*
@@ -67,6 +67,7 @@ typedef struct _DocumentClass DocumentClass;
 
 typedef struct _CompletionProvider CompletionProvider;
 typedef struct _CompletionProviderClass CompletionProviderClass;
+typedef struct _Block18Data Block18Data;
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
 #define TYPE_APP_SETTINGS (app_settings_get_type ())
@@ -93,6 +94,12 @@ struct _DocumentViewPrivate {
 	PangoFontDescription* font_desc;
 };
 
+struct _Block18Data {
+	int _ref_count_;
+	DocumentView * self;
+	CompletionProvider* provider;
+};
+
 
 static gpointer document_view_parent_class = NULL;
 
@@ -105,13 +112,18 @@ enum  {
 GType document_get_type (void) G_GNUC_CONST;
 DocumentView* document_view_new (Document* doc);
 DocumentView* document_view_construct (GType object_type, Document* doc);
-static void _lambda20_ (GObject* d, GParamSpec* p, DocumentView* self);
+static void _lambda24_ (GObject* d, GParamSpec* p, DocumentView* self);
 gboolean document_get_readonly (Document* self);
-static void __lambda20__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void __lambda24__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 void document_view_set_font_from_settings (DocumentView* self);
 void document_set_style_scheme_from_string (Document* self, const gchar* scheme_id);
 GType completion_provider_get_type (void) G_GNUC_CONST;
+static Block18Data* block18_data_ref (Block18Data* _data18_);
+static void block18_data_unref (Block18Data* _data18_);
 CompletionProvider* completion_provider_get_default (void);
+static void _lambda25_ (Block18Data* _data18_);
+void completion_provider_hide_calltip_window (CompletionProvider* self);
+static void __lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static gboolean document_view_on_backspace (DocumentView* self, GdkEventKey* event);
 static gboolean _document_view_on_backspace_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
 void document_view_scroll_to_cursor (DocumentView* self, gdouble margin);
@@ -131,7 +143,7 @@ gchar* document_view_get_indentation_style (DocumentView* self);
 static void document_view_finalize (GObject* obj);
 
 
-static void _lambda20_ (GObject* d, GParamSpec* p, DocumentView* self) {
+static void _lambda24_ (GObject* d, GParamSpec* p, DocumentView* self) {
 	gboolean _tmp0_;
 	g_return_if_fail (d != NULL);
 	g_return_if_fail (p != NULL);
@@ -140,8 +152,35 @@ static void _lambda20_ (GObject* d, GParamSpec* p, DocumentView* self) {
 }
 
 
-static void __lambda20__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda20_ (_sender, pspec, self);
+static void __lambda24__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda24_ (_sender, pspec, self);
+}
+
+
+static Block18Data* block18_data_ref (Block18Data* _data18_) {
+	g_atomic_int_inc (&_data18_->_ref_count_);
+	return _data18_;
+}
+
+
+static void block18_data_unref (Block18Data* _data18_) {
+	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
+		_g_object_unref0 (_data18_->self);
+		_g_object_unref0 (_data18_->provider);
+		g_slice_free (Block18Data, _data18_);
+	}
+}
+
+
+static void _lambda25_ (Block18Data* _data18_) {
+	DocumentView * self;
+	self = _data18_->self;
+	completion_provider_hide_calltip_window (_data18_->provider);
+}
+
+
+static void __lambda25__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda25_ (self);
 }
 
 
@@ -162,15 +201,16 @@ DocumentView* document_view_construct (GType object_type, Document* doc) {
 	gboolean _tmp4_;
 	gchar* _tmp5_ = NULL;
 	gchar* _tmp6_;
+	Block18Data* _data18_;
 	CompletionProvider* _tmp7_ = NULL;
-	CompletionProvider* provider;
 	GtkSourceCompletion* _tmp8_ = NULL;
 	GtkSourceCompletion* _tmp9_ = NULL;
+	GtkTextBuffer* _tmp10_ = NULL;
 	GError * _inner_error_ = NULL;
 	g_return_val_if_fail (doc != NULL, NULL);
 	self = (DocumentView*) g_object_new (object_type, NULL);
 	gtk_text_view_set_buffer ((GtkTextView*) self, (GtkTextBuffer*) doc);
-	g_signal_connect_object ((GObject*) doc, "notify::readonly", (GCallback) __lambda20__g_object_notify, self, 0);
+	g_signal_connect_object ((GObject*) doc, "notify::readonly", (GCallback) __lambda24__g_object_notify, self, 0);
 	gtk_text_view_set_wrap_mode ((GtkTextView*) self, GTK_WRAP_WORD);
 	gtk_source_view_set_auto_indent ((GtkSourceView*) self, TRUE);
 	gtk_source_view_set_indent_width ((GtkSourceView*) self, -1);
@@ -192,19 +232,27 @@ DocumentView* document_view_construct (GType object_type, Document* doc) {
 	_tmp6_ = _tmp5_;
 	document_set_style_scheme_from_string (doc, _tmp6_);
 	_g_free0 (_tmp6_);
+	gtk_source_view_set_smart_home_end ((GtkSourceView*) self, GTK_SOURCE_SMART_HOME_END_AFTER);
+	_data18_ = g_slice_new0 (Block18Data);
+	_data18_->_ref_count_ = 1;
+	_data18_->self = g_object_ref (self);
 	_tmp7_ = completion_provider_get_default ();
-	provider = _tmp7_;
+	_data18_->provider = _tmp7_;
 	_tmp8_ = gtk_source_view_get_completion ((GtkSourceView*) self);
-	gtk_source_completion_add_provider (_tmp8_, (GtkSourceCompletionProvider*) provider, &_inner_error_);
+	gtk_source_completion_add_provider (_tmp8_, (GtkSourceCompletionProvider*) _data18_->provider, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		_g_object_unref0 (provider);
-		goto __catch44_g_error;
+		block18_data_unref (_data18_);
+		_data18_ = NULL;
+		goto __catch46_g_error;
 	}
 	_tmp9_ = gtk_source_view_get_completion ((GtkSourceView*) self);
 	g_object_set (_tmp9_, "remember-info-visibility", TRUE, NULL);
-	_g_object_unref0 (provider);
-	goto __finally44;
-	__catch44_g_error:
+	_tmp10_ = gtk_text_view_get_buffer ((GtkTextView*) self);
+	g_signal_connect_data ((GObject*) _tmp10_, "notify::cursor-position", (GCallback) __lambda25__g_object_notify, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
+	block18_data_unref (_data18_);
+	_data18_ = NULL;
+	goto __finally46;
+	__catch46_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -212,7 +260,7 @@ DocumentView* document_view_construct (GType object_type, Document* doc) {
 		fprintf (stderr, "Error completion: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally44:
+	__finally46:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
diff --git a/src/C/documents_panel.c b/src/C/documents_panel.c
index 6080a39..3c941e7 100644
--- a/src/C/documents_panel.c
+++ b/src/C/documents_panel.c
@@ -1,10 +1,10 @@
-/* documents_panel.c generated by valac 0.12.0, the Vala compiler
+/* documents_panel.c generated by valac 0.12.1, the Vala compiler
  * generated from documents_panel.vala, do not modify */
 
 /*
  * This file is part of LaTeXila.
  *
- * Copyright  2010 SÃbastien Wilmet
+ * Copyright  2010-2011 SÃbastien Wilmet
  *
  * LaTeXila is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@ typedef struct _DocumentTabClass DocumentTabClass;
 typedef struct _MainWindow MainWindow;
 typedef struct _MainWindowClass MainWindowClass;
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-typedef struct _Block6Data Block6Data;
+typedef struct _Block7Data Block7Data;
 
 #define TYPE_DOCUMENT (document_get_type ())
 #define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
@@ -71,6 +71,16 @@ typedef struct _Block6Data Block6Data;
 typedef struct _Document Document;
 typedef struct _DocumentClass DocumentClass;
 
+#define TYPE_CLEAN_BUILD_FILES (clean_build_files_get_type ())
+#define CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFiles))
+#define CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+#define IS_CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLEAN_BUILD_FILES))
+#define IS_CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLEAN_BUILD_FILES))
+#define CLEAN_BUILD_FILES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+
+typedef struct _CleanBuildFiles CleanBuildFiles;
+typedef struct _CleanBuildFilesClass CleanBuildFilesClass;
+
 struct _DocumentsPanel {
 	GtkNotebook parent_instance;
 	DocumentsPanelPrivate * priv;
@@ -85,7 +95,7 @@ struct _DocumentsPanelPrivate {
 	MainWindow* main_window;
 };
 
-struct _Block6Data {
+struct _Block7Data {
 	int _ref_count_;
 	DocumentsPanel * self;
 	DocumentTab* tab;
@@ -104,19 +114,22 @@ enum  {
 };
 DocumentsPanel* documents_panel_new (MainWindow* main_window);
 DocumentsPanel* documents_panel_construct (GType object_type, MainWindow* main_window);
-static void _lambda26_ (GtkNotebookPage* page, guint page_num, DocumentsPanel* self);
+static void _lambda31_ (GtkNotebookPage* page, guint page_num, DocumentsPanel* self);
 static void documents_panel_set_active_tab (DocumentsPanel* self, DocumentTab* value);
-static void __lambda26__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self);
+static void __lambda31__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self);
 void documents_panel_add_tab (DocumentsPanel* self, DocumentTab* tab, gint position, gboolean jump_to);
-static Block6Data* block6_data_ref (Block6Data* _data6_);
-static void block6_data_unref (Block6Data* _data6_);
+static Block7Data* block7_data_ref (Block7Data* _data7_);
+static void block7_data_unref (Block7Data* _data7_);
 GtkHBox* document_tab_get_label (DocumentTab* self);
-static gboolean _lambda27_ (GdkEventButton* event, Block6Data* _data6_);
-static gboolean __lambda27__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
+static gboolean _lambda32_ (GdkEventButton* event, Block7Data* _data7_);
+static gboolean __lambda32__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
 void documents_panel_remove_tab (DocumentsPanel* self, DocumentTab* tab);
 GType document_get_type (void) G_GNUC_CONST;
 Document* document_tab_get_document (DocumentTab* self);
-gboolean document_clean_build_files (Document* self, MainWindow* window);
+CleanBuildFiles* clean_build_files_new (MainWindow* main_window, Document* doc);
+CleanBuildFiles* clean_build_files_construct (GType object_type, MainWindow* main_window, Document* doc);
+GType clean_build_files_get_type (void) G_GNUC_CONST;
+gboolean clean_build_files_clean (CleanBuildFiles* self);
 void documents_panel_remove_all_tabs (DocumentsPanel* self);
 DocumentTab* documents_panel_get_active_tab (DocumentsPanel* self);
 static void documents_panel_finalize (GObject* obj);
@@ -124,7 +137,7 @@ static void _vala_documents_panel_get_property (GObject * object, guint property
 static void _vala_documents_panel_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
 
 
-static void _lambda26_ (GtkNotebookPage* page, guint page_num, DocumentsPanel* self) {
+static void _lambda31_ (GtkNotebookPage* page, guint page_num, DocumentsPanel* self) {
 	GtkWidget* _tmp0_ = NULL;
 	g_return_if_fail (page != NULL);
 	_tmp0_ = gtk_notebook_get_nth_page ((GtkNotebook*) self, (gint) page_num);
@@ -132,8 +145,8 @@ static void _lambda26_ (GtkNotebookPage* page, guint page_num, DocumentsPanel* s
 }
 
 
-static void __lambda26__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self) {
-	_lambda26_ (page, page_num, self);
+static void __lambda31__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self) {
+	_lambda31_ (page, page_num, self);
 }
 
 
@@ -143,7 +156,7 @@ DocumentsPanel* documents_panel_construct (GType object_type, MainWindow* main_w
 	self = (DocumentsPanel*) g_object_new (object_type, NULL);
 	self->priv->main_window = main_window;
 	gtk_notebook_set_scrollable ((GtkNotebook*) self, TRUE);
-	g_signal_connect_object ((GtkNotebook*) self, "switch-page", (GCallback) __lambda26__gtk_notebook_switch_page, self, 0);
+	g_signal_connect_object ((GtkNotebook*) self, "switch-page", (GCallback) __lambda31__gtk_notebook_switch_page, self, 0);
 	return self;
 }
 
@@ -158,28 +171,28 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static Block6Data* block6_data_ref (Block6Data* _data6_) {
-	g_atomic_int_inc (&_data6_->_ref_count_);
-	return _data6_;
+static Block7Data* block7_data_ref (Block7Data* _data7_) {
+	g_atomic_int_inc (&_data7_->_ref_count_);
+	return _data7_;
 }
 
 
-static void block6_data_unref (Block6Data* _data6_) {
-	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
-		_g_object_unref0 (_data6_->self);
-		_g_object_unref0 (_data6_->tab);
-		g_slice_free (Block6Data, _data6_);
+static void block7_data_unref (Block7Data* _data7_) {
+	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
+		_g_object_unref0 (_data7_->self);
+		_g_object_unref0 (_data7_->tab);
+		g_slice_free (Block7Data, _data7_);
 	}
 }
 
 
-static gboolean _lambda27_ (GdkEventButton* event, Block6Data* _data6_) {
+static gboolean _lambda32_ (GdkEventButton* event, Block7Data* _data7_) {
 	DocumentsPanel * self;
 	gboolean result = FALSE;
-	self = _data6_->self;
+	self = _data7_->self;
 	if ((*event).button == 3) {
 		gint _tmp0_;
-		_tmp0_ = gtk_notebook_page_num ((GtkNotebook*) self, (GtkWidget*) _data6_->tab);
+		_tmp0_ = gtk_notebook_page_num ((GtkNotebook*) self, (GtkWidget*) _data7_->tab);
 		gtk_notebook_set_current_page ((GtkNotebook*) self, _tmp0_);
 		g_signal_emit_by_name (self, "right-click", event);
 	}
@@ -188,40 +201,40 @@ static gboolean _lambda27_ (GdkEventButton* event, Block6Data* _data6_) {
 }
 
 
-static gboolean __lambda27__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
+static gboolean __lambda32__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
 	gboolean result;
-	result = _lambda27_ (event, self);
+	result = _lambda32_ (event, self);
 	return result;
 }
 
 
 void documents_panel_add_tab (DocumentsPanel* self, DocumentTab* tab, gint position, gboolean jump_to) {
-	Block6Data* _data6_;
+	Block7Data* _data7_;
 	GtkEventBox* _tmp0_ = NULL;
 	GtkEventBox* event_box;
 	GtkHBox* _tmp1_ = NULL;
 	gint _tmp2_;
-	gint i;
+	gint page_pos;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (tab != NULL);
-	_data6_ = g_slice_new0 (Block6Data);
-	_data6_->_ref_count_ = 1;
-	_data6_->self = g_object_ref (self);
-	_data6_->tab = _g_object_ref0 (tab);
+	_data7_ = g_slice_new0 (Block7Data);
+	_data7_->_ref_count_ = 1;
+	_data7_->self = g_object_ref (self);
+	_data7_->tab = _g_object_ref0 (tab);
 	_tmp0_ = (GtkEventBox*) gtk_event_box_new ();
 	event_box = g_object_ref_sink (_tmp0_);
-	_tmp1_ = document_tab_get_label (_data6_->tab);
+	_tmp1_ = document_tab_get_label (_data7_->tab);
 	gtk_container_add ((GtkContainer*) event_box, (GtkWidget*) _tmp1_);
-	g_signal_connect_data ((GtkWidget*) event_box, "button-press-event", (GCallback) __lambda27__gtk_widget_button_press_event, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
-	_tmp2_ = gtk_notebook_insert_page ((GtkNotebook*) self, (GtkWidget*) _data6_->tab, (GtkWidget*) event_box, position);
-	i = _tmp2_;
-	gtk_notebook_set_tab_reorderable ((GtkNotebook*) self, (GtkWidget*) _data6_->tab, TRUE);
+	g_signal_connect_data ((GtkWidget*) event_box, "button-press-event", (GCallback) __lambda32__gtk_widget_button_press_event, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
+	_tmp2_ = gtk_notebook_insert_page ((GtkNotebook*) self, (GtkWidget*) _data7_->tab, (GtkWidget*) event_box, position);
+	page_pos = _tmp2_;
+	gtk_notebook_set_tab_reorderable ((GtkNotebook*) self, (GtkWidget*) _data7_->tab, TRUE);
 	if (jump_to) {
-		gtk_notebook_set_current_page ((GtkNotebook*) self, i);
+		gtk_notebook_set_current_page ((GtkNotebook*) self, page_pos);
 	}
 	_g_object_unref0 (event_box);
-	block6_data_unref (_data6_);
-	_data6_ = NULL;
+	block7_data_unref (_data7_);
+	_data7_ = NULL;
 }
 
 
@@ -230,7 +243,7 @@ void documents_panel_remove_tab (DocumentsPanel* self, DocumentTab* tab) {
 	GSettings* settings;
 	gboolean _tmp1_ = FALSE;
 	gboolean _tmp2_;
-	gint _tmp5_;
+	gint _tmp6_;
 	gint pos;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (tab != NULL);
@@ -246,11 +259,16 @@ void documents_panel_remove_tab (DocumentsPanel* self, DocumentTab* tab) {
 	}
 	if (_tmp1_) {
 		Document* _tmp4_ = NULL;
+		CleanBuildFiles* _tmp5_ = NULL;
+		CleanBuildFiles* build_files;
 		_tmp4_ = document_tab_get_document (tab);
-		document_clean_build_files (_tmp4_, self->priv->main_window);
+		_tmp5_ = clean_build_files_new (self->priv->main_window, _tmp4_);
+		build_files = _tmp5_;
+		clean_build_files_clean (build_files);
+		_g_object_unref0 (build_files);
 	}
-	_tmp5_ = gtk_notebook_page_num ((GtkNotebook*) self, (GtkWidget*) tab);
-	pos = _tmp5_;
+	_tmp6_ = gtk_notebook_page_num ((GtkNotebook*) self, (GtkWidget*) tab);
+	pos = _tmp6_;
 	gtk_notebook_remove_page ((GtkNotebook*) self, pos);
 	_g_object_unref0 (settings);
 }
diff --git a/src/C/encodings.c b/src/C/encodings.c
index 765c3f4..e12aa48 100644
--- a/src/C/encodings.c
+++ b/src/C/encodings.c
@@ -1,4 +1,4 @@
-/* encodings.c generated by valac 0.12.0, the Vala compiler
+/* encodings.c generated by valac 0.12.1, the Vala compiler
  * generated from encodings.vala, do not modify */
 
 /*
diff --git a/src/C/file_browser.c b/src/C/file_browser.c
index 2a19049..0fdcbeb 100644
--- a/src/C/file_browser.c
+++ b/src/C/file_browser.c
@@ -1,4 +1,4 @@
-/* file_browser.c generated by valac 0.12.0, the Vala compiler
+/* file_browser.c generated by valac 0.12.1, the Vala compiler
  * generated from file_browser.vala, do not modify */
 
 /*
@@ -67,7 +67,7 @@ typedef struct _BuildViewClass BuildViewClass;
 
 #define FILE_BROWSER_TYPE_FILE_COLUMN (file_browser_file_column_get_type ())
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
-typedef struct _Block16Data Block16Data;
+typedef struct _Block14Data Block14Data;
 
 #define TYPE_DOCUMENT_TAB (document_tab_get_type ())
 #define DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_TAB, DocumentTab))
@@ -121,6 +121,10 @@ typedef struct _BuildToolRunner BuildToolRunner;
 typedef struct _BuildToolRunnerClass BuildToolRunnerClass;
 #define _build_tool_free0(var) ((var == NULL) ? NULL : (var = (build_tool_free (var), NULL)))
 #define _build_tools_unref0(var) ((var == NULL) ? NULL : (var = (build_tools_unref (var), NULL)))
+
+#define TYPE_PROJECT (project_get_type ())
+typedef struct _Project Project;
+#define _project_free0(var) ((var == NULL) ? NULL : (var = (project_free (var), NULL)))
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
 
@@ -138,6 +142,7 @@ struct _FileBrowserPrivate {
 	BuildView* build_view;
 	GtkListStore* parent_dir_store;
 	GtkListStore* list_store;
+	GtkTreeView* _list_view;
 	GtkComboBox* combo_box;
 	GFile* current_directory;
 	GtkButton* parent_button;
@@ -161,7 +166,7 @@ typedef enum  {
 	FILE_BROWSER_FILE_COLUMN_N_COLUMNS
 } FileBrowserFileColumn;
 
-struct _Block16Data {
+struct _Block14Data {
 	int _ref_count_;
 	FileBrowser * self;
 	GtkButton* jump_button;
@@ -201,6 +206,11 @@ struct _BuildTool {
 	GList* jobs;
 };
 
+struct _Project {
+	GFile* directory;
+	GFile* main_file;
+};
+
 
 static gpointer file_browser_parent_class = NULL;
 
@@ -225,31 +235,34 @@ void file_browser_refresh (FileBrowser* self);
 static void _file_browser_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
 static void file_browser_on_refresh (FileBrowser* self);
 static void _file_browser_on_refresh_g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static gboolean _lambda59_ (FileBrowser* self);
-static gboolean __lambda59__gsource_func (gpointer self);
-static Block16Data* block16_data_ref (Block16Data* _data16_);
-static void block16_data_unref (Block16Data* _data16_);
+static gboolean _lambda67_ (FileBrowser* self);
+static gboolean __lambda67__gsource_func (gpointer self);
+static Block14Data* block14_data_ref (Block14Data* _data14_);
+static void block14_data_unref (Block14Data* _data14_);
 GtkButton* utils_get_toolbar_button (const gchar* stock_id);
-static void _lambda53_ (FileBrowser* self);
-static void __lambda53__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda54_ (FileBrowser* self);
-static void __lambda54__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda55_ (FileBrowser* self);
+static void _lambda60_ (FileBrowser* self);
+static void __lambda60__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda61_ (FileBrowser* self);
+static void __lambda61__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda62_ (FileBrowser* self);
 GType document_tab_get_type (void) G_GNUC_CONST;
 DocumentTab* main_window_get_active_tab (MainWindow* self);
 GType document_get_type (void) G_GNUC_CONST;
 Document* main_window_get_active_document (MainWindow* self);
 GFile* document_get_location (Document* self);
-static void __lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda56_ (Block16Data* _data16_);
-static void __lambda56__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void __lambda62__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda63_ (Block14Data* _data14_);
+static void file_browser_update_jump_button_sensitivity (FileBrowser* self, GtkButton* jump_button);
+static void _lambda64_ (Block14Data* _data14_);
+static void __lambda64__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void __lambda63__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static void _file_browser_refresh_gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda57_ (FileBrowser* self);
-static void __lambda57__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
+static void _lambda65_ (FileBrowser* self);
+static void __lambda65__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
 static gint file_browser_on_sort (FileBrowser* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b);
 static gint _file_browser_on_sort_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
-static void _lambda58_ (GtkTreePath* path, FileBrowser* self);
+static void _lambda66_ (GtkTreePath* path, FileBrowser* self);
 gpointer build_tools_ref (gpointer instance);
 void build_tools_unref (gpointer instance);
 GParamSpec* param_spec_build_tools (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -277,8 +290,14 @@ BuildToolRunner* build_tool_runner_new (GFile* file, BuildTool* tool, BuildView*
 BuildToolRunner* build_tool_runner_construct (GType object_type, GFile* file, BuildTool* tool, BuildView* view, GtkAction* action_stop_exec);
 GType build_tool_runner_get_type (void) G_GNUC_CONST;
 DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gboolean jump_to);
-static void __lambda58__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
-void file_browser_refresh_if_in_dir (FileBrowser* self, GFile* dir);
+static void __lambda66__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
+void file_browser_refresh_for_document (FileBrowser* self, Document* doc);
+GType project_get_type (void) G_GNUC_CONST;
+Project* project_dup (const Project* self);
+void project_free (Project* self);
+void project_copy (const Project* self, Project* dest);
+void project_destroy (Project* self);
+Project* document_get_project (Document* self);
 static void file_browser_insert_file (FileBrowser* self, gboolean is_dir, const gchar* pixbuf, const gchar* basename);
 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
 static void _g_object_unref0_ (gpointer var);
@@ -365,7 +384,7 @@ static void file_browser_init_settings (FileBrowser* self) {
 }
 
 
-static gboolean _lambda59_ (FileBrowser* self) {
+static gboolean _lambda67_ (FileBrowser* self) {
 	gboolean result = FALSE;
 	self->priv->timeout_id = (guint) 0;
 	file_browser_refresh (self);
@@ -374,9 +393,9 @@ static gboolean _lambda59_ (FileBrowser* self) {
 }
 
 
-static gboolean __lambda59__gsource_func (gpointer self) {
+static gboolean __lambda67__gsource_func (gpointer self) {
 	gboolean result;
-	result = _lambda59_ (self);
+	result = _lambda67_ (self);
 	return result;
 }
 
@@ -387,27 +406,27 @@ static void file_browser_on_refresh (FileBrowser* self) {
 	if (self->priv->timeout_id != 0) {
 		g_source_remove (self->priv->timeout_id);
 	}
-	_tmp0_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 2, __lambda59__gsource_func, g_object_ref (self), g_object_unref);
+	_tmp0_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 2, __lambda67__gsource_func, g_object_ref (self), g_object_unref);
 	self->priv->timeout_id = _tmp0_;
 }
 
 
-static Block16Data* block16_data_ref (Block16Data* _data16_) {
-	g_atomic_int_inc (&_data16_->_ref_count_);
-	return _data16_;
+static Block14Data* block14_data_ref (Block14Data* _data14_) {
+	g_atomic_int_inc (&_data14_->_ref_count_);
+	return _data14_;
 }
 
 
-static void block16_data_unref (Block16Data* _data16_) {
-	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
-		_g_object_unref0 (_data16_->self);
-		_g_object_unref0 (_data16_->jump_button);
-		g_slice_free (Block16Data, _data16_);
+static void block14_data_unref (Block14Data* _data14_) {
+	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
+		_g_object_unref0 (_data14_->self);
+		_g_object_unref0 (_data14_->jump_button);
+		g_slice_free (Block14Data, _data14_);
 	}
 }
 
 
-static void _lambda53_ (FileBrowser* self) {
+static void _lambda60_ (FileBrowser* self) {
 	const gchar* _tmp0_ = NULL;
 	GFile* _tmp1_ = NULL;
 	GFile* home_dir;
@@ -419,12 +438,12 @@ static void _lambda53_ (FileBrowser* self) {
 }
 
 
-static void __lambda53__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda53_ (self);
+static void __lambda60__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda60_ (self);
 }
 
 
-static void _lambda54_ (FileBrowser* self) {
+static void _lambda61_ (FileBrowser* self) {
 	GFile* _tmp0_ = NULL;
 	GFile* parent;
 	_tmp0_ = g_file_get_parent (self->priv->current_directory);
@@ -435,12 +454,12 @@ static void _lambda54_ (FileBrowser* self) {
 }
 
 
-static void __lambda54__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda54_ (self);
+static void __lambda61__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda61_ (self);
 }
 
 
-static void _lambda55_ (FileBrowser* self) {
+static void _lambda62_ (FileBrowser* self) {
 	gboolean _tmp0_ = FALSE;
 	DocumentTab* _tmp1_ = NULL;
 	Document* _tmp4_ = NULL;
@@ -469,36 +488,39 @@ static void _lambda55_ (FileBrowser* self) {
 }
 
 
-static void __lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda55_ (self);
+static void __lambda62__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda62_ (self);
 }
 
 
-static void _lambda56_ (Block16Data* _data16_) {
+static void _lambda64_ (Block14Data* _data14_) {
 	FileBrowser * self;
-	gboolean _tmp0_ = FALSE;
-	DocumentTab* _tmp1_ = NULL;
-	self = _data16_->self;
-	_tmp1_ = main_window_get_active_tab (self->priv->main_window);
-	if (_tmp1_ == NULL) {
-		_tmp0_ = TRUE;
-	} else {
-		Document* _tmp2_ = NULL;
-		GFile* _tmp3_ = NULL;
-		_tmp2_ = main_window_get_active_document (self->priv->main_window);
-		_tmp3_ = document_get_location (_tmp2_);
-		_tmp0_ = _tmp3_ == NULL;
-	}
-	if (_tmp0_) {
-		gtk_widget_set_sensitive ((GtkWidget*) _data16_->jump_button, FALSE);
-	} else {
-		gtk_widget_set_sensitive ((GtkWidget*) _data16_->jump_button, TRUE);
+	self = _data14_->self;
+	file_browser_update_jump_button_sensitivity (self, _data14_->jump_button);
+}
+
+
+static void __lambda64__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda64_ (self);
+}
+
+
+static void _lambda63_ (Block14Data* _data14_) {
+	FileBrowser * self;
+	Document* _tmp0_ = NULL;
+	self = _data14_->self;
+	file_browser_update_jump_button_sensitivity (self, _data14_->jump_button);
+	_tmp0_ = main_window_get_active_document (self->priv->main_window);
+	if (_tmp0_ != NULL) {
+		Document* _tmp1_ = NULL;
+		_tmp1_ = main_window_get_active_document (self->priv->main_window);
+		g_signal_connect_data ((GObject*) _tmp1_, "notify::location", (GCallback) __lambda64__g_object_notify, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
 	}
 }
 
 
-static void __lambda56__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda56_ (self);
+static void __lambda63__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda63_ (self);
 }
 
 
@@ -508,7 +530,7 @@ static void _file_browser_refresh_gtk_button_clicked (GtkButton* _sender, gpoint
 
 
 static void file_browser_init_toolbar (FileBrowser* self) {
-	Block16Data* _data16_;
+	Block14Data* _data14_;
 	GtkHBox* _tmp0_ = NULL;
 	GtkHBox* hbox;
 	GtkButton* _tmp1_ = NULL;
@@ -522,9 +544,9 @@ static void file_browser_init_toolbar (FileBrowser* self) {
 	const gchar* _tmp7_ = NULL;
 	const gchar* _tmp8_ = NULL;
 	g_return_if_fail (self != NULL);
-	_data16_ = g_slice_new0 (Block16Data);
-	_data16_->_ref_count_ = 1;
-	_data16_->self = g_object_ref (self);
+	_data14_ = g_slice_new0 (Block14Data);
+	_data14_->_ref_count_ = 1;
+	_data14_->self = g_object_ref (self);
 	_tmp0_ = (GtkHBox*) gtk_hbox_new (TRUE, 0);
 	hbox = g_object_ref_sink (_tmp0_);
 	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
@@ -534,7 +556,7 @@ static void file_browser_init_toolbar (FileBrowser* self) {
 	_g_object_unref0 (self->priv->parent_button);
 	self->priv->parent_button = _tmp2_;
 	_tmp3_ = utils_get_toolbar_button (GTK_STOCK_JUMP_TO);
-	_data16_->jump_button = _tmp3_;
+	_data14_->jump_button = _tmp3_;
 	_tmp4_ = utils_get_toolbar_button (GTK_STOCK_REFRESH);
 	refresh_button = _tmp4_;
 	_tmp5_ = _ ("Go to the home directory");
@@ -542,23 +564,42 @@ static void file_browser_init_toolbar (FileBrowser* self) {
 	_tmp6_ = _ ("Go to the parent directory");
 	gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->parent_button, _tmp6_);
 	_tmp7_ = _ ("Go to the active document directory");
-	gtk_widget_set_tooltip_text ((GtkWidget*) _data16_->jump_button, _tmp7_);
+	gtk_widget_set_tooltip_text ((GtkWidget*) _data14_->jump_button, _tmp7_);
 	_tmp8_ = _ ("Refresh");
 	gtk_widget_set_tooltip_text ((GtkWidget*) refresh_button, _tmp8_);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) home_button, TRUE, TRUE, (guint) 0);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->parent_button, TRUE, TRUE, (guint) 0);
-	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) _data16_->jump_button, TRUE, TRUE, (guint) 0);
+	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) _data14_->jump_button, TRUE, TRUE, (guint) 0);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) refresh_button, TRUE, TRUE, (guint) 0);
-	g_signal_connect_object (home_button, "clicked", (GCallback) __lambda53__gtk_button_clicked, self, 0);
-	g_signal_connect_object (self->priv->parent_button, "clicked", (GCallback) __lambda54__gtk_button_clicked, self, 0);
-	g_signal_connect_object (_data16_->jump_button, "clicked", (GCallback) __lambda55__gtk_button_clicked, self, 0);
-	g_signal_connect_data ((GObject*) self->priv->main_window, "notify::active-document", (GCallback) __lambda56__g_object_notify, block16_data_ref (_data16_), (GClosureNotify) block16_data_unref, 0);
+	g_signal_connect_object (home_button, "clicked", (GCallback) __lambda60__gtk_button_clicked, self, 0);
+	g_signal_connect_object (self->priv->parent_button, "clicked", (GCallback) __lambda61__gtk_button_clicked, self, 0);
+	g_signal_connect_object (_data14_->jump_button, "clicked", (GCallback) __lambda62__gtk_button_clicked, self, 0);
+	g_signal_connect_data ((GObject*) self->priv->main_window, "notify::active-document", (GCallback) __lambda63__g_object_notify, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
 	g_signal_connect_object (refresh_button, "clicked", (GCallback) _file_browser_refresh_gtk_button_clicked, self, 0);
 	_g_object_unref0 (refresh_button);
 	_g_object_unref0 (home_button);
 	_g_object_unref0 (hbox);
-	block16_data_unref (_data16_);
-	_data16_ = NULL;
+	block14_data_unref (_data14_);
+	_data14_ = NULL;
+}
+
+
+static void file_browser_update_jump_button_sensitivity (FileBrowser* self, GtkButton* jump_button) {
+	gboolean _tmp0_ = FALSE;
+	DocumentTab* _tmp1_ = NULL;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (jump_button != NULL);
+	_tmp1_ = main_window_get_active_tab (self->priv->main_window);
+	if (_tmp1_ != NULL) {
+		Document* _tmp2_ = NULL;
+		GFile* _tmp3_ = NULL;
+		_tmp2_ = main_window_get_active_document (self->priv->main_window);
+		_tmp3_ = document_get_location (_tmp2_);
+		_tmp0_ = _tmp3_ != NULL;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	gtk_widget_set_sensitive ((GtkWidget*) jump_button, _tmp0_);
 }
 
 
@@ -567,7 +608,7 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda57_ (FileBrowser* self) {
+static void _lambda65_ (FileBrowser* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gboolean _tmp1_;
@@ -593,8 +634,8 @@ static void _lambda57_ (FileBrowser* self) {
 }
 
 
-static void __lambda57__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
-	_lambda57_ (self);
+static void __lambda65__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
+	_lambda65_ (self);
 }
 
 
@@ -629,7 +670,7 @@ static void file_browser_init_combo_box (FileBrowser* self) {
 	gtk_cell_layout_set_attributes ((GtkCellLayout*) self->priv->combo_box, (GtkCellRenderer*) text_renderer, "text", FILE_BROWSER_PARENT_DIR_COLUMN_NAME, NULL, NULL);
 	g_object_set (text_renderer, "ellipsize-set", TRUE, NULL);
 	g_object_set (text_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
-	g_signal_connect_object (self->priv->combo_box, "changed", (GCallback) __lambda57__gtk_combo_box_changed, self, 0);
+	g_signal_connect_object (self->priv->combo_box, "changed", (GCallback) __lambda65__gtk_combo_box_changed, self, 0);
 	_g_object_unref0 (pixbuf_renderer);
 	_g_object_unref0 (text_renderer);
 }
@@ -642,7 +683,7 @@ static gint _file_browser_on_sort_gtk_tree_iter_compare_func (GtkTreeModel* mode
 }
 
 
-static void _lambda58_ (GtkTreePath* path, FileBrowser* self) {
+static void _lambda66_ (GtkTreePath* path, FileBrowser* self) {
 	GtkTreeModel* _tmp0_;
 	GtkTreeModel* model;
 	GtkTreeIter iter = {0};
@@ -773,15 +814,14 @@ static void _lambda58_ (GtkTreePath* path, FileBrowser* self) {
 }
 
 
-static void __lambda58__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
-	_lambda58_ (path, self);
+static void __lambda66__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+	_lambda66_ (path, self);
 }
 
 
 static void file_browser_init_list (FileBrowser* self) {
 	GtkListStore* _tmp0_ = NULL;
 	GtkTreeView* _tmp1_ = NULL;
-	GtkTreeView* tree_view;
 	GtkTreeViewColumn* _tmp2_ = NULL;
 	GtkTreeViewColumn* column;
 	GtkCellRendererPixbuf* _tmp3_ = NULL;
@@ -797,11 +837,12 @@ static void file_browser_init_list (FileBrowser* self) {
 	gtk_tree_sortable_set_sort_func ((GtkTreeSortable*) self->priv->list_store, 0, _file_browser_on_sort_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
 	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) self->priv->list_store, 0, GTK_SORT_ASCENDING);
 	_tmp1_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) self->priv->list_store);
-	tree_view = g_object_ref_sink (_tmp1_);
-	gtk_tree_view_set_headers_visible (tree_view, FALSE);
+	_g_object_unref0 (self->priv->_list_view);
+	self->priv->_list_view = g_object_ref_sink (_tmp1_);
+	gtk_tree_view_set_headers_visible (self->priv->_list_view, FALSE);
 	_tmp2_ = gtk_tree_view_column_new ();
 	column = g_object_ref_sink (_tmp2_);
-	gtk_tree_view_append_column (tree_view, column);
+	gtk_tree_view_append_column (self->priv->_list_view, column);
 	_tmp3_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
 	pixbuf_renderer = g_object_ref_sink (_tmp3_);
 	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
@@ -810,15 +851,14 @@ static void file_browser_init_list (FileBrowser* self) {
 	text_renderer = g_object_ref_sink (_tmp4_);
 	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
 	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", FILE_BROWSER_FILE_COLUMN_NAME, NULL, NULL);
-	_tmp5_ = utils_add_scrollbar ((GtkWidget*) tree_view);
+	_tmp5_ = utils_add_scrollbar ((GtkWidget*) self->priv->_list_view);
 	sw = _tmp5_;
 	gtk_box_pack_start ((GtkBox*) self, sw, TRUE, TRUE, (guint) 0);
-	g_signal_connect_object (tree_view, "row-activated", (GCallback) __lambda58__gtk_tree_view_row_activated, self, 0);
+	g_signal_connect_object (self->priv->_list_view, "row-activated", (GCallback) __lambda66__gtk_tree_view_row_activated, self, 0);
 	_g_object_unref0 (sw);
 	_g_object_unref0 (text_renderer);
 	_g_object_unref0 (pixbuf_renderer);
 	_g_object_unref0 (column);
-	_g_object_unref0 (tree_view);
 }
 
 
@@ -828,14 +868,56 @@ void file_browser_refresh (FileBrowser* self) {
 }
 
 
-void file_browser_refresh_if_in_dir (FileBrowser* self, GFile* dir) {
-	gboolean _tmp0_;
+void file_browser_refresh_for_document (FileBrowser* self, Document* doc) {
+	Project* _tmp0_ = NULL;
+	Project* project;
+	GFile* _tmp7_;
+	GFile* project_dir;
+	gboolean _tmp8_ = FALSE;
+	gboolean _tmp9_;
 	g_return_if_fail (self != NULL);
-	g_return_if_fail (dir != NULL);
-	_tmp0_ = g_file_equal (dir, self->priv->current_directory);
-	if (_tmp0_) {
+	g_return_if_fail (doc != NULL);
+	_tmp0_ = document_get_project (doc);
+	project = _tmp0_;
+	if (project == NULL) {
+		gboolean _tmp1_ = FALSE;
+		GFile* _tmp2_ = NULL;
+		_tmp2_ = document_get_location (doc);
+		if (_tmp2_ != NULL) {
+			GFile* _tmp3_ = NULL;
+			GFile* _tmp4_ = NULL;
+			GFile* _tmp5_;
+			gboolean _tmp6_;
+			_tmp3_ = document_get_location (doc);
+			_tmp4_ = g_file_get_parent (_tmp3_);
+			_tmp5_ = _tmp4_;
+			_tmp6_ = g_file_equal (self->priv->current_directory, _tmp5_);
+			_tmp1_ = _tmp6_;
+			_g_object_unref0 (_tmp5_);
+		} else {
+			_tmp1_ = FALSE;
+		}
+		if (_tmp1_) {
+			file_browser_refresh (self);
+		}
+		_project_free0 (project);
+		return;
+	}
+	_tmp7_ = _g_object_ref0 ((*project).directory);
+	project_dir = _tmp7_;
+	_tmp9_ = g_file_equal (self->priv->current_directory, project_dir);
+	if (_tmp9_) {
+		_tmp8_ = TRUE;
+	} else {
+		gboolean _tmp10_;
+		_tmp10_ = g_file_has_prefix (self->priv->current_directory, project_dir);
+		_tmp8_ = _tmp10_;
+	}
+	if (_tmp8_) {
 		file_browser_refresh (self);
 	}
+	_g_object_unref0 (project_dir);
+	_project_free0 (project);
 }
 
 
@@ -909,6 +991,7 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 	g_return_if_fail (self != NULL);
 	gtk_list_store_clear (self->priv->list_store);
 	gtk_list_store_clear (self->priv->parent_dir_store);
+	gtk_tree_view_columns_autosize (self->priv->_list_view);
 	_tmp0_ = _g_object_ref0 (dir);
 	directory = _tmp0_;
 	if (directory == NULL) {
@@ -959,7 +1042,7 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 	_tmp11_ = g_file_enumerate_children (directory, "standard::type,standard::display-name", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
 	enumerator = _tmp11_;
 	if (_inner_error_ != NULL) {
-		goto __catch26_g_error;
+		goto __catch28_g_error;
 	}
 	_tmp12_ = g_settings_get_boolean (self->priv->settings, "show-all-files");
 	show_all = _tmp12_;
@@ -996,7 +1079,7 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 			extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
 			_g_free0 (exts);
 			_g_object_unref0 (enumerator);
-			goto __catch26_g_error;
+			goto __catch28_g_error;
 		}
 		{
 			gboolean _tmp23_;
@@ -1025,7 +1108,7 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 						extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
 						_g_free0 (exts);
 						_g_object_unref0 (enumerator);
-						goto __catch26_g_error;
+						goto __catch28_g_error;
 					}
 					_g_object_unref0 (info);
 					info = _tmp25_;
@@ -1176,8 +1259,8 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 	extensions = (_vala_array_free (extensions, extensions_length1, (GDestroyNotify) g_free), NULL);
 	_g_free0 (exts);
 	_g_object_unref0 (enumerator);
-	goto __finally26;
-	__catch26_g_error:
+	goto __finally28;
+	__catch28_g_error:
 	{
 		GError * e;
 		const gchar* _tmp44_ = NULL;
@@ -1197,7 +1280,7 @@ static void file_browser_fill_stores_with_dir (FileBrowser* self, GFile* dir) {
 		_g_object_unref0 (directory);
 		return;
 	}
-	__finally26:
+	__finally28:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (directory);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1377,6 +1460,7 @@ static void file_browser_finalize (GObject* obj) {
 	_g_object_unref0 (self->priv->build_view);
 	_g_object_unref0 (self->priv->parent_dir_store);
 	_g_object_unref0 (self->priv->list_store);
+	_g_object_unref0 (self->priv->_list_view);
 	_g_object_unref0 (self->priv->combo_box);
 	_g_object_unref0 (self->priv->current_directory);
 	_g_object_unref0 (self->priv->parent_button);
diff --git a/src/C/latex_menu.c b/src/C/latex_menu.c
index 8c7752f..d803ab3 100644
--- a/src/C/latex_menu.c
+++ b/src/C/latex_menu.c
@@ -1,4 +1,4 @@
-/* latex_menu.c generated by valac 0.12.0, the Vala compiler
+/* latex_menu.c generated by valac 0.12.1, the Vala compiler
  * generated from latex_menu.vala, do not modify */
 
 /*
@@ -507,7 +507,7 @@ GType selection_type_get_type (void) G_GNUC_CONST;
 SelectionType document_get_selection_type (Document* self);
 static void latex_menu_finalize (GObject* obj);
 
-static const GtkActionEntry LATEX_MENU_latex_action_entries[202] = {{"Latex", NULL, "_LaTeX"}, {"Sectioning", "sectioning-section", "_Sectioning"}, {"SectioningPart", "sectioning-part", "\\_part", NULL, "Part", (GCallback) _latex_menu_on_sectioning_part_gtk_action_callback}, {"SectioningChapter", "sectioning-chapter", "\\_chapter", NULL, "Chapter", (GCallback) _latex_menu_on_sectioning_chapter_gtk_action_callback}, {"SectioningSection", "sectioning-section", "\\_section", NULL, "Section", (GCallback) _latex_menu_on_sectioning_section_gtk_action_callback}, {"SectioningSubsection", "sectioning-subsection", "\\s_ubsection", NULL, "Sub-section", (GCallback) _latex_menu_on_sectioning_subsection_gtk_action_callback}, {"SectioningSubsubsection", "sectioning-subsubsection", "\\su_bsubsection", NULL, "Sub-sub-section", (GCallback) _latex_menu_on_sectioning_subsubsection_gtk_action_callback}, {"SectioningParagraph", "sectioning-paragraph", "\\p_aragraph", NULL, "Paragraph", (GCallback
 ) _latex_menu_on_sectioning_paragraph_gtk_action_callback}, {"SectioningSubparagraph", "sectioning-paragraph", "\\subpa_ragraph", NULL, "Sub-paragraph", (GCallback) _latex_menu_on_sectioning_subparagraph_gtk_action_callback}, {"References", "references", "_References"}, {"ReferencesLabel", NULL, "\\_label", NULL, "Label", (GCallback) _latex_menu_on_ref_label_gtk_action_callback}, {"ReferencesRef", NULL, "\\_ref", NULL, "Reference to a label", (GCallback) _latex_menu_on_ref_ref_gtk_action_callback}, {"ReferencesPageref", NULL, "\\_pageref", NULL, "Page reference to a label", (GCallback) _latex_menu_on_ref_pageref_gtk_action_callback}, {"ReferencesIndex", NULL, "\\_index", NULL, "Add a word to the index", (GCallback) _latex_menu_on_ref_index_gtk_action_callback}, {"ReferencesFootnote", NULL, "\\_footnote", NULL, "Footnote", (GCallback) _latex_menu_on_ref_footnote_gtk_action_callback}, {"ReferencesCite", NULL, "\\_cite", NULL, "Reference to a bibliography item", (GCallback) _la
 tex_menu_on_ref_cite_gtk_action_callback}, {"Environments", GTK_STOCK_JUSTIFY_CENTER, "_Environments"}, {"EnvCenter", GTK_STOCK_JUSTIFY_CENTER, "\\begin{_center}", NULL, "Center - \\begin{center}", (GCallback) _latex_menu_on_env_center_gtk_action_callback}, {"EnvLeft", GTK_STOCK_JUSTIFY_LEFT, "\\begin{flush_left}", NULL, "Align Left - \\begin{flushleft}", (GCallback) _latex_menu_on_env_left_gtk_action_callback}, {"EnvRight", GTK_STOCK_JUSTIFY_RIGHT, "\\begin{flush_right}", NULL, "Align Right - \\begin{flushright}", (GCallback) _latex_menu_on_env_right_gtk_action_callback}, {"EnvFigure", NULL, "\\begin{_figure}", NULL, "Figure - \\begin{figure}", (GCallback) _latex_menu_on_env_figure_gtk_action_callback}, {"EnvTable", NULL, "\\begin{_table}", NULL, "Table - \\begin{table}", (GCallback) _latex_menu_on_env_table_gtk_action_callback}, {"EnvQuote", NULL, "\\begin{_quote}", NULL, "Quote - \\begin{quote}", (GCallback) _latex_menu_on_env_quote_gtk_action_callback}, {"EnvQuotation", 
 NULL, "\\begin{qu_otation}", NULL, "Quotation - \\begin{quotation}", (GCallback) _latex_menu_on_env_quotation_gtk_action_callback}, {"EnvVerse", NULL, "\\begin{_verse}", NULL, "Verse - \\begin{verse}", (GCallback) _latex_menu_on_env_verse_gtk_action_callback}, {"EnvVerbatim", NULL, "\\begin{ver_batim}", NULL, "Verbatim - \\begin{verbatim}", (GCallback) _latex_menu_on_env_verbatim_gtk_action_callback}, {"EnvMinipage", NULL, "\\begin{_minipage}", NULL, "Minipage - \\begin{minipage}", (GCallback) _latex_menu_on_env_minipage_gtk_action_callback}, {"EnvTitlepage", NULL, "\\begin{titlepage}", NULL, "Title page - \\begin{titlepage}", (GCallback) _latex_menu_on_env_titlepage_gtk_action_callback}, {"ListEnvironments", "list-enumerate", "_List Environments"}, {"ListEnvItemize", "list-itemize", "\\begin{_itemize}", NULL, "Bulleted List - \\begin{itemize}", (GCallback) _latex_menu_on_list_env_itemize_gtk_action_callback}, {"ListEnvEnumerate", "list-enumerate", "\\begin{_enumerate}", NUL
 L, "Enumeration - \\begin{enumerate}", (GCallback) _latex_menu_on_list_env_enumerate_gtk_action_callback}, {"ListEnvDescription", "list-description", "\\begin{_description}", NULL, "Description - \\begin{description}", (GCallback) _latex_menu_on_list_env_description_gtk_action_callback}, {"ListEnvList", NULL, "\\begin{_list}", NULL, "Custom list - \\begin{list}", (GCallback) _latex_menu_on_list_env_list_gtk_action_callback}, {"ListEnvItem", "list-item", "\\i_tem", "<Alt><Shift>H", "List item - \\item", (GCallback) _latex_menu_on_list_env_item_gtk_action_callback}, {"CharacterSize", "character-size", "_Characters Sizes"}, {"CharacterSizeTiny", NULL, "_tiny", NULL, "tiny", (GCallback) _latex_menu_on_size_tiny_gtk_action_callback}, {"CharacterSizeScriptsize", NULL, "_scriptsize", NULL, "scriptsize", (GCallback) _latex_menu_on_size_scriptsize_gtk_action_callback}, {"CharacterSizeFootnotesize", NULL, "_footnotesize", NULL, "footnotesize", (GCallback) _latex_menu_on_size_footnotes
 ize_gtk_action_callback}, {"CharacterSizeSmall", NULL, "s_mall", NULL, "small", (GCallback) _latex_menu_on_size_small_gtk_action_callback}, {"CharacterSizeNormalsize", NULL, "_normalsize", NULL, "normalsize", (GCallback) _latex_menu_on_size_normalsize_gtk_action_callback}, {"CharacterSizelarge", NULL, "_large", NULL, "large", (GCallback) _latex_menu_on_size_large_gtk_action_callback}, {"CharacterSizeLarge", NULL, "L_arge", NULL, "Large", (GCallback) _latex_menu_on_size_Large_gtk_action_callback}, {"CharacterSizeLARGE", NULL, "LA_RGE", NULL, "LARGE", (GCallback) _latex_menu_on_size_LARGE_gtk_action_callback}, {"CharacterSizehuge", NULL, "_huge", NULL, "huge", (GCallback) _latex_menu_on_size_huge_gtk_action_callback}, {"CharacterSizeHuge", NULL, "H_uge", NULL, "Huge", (GCallback) _latex_menu_on_size_Huge_gtk_action_callback}, {"FontStyles", "bold", "_Font Styles"}, {"Bold", "bold", "\\text_bf", "<Alt><Shift>B", "Bold - \\textbf", (GCallback) _latex_menu_on_text_bold_gtk_action
 _callback}, {"Italic", "italic", "\\text_it", "<Alt><Shift>I", "Italic - \\textit", (GCallback) _latex_menu_on_text_italic_gtk_action_callback}, {"Typewriter", "typewriter", "\\text_tt", "<Alt><Shift>T", "Typewriter - \\texttt", (GCallback) _latex_menu_on_text_typewriter_gtk_action_callback}, {"Slanted", "slanted", "\\text_sl", "<Alt><Shift>S", "Slanted - \\textsl", (GCallback) _latex_menu_on_text_slanted_gtk_action_callback}, {"SmallCaps", "small_caps", "\\texts_c", "<Alt><Shift>C", "Small Capitals - \\textsc", (GCallback) _latex_menu_on_text_small_caps_gtk_action_callback}, {"SansSerif", "sans_serif", "\\texts_f", NULL, "Sans Serif - \\textsf", (GCallback) _latex_menu_on_text_sans_serif_gtk_action_callback}, {"Emph", NULL, "\\_emph", NULL, "Emphasized - \\emph", (GCallback) _latex_menu_on_text_emph_gtk_action_callback}, {"Underline", "underline", "\\_underline", NULL, "Underline - \\underline", (GCallback) _latex_menu_on_text_underline_gtk_action_callback}, {"FontFamily", 
 NULL, "_Font Family"}, {"FontFamilyRoman", "roman", "\\_rmfamily", NULL, "Roman - \\rmfamily", (GCallback) _latex_menu_on_text_font_family_roman_gtk_action_callback}, {"FontFamilySansSerif", "sans_serif", "\\_sffamily", NULL, "Sans Serif - \\sffamily", (GCallback) _latex_menu_on_text_font_family_sans_serif_gtk_action_callback}, {"FontFamilyMonospace", "typewriter", "\\_ttfamily", NULL, "Monospace - \\ttfamily", (GCallback) _latex_menu_on_text_font_family_monospace_gtk_action_callback}, {"FontSeries", NULL, "F_ont Series"}, {"FontSeriesMedium", "roman", "\\_mdseries", NULL, "Medium - \\mdseries", (GCallback) _latex_menu_on_text_font_series_medium_gtk_action_callback}, {"FontSeriesBold", "bold", "\\_bfseries", NULL, "Bold - \\bfseries", (GCallback) _latex_menu_on_text_font_series_bold_gtk_action_callback}, {"FontShape", NULL, "Fo_nt Shape"}, {"FontShapeUpright", "roman", "\\_upshape", NULL, "Upright - \\upshape", (GCallback) _latex_menu_on_text_font_shape_upright_gtk_action_ca
 llback}, {"FontShapeItalic", "italic", "\\_itshape", NULL, "Italic - \\itshape", (GCallback) _latex_menu_on_text_font_shape_italic_gtk_action_callback}, {"FontShapeSlanted", "slanted", "\\_slshape", NULL, "Slanted - \\slshape", (GCallback) _latex_menu_on_text_font_shape_slanted_gtk_action_callback}, {"FontShapeSmallCaps", "small_caps", "\\s_cshape", NULL, "Small Capitals - \\scshape", (GCallback) _latex_menu_on_text_font_shape_small_caps_gtk_action_callback}, {"Tabular", "table", "_Tabular"}, {"TabularTabbing", NULL, "\\begin{ta_bbing}", NULL, "Tabbing - \\begin{tabbing}", (GCallback) _latex_menu_on_tabular_tabbing_gtk_action_callback}, {"TabularTabular", NULL, "\\begin{_tabular}", NULL, "Tabular - \\begin{tabular}", (GCallback) _latex_menu_on_tabular_tabular_gtk_action_callback}, {"TabularMulticolumn", NULL, "\\_multicolumn", NULL, "Multicolumn - \\multicolumn", (GCallback) _latex_menu_on_tabular_multicolumn_gtk_action_callback}, {"TabularHline", NULL, "\\_hline", NULL, "Ho
 rizontal line - \\hline", (GCallback) _latex_menu_on_tabular_hline_gtk_action_callback}, {"TabularVline", NULL, "\\_vline", NULL, "Vertical line - \\vline", (GCallback) _latex_menu_on_tabular_vline_gtk_action_callback}, {"TabularCline", NULL, "\\_cline", NULL, "Horizontal line (columns specified) - \\cline", (GCallback) _latex_menu_on_tabular_cline_gtk_action_callback}, {"Spacing", NULL, "_Spacing"}, {"SpacingNewLine", NULL, "New _Line", NULL, "New Line - \\\\", (GCallback) _latex_menu_on_spacing_new_line_gtk_action_callback}, {"SpacingNewPage", NULL, "\\new_page", NULL, "New page - \\newpage", (GCallback) _latex_menu_on_spacing_new_page_gtk_action_callback}, {"SpacingLineBreak", NULL, "\\l_inebreak", NULL, "Line break - \\linebreak", (GCallback) _latex_menu_on_spacing_line_break_gtk_action_callback}, {"SpacingPageBreak", NULL, "\\p_agebreak", NULL, "Page break - \\pagebreak", (GCallback) _latex_menu_on_spacing_page_break_gtk_action_callback}, {"SpacingBigSkip", NULL, "\\_bi
 gskip", NULL, "Big skip - \\bigskip", (GCallback) _latex_menu_on_spacing_bigskip_gtk_action_callback}, {"SpacingMedSkip", NULL, "\\_medskip", NULL, "Medium skip - \\medskip", (GCallback) _latex_menu_on_spacing_medskip_gtk_action_callback}, {"SpacingHSpace", NULL, "\\_hspace", NULL, "Horizontal space - \\hspace", (GCallback) _latex_menu_on_spacing_hspace_gtk_action_callback}, {"SpacingVSpace", NULL, "\\_vspace", NULL, "Vertical space - \\vspace", (GCallback) _latex_menu_on_spacing_vspace_gtk_action_callback}, {"SpacingNoIndent", NULL, "\\_noindent", NULL, "No paragraph indentation - \\noindent", (GCallback) _latex_menu_on_spacing_noindent_gtk_action_callback}, {"Accents", NULL, "International _Accents"}, {"Accent0", "accent0", "\\'", NULL, "Acute accent - \\'", (GCallback) _latex_menu_on_accent0_gtk_action_callback}, {"Accent1", "accent1", "\\`", NULL, "Grave accent - \\`", (GCallback) _latex_menu_on_accent1_gtk_action_callback}, {"Accent2", "accent2", "\\^", NULL, "Circumfle
 x accent - \\^", (GCallback) _latex_menu_on_accent2_gtk_action_callback}, {"Accent3", "accent3", "\\\"", NULL, "Trema - \\\"", (GCallback) _latex_menu_on_accent3_gtk_action_callback}, {"Accent4", "accent4", "\\~", NULL, "Tilde - \\~", (GCallback) _latex_menu_on_accent4_gtk_action_callback}, {"Accent5", "accent5", "\\=", NULL, "Macron - \\=", (GCallback) _latex_menu_on_accent5_gtk_action_callback}, {"Accent6", "accent6", "\\.", NULL, "Dot - \\.", (GCallback) _latex_menu_on_accent6_gtk_action_callback}, {"Accent7", "accent7", "\\v", NULL, "Caron - \\v", (GCallback) _latex_menu_on_accent7_gtk_action_callback}, {"Accent8", "accent8", "\\u", NULL, "Breve - \\u", (GCallback) _latex_menu_on_accent8_gtk_action_callback}, {"Accent9", "accent9", "\\H", NULL, "Double acute accent - \\H", (GCallback) _latex_menu_on_accent9_gtk_action_callback}, {"Accent10", "accent10", "\\c", NULL, NULL, (GCallback) _latex_menu_on_accent10_gtk_action_callback}, {"Accent11", "accent11", "\\k", NULL, NULL
 , (GCallback) _latex_menu_on_accent11_gtk_action_callback}, {"Accent12", "accent12", "\\d", NULL, NULL, (GCallback) _latex_menu_on_accent12_gtk_action_callback}, {"Accent13", "accent13", "\\b", NULL, NULL, (GCallback) _latex_menu_on_accent13_gtk_action_callback}, {"Accent14", "accent14", "\\r", NULL, NULL, (GCallback) _latex_menu_on_accent14_gtk_action_callback}, {"Accent15", "accent15", "\\t", NULL, NULL, (GCallback) _latex_menu_on_accent15_gtk_action_callback}, {"LatexMisc", NULL, "_Misc"}, {"LatexDocumentClass", NULL, "\\_documentclass", NULL, "Document class - \\documentclass", (GCallback) _latex_menu_on_documentclass_gtk_action_callback}, {"LatexUsepackage", NULL, "\\_usepackage", NULL, "Use package - \\usepackage", (GCallback) _latex_menu_on_usepackage_gtk_action_callback}, {"LatexAMS", NULL, "_AMS packages", NULL, "AMS packages", (GCallback) _latex_menu_on_ams_packages_gtk_action_callback}, {"LatexAuthor", NULL, "\\au_thor", NULL, "Author - \\author", (GCallback) _lat
 ex_menu_on_author_gtk_action_callback}, {"LatexTitle", NULL, "\\t_itle", NULL, "Title - \\title", (GCallback) _latex_menu_on_title_gtk_action_callback}, {"LatexBeginDocument", NULL, "\\begin{d_ocument}", NULL, "Content of the document - \\begin{document}", (GCallback) _latex_menu_on_begin_document_gtk_action_callback}, {"LatexMakeTitle", NULL, "\\_maketitle", NULL, "Make title - \\maketitle", (GCallback) _latex_menu_on_maketitle_gtk_action_callback}, {"LatexTableOfContents", NULL, "\\tableof_contents", NULL, "Table of contents - \\tableofcontents", (GCallback) _latex_menu_on_tableofcontents_gtk_action_callback}, {"LatexAbstract", NULL, "\\begin{abst_ract}", NULL, "Abstract - \\begin{abstract}", (GCallback) _latex_menu_on_abstract_gtk_action_callback}, {"LatexIncludeGraphics", NULL, "\\include_graphics", NULL, "Include an image (graphicx package) - \\includegraphics", (GCallback) _latex_menu_on_include_graphics_gtk_action_callback}, {"LatexInput", NULL, "\\_input", NULL, "Inc
 lude a file - \\input", (GCallback) _latex_menu_on_input_gtk_action_callback}, {"Math", NULL, "_Math"}, {"MathEnvironments", NULL, "_Math Environments"}, {"MathEnvNormal", "math", "_Mathematical Environment - $...$", "<Alt><Shift>M", "Mathematical Environment - $...$", (GCallback) _latex_menu_on_math_env_normal_gtk_action_callback}, {"MathEnvCentered", "math-centered", "_Centered Formula - \\[...\\]", "<Alt><Shift>E", "Centered Formula - \\[...\\]", (GCallback) _latex_menu_on_math_env_centered_gtk_action_callback}, {"MathEnvNumbered", "math-numbered", "_Numbered Equation - \\begin{equation}", NULL, "Numbered Equation - \\begin{equation}", (GCallback) _latex_menu_on_math_env_numbered_gtk_action_callback}, {"MathEnvArray", "math-array", "_Array of Equations - \\begin{align*}", NULL, "Array of Equations - \\begin{align*}", (GCallback) _latex_menu_on_math_env_array_gtk_action_callback}, {"MathEnvNumberedArray", "math-numbered-array", "Numbered Array of _Equations - \\begin{align
 }", NULL, "Numbered Array of Equations - \\begin{align}", (GCallback) _latex_menu_on_math_env_numbered_array_gtk_action_callback}, {"MathSuperscript", "math-superscript", "_Superscript - ^{}", NULL, "Superscript - ^{}", (GCallback) _latex_menu_on_math_superscript_gtk_action_callback}, {"MathSubscript", "math-subscript", "Su_bscript - __{}", NULL, "Subscript - _{}", (GCallback) _latex_menu_on_math_subscript_gtk_action_callback}, {"MathFrac", "math-frac", "_Fraction - \\frac{}{}", "<Alt><Shift>F", "Fraction - \\frac{}{}", (GCallback) _latex_menu_on_math_frac_gtk_action_callback}, {"MathSquareRoot", "math-square-root", "Square _Root - \\sqrt{}", NULL, "Square Root - \\sqrt{}", (GCallback) _latex_menu_on_math_square_root_gtk_action_callback}, {"MathNthRoot", "math-nth-root", "_N-th Root - \\sqrt[]{}", NULL, "N-th Root - \\sqrt[]{}", (GCallback) _latex_menu_on_math_nth_root_gtk_action_callback}, {"MathFunctions", NULL, "Math _Functions"}, {"MathFuncArccos", NULL, "\\arccos", NULL
 , NULL, (GCallback) _latex_menu_on_math_func_arccos_gtk_action_callback}, {"MathFuncArcsin", NULL, "\\arcsin", NULL, NULL, (GCallback) _latex_menu_on_math_func_arcsin_gtk_action_callback}, {"MathFuncArctan", NULL, "\\arctan", NULL, NULL, (GCallback) _latex_menu_on_math_func_arctan_gtk_action_callback}, {"MathFuncCos", NULL, "\\cos", NULL, NULL, (GCallback) _latex_menu_on_math_func_cos_gtk_action_callback}, {"MathFuncCosh", NULL, "\\cosh", NULL, NULL, (GCallback) _latex_menu_on_math_func_cosh_gtk_action_callback}, {"MathFuncCot", NULL, "\\cot", NULL, NULL, (GCallback) _latex_menu_on_math_func_cot_gtk_action_callback}, {"MathFuncCoth", NULL, "\\coth", NULL, NULL, (GCallback) _latex_menu_on_math_func_coth_gtk_action_callback}, {"MathFuncCsc", NULL, "\\csc", NULL, NULL, (GCallback) _latex_menu_on_math_func_csc_gtk_action_callback}, {"MathFuncDeg", NULL, "\\deg", NULL, NULL, (GCallback) _latex_menu_on_math_func_deg_gtk_action_callback}, {"MathFuncDet", NULL, "\\det", NULL, NULL, 
 (GCallback) _latex_menu_on_math_func_det_gtk_action_callback}, {"MathFuncDim", NULL, "\\dim", NULL, NULL, (GCallback) _latex_menu_on_math_func_dim_gtk_action_callback}, {"MathFuncExp", NULL, "\\exp", NULL, NULL, (GCallback) _latex_menu_on_math_func_exp_gtk_action_callback}, {"MathFuncGcd", NULL, "\\gcd", NULL, NULL, (GCallback) _latex_menu_on_math_func_gcd_gtk_action_callback}, {"MathFuncHom", NULL, "\\hom", NULL, NULL, (GCallback) _latex_menu_on_math_func_hom_gtk_action_callback}, {"MathFuncInf", NULL, "\\inf", NULL, NULL, (GCallback) _latex_menu_on_math_func_inf_gtk_action_callback}, {"MathFuncKer", NULL, "\\ker", NULL, NULL, (GCallback) _latex_menu_on_math_func_ker_gtk_action_callback}, {"MathFuncLg", NULL, "\\lg", NULL, NULL, (GCallback) _latex_menu_on_math_func_lg_gtk_action_callback}, {"MathFuncLim", NULL, "\\lim", NULL, NULL, (GCallback) _latex_menu_on_math_func_lim_gtk_action_callback}, {"MathFuncLiminf", NULL, "\\liminf", NULL, NULL, (GCallback) _latex_menu_on_math_
 func_liminf_gtk_action_callback}, {"MathFuncLimsup", NULL, "\\limsup", NULL, NULL, (GCallback) _latex_menu_on_math_func_limsup_gtk_action_callback}, {"MathFuncLn", NULL, "\\ln", NULL, NULL, (GCallback) _latex_menu_on_math_func_ln_gtk_action_callback}, {"MathFuncLog", NULL, "\\log", NULL, NULL, (GCallback) _latex_menu_on_math_func_log_gtk_action_callback}, {"MathFuncMax", NULL, "\\max", NULL, NULL, (GCallback) _latex_menu_on_math_func_max_gtk_action_callback}, {"MathFuncMin", NULL, "\\min", NULL, NULL, (GCallback) _latex_menu_on_math_func_min_gtk_action_callback}, {"MathFuncSec", NULL, "\\sec", NULL, NULL, (GCallback) _latex_menu_on_math_func_sec_gtk_action_callback}, {"MathFuncSin", NULL, "\\sin", NULL, NULL, (GCallback) _latex_menu_on_math_func_sin_gtk_action_callback}, {"MathFuncSinh", NULL, "\\sinh", NULL, NULL, (GCallback) _latex_menu_on_math_func_sinh_gtk_action_callback}, {"MathFuncSup", NULL, "\\sup", NULL, NULL, (GCallback) _latex_menu_on_math_func_sup_gtk_action_cal
 lback}, {"MathFuncTan", NULL, "\\tan", NULL, NULL, (GCallback) _latex_menu_on_math_func_tan_gtk_action_callback}, {"MathFuncTanh", NULL, "\\tanh", NULL, NULL, (GCallback) _latex_menu_on_math_func_tanh_gtk_action_callback}, {"MathFontStyles", NULL, "Math Font _Styles"}, {"MathFSrm", "roman", "\\math_rm", NULL, "Roman - \\mathrm", (GCallback) _latex_menu_on_math_font_style_rm_gtk_action_callback}, {"MathFSit", "italic", "\\math_it", NULL, "Italic - \\mathit", (GCallback) _latex_menu_on_math_font_style_it_gtk_action_callback}, {"MathFSbf", "bold", "\\math_bf", NULL, "Bold - \\mathbf", (GCallback) _latex_menu_on_math_font_style_bf_gtk_action_callback}, {"MathFSsf", "sans_serif", "\\math_sf", NULL, "Sans Serif - \\mathsf", (GCallback) _latex_menu_on_math_font_style_sf_gtk_action_callback}, {"MathFStt", "typewriter", "\\math_tt", NULL, "Typewriter - \\mathtt", (GCallback) _latex_menu_on_math_font_style_tt_gtk_action_callback}, {"MathFScal", "mathcal", "\\math_cal", NULL, "Calligra
 phic - \\mathcal", (GCallback) _latex_menu_on_math_font_style_cal_gtk_action_callback}, {"MathFSbb", "blackboard", "\\_mathbb", NULL, "Blackboard (uppercase only)  - \\mathbb (amsfonts package)", (GCallback) _latex_menu_on_math_font_style_bb_gtk_action_callback}, {"MathFSfrak", "mathfrak", "\\math_frak", NULL, "Euler Fraktur - \\mathfrak (amsfonts package)", (GCallback) _latex_menu_on_math_font_style_frak_gtk_action_callback}, {"MathAccents", NULL, "Math _Accents"}, {"MathAccentAcute", "mathaccent0", "\\_acute", NULL, NULL, (GCallback) _latex_menu_on_math_accent_acute_gtk_action_callback}, {"MathAccentGrave", "mathaccent1", "\\_grave", NULL, NULL, (GCallback) _latex_menu_on_math_accent_grave_gtk_action_callback}, {"MathAccentTilde", "mathaccent2", "\\_tilde", NULL, NULL, (GCallback) _latex_menu_on_math_accent_tilde_gtk_action_callback}, {"MathAccentBar", "mathaccent3", "\\_bar", NULL, NULL, (GCallback) _latex_menu_on_math_accent_bar_gtk_action_callback}, {"MathAccentVec", "m
 athaccent4", "\\_vec", NULL, NULL, (GCallback) _latex_menu_on_math_accent_vec_gtk_action_callback}, {"MathAccentHat", "mathaccent5", "\\_hat", NULL, NULL, (GCallback) _latex_menu_on_math_accent_hat_gtk_action_callback}, {"MathAccentCheck", "mathaccent6", "\\_check", NULL, NULL, (GCallback) _latex_menu_on_math_accent_check_gtk_action_callback}, {"MathAccentBreve", "mathaccent7", "\\b_reve", NULL, NULL, (GCallback) _latex_menu_on_math_accent_breve_gtk_action_callback}, {"MathAccentDot", "mathaccent8", "\\_dot", NULL, NULL, (GCallback) _latex_menu_on_math_accent_dot_gtk_action_callback}, {"MathAccentDdot", "mathaccent9", "\\dd_ot", NULL, NULL, (GCallback) _latex_menu_on_math_accent_ddot_gtk_action_callback}, {"MathAccentRing", "mathaccent10", "\\_mathring", NULL, NULL, (GCallback) _latex_menu_on_math_accent_ring_gtk_action_callback}, {"MathSpaces", NULL, "Math _Spaces"}, {"MathSpaceSmall", NULL, "_Small", NULL, "Small - \\,", (GCallback) _latex_menu_on_math_space_small_gtk_acti
 on_callback}, {"MathSpaceMedium", NULL, "_Medium", NULL, "Medium - \\:", (GCallback) _latex_menu_on_math_space_medium_gtk_action_callback}, {"MathSpaceLarge", NULL, "_Large", NULL, "Large - \\;", (GCallback) _latex_menu_on_math_space_large_gtk_action_callback}, {"MathSpaceQuad", NULL, "\\_quad", NULL, NULL, (GCallback) _latex_menu_on_math_space_quad_gtk_action_callback}, {"MathSpaceQquad", NULL, "\\qqu_ad", NULL, NULL, (GCallback) _latex_menu_on_math_space_qquad_gtk_action_callback}, {"MathLeftDelimiters", "delimiters-left", "_Left Delimiters"}, {"MathLeftDelimiter1", NULL, "left (", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_1_gtk_action_callback}, {"MathLeftDelimiter2", NULL, "left [", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_2_gtk_action_callback}, {"MathLeftDelimiter3", NULL, "left { ", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_3_gtk_action_callback}, {"MathLeftDelimiter4", NULL, "left <", NULL, NULL, (GCallback) _latex_
 menu_on_math_left_delimiter_4_gtk_action_callback}, {"MathLeftDelimiter5", NULL, "left )", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_5_gtk_action_callback}, {"MathLeftDelimiter6", NULL, "left ]", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_6_gtk_action_callback}, {"MathLeftDelimiter7", NULL, "left  }", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_7_gtk_action_callback}, {"MathLeftDelimiter8", NULL, "left >", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_8_gtk_action_callback}, {"MathLeftDelimiter9", NULL, "left .", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_9_gtk_action_callback}, {"MathRightDelimiters", "delimiters-right", "Right _Delimiters"}, {"MathRightDelimiter1", NULL, "right )", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_1_gtk_action_callback}, {"MathRightDelimiter2", NULL, "right ]", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_2_gtk_action_callback}, {"MathRigh
 tDelimiter3", NULL, "right  }", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_3_gtk_action_callback}, {"MathRightDelimiter4", NULL, "right >", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_4_gtk_action_callback}, {"MathRightDelimiter5", NULL, "right (", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_5_gtk_action_callback}, {"MathRightDelimiter6", NULL, "right [", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_6_gtk_action_callback}, {"MathRightDelimiter7", NULL, "right { ", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_7_gtk_action_callback}, {"MathRightDelimiter8", NULL, "right <", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_8_gtk_action_callback}, {"MathRightDelimiter9", NULL, "right .", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_9_gtk_action_callback}};
+static const GtkActionEntry LATEX_MENU_latex_action_entries[202] = {{"Latex", NULL, "_LaTeX"}, {"Sectioning", "sectioning-section", "_Sectioning"}, {"SectioningPart", "sectioning-part", "\\_part", NULL, "Part", (GCallback) _latex_menu_on_sectioning_part_gtk_action_callback}, {"SectioningChapter", "sectioning-chapter", "\\_chapter", NULL, "Chapter", (GCallback) _latex_menu_on_sectioning_chapter_gtk_action_callback}, {"SectioningSection", "sectioning-section", "\\_section", NULL, "Section", (GCallback) _latex_menu_on_sectioning_section_gtk_action_callback}, {"SectioningSubsection", "sectioning-subsection", "\\s_ubsection", NULL, "Sub-section", (GCallback) _latex_menu_on_sectioning_subsection_gtk_action_callback}, {"SectioningSubsubsection", "sectioning-subsubsection", "\\su_bsubsection", NULL, "Sub-sub-section", (GCallback) _latex_menu_on_sectioning_subsubsection_gtk_action_callback}, {"SectioningParagraph", "sectioning-paragraph", "\\p_aragraph", NULL, "Paragraph", (GCallback
 ) _latex_menu_on_sectioning_paragraph_gtk_action_callback}, {"SectioningSubparagraph", "sectioning-paragraph", "\\subpa_ragraph", NULL, "Sub-paragraph", (GCallback) _latex_menu_on_sectioning_subparagraph_gtk_action_callback}, {"References", "references", "_References"}, {"ReferencesLabel", NULL, "\\_label", NULL, "Label", (GCallback) _latex_menu_on_ref_label_gtk_action_callback}, {"ReferencesRef", NULL, "\\_ref", NULL, "Reference to a label", (GCallback) _latex_menu_on_ref_ref_gtk_action_callback}, {"ReferencesPageref", NULL, "\\_pageref", NULL, "Page reference to a label", (GCallback) _latex_menu_on_ref_pageref_gtk_action_callback}, {"ReferencesIndex", NULL, "\\_index", NULL, "Add a word to the index", (GCallback) _latex_menu_on_ref_index_gtk_action_callback}, {"ReferencesFootnote", NULL, "\\_footnote", NULL, "Footnote", (GCallback) _latex_menu_on_ref_footnote_gtk_action_callback}, {"ReferencesCite", NULL, "\\_cite", NULL, "Reference to a bibliography item", (GCallback) _la
 tex_menu_on_ref_cite_gtk_action_callback}, {"Environments", GTK_STOCK_JUSTIFY_CENTER, "_Environments"}, {"EnvCenter", GTK_STOCK_JUSTIFY_CENTER, "\\begin{_center}", NULL, "Center - \\begin{center}", (GCallback) _latex_menu_on_env_center_gtk_action_callback}, {"EnvLeft", GTK_STOCK_JUSTIFY_LEFT, "\\begin{flush_left}", NULL, "Align Left - \\begin{flushleft}", (GCallback) _latex_menu_on_env_left_gtk_action_callback}, {"EnvRight", GTK_STOCK_JUSTIFY_RIGHT, "\\begin{flush_right}", NULL, "Align Right - \\begin{flushright}", (GCallback) _latex_menu_on_env_right_gtk_action_callback}, {"EnvFigure", NULL, "\\begin{_figure}", NULL, "Figure - \\begin{figure}", (GCallback) _latex_menu_on_env_figure_gtk_action_callback}, {"EnvTable", NULL, "\\begin{_table}", NULL, "Table - \\begin{table}", (GCallback) _latex_menu_on_env_table_gtk_action_callback}, {"EnvQuote", NULL, "\\begin{_quote}", NULL, "Quote - \\begin{quote}", (GCallback) _latex_menu_on_env_quote_gtk_action_callback}, {"EnvQuotation", 
 NULL, "\\begin{qu_otation}", NULL, "Quotation - \\begin{quotation}", (GCallback) _latex_menu_on_env_quotation_gtk_action_callback}, {"EnvVerse", NULL, "\\begin{_verse}", NULL, "Verse - \\begin{verse}", (GCallback) _latex_menu_on_env_verse_gtk_action_callback}, {"EnvVerbatim", NULL, "\\begin{ver_batim}", NULL, "Verbatim - \\begin{verbatim}", (GCallback) _latex_menu_on_env_verbatim_gtk_action_callback}, {"EnvMinipage", NULL, "\\begin{_minipage}", NULL, "Minipage - \\begin{minipage}", (GCallback) _latex_menu_on_env_minipage_gtk_action_callback}, {"EnvTitlepage", NULL, "\\begin{titlepage}", NULL, "Title page - \\begin{titlepage}", (GCallback) _latex_menu_on_env_titlepage_gtk_action_callback}, {"ListEnvironments", "list-enumerate", "_List Environments"}, {"ListEnvItemize", "list-itemize", "\\begin{_itemize}", NULL, "Bulleted List - \\begin{itemize}", (GCallback) _latex_menu_on_list_env_itemize_gtk_action_callback}, {"ListEnvEnumerate", "list-enumerate", "\\begin{_enumerate}", NUL
 L, "Enumeration - \\begin{enumerate}", (GCallback) _latex_menu_on_list_env_enumerate_gtk_action_callback}, {"ListEnvDescription", "list-description", "\\begin{_description}", NULL, "Description - \\begin{description}", (GCallback) _latex_menu_on_list_env_description_gtk_action_callback}, {"ListEnvList", NULL, "\\begin{_list}", NULL, "Custom list - \\begin{list}", (GCallback) _latex_menu_on_list_env_list_gtk_action_callback}, {"ListEnvItem", "list-item", "\\i_tem", "<Alt><Shift>H", "List item - \\item", (GCallback) _latex_menu_on_list_env_item_gtk_action_callback}, {"CharacterSize", "character-size", "_Characters Sizes"}, {"CharacterSizeTiny", NULL, "_tiny", NULL, "tiny", (GCallback) _latex_menu_on_size_tiny_gtk_action_callback}, {"CharacterSizeScriptsize", NULL, "_scriptsize", NULL, "scriptsize", (GCallback) _latex_menu_on_size_scriptsize_gtk_action_callback}, {"CharacterSizeFootnotesize", NULL, "_footnotesize", NULL, "footnotesize", (GCallback) _latex_menu_on_size_footnotes
 ize_gtk_action_callback}, {"CharacterSizeSmall", NULL, "s_mall", NULL, "small", (GCallback) _latex_menu_on_size_small_gtk_action_callback}, {"CharacterSizeNormalsize", NULL, "_normalsize", NULL, "normalsize", (GCallback) _latex_menu_on_size_normalsize_gtk_action_callback}, {"CharacterSizelarge", NULL, "_large", NULL, "large", (GCallback) _latex_menu_on_size_large_gtk_action_callback}, {"CharacterSizeLarge", NULL, "L_arge", NULL, "Large", (GCallback) _latex_menu_on_size_Large_gtk_action_callback}, {"CharacterSizeLARGE", NULL, "LA_RGE", NULL, "LARGE", (GCallback) _latex_menu_on_size_LARGE_gtk_action_callback}, {"CharacterSizehuge", NULL, "_huge", NULL, "huge", (GCallback) _latex_menu_on_size_huge_gtk_action_callback}, {"CharacterSizeHuge", NULL, "H_uge", NULL, "Huge", (GCallback) _latex_menu_on_size_Huge_gtk_action_callback}, {"FontStyles", "bold", "_Font Styles"}, {"Bold", "bold", "\\text_bf", "<Alt><Shift>B", "Bold - \\textbf", (GCallback) _latex_menu_on_text_bold_gtk_action
 _callback}, {"Italic", "italic", "\\text_it", "<Alt><Shift>I", "Italic - \\textit", (GCallback) _latex_menu_on_text_italic_gtk_action_callback}, {"Typewriter", "typewriter", "\\text_tt", "<Alt><Shift>T", "Typewriter - \\texttt", (GCallback) _latex_menu_on_text_typewriter_gtk_action_callback}, {"Slanted", "slanted", "\\text_sl", "<Alt><Shift>S", "Slanted - \\textsl", (GCallback) _latex_menu_on_text_slanted_gtk_action_callback}, {"SmallCaps", "small_caps", "\\texts_c", "<Alt><Shift>C", "Small Capitals - \\textsc", (GCallback) _latex_menu_on_text_small_caps_gtk_action_callback}, {"SansSerif", "sans_serif", "\\texts_f", NULL, "Sans Serif - \\textsf", (GCallback) _latex_menu_on_text_sans_serif_gtk_action_callback}, {"Emph", NULL, "\\_emph", NULL, "Emphasized - \\emph", (GCallback) _latex_menu_on_text_emph_gtk_action_callback}, {"Underline", "underline", "\\_underline", NULL, "Underline - \\underline", (GCallback) _latex_menu_on_text_underline_gtk_action_callback}, {"FontFamily", 
 NULL, "_Font Family"}, {"FontFamilyRoman", "roman", "\\_rmfamily", NULL, "Roman - \\rmfamily", (GCallback) _latex_menu_on_text_font_family_roman_gtk_action_callback}, {"FontFamilySansSerif", "sans_serif", "\\_sffamily", NULL, "Sans Serif - \\sffamily", (GCallback) _latex_menu_on_text_font_family_sans_serif_gtk_action_callback}, {"FontFamilyMonospace", "typewriter", "\\_ttfamily", NULL, "Monospace - \\ttfamily", (GCallback) _latex_menu_on_text_font_family_monospace_gtk_action_callback}, {"FontSeries", NULL, "F_ont Series"}, {"FontSeriesMedium", "roman", "\\_mdseries", NULL, "Medium - \\mdseries", (GCallback) _latex_menu_on_text_font_series_medium_gtk_action_callback}, {"FontSeriesBold", "bold", "\\_bfseries", NULL, "Bold - \\bfseries", (GCallback) _latex_menu_on_text_font_series_bold_gtk_action_callback}, {"FontShape", NULL, "Fo_nt Shape"}, {"FontShapeUpright", "roman", "\\_upshape", NULL, "Upright - \\upshape", (GCallback) _latex_menu_on_text_font_shape_upright_gtk_action_ca
 llback}, {"FontShapeItalic", "italic", "\\_itshape", NULL, "Italic - \\itshape", (GCallback) _latex_menu_on_text_font_shape_italic_gtk_action_callback}, {"FontShapeSlanted", "slanted", "\\_slshape", NULL, "Slanted - \\slshape", (GCallback) _latex_menu_on_text_font_shape_slanted_gtk_action_callback}, {"FontShapeSmallCaps", "small_caps", "\\s_cshape", NULL, "Small Capitals - \\scshape", (GCallback) _latex_menu_on_text_font_shape_small_caps_gtk_action_callback}, {"Tabular", "table", "_Tabular"}, {"TabularTabbing", NULL, "\\begin{ta_bbing}", NULL, "Tabbing - \\begin{tabbing}", (GCallback) _latex_menu_on_tabular_tabbing_gtk_action_callback}, {"TabularTabular", NULL, "\\begin{_tabular}", NULL, "Tabular - \\begin{tabular}", (GCallback) _latex_menu_on_tabular_tabular_gtk_action_callback}, {"TabularMulticolumn", NULL, "\\_multicolumn", NULL, "Multicolumn - \\multicolumn", (GCallback) _latex_menu_on_tabular_multicolumn_gtk_action_callback}, {"TabularHline", NULL, "\\_hline", NULL, "Ho
 rizontal line - \\hline", (GCallback) _latex_menu_on_tabular_hline_gtk_action_callback}, {"TabularVline", NULL, "\\_vline", NULL, "Vertical line - \\vline", (GCallback) _latex_menu_on_tabular_vline_gtk_action_callback}, {"TabularCline", NULL, "\\_cline", NULL, "Horizontal line (columns specified) - \\cline", (GCallback) _latex_menu_on_tabular_cline_gtk_action_callback}, {"Spacing", NULL, "_Spacing"}, {"SpacingNewLine", NULL, "New _Line", NULL, "New Line - \\\\", (GCallback) _latex_menu_on_spacing_new_line_gtk_action_callback}, {"SpacingNewPage", NULL, "\\new_page", NULL, "New page - \\newpage", (GCallback) _latex_menu_on_spacing_new_page_gtk_action_callback}, {"SpacingLineBreak", NULL, "\\l_inebreak", NULL, "Line break - \\linebreak", (GCallback) _latex_menu_on_spacing_line_break_gtk_action_callback}, {"SpacingPageBreak", NULL, "\\p_agebreak", NULL, "Page break - \\pagebreak", (GCallback) _latex_menu_on_spacing_page_break_gtk_action_callback}, {"SpacingBigSkip", NULL, "\\_bi
 gskip", NULL, "Big skip - \\bigskip", (GCallback) _latex_menu_on_spacing_bigskip_gtk_action_callback}, {"SpacingMedSkip", NULL, "\\_medskip", NULL, "Medium skip - \\medskip", (GCallback) _latex_menu_on_spacing_medskip_gtk_action_callback}, {"SpacingHSpace", NULL, "\\_hspace", NULL, "Horizontal space - \\hspace", (GCallback) _latex_menu_on_spacing_hspace_gtk_action_callback}, {"SpacingVSpace", NULL, "\\_vspace", NULL, "Vertical space - \\vspace", (GCallback) _latex_menu_on_spacing_vspace_gtk_action_callback}, {"SpacingNoIndent", NULL, "\\_noindent", NULL, "No paragraph indentation - \\noindent", (GCallback) _latex_menu_on_spacing_noindent_gtk_action_callback}, {"Accents", NULL, "International _Accents"}, {"Accent0", "accent0", "\\'", NULL, "Acute accent - \\'", (GCallback) _latex_menu_on_accent0_gtk_action_callback}, {"Accent1", "accent1", "\\`", NULL, "Grave accent - \\`", (GCallback) _latex_menu_on_accent1_gtk_action_callback}, {"Accent2", "accent2", "\\^", NULL, "Circumfle
 x accent - \\^", (GCallback) _latex_menu_on_accent2_gtk_action_callback}, {"Accent3", "accent3", "\\\"", NULL, "Trema - \\\"", (GCallback) _latex_menu_on_accent3_gtk_action_callback}, {"Accent4", "accent4", "\\~", NULL, "Tilde - \\~", (GCallback) _latex_menu_on_accent4_gtk_action_callback}, {"Accent5", "accent5", "\\=", NULL, "Macron - \\=", (GCallback) _latex_menu_on_accent5_gtk_action_callback}, {"Accent6", "accent6", "\\.", NULL, "Dot above - \\.", (GCallback) _latex_menu_on_accent6_gtk_action_callback}, {"Accent7", "accent7", "\\v", NULL, "Caron - \\v", (GCallback) _latex_menu_on_accent7_gtk_action_callback}, {"Accent8", "accent8", "\\u", NULL, "Breve - \\u", (GCallback) _latex_menu_on_accent8_gtk_action_callback}, {"Accent9", "accent9", "\\H", NULL, "Double acute accent - \\H", (GCallback) _latex_menu_on_accent9_gtk_action_callback}, {"Accent10", "accent10", "\\c", NULL, "Cedilla - \\c", (GCallback) _latex_menu_on_accent10_gtk_action_callback}, {"Accent11", "accent11", 
 "\\k", NULL, "Ogonek - \\k", (GCallback) _latex_menu_on_accent11_gtk_action_callback}, {"Accent12", "accent12", "\\d", NULL, "Dot below - \\d", (GCallback) _latex_menu_on_accent12_gtk_action_callback}, {"Accent13", "accent13", "\\b", NULL, "Macron below - \\b", (GCallback) _latex_menu_on_accent13_gtk_action_callback}, {"Accent14", "accent14", "\\r", NULL, "Ring - \\r", (GCallback) _latex_menu_on_accent14_gtk_action_callback}, {"Accent15", "accent15", "\\t", NULL, "Tie - \\t", (GCallback) _latex_menu_on_accent15_gtk_action_callback}, {"LatexMisc", NULL, "_Misc"}, {"LatexDocumentClass", NULL, "\\_documentclass", NULL, "Document class - \\documentclass", (GCallback) _latex_menu_on_documentclass_gtk_action_callback}, {"LatexUsepackage", NULL, "\\_usepackage", NULL, "Use package - \\usepackage", (GCallback) _latex_menu_on_usepackage_gtk_action_callback}, {"LatexAMS", NULL, "_AMS packages", NULL, "AMS packages", (GCallback) _latex_menu_on_ams_packages_gtk_action_callback}, {"Latex
 Author", NULL, "\\au_thor", NULL, "Author - \\author", (GCallback) _latex_menu_on_author_gtk_action_callback}, {"LatexTitle", NULL, "\\t_itle", NULL, "Title - \\title", (GCallback) _latex_menu_on_title_gtk_action_callback}, {"LatexBeginDocument", NULL, "\\begin{d_ocument}", NULL, "Content of the document - \\begin{document}", (GCallback) _latex_menu_on_begin_document_gtk_action_callback}, {"LatexMakeTitle", NULL, "\\_maketitle", NULL, "Make title - \\maketitle", (GCallback) _latex_menu_on_maketitle_gtk_action_callback}, {"LatexTableOfContents", NULL, "\\tableof_contents", NULL, "Table of contents - \\tableofcontents", (GCallback) _latex_menu_on_tableofcontents_gtk_action_callback}, {"LatexAbstract", NULL, "\\begin{abst_ract}", NULL, "Abstract - \\begin{abstract}", (GCallback) _latex_menu_on_abstract_gtk_action_callback}, {"LatexIncludeGraphics", NULL, "\\include_graphics", NULL, "Include an image (graphicx package) - \\includegraphics", (GCallback) _latex_menu_on_include_gra
 phics_gtk_action_callback}, {"LatexInput", NULL, "\\_input", NULL, "Include a file - \\input", (GCallback) _latex_menu_on_input_gtk_action_callback}, {"Math", NULL, "_Math"}, {"MathEnvironments", NULL, "_Math Environments"}, {"MathEnvNormal", "math", "_Mathematical Environment - $...$", "<Alt><Shift>M", "Mathematical Environment - $...$", (GCallback) _latex_menu_on_math_env_normal_gtk_action_callback}, {"MathEnvCentered", "math-centered", "_Centered Formula - \\[...\\]", "<Alt><Shift>E", "Centered Formula - \\[...\\]", (GCallback) _latex_menu_on_math_env_centered_gtk_action_callback}, {"MathEnvNumbered", "math-numbered", "_Numbered Equation - \\begin{equation}", NULL, "Numbered Equation - \\begin{equation}", (GCallback) _latex_menu_on_math_env_numbered_gtk_action_callback}, {"MathEnvArray", "math-array", "_Array of Equations - \\begin{align*}", NULL, "Array of Equations - \\begin{align*}", (GCallback) _latex_menu_on_math_env_array_gtk_action_callback}, {"MathEnvNumberedArray
 ", "math-numbered-array", "Numbered Array of _Equations - \\begin{align}", NULL, "Numbered Array of Equations - \\begin{align}", (GCallback) _latex_menu_on_math_env_numbered_array_gtk_action_callback}, {"MathSuperscript", "math-superscript", "_Superscript - ^{}", NULL, "Superscript - ^{}", (GCallback) _latex_menu_on_math_superscript_gtk_action_callback}, {"MathSubscript", "math-subscript", "Su_bscript - __{}", NULL, "Subscript - _{}", (GCallback) _latex_menu_on_math_subscript_gtk_action_callback}, {"MathFrac", "math-frac", "_Fraction - \\frac{}{}", "<Alt><Shift>F", "Fraction - \\frac{}{}", (GCallback) _latex_menu_on_math_frac_gtk_action_callback}, {"MathSquareRoot", "math-square-root", "Square _Root - \\sqrt{}", NULL, "Square Root - \\sqrt{}", (GCallback) _latex_menu_on_math_square_root_gtk_action_callback}, {"MathNthRoot", "math-nth-root", "_N-th Root - \\sqrt[]{}", NULL, "N-th Root - \\sqrt[]{}", (GCallback) _latex_menu_on_math_nth_root_gtk_action_callback}, {"MathFunction
 s", NULL, "Math _Functions"}, {"MathFuncArccos", NULL, "\\arccos", NULL, NULL, (GCallback) _latex_menu_on_math_func_arccos_gtk_action_callback}, {"MathFuncArcsin", NULL, "\\arcsin", NULL, NULL, (GCallback) _latex_menu_on_math_func_arcsin_gtk_action_callback}, {"MathFuncArctan", NULL, "\\arctan", NULL, NULL, (GCallback) _latex_menu_on_math_func_arctan_gtk_action_callback}, {"MathFuncCos", NULL, "\\cos", NULL, NULL, (GCallback) _latex_menu_on_math_func_cos_gtk_action_callback}, {"MathFuncCosh", NULL, "\\cosh", NULL, NULL, (GCallback) _latex_menu_on_math_func_cosh_gtk_action_callback}, {"MathFuncCot", NULL, "\\cot", NULL, NULL, (GCallback) _latex_menu_on_math_func_cot_gtk_action_callback}, {"MathFuncCoth", NULL, "\\coth", NULL, NULL, (GCallback) _latex_menu_on_math_func_coth_gtk_action_callback}, {"MathFuncCsc", NULL, "\\csc", NULL, NULL, (GCallback) _latex_menu_on_math_func_csc_gtk_action_callback}, {"MathFuncDeg", NULL, "\\deg", NULL, NULL, (GCallback) _latex_menu_on_math_fun
 c_deg_gtk_action_callback}, {"MathFuncDet", NULL, "\\det", NULL, NULL, (GCallback) _latex_menu_on_math_func_det_gtk_action_callback}, {"MathFuncDim", NULL, "\\dim", NULL, NULL, (GCallback) _latex_menu_on_math_func_dim_gtk_action_callback}, {"MathFuncExp", NULL, "\\exp", NULL, NULL, (GCallback) _latex_menu_on_math_func_exp_gtk_action_callback}, {"MathFuncGcd", NULL, "\\gcd", NULL, NULL, (GCallback) _latex_menu_on_math_func_gcd_gtk_action_callback}, {"MathFuncHom", NULL, "\\hom", NULL, NULL, (GCallback) _latex_menu_on_math_func_hom_gtk_action_callback}, {"MathFuncInf", NULL, "\\inf", NULL, NULL, (GCallback) _latex_menu_on_math_func_inf_gtk_action_callback}, {"MathFuncKer", NULL, "\\ker", NULL, NULL, (GCallback) _latex_menu_on_math_func_ker_gtk_action_callback}, {"MathFuncLg", NULL, "\\lg", NULL, NULL, (GCallback) _latex_menu_on_math_func_lg_gtk_action_callback}, {"MathFuncLim", NULL, "\\lim", NULL, NULL, (GCallback) _latex_menu_on_math_func_lim_gtk_action_callback}, {"MathFunc
 Liminf", NULL, "\\liminf", NULL, NULL, (GCallback) _latex_menu_on_math_func_liminf_gtk_action_callback}, {"MathFuncLimsup", NULL, "\\limsup", NULL, NULL, (GCallback) _latex_menu_on_math_func_limsup_gtk_action_callback}, {"MathFuncLn", NULL, "\\ln", NULL, NULL, (GCallback) _latex_menu_on_math_func_ln_gtk_action_callback}, {"MathFuncLog", NULL, "\\log", NULL, NULL, (GCallback) _latex_menu_on_math_func_log_gtk_action_callback}, {"MathFuncMax", NULL, "\\max", NULL, NULL, (GCallback) _latex_menu_on_math_func_max_gtk_action_callback}, {"MathFuncMin", NULL, "\\min", NULL, NULL, (GCallback) _latex_menu_on_math_func_min_gtk_action_callback}, {"MathFuncSec", NULL, "\\sec", NULL, NULL, (GCallback) _latex_menu_on_math_func_sec_gtk_action_callback}, {"MathFuncSin", NULL, "\\sin", NULL, NULL, (GCallback) _latex_menu_on_math_func_sin_gtk_action_callback}, {"MathFuncSinh", NULL, "\\sinh", NULL, NULL, (GCallback) _latex_menu_on_math_func_sinh_gtk_action_callback}, {"MathFuncSup", NULL, "\\su
 p", NULL, NULL, (GCallback) _latex_menu_on_math_func_sup_gtk_action_callback}, {"MathFuncTan", NULL, "\\tan", NULL, NULL, (GCallback) _latex_menu_on_math_func_tan_gtk_action_callback}, {"MathFuncTanh", NULL, "\\tanh", NULL, NULL, (GCallback) _latex_menu_on_math_func_tanh_gtk_action_callback}, {"MathFontStyles", NULL, "Math Font _Styles"}, {"MathFSrm", "roman", "\\math_rm", NULL, "Roman - \\mathrm", (GCallback) _latex_menu_on_math_font_style_rm_gtk_action_callback}, {"MathFSit", "italic", "\\math_it", NULL, "Italic - \\mathit", (GCallback) _latex_menu_on_math_font_style_it_gtk_action_callback}, {"MathFSbf", "bold", "\\math_bf", NULL, "Bold - \\mathbf", (GCallback) _latex_menu_on_math_font_style_bf_gtk_action_callback}, {"MathFSsf", "sans_serif", "\\math_sf", NULL, "Sans Serif - \\mathsf", (GCallback) _latex_menu_on_math_font_style_sf_gtk_action_callback}, {"MathFStt", "typewriter", "\\math_tt", NULL, "Typewriter - \\mathtt", (GCallback) _latex_menu_on_math_font_style_tt_gtk_a
 ction_callback}, {"MathFScal", "mathcal", "\\math_cal", NULL, "Calligraphic - \\mathcal", (GCallback) _latex_menu_on_math_font_style_cal_gtk_action_callback}, {"MathFSbb", "blackboard", "\\_mathbb", NULL, "Blackboard (uppercase only)  - \\mathbb (amsfonts package)", (GCallback) _latex_menu_on_math_font_style_bb_gtk_action_callback}, {"MathFSfrak", "mathfrak", "\\math_frak", NULL, "Euler Fraktur - \\mathfrak (amsfonts package)", (GCallback) _latex_menu_on_math_font_style_frak_gtk_action_callback}, {"MathAccents", NULL, "Math _Accents"}, {"MathAccentAcute", "mathaccent0", "\\_acute", NULL, NULL, (GCallback) _latex_menu_on_math_accent_acute_gtk_action_callback}, {"MathAccentGrave", "mathaccent1", "\\_grave", NULL, NULL, (GCallback) _latex_menu_on_math_accent_grave_gtk_action_callback}, {"MathAccentTilde", "mathaccent2", "\\_tilde", NULL, NULL, (GCallback) _latex_menu_on_math_accent_tilde_gtk_action_callback}, {"MathAccentBar", "mathaccent3", "\\_bar", NULL, NULL, (GCallback) _l
 atex_menu_on_math_accent_bar_gtk_action_callback}, {"MathAccentVec", "mathaccent4", "\\_vec", NULL, NULL, (GCallback) _latex_menu_on_math_accent_vec_gtk_action_callback}, {"MathAccentHat", "mathaccent5", "\\_hat", NULL, NULL, (GCallback) _latex_menu_on_math_accent_hat_gtk_action_callback}, {"MathAccentCheck", "mathaccent6", "\\_check", NULL, NULL, (GCallback) _latex_menu_on_math_accent_check_gtk_action_callback}, {"MathAccentBreve", "mathaccent7", "\\b_reve", NULL, NULL, (GCallback) _latex_menu_on_math_accent_breve_gtk_action_callback}, {"MathAccentDot", "mathaccent8", "\\_dot", NULL, NULL, (GCallback) _latex_menu_on_math_accent_dot_gtk_action_callback}, {"MathAccentDdot", "mathaccent9", "\\dd_ot", NULL, NULL, (GCallback) _latex_menu_on_math_accent_ddot_gtk_action_callback}, {"MathAccentRing", "mathaccent10", "\\_mathring", NULL, NULL, (GCallback) _latex_menu_on_math_accent_ring_gtk_action_callback}, {"MathSpaces", NULL, "Math _Spaces"}, {"MathSpaceSmall", NULL, "_Small", NU
 LL, "Small - \\,", (GCallback) _latex_menu_on_math_space_small_gtk_action_callback}, {"MathSpaceMedium", NULL, "_Medium", NULL, "Medium - \\:", (GCallback) _latex_menu_on_math_space_medium_gtk_action_callback}, {"MathSpaceLarge", NULL, "_Large", NULL, "Large - \\;", (GCallback) _latex_menu_on_math_space_large_gtk_action_callback}, {"MathSpaceQuad", NULL, "\\_quad", NULL, NULL, (GCallback) _latex_menu_on_math_space_quad_gtk_action_callback}, {"MathSpaceQquad", NULL, "\\qqu_ad", NULL, NULL, (GCallback) _latex_menu_on_math_space_qquad_gtk_action_callback}, {"MathLeftDelimiters", "delimiters-left", "_Left Delimiters"}, {"MathLeftDelimiter1", NULL, "left (", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_1_gtk_action_callback}, {"MathLeftDelimiter2", NULL, "left [", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_2_gtk_action_callback}, {"MathLeftDelimiter3", NULL, "left { ", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_3_gtk_action_callback},
  {"MathLeftDelimiter4", NULL, "left <", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_4_gtk_action_callback}, {"MathLeftDelimiter5", NULL, "left )", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_5_gtk_action_callback}, {"MathLeftDelimiter6", NULL, "left ]", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_6_gtk_action_callback}, {"MathLeftDelimiter7", NULL, "left  }", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_7_gtk_action_callback}, {"MathLeftDelimiter8", NULL, "left >", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_8_gtk_action_callback}, {"MathLeftDelimiter9", NULL, "left .", NULL, NULL, (GCallback) _latex_menu_on_math_left_delimiter_9_gtk_action_callback}, {"MathRightDelimiters", "delimiters-right", "Right _Delimiters"}, {"MathRightDelimiter1", NULL, "right )", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_1_gtk_action_callback}, {"MathRightDelimiter2", NULL, "right ]", NULL, NULL, (GCallback)
  _latex_menu_on_math_right_delimiter_2_gtk_action_callback}, {"MathRightDelimiter3", NULL, "right  }", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_3_gtk_action_callback}, {"MathRightDelimiter4", NULL, "right >", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_4_gtk_action_callback}, {"MathRightDelimiter5", NULL, "right (", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_5_gtk_action_callback}, {"MathRightDelimiter6", NULL, "right [", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_6_gtk_action_callback}, {"MathRightDelimiter7", NULL, "right { ", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_7_gtk_action_callback}, {"MathRightDelimiter8", NULL, "right <", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_8_gtk_action_callback}, {"MathRightDelimiter9", NULL, "right .", NULL, NULL, (GCallback) _latex_menu_on_math_right_delimiter_9_gtk_action_callback}};
 
 static void _latex_menu_on_sectioning_part_gtk_action_callback (GtkAction* action, gpointer self) {
 	latex_menu_on_sectioning_part (self);
@@ -1529,7 +1529,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	regex = _tmp3_;
 	if (_inner_error_ != NULL) {
 		if (_inner_error_->domain == G_REGEX_ERROR) {
-			goto __catch43_g_regex_error;
+			goto __catch45_g_regex_error;
 		}
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -1540,7 +1540,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	if (_inner_error_ != NULL) {
 		_g_regex_unref0 (regex);
 		if (_inner_error_->domain == G_REGEX_ERROR) {
-			goto __catch43_g_regex_error;
+			goto __catch45_g_regex_error;
 		}
 		_g_regex_unref0 (regex);
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1551,8 +1551,8 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 	_g_regex_unref0 (regex);
 	return result;
 	_g_regex_unref0 (regex);
-	goto __finally43;
-	__catch43_g_regex_error:
+	goto __finally45;
+	__catch45_g_regex_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1560,7 +1560,7 @@ static gchar* string_replace (const gchar* self, const gchar* old, const gchar*
 		g_assert_not_reached ();
 		_g_error_free0 (e);
 	}
-	__finally43:
+	__finally45:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
diff --git a/src/C/latex_post_processor.c b/src/C/latex_post_processor.c
index 48d6d01..a2fd66f 100644
--- a/src/C/latex_post_processor.c
+++ b/src/C/latex_post_processor.c
@@ -1,4 +1,4 @@
-/* latex_post_processor.c generated by valac 0.12.0, the Vala compiler
+/* latex_post_processor.c generated by valac 0.12.1, the Vala compiler
  * generated from latex_post_processor.vala, do not modify */
 
 /*
@@ -210,6 +210,7 @@ static void _g_slist_free__latex_post_processor_file_in_stack_free0_ (GSList* se
 #define LATEX_POST_PROCESSOR_NO_LINE (-1)
 LatexPostProcessor* latex_post_processor_new (void);
 LatexPostProcessor* latex_post_processor_construct (GType object_type);
+static void latex_post_processor_reset_msg (LatexPostProcessor* self);
 static void latex_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output, gint status);
 void post_processor_set_successful (PostProcessor* self, gboolean value);
 static void latex_post_processor_latex_output_filter (LatexPostProcessor* self, const gchar* line);
@@ -264,8 +265,6 @@ static void _g_slist_free__latex_post_processor_file_in_stack_free0_ (GSList* se
 
 LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 	LatexPostProcessor * self = NULL;
-	BuildIssue _tmp30_ = {0};
-	BuildIssue _tmp31_ = {0};
 	GError * _inner_error_ = NULL;
 	self = (LatexPostProcessor*) g_object_new (object_type, NULL);
 	if (latex_post_processor_reg_badbox == NULL) {
@@ -303,7 +302,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp1_ = _tmp0_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -315,7 +314,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp3_ = _tmp2_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -327,7 +326,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp5_ = _tmp4_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -339,7 +338,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp7_ = _tmp6_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -347,11 +346,11 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		}
 		_g_regex_unref0 (latex_post_processor_reg_badbox_output);
 		latex_post_processor_reg_badbox_output = _tmp7_;
-		_tmp8_ = g_regex_new ("^(((! )?(La|pdf)TeX)|Package|Class) .*Warning.*:(.*)", G_REGEX_CASELESS, 0, &_inner_error_);
+		_tmp8_ = g_regex_new ("^(((! )?(La|pdf)TeX)|Package|Class) .*Warning[^:]*:[[:space:]]*(.*)", G_REGEX_CASELESS, 0, &_inner_error_);
 		_tmp9_ = _tmp8_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -363,7 +362,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp11_ = _tmp10_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -375,7 +374,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp13_ = _tmp12_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -387,7 +386,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp15_ = _tmp14_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -399,7 +398,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp17_ = _tmp16_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -411,7 +410,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp19_ = _tmp18_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -423,7 +422,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp21_ = _tmp20_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -435,7 +434,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp23_ = _tmp22_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -447,7 +446,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp25_ = _tmp24_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -459,7 +458,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp27_ = _tmp26_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -471,7 +470,7 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		_tmp29_ = _tmp28_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch32_g_regex_error;
+				goto __catch34_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -479,8 +478,8 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 		}
 		_g_regex_unref0 (latex_post_processor_reg_spaces);
 		latex_post_processor_reg_spaces = _tmp29_;
-		goto __finally32;
-		__catch32_g_regex_error:
+		goto __finally34;
+		__catch34_g_regex_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -488,20 +487,14 @@ LatexPostProcessor* latex_post_processor_construct (GType object_type) {
 			fprintf (stderr, "LatexPostProcessor: %s\n", e->message);
 			_g_error_free0 (e);
 		}
-		__finally32:
+		__finally34:
 		if (_inner_error_ != NULL) {
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
 			return NULL;
 		}
 	}
-	memset (&_tmp30_, 0, sizeof (BuildIssue));
-	_tmp31_ = _tmp30_;
-	build_issue_destroy (&self->priv->msg);
-	self->priv->msg = _tmp31_;
-	self->priv->msg.message_type = BUILD_MESSAGE_TYPE_OTHER;
-	self->priv->msg.start_line = LATEX_POST_PROCESSOR_NO_LINE;
-	self->priv->msg.end_line = LATEX_POST_PROCESSOR_NO_LINE;
+	latex_post_processor_reset_msg (self);
 	return self;
 }
 
@@ -616,7 +609,9 @@ static PostProcessorIssues* latex_post_processor_real_get_issues (PostProcessor*
 	_g_object_unref0 (pp_issues[0].issues);
 	pp_issues[0].issues = _tmp1_;
 	_tmp2_ = pp_issues;
-	*result_length1 = pp_issues_length1;
+	if (result_length1) {
+		*result_length1 = pp_issues_length1;
+	}
 	result = _tmp2_;
 	return result;
 }
@@ -695,14 +690,6 @@ static void latex_post_processor_latex_output_filter (LatexPostProcessor* self,
 }
 
 
-static const gchar* string_to_string (const gchar* self) {
-	const gchar* result = NULL;
-	g_return_val_if_fail (self != NULL, NULL);
-	result = self;
-	return result;
-}
-
-
 static gboolean latex_post_processor_detect_badbox (LatexPostProcessor* self, const gchar* line) {
 	gboolean result = FALSE;
 	g_return_val_if_fail (self != NULL, FALSE);
@@ -718,7 +705,6 @@ static gboolean latex_post_processor_detect_badbox (LatexPostProcessor* self, co
 				return result;
 			}
 			self->priv->msg.message_type = BUILD_MESSAGE_TYPE_BADBOX;
-			self->priv->nb_badboxes++;
 			_tmp1_ = latex_post_processor_detect_badbox_line (self, line, FALSE);
 			if (_tmp1_) {
 				latex_post_processor_add_msg (self, TRUE);
@@ -734,23 +720,16 @@ static gboolean latex_post_processor_detect_badbox (LatexPostProcessor* self, co
 		}
 		case LATEX_POST_PROCESSOR_FILTER_STATUS_BADBOX:
 		{
-			const gchar* _tmp3_ = NULL;
-			gchar* _tmp4_ = NULL;
-			gchar* _tmp5_;
-			gchar* _tmp6_;
-			gint _tmp7_;
-			gboolean _tmp8_;
-			_tmp3_ = string_to_string (line);
-			_tmp4_ = g_strconcat (" ", _tmp3_, NULL);
-			_tmp5_ = _tmp4_;
-			_tmp6_ = g_strconcat (self->priv->line_buf, _tmp5_, NULL);
+			gchar* _tmp3_;
+			gint _tmp4_;
+			gboolean _tmp5_;
+			_tmp3_ = g_strconcat (self->priv->line_buf, line, NULL);
 			_g_free0 (self->priv->line_buf);
-			self->priv->line_buf = _tmp6_;
-			_g_free0 (_tmp5_);
+			self->priv->line_buf = _tmp3_;
 			self->priv->nb_lines++;
-			_tmp7_ = strlen (line);
-			_tmp8_ = latex_post_processor_detect_badbox_line (self, self->priv->line_buf, _tmp7_ == 0);
-			if (_tmp8_) {
+			_tmp4_ = strlen (line);
+			_tmp5_ = latex_post_processor_detect_badbox_line (self, self->priv->line_buf, _tmp4_ == 0);
+			if (_tmp5_) {
 				latex_post_processor_add_msg (self, TRUE);
 				self->priv->nb_lines = 0;
 			}
@@ -893,7 +872,6 @@ static gboolean latex_post_processor_detect_warning (LatexPostProcessor* self, c
 				gint strings_length1;
 				gint _strings_size_;
 				gboolean _tmp3_;
-				self->priv->nb_warnings++;
 				self->priv->msg.message_type = BUILD_MESSAGE_TYPE_WARNING;
 				_tmp2_ = _tmp1_ = g_regex_split (latex_post_processor_reg_warning, line, 0);
 				strings = _tmp2_;
@@ -922,7 +900,6 @@ static gboolean latex_post_processor_detect_warning (LatexPostProcessor* self, c
 					gint strings_length1;
 					gint _strings_size_;
 					gchar* _tmp8_;
-					self->priv->nb_warnings++;
 					self->priv->msg.message_type = BUILD_MESSAGE_TYPE_WARNING;
 					_tmp7_ = _tmp6_ = g_regex_split (latex_post_processor_reg_warning_no_file, line, 0);
 					strings = _tmp7_;
@@ -943,23 +920,16 @@ static gboolean latex_post_processor_detect_warning (LatexPostProcessor* self, c
 		}
 		case LATEX_POST_PROCESSOR_FILTER_STATUS_WARNING:
 		{
-			const gchar* _tmp9_ = NULL;
-			gchar* _tmp10_ = NULL;
-			gchar* _tmp11_;
-			gchar* _tmp12_;
-			gint _tmp13_;
-			gboolean _tmp14_;
-			_tmp9_ = string_to_string (line);
-			_tmp10_ = g_strconcat (" ", _tmp9_, NULL);
-			_tmp11_ = _tmp10_;
-			_tmp12_ = g_strconcat (self->priv->line_buf, _tmp11_, NULL);
+			gchar* _tmp9_;
+			gint _tmp10_;
+			gboolean _tmp11_;
+			_tmp9_ = g_strconcat (self->priv->line_buf, line, NULL);
 			_g_free0 (self->priv->line_buf);
-			self->priv->line_buf = _tmp12_;
-			_g_free0 (_tmp11_);
+			self->priv->line_buf = _tmp9_;
 			self->priv->nb_lines++;
-			_tmp13_ = strlen (line);
-			_tmp14_ = latex_post_processor_detect_warning_line (self, self->priv->line_buf, _tmp13_ == 0);
-			if (_tmp14_) {
+			_tmp10_ = strlen (line);
+			_tmp11_ = latex_post_processor_detect_warning_line (self, self->priv->line_buf, _tmp10_ == 0);
+			if (_tmp11_) {
 				latex_post_processor_add_msg (self, TRUE);
 				self->priv->nb_lines = 0;
 			}
@@ -1146,7 +1116,6 @@ static gboolean latex_post_processor_detect_error (LatexPostProcessor* self, con
 			if (found) {
 				gint _tmp12_;
 				gchar _tmp13_;
-				self->priv->nb_errors++;
 				self->priv->nb_lines++;
 				self->priv->msg.message_type = BUILD_MESSAGE_TYPE_ERROR;
 				_tmp12_ = strlen (line);
@@ -1174,34 +1143,27 @@ static gboolean latex_post_processor_detect_error (LatexPostProcessor* self, con
 		}
 		case LATEX_POST_PROCESSOR_FILTER_STATUS_ERROR:
 		{
-			const gchar* _tmp16_ = NULL;
-			gchar* _tmp17_ = NULL;
-			gchar* _tmp18_;
-			gchar* _tmp19_;
-			gint _tmp20_;
-			gchar _tmp21_;
-			_tmp16_ = string_to_string (line);
-			_tmp17_ = g_strconcat (" ", _tmp16_, NULL);
-			_tmp18_ = _tmp17_;
-			_tmp19_ = g_strconcat (self->priv->line_buf, _tmp18_, NULL);
+			gchar* _tmp16_;
+			gint _tmp17_;
+			gchar _tmp18_;
+			_tmp16_ = g_strconcat (self->priv->line_buf, line, NULL);
 			_g_free0 (self->priv->line_buf);
-			self->priv->line_buf = _tmp19_;
-			_g_free0 (_tmp18_);
+			self->priv->line_buf = _tmp16_;
 			self->priv->nb_lines++;
-			_tmp20_ = strlen (line);
-			_tmp21_ = string_get (line, (glong) (_tmp20_ - 1));
-			if (_tmp21_ == '.') {
-				gchar* _tmp22_;
-				_tmp22_ = g_strdup (self->priv->line_buf);
+			_tmp17_ = strlen (line);
+			_tmp18_ = string_get (line, (glong) (_tmp17_ - 1));
+			if (_tmp18_ == '.') {
+				gchar* _tmp19_;
+				_tmp19_ = g_strdup (self->priv->line_buf);
 				_g_free0 (self->priv->msg.message);
-				self->priv->msg.message = _tmp22_;
+				self->priv->msg.message = _tmp19_;
 				self->priv->status = LATEX_POST_PROCESSOR_FILTER_STATUS_ERROR_SEARCH_LINE;
 			} else {
 				if (self->priv->nb_lines > 4) {
-					gchar* _tmp23_;
-					_tmp23_ = g_strdup (self->priv->line_buf);
+					gchar* _tmp20_;
+					_tmp20_ = g_strdup (self->priv->line_buf);
 					_g_free0 (self->priv->msg.message);
-					self->priv->msg.message = _tmp23_;
+					self->priv->msg.message = _tmp20_;
 					self->priv->msg.start_line = LATEX_POST_PROCESSOR_NO_LINE;
 					latex_post_processor_add_msg (self, TRUE);
 					self->priv->nb_lines = 0;
@@ -1213,22 +1175,22 @@ static gboolean latex_post_processor_detect_error (LatexPostProcessor* self, con
 		}
 		case LATEX_POST_PROCESSOR_FILTER_STATUS_ERROR_SEARCH_LINE:
 		{
-			gboolean _tmp24_;
+			gboolean _tmp21_;
 			self->priv->nb_lines++;
-			_tmp24_ = g_regex_match (latex_post_processor_reg_error_line, line, 0, NULL);
-			if (_tmp24_) {
-				gchar** _tmp25_;
-				gchar** _tmp26_ = NULL;
+			_tmp21_ = g_regex_match (latex_post_processor_reg_error_line, line, 0, NULL);
+			if (_tmp21_) {
+				gchar** _tmp22_;
+				gchar** _tmp23_ = NULL;
 				gchar** strings;
 				gint strings_length1;
 				gint _strings_size_;
-				gint _tmp27_;
-				_tmp26_ = _tmp25_ = g_regex_split (latex_post_processor_reg_error_line, line, 0);
-				strings = _tmp26_;
-				strings_length1 = _vala_array_length (_tmp25_);
-				_strings_size_ = _vala_array_length (_tmp25_);
-				_tmp27_ = atoi (strings[1]);
-				self->priv->msg.start_line = _tmp27_;
+				gint _tmp24_;
+				_tmp23_ = _tmp22_ = g_regex_split (latex_post_processor_reg_error_line, line, 0);
+				strings = _tmp23_;
+				strings_length1 = _vala_array_length (_tmp22_);
+				_strings_size_ = _vala_array_length (_tmp22_);
+				_tmp24_ = atoi (strings[1]);
+				self->priv->msg.start_line = _tmp24_;
 				latex_post_processor_add_msg (self, TRUE);
 				self->priv->nb_lines = 0;
 				self->priv->status = LATEX_POST_PROCESSOR_FILTER_STATUS_START;
@@ -1341,7 +1303,7 @@ static gboolean latex_post_processor_detect_other (LatexPostProcessor* self, con
 		new_line = _tmp9_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch33_g_regex_error;
+				goto __catch35_g_regex_error;
 			}
 			_g_free0 (human_size);
 			strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
@@ -1353,8 +1315,8 @@ static gboolean latex_post_processor_detect_other (LatexPostProcessor* self, con
 		_g_free0 (self->priv->msg.message);
 		self->priv->msg.message = _tmp10_;
 		_g_free0 (new_line);
-		goto __finally33;
-		__catch33_g_regex_error:
+		goto __finally35;
+		__catch35_g_regex_error:
 		{
 			GError * e;
 			gchar* _tmp11_;
@@ -1365,7 +1327,7 @@ static gboolean latex_post_processor_detect_other (LatexPostProcessor* self, con
 			self->priv->msg.message = _tmp11_;
 			_g_error_free0 (e);
 		}
-		__finally33:
+		__finally35:
 		if (_inner_error_ != NULL) {
 			_g_free0 (human_size);
 			strings = (_vala_array_free (strings, strings_length1, (GDestroyNotify) g_free), NULL);
@@ -1963,30 +1925,40 @@ static gboolean latex_post_processor_top_file_on_stack_is_reliable (LatexPostPro
 
 
 static void latex_post_processor_add_msg (LatexPostProcessor* self, gboolean set_filename) {
-	gchar* _tmp1_ = NULL;
-	gchar* _tmp2_;
+	gboolean _tmp0_ = FALSE;
+	gchar* _tmp2_ = NULL;
+	gchar* _tmp3_;
 	GError * _inner_error_ = NULL;
 	g_return_if_fail (self != NULL);
+	if (self->priv->msg.message_type == BUILD_MESSAGE_TYPE_WARNING) {
+		_tmp0_ = g_strcmp0 (self->priv->msg.message, "There were undefined references.") == 0;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	if (_tmp0_) {
+		latex_post_processor_reset_msg (self);
+		return;
+	}
 	if (set_filename) {
-		gchar* _tmp0_ = NULL;
-		_tmp0_ = latex_post_processor_get_current_filename (self);
+		gchar* _tmp1_ = NULL;
+		_tmp1_ = latex_post_processor_get_current_filename (self);
 		_g_free0 (self->priv->msg.filename);
-		self->priv->msg.filename = _tmp0_;
+		self->priv->msg.filename = _tmp1_;
 	}
-	_tmp1_ = g_regex_replace (latex_post_processor_reg_spaces, self->priv->msg.message, (gssize) (-1), 0, " ", 0, &_inner_error_);
-	_tmp2_ = _tmp1_;
+	_tmp2_ = g_regex_replace (latex_post_processor_reg_spaces, self->priv->msg.message, (gssize) (-1), 0, " ", 0, &_inner_error_);
+	_tmp3_ = _tmp2_;
 	if (_inner_error_ != NULL) {
 		if (_inner_error_->domain == G_REGEX_ERROR) {
-			goto __catch34_g_regex_error;
+			goto __catch36_g_regex_error;
 		}
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
 		return;
 	}
 	_g_free0 (self->priv->msg.message);
-	self->priv->msg.message = _tmp2_;
-	goto __finally34;
-	__catch34_g_regex_error:
+	self->priv->msg.message = _tmp3_;
+	goto __finally36;
+	__catch36_g_regex_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1994,13 +1966,44 @@ static void latex_post_processor_add_msg (LatexPostProcessor* self, gboolean set
 		fprintf (stderr, "Latex post processor warning: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally34:
+	__finally36:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
 		return;
 	}
+	switch (self->priv->msg.message_type) {
+		case BUILD_MESSAGE_TYPE_BADBOX:
+		{
+			self->priv->nb_badboxes++;
+			break;
+		}
+		case BUILD_MESSAGE_TYPE_WARNING:
+		{
+			self->priv->nb_warnings++;
+			break;
+		}
+		case BUILD_MESSAGE_TYPE_ERROR:
+		{
+			self->priv->nb_errors++;
+			break;
+		}
+		default:
+		break;
+	}
 	gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->issues, &self->priv->msg);
+	latex_post_processor_reset_msg (self);
+}
+
+
+static void latex_post_processor_reset_msg (LatexPostProcessor* self) {
+	BuildIssue _tmp0_ = {0};
+	BuildIssue _tmp1_ = {0};
+	g_return_if_fail (self != NULL);
+	memset (&_tmp0_, 0, sizeof (BuildIssue));
+	_tmp1_ = _tmp0_;
+	build_issue_destroy (&self->priv->msg);
+	self->priv->msg = _tmp1_;
 	_g_free0 (self->priv->msg.message);
 	self->priv->msg.message = NULL;
 	self->priv->msg.message_type = BUILD_MESSAGE_TYPE_OTHER;
diff --git a/src/C/main.c b/src/C/main.c
index b4864d1..00ca7f1 100644
--- a/src/C/main.c
+++ b/src/C/main.c
@@ -1,10 +1,10 @@
-/* main.c generated by valac 0.12.0, the Vala compiler
+/* main.c generated by valac 0.12.1, the Vala compiler
  * generated from main.vala, do not modify */
 
 /*
  * This file is part of LaTeXila.
  *
- * Copyright  2010 SÃbastien Wilmet
+ * Copyright  2010-2011 SÃbastien Wilmet
  *
  * LaTeXila is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@ gchar** remaining_args = NULL;
 extern gint application_NEW_WINDOW;
 
 gint _vala_main (gchar** args, int args_length1);
-static void _vala_array_add18 (gchar*** array, int* length, int* size, gchar* value);
+static void _vala_array_add19 (gchar*** array, int* length, int* size, gchar* value);
 GType application_get_type (void) G_GNUC_CONST;
 Application* application_get_default (void);
 void application_open_documents (Application* self, gchar** uris);
@@ -72,7 +72,7 @@ static gint _vala_array_length (gpointer array);
 
 const GOptionEntry options[5] = {{"version", 'V', 0, G_OPTION_ARG_NONE, &option_version, "Show the application's version", NULL}, {"new-document", 'n', 0, G_OPTION_ARG_NONE, &option_new_document, "Create new document", NULL}, {"new-window", '\0', 0, G_OPTION_ARG_NONE, &option_new_window, "Create a new top-level window in an existing instance of LaTeXila", NULL}, {"", '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &remaining_args, NULL, "[FILE...]"}, {NULL}};
 
-static void _vala_array_add18 (gchar*** array, int* length, int* size, gchar* value) {
+static void _vala_array_add19 (gchar*** array, int* length, int* size, gchar* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (gchar*, *array, (*size) + 1);
@@ -124,15 +124,15 @@ gint _vala_main (gchar** args, int args_length1) {
 	g_option_context_parse (context, &args_length1, &args, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		if (_inner_error_->domain == G_OPTION_ERROR) {
-			goto __catch52_g_option_error;
+			goto __catch60_g_option_error;
 		}
 		_g_option_context_free0 (context);
 		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
 		return 0;
 	}
-	goto __finally52;
-	__catch52_g_option_error:
+	goto __finally60;
+	__catch60_g_option_error:
 	{
 		GError * e;
 		const gchar* _tmp4_ = NULL;
@@ -146,7 +146,7 @@ gint _vala_main (gchar** args, int args_length1) {
 		_g_option_context_free0 (context);
 		return result;
 	}
-	__finally52:
+	__finally60:
 	if (_inner_error_ != NULL) {
 		_g_option_context_free0 (context);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -190,7 +190,7 @@ gint _vala_main (gchar** args, int args_length1) {
 					_tmp8_ = g_file_new_for_path (arg);
 					_tmp9_ = _tmp8_;
 					_tmp10_ = g_file_get_uri (_tmp9_);
-					_vala_array_add18 (&uris, &uris_length1, &_uris_size_, _tmp10_);
+					_vala_array_add19 (&uris, &uris_length1, &_uris_size_, _tmp10_);
 					_g_object_unref0 (_tmp9_);
 					_g_free0 (arg);
 				}
@@ -259,7 +259,7 @@ gint _vala_main (gchar** args, int args_length1) {
 			ok = resp == UNIQUE_RESPONSE_OK;
 		}
 		if (!ok) {
-			g_error ("main.vala:133: Error: communication with first instance of LaTeXila fa" \
+			g_error ("main.vala:134: Error: communication with first instance of LaTeXila fa" \
 "iled\n");
 		}
 		result = 0;
diff --git a/src/C/main_window.c b/src/C/main_window.c
index ecdc734..1a0c81d 100644
--- a/src/C/main_window.c
+++ b/src/C/main_window.c
@@ -1,4 +1,4 @@
-/* main_window.c generated by valac 0.12.0, the Vala compiler
+/* main_window.c generated by valac 0.12.1, the Vala compiler
  * generated from main_window.vala, do not modify */
 
 /*
@@ -150,6 +150,16 @@ typedef struct _BuildToolRunnerClass BuildToolRunnerClass;
 #define _g_free0(var) (var = (g_free (var), NULL))
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
+#define TYPE_COMPLETION_PROVIDER (completion_provider_get_type ())
+#define COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMPLETION_PROVIDER, CompletionProvider))
+#define COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMPLETION_PROVIDER, CompletionProviderClass))
+#define IS_COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMPLETION_PROVIDER))
+#define IS_COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMPLETION_PROVIDER))
+#define COMPLETION_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMPLETION_PROVIDER, CompletionProviderClass))
+
+typedef struct _CompletionProvider CompletionProvider;
+typedef struct _CompletionProviderClass CompletionProviderClass;
+
 #define TYPE_DOCUMENT (document_get_type ())
 #define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
 #define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
@@ -201,7 +211,7 @@ typedef struct _LatexMenuClass LatexMenuClass;
 
 typedef struct _Application Application;
 typedef struct _ApplicationClass ApplicationClass;
-typedef struct _Block7Data Block7Data;
+typedef struct _Block8Data Block8Data;
 typedef struct _DocumentPrivate DocumentPrivate;
 
 #define TYPE_TAB_INFO_BAR (tab_info_bar_get_type ())
@@ -213,7 +223,7 @@ typedef struct _DocumentPrivate DocumentPrivate;
 
 typedef struct _TabInfoBar TabInfoBar;
 typedef struct _TabInfoBarClass TabInfoBarClass;
-typedef struct _Block8Data Block8Data;
+typedef struct _Block9Data Block9Data;
 #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
 
@@ -236,7 +246,6 @@ typedef struct _BuildJob BuildJob;
 typedef struct _BuildTool BuildTool;
 #define _build_tool_free0(var) ((var == NULL) ? NULL : (var = (build_tool_free (var), NULL)))
 #define _build_tools_unref0(var) ((var == NULL) ? NULL : (var = (build_tools_unref (var), NULL)))
-typedef struct _Block9Data Block9Data;
 
 #define TYPE_TEMPLATES (templates_get_type ())
 #define TEMPLATES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEMPLATES, Templates))
@@ -249,6 +258,18 @@ typedef struct _Templates Templates;
 typedef struct _TemplatesClass TemplatesClass;
 #define __g_slist_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_object_unref0_ (var), NULL)))
 
+#define TYPE_CLEAN_BUILD_FILES (clean_build_files_get_type ())
+#define CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFiles))
+#define CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+#define IS_CLEAN_BUILD_FILES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CLEAN_BUILD_FILES))
+#define IS_CLEAN_BUILD_FILES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CLEAN_BUILD_FILES))
+#define CLEAN_BUILD_FILES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CLEAN_BUILD_FILES, CleanBuildFilesClass))
+
+typedef struct _CleanBuildFiles CleanBuildFiles;
+typedef struct _CleanBuildFilesClass CleanBuildFilesClass;
+
+#define TYPE_STRUCT_ACTION (struct_action_get_type ())
+
 struct _MainWindow {
 	GtkWindow parent_instance;
 	MainWindowPrivate * priv;
@@ -265,11 +286,12 @@ struct _MainWindowPrivate {
 	GotoLine* goto_line;
 	SearchAndReplace* search_and_replace;
 	BuildView* build_view;
+	GtkToolbar* main_toolbar;
 	GtkToolbar* edit_toolbar;
 	SidePanel* side_panel;
 	Symbols* symbols;
 	FileBrowser* file_browser;
-	Structure* structure;
+	Structure* _structure;
 	GtkHPaned* main_hpaned;
 	GtkVPaned* vpaned;
 	GtkUIManager* ui_manager;
@@ -284,7 +306,7 @@ struct _MainWindowPrivate {
 	guint tip_message_cid;
 };
 
-struct _Block7Data {
+struct _Block8Data {
 	int _ref_count_;
 	MainWindow * self;
 	DocumentTab* tab;
@@ -302,7 +324,7 @@ struct _DocumentClass {
 	GtkSourceBufferClass parent_class;
 };
 
-struct _Block8Data {
+struct _Block9Data {
 	int _ref_count_;
 	MainWindow * self;
 	DocumentTab* tab;
@@ -335,11 +357,16 @@ struct _BuildTool {
 	GList* jobs;
 };
 
-struct _Block9Data {
-	int _ref_count_;
-	MainWindow * self;
-	GFile* main_file;
-};
+typedef enum  {
+	STRUCT_ACTION_CUT,
+	STRUCT_ACTION_COPY,
+	STRUCT_ACTION_DELETE,
+	STRUCT_ACTION_SELECT,
+	STRUCT_ACTION_COMMENT,
+	STRUCT_ACTION_SHIFT_LEFT,
+	STRUCT_ACTION_SHIFT_RIGHT,
+	STRUCT_ACTION_NB_ACTIONS
+} StructAction;
 
 
 static gpointer main_window_parent_class = NULL;
@@ -434,16 +461,34 @@ void main_window_on_projects_config_current (MainWindow* self);
 static void _main_window_on_projects_config_current_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_projects_manage (MainWindow* self);
 static void _main_window_on_projects_manage_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_cut (MainWindow* self);
+static void _main_window_on_structure_cut_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_copy (MainWindow* self);
+static void _main_window_on_structure_copy_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_delete (MainWindow* self);
+static void _main_window_on_structure_delete_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_select (MainWindow* self);
+static void _main_window_on_structure_select_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_comment (MainWindow* self);
+static void _main_window_on_structure_comment_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_shift_left (MainWindow* self);
+static void _main_window_on_structure_shift_left_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_structure_shift_right (MainWindow* self);
+static void _main_window_on_structure_shift_right_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_help_contents (MainWindow* self);
+static void _main_window_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_help_latex_reference (MainWindow* self);
 static void _main_window_on_help_latex_reference_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_about_dialog (MainWindow* self);
 static void _main_window_on_about_dialog_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_show_main_toolbar (MainWindow* self, GtkAction* action);
+static void _main_window_on_show_main_toolbar_gtk_action_callback (GtkAction* action, gpointer self);
+void main_window_on_show_edit_toolbar (MainWindow* self, GtkAction* action);
+static void _main_window_on_show_edit_toolbar_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_show_side_panel (MainWindow* self, GtkAction* action);
 static void _main_window_on_show_side_panel_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_show_bottom_panel (MainWindow* self, GtkAction* action);
 static void _main_window_on_show_bottom_panel_gtk_action_callback (GtkAction* action, gpointer self);
-void main_window_on_show_edit_toolbar (MainWindow* self, GtkAction* action);
-static void _main_window_on_show_edit_toolbar_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_build_show_errors (MainWindow* self, GtkAction* action);
 static void _main_window_on_build_show_errors_gtk_action_callback (GtkAction* action, gpointer self);
 void main_window_on_build_show_warnings (MainWindow* self, GtkAction* action);
@@ -456,8 +501,8 @@ static void main_window_initialize_menubar_and_toolbar (MainWindow* self);
 static void main_window_setup_toolbar_open_button (MainWindow* self, GtkToolbar* toolbar);
 DocumentsPanel* documents_panel_new (MainWindow* main_window);
 DocumentsPanel* documents_panel_construct (GType object_type, MainWindow* main_window);
-static void _lambda81_ (GdkEventButton* event, MainWindow* self);
-static void __lambda81__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self);
+static void _lambda93_ (GdkEventButton* event, MainWindow* self);
+static void __lambda93__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self);
 CustomStatusbar* custom_statusbar_new (void);
 CustomStatusbar* custom_statusbar_construct (GType object_type);
 GotoLine* goto_line_new (MainWindow* main_window);
@@ -473,22 +518,22 @@ Symbols* symbols_construct (GType object_type, MainWindow* main_window);
 void side_panel_add_component (SidePanel* self, const gchar* name, const gchar* stock_id, GtkVBox* component);
 FileBrowser* file_browser_new (MainWindow* main_window);
 FileBrowser* file_browser_construct (GType object_type, MainWindow* main_window);
-Structure* structure_new (MainWindow* main_window);
-Structure* structure_construct (GType object_type, MainWindow* main_window);
+Structure* structure_new (MainWindow* main_window, GtkUIManager* ui_manager);
+Structure* structure_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
 void side_panel_restore_state (SidePanel* self);
-static gboolean _lambda82_ (MainWindow* self);
-static gboolean __lambda82__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
-static void _lambda83_ (MainWindow* self);
+static gboolean _lambda94_ (MainWindow* self);
+static gboolean __lambda94__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self);
+static void _lambda95_ (MainWindow* self);
 static void main_window_set_file_actions_sensitivity (MainWindow* self, gboolean sensitive);
 static void main_window_set_documents_move_to_new_window_sensitivity (MainWindow* self, gboolean sensitive);
 static void main_window_update_documents_list_menu (MainWindow* self);
-static void __lambda83__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
-static void _lambda84_ (MainWindow* self);
+static void __lambda95__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
+static void _lambda96_ (MainWindow* self);
 void custom_statusbar_set_cursor_position (CustomStatusbar* self, gint line, gint col);
 void search_and_replace_hide (SearchAndReplace* self);
 static void main_window_my_set_title (MainWindow* self);
-static void __lambda84__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
-static void _lambda85_ (GtkNotebookPage* pg, guint page_num, MainWindow* self);
+static void __lambda96__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
+static void _lambda97_ (GtkNotebookPage* pg, guint page_num, MainWindow* self);
 static void main_window_set_undo_sensitivity (MainWindow* self);
 static void main_window_set_redo_sensitivity (MainWindow* self);
 static void main_window_update_next_prev_doc_sensitivity (MainWindow* self);
@@ -497,9 +542,16 @@ void main_window_update_config_project_sensitivity (MainWindow* self);
 static void main_window_update_cursor_position_statusbar (MainWindow* self);
 static void main_window_documents_list_menu_activate (MainWindow* self, GtkAction* action);
 static void _main_window_documents_list_menu_activate_gtk_action_activate (GtkAction* _sender, gpointer self);
-static void __lambda85__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self);
-static void _lambda86_ (MainWindow* self);
-static void __lambda86__gtk_notebook_page_reordered (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
+static void __lambda97__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self);
+static void _lambda98_ (MainWindow* self);
+static void __lambda98__gtk_notebook_page_reordered (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self);
+static void _lambda99_ (MainWindow* self);
+GType completion_provider_get_type (void) G_GNUC_CONST;
+CompletionProvider* completion_provider_get_default (void);
+void completion_provider_hide_calltip_window (CompletionProvider* self);
+static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static gboolean _lambda100_ (MainWindow* self);
+static gboolean __lambda100__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self);
 GtkWidget* search_and_replace_get_widget (SearchAndReplace* self);
 static void main_window_show_or_hide_widgets (MainWindow* self);
 static void main_window_show_or_hide_build_messages (MainWindow* self);
@@ -518,14 +570,14 @@ static void main_window_configure_recent_chooser (MainWindow* self, GtkRecentCho
 LatexMenu* latex_menu_new (MainWindow* main_window);
 LatexMenu* latex_menu_construct (GType object_type, MainWindow* main_window);
 GType latex_menu_get_type (void) G_GNUC_CONST;
-static void _lambda79_ (GtkAction* action, GtkWidget* p, MainWindow* self);
+static void _lambda91_ (GtkAction* action, GtkWidget* p, MainWindow* self);
 static void main_window_on_menu_item_select (MainWindow* self, GtkItem* proxy);
 static void _main_window_on_menu_item_select_gtk_item_select (GtkItem* _sender, gpointer self);
 static void main_window_on_menu_item_deselect (MainWindow* self, GtkItem* proxy);
 static void _main_window_on_menu_item_deselect_gtk_item_deselect (GtkItem* _sender, gpointer self);
-static void __lambda79__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
-static void _lambda80_ (GtkAction* action, GtkWidget* p, MainWindow* self);
-static void __lambda80__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
+static void __lambda91__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
+static void _lambda92_ (GtkAction* action, GtkWidget* p, MainWindow* self);
+static void __lambda92__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self);
 void main_window_update_build_tools_menu (MainWindow* self);
 void build_view_set_show_errors (BuildView* self, gboolean value);
 void build_view_set_show_warnings (BuildView* self, gboolean value);
@@ -538,16 +590,16 @@ DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gbool
 GType application_get_type (void) G_GNUC_CONST;
 Application* application_get_default (void);
 GList* application_get_windows (Application* self);
+static Block8Data* block8_data_ref (Block8Data* _data8_);
+static void block8_data_unref (Block8Data* _data8_);
 GFile* document_get_location (Document* self);
-static Block7Data* block7_data_ref (Block7Data* _data7_);
-static void block7_data_unref (Block7Data* _data7_);
 void main_window_set_active_tab (MainWindow* self, DocumentTab* value);
 DocumentTab* main_window_create_tab_from_location (MainWindow* self, GFile* location, gboolean jump_to);
 void document_set_readonly (Document* self, gboolean value);
 GType tab_info_bar_get_type (void) G_GNUC_CONST;
 TabInfoBar* document_tab_add_message (DocumentTab* self, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
-static void _lambda62_ (gint response_id, Block7Data* _data7_);
-static void __lambda62__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
+static void _lambda71_ (gint response_id, Block8Data* _data8_);
+static void __lambda71__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
 DocumentTab* main_window_create_tab (MainWindow* self, gboolean jump_to);
 DocumentTab* document_tab_new (void);
 DocumentTab* document_tab_construct (GType object_type);
@@ -557,26 +609,28 @@ DocumentTab* document_tab_construct_from_location (GType object_type, GFile* loc
 void main_window_create_tab_with_view (MainWindow* self, DocumentView* view);
 DocumentTab* document_tab_new_with_view (DocumentView* view);
 DocumentTab* document_tab_construct_with_view (GType object_type, DocumentView* view);
-static Block8Data* block8_data_ref (Block8Data* _data8_);
-static void block8_data_unref (Block8Data* _data8_);
-static void _lambda46_ (Block8Data* _data8_);
+static Block9Data* block9_data_ref (Block9Data* _data9_);
+static void block9_data_unref (Block9Data* _data9_);
+static void _lambda53_ (Block9Data* _data9_);
 gboolean main_window_close_tab (MainWindow* self, DocumentTab* tab, gboolean force_close);
-static void __lambda46__document_tab_close_document (DocumentTab* _sender, gpointer self);
-static void _lambda47_ (Block8Data* _data8_);
+static void __lambda53__document_tab_close_document (DocumentTab* _sender, gpointer self);
+static void _lambda54_ (Block9Data* _data9_);
 DocumentTab* main_window_get_active_tab (MainWindow* self);
-static void __lambda47__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda48_ (Block8Data* _data8_);
-static void __lambda48__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda49_ (Block8Data* _data8_);
+static void __lambda54__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda55_ (Block9Data* _data9_);
+static void __lambda55__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda56_ (Block9Data* _data9_);
 static void main_window_selection_changed (MainWindow* self);
-static void __lambda49__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda50_ (Block8Data* _data8_);
+static void __lambda56__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda57_ (Block9Data* _data9_);
 static void main_window_sync_name (MainWindow* self, DocumentTab* tab);
-static void __lambda50__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
-static void _lambda60_ (Block8Data* _data8_);
-static void __lambda60__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
-static void _lambda61_ (Block8Data* _data8_);
-static void __lambda61__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void __lambda57__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda68_ (MainWindow* self);
+static void __lambda68__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda69_ (Block9Data* _data9_);
+static void __lambda69__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self);
+static void _lambda70_ (Block9Data* _data9_);
+static void __lambda70__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static void _main_window_update_cursor_position_statusbar_document_cursor_moved (Document* _sender, gpointer self);
 void documents_panel_add_tab (DocumentsPanel* self, DocumentTab* tab, gint position, gboolean jump_to);
 const gchar* document_tab_get_label_text (DocumentTab* self);
@@ -601,11 +655,11 @@ void dialogs_close_several_unsaved_documents (MainWindow* window, GList* unsaved
 void main_window_remove_all_tabs (MainWindow* self);
 DocumentView* main_window_get_active_view (MainWindow* self);
 guint document_view_my_get_visual_column (DocumentView* self, GtkTextIter* iter);
-static void _lambda78_ (GtkRecentChooser* chooser, MainWindow* self);
-static void __lambda78__gtk_recent_chooser_item_activated (GtkRecentChooser* _sender, gpointer self);
+static void _lambda90_ (GtkRecentChooser* chooser, MainWindow* self);
+static void __lambda90__gtk_recent_chooser_item_activated (GtkRecentChooser* _sender, gpointer self);
 void main_window_save_state (MainWindow* self, gboolean sync);
-gint side_panel_get_active_component (SidePanel* self);
 void structure_save_state (Structure* self);
+gint side_panel_get_active_component (SidePanel* self);
 static void main_window_move_tab_to_new_window (MainWindow* self, DocumentTab* tab);
 MainWindow* application_create_window (Application* self, GdkScreen* screen);
 static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction* action);
@@ -631,8 +685,6 @@ void build_tool_free (BuildTool* self);
 void build_tool_copy (const BuildTool* self, BuildTool* dest);
 void build_tool_destroy (BuildTool* self);
 GeeIterator* build_tools_iterator (BuildTools* self);
-static Block9Data* block9_data_ref (Block9Data* _data9_);
-static void block9_data_unref (Block9Data* _data9_);
 BuildTool* build_tools_get (BuildTools* self, gint id);
 void build_view_show (BuildView* self);
 gint document_get_project_id (Document* self);
@@ -640,11 +692,11 @@ GList* application_get_documents (Application* self);
 GFile* document_get_main_file (Document* self);
 BuildToolRunner* build_tool_runner_new (GFile* file, BuildTool* tool, BuildView* view, GtkAction* action_stop_exec);
 BuildToolRunner* build_tool_runner_construct (GType object_type, GFile* file, BuildTool* tool, BuildView* view, GtkAction* action_stop_exec);
-static void _lambda52_ (Block9Data* _data9_);
-void file_browser_refresh_if_in_dir (FileBrowser* self, GFile* dir);
-static void __lambda52__build_tool_runner_finished (BuildToolRunner* _sender, gpointer self);
+static void _lambda59_ (MainWindow* self);
+void file_browser_refresh_for_document (FileBrowser* self, Document* doc);
+static void __lambda59__build_tool_runner_finished (BuildToolRunner* _sender, gpointer self);
 GtkAction* main_window_get_action_stop_exec (MainWindow* self);
-gboolean document_is_tex_document (Document* self);
+gboolean document_is_main_file_a_tex_file (Document* self);
 gchar* utils_get_extension (const gchar* path);
 static gboolean _vala_string_array_contains (gchar** stack, int stack_length, gchar* needle);
 GType templates_get_type (void) G_GNUC_CONST;
@@ -670,11 +722,16 @@ void search_and_replace_show_search (SearchAndReplace* self);
 void search_and_replace_show_search_and_replace (SearchAndReplace* self);
 void goto_line_show (GotoLine* self);
 void build_tool_runner_abort (BuildToolRunner* self);
-gboolean document_clean_build_files (Document* self, MainWindow* window);
+CleanBuildFiles* clean_build_files_new (MainWindow* main_window, Document* doc);
+CleanBuildFiles* clean_build_files_construct (GType object_type, MainWindow* main_window, Document* doc);
+GType clean_build_files_get_type (void) G_GNUC_CONST;
+gboolean clean_build_files_clean (CleanBuildFiles* self);
 gchar* utils_get_shortname (const gchar* path);
 void project_dialogs_new_project (MainWindow* main_window);
 gboolean project_dialogs_configure_project (GtkWindow* main_window, gint project_id);
 void project_dialogs_manage_projects (MainWindow* main_window);
+GType struct_action_get_type (void) G_GNUC_CONST;
+void structure_do_action (Structure* self, StructAction action_type);
 DocumentTab* documents_panel_get_active_tab (DocumentsPanel* self);
 static void main_window_finalize (GObject* obj);
 static void _vala_main_window_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
@@ -683,8 +740,8 @@ static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNoti
 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 static gint _vala_array_length (gpointer array);
 
-static const GtkActionEntry MAIN_WINDOW_action_entries[46] = {{"File", NULL, "_File"}, {"FileNew", GTK_STOCK_NEW, NULL, NULL, "New file", (GCallback) _main_window_on_file_new_gtk_action_callback}, {"FileNewWindow", NULL, "New _Window", NULL, "Create a new window", (GCallback) _main_window_on_new_window_gtk_action_callback}, {"FileOpen", GTK_STOCK_OPEN, NULL, NULL, "Open a file", (GCallback) _main_window_on_file_open_gtk_action_callback}, {"FileSave", GTK_STOCK_SAVE, NULL, NULL, "Save the current file", (GCallback) _main_window_on_file_save_gtk_action_callback}, {"FileSaveAs", GTK_STOCK_SAVE_AS, NULL, NULL, "Save the current file with a different name", (GCallback) _main_window_on_file_save_as_gtk_action_callback}, {"FileCreateTemplate", NULL, "Create _Template From Document...", NULL, "Create a new template from the current document", (GCallback) _main_window_on_create_template_gtk_action_callback}, {"FileDeleteTemplate", NULL, "_Delete Template...", NULL, "Delete personal t
 emplate(s)", (GCallback) _main_window_on_delete_template_gtk_action_callback}, {"FileClose", GTK_STOCK_CLOSE, NULL, NULL, "Close the current file", (GCallback) _main_window_on_file_close_gtk_action_callback}, {"FileQuit", GTK_STOCK_QUIT, NULL, NULL, "Quit the program", (GCallback) _main_window_on_quit_gtk_action_callback}, {"Edit", NULL, "_Edit"}, {"EditUndo", GTK_STOCK_UNDO, NULL, "<Control>Z", "Undo the last action", (GCallback) _main_window_on_edit_undo_gtk_action_callback}, {"EditRedo", GTK_STOCK_REDO, NULL, "<Shift><Control>Z", "Redo the last undone action", (GCallback) _main_window_on_edit_redo_gtk_action_callback}, {"EditCut", GTK_STOCK_CUT, NULL, NULL, "Cut the selection", (GCallback) _main_window_on_edit_cut_gtk_action_callback}, {"EditCopy", GTK_STOCK_COPY, NULL, NULL, "Copy the selection", (GCallback) _main_window_on_edit_copy_gtk_action_callback}, {"EditPaste", GTK_STOCK_PASTE, NULL, NULL, "Paste the clipboard", (GCallback) _main_window_on_edit_paste_gtk_action_c
 allback}, {"EditDelete", GTK_STOCK_DELETE, NULL, NULL, "Delete the selected text", (GCallback) _main_window_on_edit_delete_gtk_action_callback}, {"EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<Control>A", "Select the entire document", (GCallback) _main_window_on_edit_select_all_gtk_action_callback}, {"EditComment", NULL, "_Comment", "<Control>M", "Comment the selected lines (add the character \"%\")", (GCallback) _main_window_on_edit_comment_gtk_action_callback}, {"EditUncomment", NULL, "_Uncomment", "<Shift><Control>M", "Uncomment the selected lines (remove the character \"%\")", (GCallback) _main_window_on_edit_uncomment_gtk_action_callback}, {"EditPreferences", GTK_STOCK_PREFERENCES, NULL, NULL, "Configure the application", (GCallback) _main_window_on_open_preferences_gtk_action_callback}, {"View", NULL, "_View"}, {"ViewZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "<Control>plus", "Enlarge the font", (GCallback) _main_window_on_view_zoom_in_gtk_action_callback}, {"ViewZoomOut"
 , GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<Control>minus", "Shrink the font", (GCallback) _main_window_on_view_zoom_out_gtk_action_callback}, {"ViewZoomReset", GTK_STOCK_ZOOM_100, "_Reset Zoom", "<Control>0", "Reset the size of the font", (GCallback) _main_window_on_view_zoom_reset_gtk_action_callback}, {"Search", NULL, "_Search"}, {"SearchFind", GTK_STOCK_FIND, NULL, NULL, "Search for text", (GCallback) _main_window_on_search_find_gtk_action_callback}, {"SearchReplace", GTK_STOCK_FIND_AND_REPLACE, NULL, NULL, "Search for and replace text", (GCallback) _main_window_on_search_replace_gtk_action_callback}, {"SearchGoToLine", GTK_STOCK_JUMP_TO, "_Go to Line...", "<Control>G", "Go to a specific line", (GCallback) _main_window_on_search_goto_line_gtk_action_callback}, {"Build", NULL, "_Build"}, {"BuildClean", GTK_STOCK_CLEAR, "Cleanup Build _Files", NULL, "Clean-up build files (*.aux, *.log, *.out, *.toc, etc)", (GCallback) _main_window_on_build_clean_gtk_action_callback}, {"BuildStopE
 xecution", GTK_STOCK_STOP, "_Stop Execution", "<Release>F12", "Stop Execution", (GCallback) _main_window_on_build_stop_execution_gtk_action_callback}, {"BuildViewLog", "view_log", "View _Log", NULL, "View Log", (GCallback) _main_window_on_build_view_log_gtk_action_callback}, {"Documents", NULL, "_Documents"}, {"DocumentsSaveAll", GTK_STOCK_SAVE, "_Save All", "<Shift><Control>L", "Save all open files", (GCallback) _main_window_on_documents_save_all_gtk_action_callback}, {"DocumentsCloseAll", GTK_STOCK_CLOSE, "_Close All", "<Shift><Control>W", "Close all open files", (GCallback) _main_window_on_documents_close_all_gtk_action_callback}, {"DocumentsPrevious", GTK_STOCK_GO_BACK, "_Previous Document", "<Control><Alt>Page_Up", "Activate previous document", (GCallback) _main_window_on_documents_previous_gtk_action_callback}, {"DocumentsNext", GTK_STOCK_GO_FORWARD, "_Next Document", "<Control><Alt>Page_Down", "Activate next document", (GCallback) _main_window_on_documents_next_gtk_ac
 tion_callback}, {"DocumentsMoveToNewWindow", NULL, "_Move to New Window", NULL, "Move the current document to a new window", (GCallback) _main_window_on_documents_move_to_new_window_gtk_action_callback}, {"Projects", NULL, "_Projects"}, {"ProjectsNew", GTK_STOCK_NEW, "_New Project", NULL, "Create a new project", (GCallback) _main_window_on_projects_new_gtk_action_callback}, {"ProjectsConfigCurrent", GTK_STOCK_PROPERTIES, "_Configure Current Project", NULL, "Change the main file of the current project", (GCallback) _main_window_on_projects_config_current_gtk_action_callback}, {"ProjectsManage", GTK_STOCK_PREFERENCES, "_Manage Projects", NULL, "Manage Projects", (GCallback) _main_window_on_projects_manage_gtk_action_callback}, {"Help", NULL, "_Help"}, {"HelpLatexReference", GTK_STOCK_HELP, "_LaTeX Reference", "<Release>F1", "The Kile LaTeX Reference", (GCallback) _main_window_on_help_latex_reference_gtk_action_callback}, {"HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, "About LaTeXi
 la", (GCallback) _main_window_on_about_dialog_gtk_action_callback}};
-static const GtkToggleActionEntry MAIN_WINDOW_toggle_action_entries[6] = {{"ViewSidePanel", NULL, "_Side panel", NULL, "Show or hide the side panel", (GCallback) _main_window_on_show_side_panel_gtk_action_callback}, {"ViewBottomPanel", NULL, "_Bottom panel", NULL, "Show or hide the bottom panel", (GCallback) _main_window_on_show_bottom_panel_gtk_action_callback}, {"ViewEditToolbar", NULL, "_Edit Toolbar", NULL, "Show or hide the edit toolbar", (GCallback) _main_window_on_show_edit_toolbar_gtk_action_callback}, {"BuildShowErrors", GTK_STOCK_DIALOG_ERROR, "Show _Errors", NULL, "Show Errors", (GCallback) _main_window_on_build_show_errors_gtk_action_callback}, {"BuildShowWarnings", GTK_STOCK_DIALOG_WARNING, "Show _Warnings", NULL, "Show Warnings", (GCallback) _main_window_on_build_show_warnings_gtk_action_callback}, {"BuildShowBadBoxes", "badbox", "Show _BadBoxes", NULL, "Show BadBoxes", (GCallback) _main_window_on_build_show_badboxes_gtk_action_callback}};
+static const GtkActionEntry MAIN_WINDOW_action_entries[55] = {{"File", NULL, "_File"}, {"FileNew", GTK_STOCK_NEW, NULL, NULL, "New file", (GCallback) _main_window_on_file_new_gtk_action_callback}, {"FileNewWindow", NULL, "New _Window", NULL, "Create a new window", (GCallback) _main_window_on_new_window_gtk_action_callback}, {"FileOpen", GTK_STOCK_OPEN, NULL, NULL, "Open a file", (GCallback) _main_window_on_file_open_gtk_action_callback}, {"FileSave", GTK_STOCK_SAVE, NULL, NULL, "Save the current file", (GCallback) _main_window_on_file_save_gtk_action_callback}, {"FileSaveAs", GTK_STOCK_SAVE_AS, NULL, NULL, "Save the current file with a different name", (GCallback) _main_window_on_file_save_as_gtk_action_callback}, {"FileCreateTemplate", NULL, "Create _Template From Document...", NULL, "Create a new template from the current document", (GCallback) _main_window_on_create_template_gtk_action_callback}, {"FileDeleteTemplate", NULL, "_Delete Template...", NULL, "Delete personal t
 emplate(s)", (GCallback) _main_window_on_delete_template_gtk_action_callback}, {"FileClose", GTK_STOCK_CLOSE, NULL, NULL, "Close the current file", (GCallback) _main_window_on_file_close_gtk_action_callback}, {"FileQuit", GTK_STOCK_QUIT, NULL, NULL, "Quit the program", (GCallback) _main_window_on_quit_gtk_action_callback}, {"Edit", NULL, "_Edit"}, {"EditUndo", GTK_STOCK_UNDO, NULL, "<Control>Z", "Undo the last action", (GCallback) _main_window_on_edit_undo_gtk_action_callback}, {"EditRedo", GTK_STOCK_REDO, NULL, "<Shift><Control>Z", "Redo the last undone action", (GCallback) _main_window_on_edit_redo_gtk_action_callback}, {"EditCut", GTK_STOCK_CUT, NULL, NULL, "Cut the selection", (GCallback) _main_window_on_edit_cut_gtk_action_callback}, {"EditCopy", GTK_STOCK_COPY, NULL, NULL, "Copy the selection", (GCallback) _main_window_on_edit_copy_gtk_action_callback}, {"EditPaste", GTK_STOCK_PASTE, NULL, "", "Paste the clipboard", (GCallback) _main_window_on_edit_paste_gtk_action_cal
 lback}, {"EditDelete", GTK_STOCK_DELETE, NULL, NULL, "Delete the selected text", (GCallback) _main_window_on_edit_delete_gtk_action_callback}, {"EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<Control>A", "Select the entire document", (GCallback) _main_window_on_edit_select_all_gtk_action_callback}, {"EditComment", NULL, "_Comment", "<Control>M", "Comment the selected lines (add the character \"%\")", (GCallback) _main_window_on_edit_comment_gtk_action_callback}, {"EditUncomment", NULL, "_Uncomment", "<Shift><Control>M", "Uncomment the selected lines (remove the character \"%\")", (GCallback) _main_window_on_edit_uncomment_gtk_action_callback}, {"EditPreferences", GTK_STOCK_PREFERENCES, NULL, NULL, "Configure the application", (GCallback) _main_window_on_open_preferences_gtk_action_callback}, {"View", NULL, "_View"}, {"ViewZoomIn", GTK_STOCK_ZOOM_IN, "Zoom _In", "<Control>plus", "Enlarge the font", (GCallback) _main_window_on_view_zoom_in_gtk_action_callback}, {"ViewZoomOut", 
 GTK_STOCK_ZOOM_OUT, "Zoom _Out", "<Control>minus", "Shrink the font", (GCallback) _main_window_on_view_zoom_out_gtk_action_callback}, {"ViewZoomReset", GTK_STOCK_ZOOM_100, "_Reset Zoom", "<Control>0", "Reset the size of the font", (GCallback) _main_window_on_view_zoom_reset_gtk_action_callback}, {"Search", NULL, "_Search"}, {"SearchFind", GTK_STOCK_FIND, NULL, NULL, "Search for text", (GCallback) _main_window_on_search_find_gtk_action_callback}, {"SearchReplace", GTK_STOCK_FIND_AND_REPLACE, NULL, NULL, "Search for and replace text", (GCallback) _main_window_on_search_replace_gtk_action_callback}, {"SearchGoToLine", GTK_STOCK_JUMP_TO, "_Go to Line...", "<Control>G", "Go to a specific line", (GCallback) _main_window_on_search_goto_line_gtk_action_callback}, {"Build", NULL, "_Build"}, {"BuildClean", GTK_STOCK_CLEAR, "Cleanup Build _Files", NULL, "Clean-up build files (*.aux, *.log, *.out, *.toc, etc)", (GCallback) _main_window_on_build_clean_gtk_action_callback}, {"BuildStopExe
 cution", GTK_STOCK_STOP, "_Stop Execution", "<Release>F12", "Stop Execution", (GCallback) _main_window_on_build_stop_execution_gtk_action_callback}, {"BuildViewLog", "view_log", "View _Log", NULL, "View Log", (GCallback) _main_window_on_build_view_log_gtk_action_callback}, {"Documents", NULL, "_Documents"}, {"DocumentsSaveAll", GTK_STOCK_SAVE, "_Save All", "<Shift><Control>L", "Save all open files", (GCallback) _main_window_on_documents_save_all_gtk_action_callback}, {"DocumentsCloseAll", GTK_STOCK_CLOSE, "_Close All", "<Shift><Control>W", "Close all open files", (GCallback) _main_window_on_documents_close_all_gtk_action_callback}, {"DocumentsPrevious", GTK_STOCK_GO_BACK, "_Previous Document", "<Control><Alt>Page_Up", "Activate previous document", (GCallback) _main_window_on_documents_previous_gtk_action_callback}, {"DocumentsNext", GTK_STOCK_GO_FORWARD, "_Next Document", "<Control><Alt>Page_Down", "Activate next document", (GCallback) _main_window_on_documents_next_gtk_acti
 on_callback}, {"DocumentsMoveToNewWindow", NULL, "_Move to New Window", NULL, "Move the current document to a new window", (GCallback) _main_window_on_documents_move_to_new_window_gtk_action_callback}, {"Projects", NULL, "_Projects"}, {"ProjectsNew", GTK_STOCK_NEW, "_New Project", NULL, "Create a new project", (GCallback) _main_window_on_projects_new_gtk_action_callback}, {"ProjectsConfigCurrent", GTK_STOCK_PROPERTIES, "_Configure Current Project", NULL, "Change the main file of the current project", (GCallback) _main_window_on_projects_config_current_gtk_action_callback}, {"ProjectsManage", GTK_STOCK_PREFERENCES, "_Manage Projects", NULL, "Manage Projects", (GCallback) _main_window_on_projects_manage_gtk_action_callback}, {"Structure", NULL, "S_tructure"}, {"StructureCut", GTK_STOCK_CUT, NULL, "", "Cut the selected structure item", (GCallback) _main_window_on_structure_cut_gtk_action_callback}, {"StructureCopy", GTK_STOCK_COPY, NULL, "", "Copy the selected structure item", 
 (GCallback) _main_window_on_structure_copy_gtk_action_callback}, {"StructureDelete", GTK_STOCK_DELETE, NULL, "", "Delete the selected structure item", (GCallback) _main_window_on_structure_delete_gtk_action_callback}, {"StructureSelect", GTK_STOCK_SELECT_ALL, "_Select", "", "Select the contents of the selected structure item", (GCallback) _main_window_on_structure_select_gtk_action_callback}, {"StructureComment", NULL, "_Comment", NULL, "Comment the selected structure item", (GCallback) _main_window_on_structure_comment_gtk_action_callback}, {"StructureShiftLeft", GTK_STOCK_GO_BACK, "Shift _Left", "", "Shift the selected structure item to the left (e.g. section â chapter", (GCallback) _main_window_on_structure_shift_left_gtk_action_callback}, {"StructureShiftRight", GTK_STOCK_GO_FORWARD, "Shift _Right", "", "Shift the selected structure item to the right (e.g. chapter â section", (GCallback) _main_window_on_structure_shift_right_gtk_action_callback}, {"Help", NULL, "_Hel
 p"}, {"HelpContents", GTK_STOCK_HELP, "_Contents", "<Release>F1", "Open the LaTeXila documentation", (GCallback) _main_window_on_help_contents_gtk_action_callback}, {"HelpLatexReference", NULL, "_LaTeX Reference", NULL, "The Kile LaTeX Reference", (GCallback) _main_window_on_help_latex_reference_gtk_action_callback}, {"HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, "About LaTeXila", (GCallback) _main_window_on_about_dialog_gtk_action_callback}};
+static const GtkToggleActionEntry MAIN_WINDOW_toggle_action_entries[7] = {{"ViewMainToolbar", NULL, "_Main Toolbar", NULL, "Show or hide the main toolbar", (GCallback) _main_window_on_show_main_toolbar_gtk_action_callback}, {"ViewEditToolbar", NULL, "_Edit Toolbar", NULL, "Show or hide the edit toolbar", (GCallback) _main_window_on_show_edit_toolbar_gtk_action_callback}, {"ViewSidePanel", NULL, "_Side panel", NULL, "Show or hide the side panel", (GCallback) _main_window_on_show_side_panel_gtk_action_callback}, {"ViewBottomPanel", NULL, "_Bottom panel", NULL, "Show or hide the bottom panel", (GCallback) _main_window_on_show_bottom_panel_gtk_action_callback}, {"BuildShowErrors", GTK_STOCK_DIALOG_ERROR, "Show _Errors", NULL, "Show Errors", (GCallback) _main_window_on_build_show_errors_gtk_action_callback}, {"BuildShowWarnings", GTK_STOCK_DIALOG_WARNING, "Show _Warnings", NULL, "Show Warnings", (GCallback) _main_window_on_build_show_warnings_gtk_action_callback}, {"BuildShowBadB
 oxes", "badbox", "Show _BadBoxes", NULL, "Show BadBoxes", (GCallback) _main_window_on_build_show_badboxes_gtk_action_callback}};
 
 static void _main_window_on_file_new_gtk_action_callback (GtkAction* action, gpointer self) {
 	main_window_on_file_new (self);
@@ -866,6 +923,46 @@ static void _main_window_on_projects_manage_gtk_action_callback (GtkAction* acti
 }
 
 
+static void _main_window_on_structure_cut_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_cut (self);
+}
+
+
+static void _main_window_on_structure_copy_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_copy (self);
+}
+
+
+static void _main_window_on_structure_delete_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_delete (self);
+}
+
+
+static void _main_window_on_structure_select_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_select (self);
+}
+
+
+static void _main_window_on_structure_comment_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_comment (self);
+}
+
+
+static void _main_window_on_structure_shift_left_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_shift_left (self);
+}
+
+
+static void _main_window_on_structure_shift_right_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_structure_shift_right (self);
+}
+
+
+static void _main_window_on_help_contents_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_help_contents (self);
+}
+
+
 static void _main_window_on_help_latex_reference_gtk_action_callback (GtkAction* action, gpointer self) {
 	main_window_on_help_latex_reference (self);
 }
@@ -876,6 +973,16 @@ static void _main_window_on_about_dialog_gtk_action_callback (GtkAction* action,
 }
 
 
+static void _main_window_on_show_main_toolbar_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_show_main_toolbar (self, action);
+}
+
+
+static void _main_window_on_show_edit_toolbar_gtk_action_callback (GtkAction* action, gpointer self) {
+	main_window_on_show_edit_toolbar (self, action);
+}
+
+
 static void _main_window_on_show_side_panel_gtk_action_callback (GtkAction* action, gpointer self) {
 	main_window_on_show_side_panel (self, action);
 }
@@ -886,11 +993,6 @@ static void _main_window_on_show_bottom_panel_gtk_action_callback (GtkAction* ac
 }
 
 
-static void _main_window_on_show_edit_toolbar_gtk_action_callback (GtkAction* action, gpointer self) {
-	main_window_on_show_edit_toolbar (self, action);
-}
-
-
 static void _main_window_on_build_show_errors_gtk_action_callback (GtkAction* action, gpointer self) {
 	main_window_on_build_show_errors (self, action);
 }
@@ -911,7 +1013,7 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda81_ (GdkEventButton* event, MainWindow* self) {
+static void _lambda93_ (GdkEventButton* event, MainWindow* self) {
 	GtkWidget* _tmp0_ = NULL;
 	GtkMenu* _tmp1_;
 	GtkMenu* popup_menu;
@@ -923,12 +1025,12 @@ static void _lambda81_ (GdkEventButton* event, MainWindow* self) {
 }
 
 
-static void __lambda81__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self) {
-	_lambda81_ (event, self);
+static void __lambda93__documents_panel_right_click (DocumentsPanel* _sender, GdkEventButton* event, gpointer self) {
+	_lambda93_ (event, self);
 }
 
 
-static gboolean _lambda82_ (MainWindow* self) {
+static gboolean _lambda94_ (MainWindow* self) {
 	gboolean result = FALSE;
 	main_window_on_quit (self);
 	result = TRUE;
@@ -936,14 +1038,14 @@ static gboolean _lambda82_ (MainWindow* self) {
 }
 
 
-static gboolean __lambda82__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
+static gboolean __lambda94__gtk_widget_delete_event (GtkWidget* _sender, GdkEvent* event, gpointer self) {
 	gboolean result;
-	result = _lambda82_ (self);
+	result = _lambda94_ (self);
 	return result;
 }
 
 
-static void _lambda83_ (MainWindow* self) {
+static void _lambda95_ (MainWindow* self) {
 	gint _tmp0_;
 	gint nb_pages;
 	_tmp0_ = gtk_notebook_get_n_pages ((GtkNotebook*) self->priv->documents_panel);
@@ -959,12 +1061,12 @@ static void _lambda83_ (MainWindow* self) {
 }
 
 
-static void __lambda83__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
-	_lambda83_ (self);
+static void __lambda95__gtk_notebook_page_added (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
+	_lambda95_ (self);
 }
 
 
-static void _lambda84_ (MainWindow* self) {
+static void _lambda96_ (MainWindow* self) {
 	gint _tmp0_;
 	gint nb_pages;
 	_tmp0_ = gtk_notebook_get_n_pages ((GtkNotebook*) self->priv->documents_panel);
@@ -987,8 +1089,8 @@ static void _lambda84_ (MainWindow* self) {
 }
 
 
-static void __lambda84__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
-	_lambda84_ (self);
+static void __lambda96__gtk_notebook_page_removed (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
+	_lambda96_ (self);
 }
 
 
@@ -997,7 +1099,7 @@ static void _main_window_documents_list_menu_activate_gtk_action_activate (GtkAc
 }
 
 
-static void _lambda85_ (GtkNotebookPage* pg, guint page_num, MainWindow* self) {
+static void _lambda97_ (GtkNotebookPage* pg, guint page_num, MainWindow* self) {
 	gchar* _tmp0_ = NULL;
 	gchar* _tmp1_;
 	gchar* _tmp2_ = NULL;
@@ -1038,19 +1140,54 @@ static void _lambda85_ (GtkNotebookPage* pg, guint page_num, MainWindow* self) {
 }
 
 
-static void __lambda85__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self) {
-	_lambda85_ (page, page_num, self);
+static void __lambda97__gtk_notebook_switch_page (GtkNotebook* _sender, GtkNotebookPage* page, guint page_num, gpointer self) {
+	_lambda97_ (page, page_num, self);
 }
 
 
-static void _lambda86_ (MainWindow* self) {
+static void _lambda98_ (MainWindow* self) {
 	main_window_update_next_prev_doc_sensitivity (self);
 	main_window_update_documents_list_menu (self);
 }
 
 
-static void __lambda86__gtk_notebook_page_reordered (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
-	_lambda86_ (self);
+static void __lambda98__gtk_notebook_page_reordered (GtkNotebook* _sender, GtkWidget* p0, guint p1, gpointer self) {
+	_lambda98_ (self);
+}
+
+
+static void _lambda99_ (MainWindow* self) {
+	CompletionProvider* _tmp0_ = NULL;
+	CompletionProvider* provider;
+	_tmp0_ = completion_provider_get_default ();
+	provider = _tmp0_;
+	completion_provider_hide_calltip_window (provider);
+	_g_object_unref0 (provider);
+}
+
+
+static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda99_ (self);
+}
+
+
+static gboolean _lambda100_ (MainWindow* self) {
+	gboolean result = FALSE;
+	CompletionProvider* _tmp0_ = NULL;
+	CompletionProvider* provider;
+	_tmp0_ = completion_provider_get_default ();
+	provider = _tmp0_;
+	completion_provider_hide_calltip_window (provider);
+	result = FALSE;
+	_g_object_unref0 (provider);
+	return result;
+}
+
+
+static gboolean __lambda100__gtk_widget_focus_out_event (GtkWidget* _sender, GdkEventFocus* event, gpointer self) {
+	gboolean result;
+	result = _lambda100_ (self);
+	return result;
 }
 
 
@@ -1067,7 +1204,6 @@ MainWindow* main_window_construct (GType object_type) {
 	GtkWidget* menu;
 	GtkWidget* _tmp4_ = NULL;
 	GtkToolbar* _tmp5_;
-	GtkToolbar* toolbar;
 	GtkWidget* _tmp6_ = NULL;
 	GtkToolbar* _tmp7_;
 	GtkWidget* _tmp8_ = NULL;
@@ -1128,9 +1264,10 @@ MainWindow* main_window_construct (GType object_type) {
 	menu = _tmp3_;
 	_tmp4_ = gtk_ui_manager_get_widget (self->priv->ui_manager, "/MainToolbar");
 	_tmp5_ = _g_object_ref0 (GTK_TOOLBAR (_tmp4_));
-	toolbar = _tmp5_;
-	gtk_toolbar_set_style (toolbar, GTK_TOOLBAR_ICONS);
-	main_window_setup_toolbar_open_button (self, toolbar);
+	_g_object_unref0 (self->priv->main_toolbar);
+	self->priv->main_toolbar = _tmp5_;
+	gtk_toolbar_set_style (self->priv->main_toolbar, GTK_TOOLBAR_ICONS);
+	main_window_setup_toolbar_open_button (self, self->priv->main_toolbar);
 	_tmp6_ = gtk_ui_manager_get_widget (self->priv->ui_manager, "/EditToolbar");
 	_tmp7_ = _g_object_ref0 (GTK_TOOLBAR (_tmp6_));
 	_g_object_unref0 (self->priv->edit_toolbar);
@@ -1145,7 +1282,7 @@ MainWindow* main_window_construct (GType object_type) {
 	_tmp10_ = documents_panel_new (self);
 	_g_object_unref0 (self->priv->documents_panel);
 	self->priv->documents_panel = g_object_ref_sink (_tmp10_);
-	g_signal_connect_object (self->priv->documents_panel, "right-click", (GCallback) __lambda81__documents_panel_right_click, self, 0);
+	g_signal_connect_object (self->priv->documents_panel, "right-click", (GCallback) __lambda93__documents_panel_right_click, self, 0);
 	_tmp11_ = custom_statusbar_new ();
 	_g_object_unref0 (self->priv->statusbar);
 	self->priv->statusbar = g_object_ref_sink (_tmp11_);
@@ -1184,27 +1321,29 @@ MainWindow* main_window_construct (GType object_type) {
 	self->priv->file_browser = g_object_ref_sink (_tmp25_);
 	_tmp26_ = _ ("File Browser");
 	side_panel_add_component (self->priv->side_panel, _tmp26_, GTK_STOCK_OPEN, (GtkVBox*) self->priv->file_browser);
-	_tmp27_ = structure_new (self);
-	_g_object_unref0 (self->priv->structure);
-	self->priv->structure = g_object_ref_sink (_tmp27_);
+	_tmp27_ = structure_new (self, self->priv->ui_manager);
+	_g_object_unref0 (self->priv->_structure);
+	self->priv->_structure = g_object_ref_sink (_tmp27_);
 	_tmp28_ = _ ("Structure");
-	side_panel_add_component (self->priv->side_panel, _tmp28_, GTK_STOCK_INDEX, (GtkVBox*) self->priv->structure);
+	side_panel_add_component (self->priv->side_panel, _tmp28_, GTK_STOCK_INDEX, (GtkVBox*) self->priv->_structure);
 	side_panel_restore_state (self->priv->side_panel);
-	g_signal_connect_object ((GtkWidget*) self, "delete-event", (GCallback) __lambda82__gtk_widget_delete_event, self, 0);
-	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-added", (GCallback) __lambda83__gtk_notebook_page_added, self, 0);
-	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-removed", (GCallback) __lambda84__gtk_notebook_page_removed, self, 0);
-	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "switch-page", (GCallback) __lambda85__gtk_notebook_switch_page, self, 0);
-	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-reordered", (GCallback) __lambda86__gtk_notebook_page_reordered, self, 0);
+	g_signal_connect_object ((GtkWidget*) self, "delete-event", (GCallback) __lambda94__gtk_widget_delete_event, self, 0);
+	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-added", (GCallback) __lambda95__gtk_notebook_page_added, self, 0);
+	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-removed", (GCallback) __lambda96__gtk_notebook_page_removed, self, 0);
+	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "switch-page", (GCallback) __lambda97__gtk_notebook_switch_page, self, 0);
+	g_signal_connect_object ((GtkNotebook*) self->priv->documents_panel, "page-reordered", (GCallback) __lambda98__gtk_notebook_page_reordered, self, 0);
+	g_signal_connect_object ((GObject*) self, "notify::active-tab", (GCallback) __lambda99__g_object_notify, self, 0);
+	g_signal_connect_object ((GtkWidget*) self, "focus-out-event", (GCallback) __lambda100__gtk_widget_focus_out_event, self, 0);
 	main_window_set_file_actions_sensitivity (self, FALSE);
 	main_window_set_documents_move_to_new_window_sensitivity (self, FALSE);
 	_tmp29_ = (GtkVBox*) gtk_vbox_new (FALSE, 0);
 	main_vbox = g_object_ref_sink (_tmp29_);
 	gtk_box_pack_start ((GtkBox*) main_vbox, menu, FALSE, FALSE, (guint) 0);
-	gtk_box_pack_start ((GtkBox*) main_vbox, (GtkWidget*) toolbar, FALSE, FALSE, (guint) 0);
+	gtk_box_pack_start ((GtkBox*) main_vbox, (GtkWidget*) self->priv->main_toolbar, FALSE, FALSE, (guint) 0);
 	gtk_box_pack_start ((GtkBox*) main_vbox, (GtkWidget*) self->priv->edit_toolbar, FALSE, FALSE, (guint) 0);
 	gtk_widget_show ((GtkWidget*) main_vbox);
 	gtk_widget_show_all (menu);
-	gtk_widget_show_all ((GtkWidget*) toolbar);
+	gtk_widget_show_all ((GtkWidget*) self->priv->main_toolbar);
 	_tmp30_ = (GtkHPaned*) gtk_hpaned_new ();
 	_g_object_unref0 (self->priv->main_hpaned);
 	self->priv->main_hpaned = g_object_ref_sink (_tmp30_);
@@ -1244,7 +1383,6 @@ MainWindow* main_window_construct (GType object_type) {
 	_g_object_unref0 (action_view_side_panel);
 	_g_object_unref0 (action_view_bottom_panel);
 	_g_object_unref0 (build_toolbar);
-	_g_object_unref0 (toolbar);
 	_g_object_unref0 (menu);
 	_g_object_unref0 (settings);
 	return self;
@@ -1397,7 +1535,7 @@ static void _main_window_on_menu_item_deselect_gtk_item_deselect (GtkItem* _send
 }
 
 
-static void _lambda79_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
+static void _lambda91_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
 	g_return_if_fail (action != NULL);
 	g_return_if_fail (p != NULL);
 	if (GTK_IS_MENU_ITEM (p)) {
@@ -1412,12 +1550,12 @@ static void _lambda79_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
 }
 
 
-static void __lambda79__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
-	_lambda79_ (action, proxy, self);
+static void __lambda91__gtk_ui_manager_connect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
+	_lambda91_ (action, proxy, self);
 }
 
 
-static void _lambda80_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
+static void _lambda92_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
 	g_return_if_fail (action != NULL);
 	g_return_if_fail (p != NULL);
 	if (GTK_IS_MENU_ITEM (p)) {
@@ -1436,8 +1574,8 @@ static void _lambda80_ (GtkAction* action, GtkWidget* p, MainWindow* self) {
 }
 
 
-static void __lambda80__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
-	_lambda80_ (action, proxy, self);
+static void __lambda92__gtk_ui_manager_disconnect_proxy (GtkUIManager* _sender, GtkAction* action, GtkWidget* proxy, gpointer self) {
+	_lambda92_ (action, proxy, self);
 }
 
 
@@ -1490,7 +1628,7 @@ static void main_window_initialize_menubar_and_toolbar (MainWindow* self) {
 		GError * err;
 		err = _inner_error_;
 		_inner_error_ = NULL;
-		g_error ("main_window.vala:491: %s", err->message);
+		g_error ("main_window.vala:540: %s", err->message);
 		_g_error_free0 (err);
 	}
 	__finally3:
@@ -1502,8 +1640,8 @@ static void main_window_initialize_menubar_and_toolbar (MainWindow* self) {
 	}
 	_tmp7_ = gtk_ui_manager_get_accel_group (self->priv->ui_manager);
 	gtk_window_add_accel_group ((GtkWindow*) self, _tmp7_);
-	g_signal_connect_object (self->priv->ui_manager, "connect-proxy", (GCallback) __lambda79__gtk_ui_manager_connect_proxy, self, 0);
-	g_signal_connect_object (self->priv->ui_manager, "disconnect-proxy", (GCallback) __lambda80__gtk_ui_manager_disconnect_proxy, self, 0);
+	g_signal_connect_object (self->priv->ui_manager, "connect-proxy", (GCallback) __lambda91__gtk_ui_manager_connect_proxy, self, 0);
+	g_signal_connect_object (self->priv->ui_manager, "disconnect-proxy", (GCallback) __lambda92__gtk_ui_manager_disconnect_proxy, self, 0);
 	_tmp8_ = gtk_action_group_new ("DocumentsListActions");
 	_g_object_unref0 (self->priv->documents_list_action_group);
 	self->priv->documents_list_action_group = _tmp8_;
@@ -1559,38 +1697,49 @@ static void main_window_show_or_hide_widgets (MainWindow* self) {
 	gboolean _tmp7_;
 	GtkAction* _tmp8_ = NULL;
 	GtkToggleAction* _tmp9_;
+	gboolean _tmp10_;
+	GtkAction* _tmp11_ = NULL;
+	GtkToggleAction* _tmp12_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.ui");
 	settings = _tmp0_;
-	_tmp1_ = g_settings_get_boolean (settings, "edit-toolbar-visible");
+	_tmp1_ = g_settings_get_boolean (settings, "main-toolbar-visible");
 	show = _tmp1_;
-	if (!show) {
-		gtk_widget_hide ((GtkWidget*) self->priv->edit_toolbar);
-	}
-	_tmp2_ = gtk_action_group_get_action (self->priv->action_group, "ViewEditToolbar");
+	gtk_widget_set_visible ((GtkWidget*) self->priv->main_toolbar, show);
+	_tmp2_ = gtk_action_group_get_action (self->priv->action_group, "ViewMainToolbar");
 	_tmp3_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp2_));
 	action = _tmp3_;
 	gtk_toggle_action_set_active (action, show);
-	_tmp4_ = g_settings_get_boolean (settings, "side-panel-visible");
+	_tmp4_ = g_settings_get_boolean (settings, "edit-toolbar-visible");
 	show = _tmp4_;
 	if (!show) {
-		gtk_widget_hide ((GtkWidget*) self->priv->side_panel);
+		gtk_widget_hide ((GtkWidget*) self->priv->edit_toolbar);
 	}
-	_tmp5_ = gtk_action_group_get_action (self->priv->action_group, "ViewSidePanel");
+	_tmp5_ = gtk_action_group_get_action (self->priv->action_group, "ViewEditToolbar");
 	_tmp6_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp5_));
 	_g_object_unref0 (action);
 	action = _tmp6_;
 	gtk_toggle_action_set_active (action, show);
-	_tmp7_ = g_settings_get_boolean (settings, "bottom-panel-visible");
+	_tmp7_ = g_settings_get_boolean (settings, "side-panel-visible");
 	show = _tmp7_;
 	if (!show) {
-		gtk_widget_hide ((GtkWidget*) self->priv->build_view);
+		gtk_widget_hide ((GtkWidget*) self->priv->side_panel);
 	}
-	_tmp8_ = gtk_action_group_get_action (self->priv->action_group, "ViewBottomPanel");
+	_tmp8_ = gtk_action_group_get_action (self->priv->action_group, "ViewSidePanel");
 	_tmp9_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp8_));
 	_g_object_unref0 (action);
 	action = _tmp9_;
 	gtk_toggle_action_set_active (action, show);
+	_tmp10_ = g_settings_get_boolean (settings, "bottom-panel-visible");
+	show = _tmp10_;
+	if (!show) {
+		gtk_widget_hide ((GtkWidget*) self->priv->build_view);
+	}
+	_tmp11_ = gtk_action_group_get_action (self->priv->action_group, "ViewBottomPanel");
+	_tmp12_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp11_));
+	_g_object_unref0 (action);
+	action = _tmp12_;
+	gtk_toggle_action_set_active (action, show);
 	_g_object_unref0 (action);
 	_g_object_unref0 (settings);
 }
@@ -1683,39 +1832,39 @@ FileBrowser* main_window_get_file_browser (MainWindow* self) {
 }
 
 
-static Block7Data* block7_data_ref (Block7Data* _data7_) {
-	g_atomic_int_inc (&_data7_->_ref_count_);
-	return _data7_;
+static Block8Data* block8_data_ref (Block8Data* _data8_) {
+	g_atomic_int_inc (&_data8_->_ref_count_);
+	return _data8_;
 }
 
 
-static void block7_data_unref (Block7Data* _data7_) {
-	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
-		_g_object_unref0 (_data7_->self);
-		_g_object_unref0 (_data7_->infobar);
-		_g_object_unref0 (_data7_->tab);
-		g_slice_free (Block7Data, _data7_);
+static void block8_data_unref (Block8Data* _data8_) {
+	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
+		_g_object_unref0 (_data8_->self);
+		_g_object_unref0 (_data8_->infobar);
+		_g_object_unref0 (_data8_->tab);
+		g_slice_free (Block8Data, _data8_);
 	}
 }
 
 
-static void _lambda62_ (gint response_id, Block7Data* _data7_) {
+static void _lambda71_ (gint response_id, Block8Data* _data8_) {
 	MainWindow * self;
 	DocumentView* _tmp1_ = NULL;
-	self = _data7_->self;
+	self = _data8_->self;
 	if (response_id == GTK_RESPONSE_YES) {
 		Document* _tmp0_ = NULL;
-		_tmp0_ = document_tab_get_document (_data7_->tab);
+		_tmp0_ = document_tab_get_document (_data8_->tab);
 		document_set_readonly (_tmp0_, FALSE);
 	}
-	gtk_object_destroy ((GtkObject*) _data7_->infobar);
-	_tmp1_ = document_tab_get_view (_data7_->tab);
+	gtk_object_destroy ((GtkObject*) _data8_->infobar);
+	_tmp1_ = document_tab_get_view (_data8_->tab);
 	gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
 }
 
 
-static void __lambda62__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
-	_lambda62_ (response_id, self);
+static void __lambda71__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
+	_lambda71_ (response_id, self);
 }
 
 
@@ -1755,86 +1904,89 @@ DocumentTab* main_window_open_document (MainWindow* self, GFile* location, gbool
 						_tmp6_ = _g_object_ref0 ((Document*) doc_it->data);
 						doc = _tmp6_;
 						{
+							Block8Data* _data8_;
 							gboolean _tmp7_ = FALSE;
 							GFile* _tmp8_ = NULL;
+							DocumentTab* _tmp12_ = NULL;
+							Document* _tmp13_ = NULL;
+							const gchar* _tmp14_ = NULL;
+							gchar* _tmp15_ = NULL;
+							gchar* _tmp16_;
+							gchar* _tmp17_ = NULL;
+							gchar* _tmp18_;
+							gchar* primary_msg;
+							const gchar* _tmp19_ = NULL;
+							gchar* _tmp20_;
+							gchar* secondary_msg;
+							TabInfoBar* _tmp21_ = NULL;
+							const gchar* _tmp22_ = NULL;
+							const gchar* _tmp23_ = NULL;
+							DocumentTab* _tmp24_;
+							_data8_ = g_slice_new0 (Block8Data);
+							_data8_->_ref_count_ = 1;
+							_data8_->self = g_object_ref (self);
 							_tmp8_ = document_get_location (doc);
-							if (_tmp8_ != NULL) {
+							if (_tmp8_ == NULL) {
+								_tmp7_ = TRUE;
+							} else {
 								GFile* _tmp9_ = NULL;
 								gboolean _tmp10_;
 								_tmp9_ = document_get_location (doc);
 								_tmp10_ = g_file_equal (location, _tmp9_);
-								_tmp7_ = _tmp10_;
-							} else {
-								_tmp7_ = FALSE;
+								_tmp7_ = !_tmp10_;
 							}
 							if (_tmp7_) {
-								Block7Data* _data7_;
-								DocumentTab* _tmp12_ = NULL;
-								Document* _tmp13_ = NULL;
-								const gchar* _tmp14_ = NULL;
-								gchar* _tmp15_ = NULL;
-								gchar* _tmp16_;
-								gchar* _tmp17_ = NULL;
-								gchar* _tmp18_;
-								gchar* primary_msg;
-								const gchar* _tmp19_ = NULL;
-								gchar* _tmp20_;
-								gchar* secondary_msg;
-								TabInfoBar* _tmp21_ = NULL;
-								const gchar* _tmp22_ = NULL;
-								const gchar* _tmp23_ = NULL;
-								DocumentTab* _tmp24_;
-								_data7_ = g_slice_new0 (Block7Data);
-								_data7_->_ref_count_ = 1;
-								_data7_->self = g_object_ref (self);
-								if (self == w) {
-									DocumentTab* _tmp11_;
-									if (jump_to) {
-										main_window_set_active_tab (self, doc->tab);
-									}
-									_tmp11_ = _g_object_ref0 (doc->tab);
-									result = _tmp11_;
-									block7_data_unref (_data7_);
-									_data7_ = NULL;
-									_g_object_unref0 (doc);
-									__g_list_free__g_object_unref0_0 (doc_collection);
-									_g_object_unref0 (w);
-									return result;
+								_g_object_unref0 (doc);
+								block8_data_unref (_data8_);
+								_data8_ = NULL;
+								continue;
+							}
+							if (self == w) {
+								DocumentTab* _tmp11_;
+								if (jump_to) {
+									main_window_set_active_tab (self, doc->tab);
 								}
-								_tmp12_ = main_window_create_tab_from_location (self, location, jump_to);
-								_data7_->tab = _tmp12_;
-								_tmp13_ = document_tab_get_document (_data7_->tab);
-								document_set_readonly (_tmp13_, TRUE);
-								_tmp14_ = _ ("This file (%s) is already opened in another LaTeXila window.");
-								_tmp15_ = g_file_get_parse_name (location);
-								_tmp16_ = _tmp15_;
-								_tmp17_ = g_strdup_printf (_tmp14_, _tmp16_);
-								_tmp18_ = _tmp17_;
-								_g_free0 (_tmp16_);
-								primary_msg = _tmp18_;
-								_tmp19_ = _ ("LaTeXila opened this instance of the file in a non-editable way. Do yo" \
-"u want to edit it anyway?");
-								_tmp20_ = g_strdup (_tmp19_);
-								secondary_msg = _tmp20_;
-								_tmp21_ = document_tab_add_message (_data7_->tab, primary_msg, secondary_msg, GTK_MESSAGE_WARNING);
-								_data7_->infobar = (GtkInfoBar*) _tmp21_;
-								_tmp22_ = _ ("Edit Anyway");
-								gtk_info_bar_add_button (_data7_->infobar, _tmp22_, (gint) GTK_RESPONSE_YES);
-								_tmp23_ = _ ("Don't Edit");
-								gtk_info_bar_add_button (_data7_->infobar, _tmp23_, (gint) GTK_RESPONSE_NO);
-								g_signal_connect_data (_data7_->infobar, "response", (GCallback) __lambda62__gtk_info_bar_response, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
-								_tmp24_ = _g_object_ref0 (_data7_->tab);
-								result = _tmp24_;
-								_g_free0 (secondary_msg);
-								_g_free0 (primary_msg);
-								block7_data_unref (_data7_);
-								_data7_ = NULL;
+								_tmp11_ = _g_object_ref0 (doc->tab);
+								result = _tmp11_;
 								_g_object_unref0 (doc);
+								block8_data_unref (_data8_);
+								_data8_ = NULL;
 								__g_list_free__g_object_unref0_0 (doc_collection);
 								_g_object_unref0 (w);
 								return result;
 							}
+							_tmp12_ = main_window_create_tab_from_location (self, location, jump_to);
+							_data8_->tab = _tmp12_;
+							_tmp13_ = document_tab_get_document (_data8_->tab);
+							document_set_readonly (_tmp13_, TRUE);
+							_tmp14_ = _ ("This file (%s) is already opened in another LaTeXila window.");
+							_tmp15_ = g_file_get_parse_name (location);
+							_tmp16_ = _tmp15_;
+							_tmp17_ = g_strdup_printf (_tmp14_, _tmp16_);
+							_tmp18_ = _tmp17_;
+							_g_free0 (_tmp16_);
+							primary_msg = _tmp18_;
+							_tmp19_ = _ ("LaTeXila opened this instance of the file in a non-editable way. Do yo" \
+"u want to edit it anyway?");
+							_tmp20_ = g_strdup (_tmp19_);
+							secondary_msg = _tmp20_;
+							_tmp21_ = document_tab_add_message (_data8_->tab, primary_msg, secondary_msg, GTK_MESSAGE_WARNING);
+							_data8_->infobar = (GtkInfoBar*) _tmp21_;
+							_tmp22_ = _ ("Edit Anyway");
+							gtk_info_bar_add_button (_data8_->infobar, _tmp22_, (gint) GTK_RESPONSE_YES);
+							_tmp23_ = _ ("Don't Edit");
+							gtk_info_bar_add_button (_data8_->infobar, _tmp23_, (gint) GTK_RESPONSE_NO);
+							g_signal_connect_data (_data8_->infobar, "response", (GCallback) __lambda71__gtk_info_bar_response, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
+							_tmp24_ = _g_object_ref0 (_data8_->tab);
+							result = _tmp24_;
+							_g_free0 (secondary_msg);
+							_g_free0 (primary_msg);
 							_g_object_unref0 (doc);
+							block8_data_unref (_data8_);
+							_data8_ = NULL;
+							__g_list_free__g_object_unref0_0 (doc_collection);
+							_g_object_unref0 (w);
+							return result;
 						}
 					}
 					__g_list_free__g_object_unref0_0 (doc_collection);
@@ -1896,118 +2048,128 @@ void main_window_create_tab_with_view (MainWindow* self, DocumentView* view) {
 }
 
 
-static Block8Data* block8_data_ref (Block8Data* _data8_) {
-	g_atomic_int_inc (&_data8_->_ref_count_);
-	return _data8_;
+static Block9Data* block9_data_ref (Block9Data* _data9_) {
+	g_atomic_int_inc (&_data9_->_ref_count_);
+	return _data9_;
 }
 
 
-static void block8_data_unref (Block8Data* _data8_) {
-	if (g_atomic_int_dec_and_test (&_data8_->_ref_count_)) {
-		_g_object_unref0 (_data8_->self);
-		_g_object_unref0 (_data8_->tab);
-		g_slice_free (Block8Data, _data8_);
+static void block9_data_unref (Block9Data* _data9_) {
+	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
+		_g_object_unref0 (_data9_->self);
+		_g_object_unref0 (_data9_->tab);
+		g_slice_free (Block9Data, _data9_);
 	}
 }
 
 
-static void _lambda46_ (Block8Data* _data8_) {
+static void _lambda53_ (Block9Data* _data9_) {
 	MainWindow * self;
-	self = _data8_->self;
-	main_window_close_tab (self, _data8_->tab, FALSE);
+	self = _data9_->self;
+	main_window_close_tab (self, _data9_->tab, FALSE);
 }
 
 
-static void __lambda46__document_tab_close_document (DocumentTab* _sender, gpointer self) {
-	_lambda46_ (self);
+static void __lambda53__document_tab_close_document (DocumentTab* _sender, gpointer self) {
+	_lambda53_ (self);
 }
 
 
-static void _lambda47_ (Block8Data* _data8_) {
+static void _lambda54_ (Block9Data* _data9_) {
 	MainWindow * self;
 	DocumentTab* _tmp0_ = NULL;
-	self = _data8_->self;
+	self = _data9_->self;
 	_tmp0_ = main_window_get_active_tab (self);
-	if (_data8_->tab != _tmp0_) {
+	if (_data9_->tab != _tmp0_) {
 		return;
 	}
 	main_window_set_undo_sensitivity (self);
 }
 
 
-static void __lambda47__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda47_ (self);
+static void __lambda54__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda54_ (self);
 }
 
 
-static void _lambda48_ (Block8Data* _data8_) {
+static void _lambda55_ (Block9Data* _data9_) {
 	MainWindow * self;
 	DocumentTab* _tmp0_ = NULL;
-	self = _data8_->self;
+	self = _data9_->self;
 	_tmp0_ = main_window_get_active_tab (self);
-	if (_data8_->tab != _tmp0_) {
+	if (_data9_->tab != _tmp0_) {
 		return;
 	}
 	main_window_set_redo_sensitivity (self);
 }
 
 
-static void __lambda48__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda48_ (self);
+static void __lambda55__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda55_ (self);
 }
 
 
-static void _lambda49_ (Block8Data* _data8_) {
+static void _lambda56_ (Block9Data* _data9_) {
 	MainWindow * self;
 	DocumentTab* _tmp0_ = NULL;
-	self = _data8_->self;
+	self = _data9_->self;
 	_tmp0_ = main_window_get_active_tab (self);
-	if (_data8_->tab != _tmp0_) {
+	if (_data9_->tab != _tmp0_) {
 		return;
 	}
 	main_window_selection_changed (self);
 }
 
 
-static void __lambda49__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda49_ (self);
+static void __lambda56__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda56_ (self);
 }
 
 
-static void _lambda50_ (Block8Data* _data8_) {
+static void _lambda57_ (Block9Data* _data9_) {
 	MainWindow * self;
-	self = _data8_->self;
-	main_window_sync_name (self, _data8_->tab);
+	self = _data9_->self;
+	main_window_sync_name (self, _data9_->tab);
+	main_window_update_build_tools_sensitivity (self);
+}
+
+
+static void __lambda57__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda57_ (self);
+}
+
+
+static void _lambda68_ (MainWindow* self) {
 	main_window_update_build_tools_sensitivity (self);
 }
 
 
-static void __lambda50__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda50_ (self);
+static void __lambda68__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda68_ (self);
 }
 
 
-static void _lambda60_ (Block8Data* _data8_) {
+static void _lambda69_ (Block9Data* _data9_) {
 	MainWindow * self;
-	self = _data8_->self;
-	main_window_sync_name (self, _data8_->tab);
+	self = _data9_->self;
+	main_window_sync_name (self, _data9_->tab);
 }
 
 
-static void __lambda60__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
-	_lambda60_ (self);
+static void __lambda69__gtk_text_buffer_modified_changed (GtkTextBuffer* _sender, gpointer self) {
+	_lambda69_ (self);
 }
 
 
-static void _lambda61_ (Block8Data* _data8_) {
+static void _lambda70_ (Block9Data* _data9_) {
 	MainWindow * self;
-	self = _data8_->self;
-	main_window_sync_name (self, _data8_->tab);
+	self = _data9_->self;
+	main_window_sync_name (self, _data9_->tab);
 }
 
 
-static void __lambda61__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda61_ (self);
+static void __lambda70__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda70_ (self);
 }
 
 
@@ -2018,7 +2180,7 @@ static void _main_window_update_cursor_position_statusbar_document_cursor_moved
 
 static DocumentTab* main_window_process_create_tab (MainWindow* self, DocumentTab* tab, gboolean jump_to) {
 	DocumentTab* result = NULL;
-	Block8Data* _data8_;
+	Block9Data* _data9_;
 	Document* _tmp0_ = NULL;
 	Document* _tmp1_ = NULL;
 	Document* _tmp2_ = NULL;
@@ -2026,47 +2188,50 @@ static DocumentTab* main_window_process_create_tab (MainWindow* self, DocumentTa
 	Document* _tmp4_ = NULL;
 	Document* _tmp5_ = NULL;
 	Document* _tmp6_ = NULL;
-	gboolean _tmp7_;
-	DocumentTab* _tmp8_;
+	Document* _tmp7_ = NULL;
+	gboolean _tmp8_;
+	DocumentTab* _tmp9_;
 	g_return_val_if_fail (self != NULL, NULL);
-	_data8_ = g_slice_new0 (Block8Data);
-	_data8_->_ref_count_ = 1;
-	_data8_->self = g_object_ref (self);
-	_data8_->tab = _g_object_ref0 (tab);
-	if (_data8_->tab == NULL) {
+	_data9_ = g_slice_new0 (Block9Data);
+	_data9_->_ref_count_ = 1;
+	_data9_->self = g_object_ref (self);
+	_data9_->tab = _g_object_ref0 (tab);
+	if (_data9_->tab == NULL) {
 		result = NULL;
-		block8_data_unref (_data8_);
-		_data8_ = NULL;
+		block9_data_unref (_data9_);
+		_data9_ = NULL;
 		return result;
 	}
-	g_signal_connect_data (_data8_->tab, "close-document", (GCallback) __lambda46__document_tab_close_document, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp0_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GObject*) _tmp0_, "notify::can-undo", (GCallback) __lambda47__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp1_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GObject*) _tmp1_, "notify::can-redo", (GCallback) __lambda48__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp2_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GObject*) _tmp2_, "notify::has-selection", (GCallback) __lambda49__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp3_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GObject*) _tmp3_, "notify::location", (GCallback) __lambda50__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp4_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GtkTextBuffer*) _tmp4_, "modified-changed", (GCallback) __lambda60__gtk_text_buffer_modified_changed, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp5_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_data ((GObject*) _tmp5_, "notify::readonly", (GCallback) __lambda61__g_object_notify, block8_data_ref (_data8_), (GClosureNotify) block8_data_unref, 0);
-	_tmp6_ = document_tab_get_document (_data8_->tab);
-	g_signal_connect_object (_tmp6_, "cursor-moved", (GCallback) _main_window_update_cursor_position_statusbar_document_cursor_moved, self, 0);
-	gtk_widget_show ((GtkWidget*) _data8_->tab);
-	documents_panel_add_tab (self->priv->documents_panel, _data8_->tab, -1, jump_to);
+	g_signal_connect_data (_data9_->tab, "close-document", (GCallback) __lambda53__document_tab_close_document, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp0_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GObject*) _tmp0_, "notify::can-undo", (GCallback) __lambda54__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp1_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GObject*) _tmp1_, "notify::can-redo", (GCallback) __lambda55__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp2_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GObject*) _tmp2_, "notify::has-selection", (GCallback) __lambda56__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp3_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GObject*) _tmp3_, "notify::location", (GCallback) __lambda57__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp4_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_object ((GObject*) _tmp4_, "notify::project-id", (GCallback) __lambda68__g_object_notify, self, 0);
+	_tmp5_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GtkTextBuffer*) _tmp5_, "modified-changed", (GCallback) __lambda69__gtk_text_buffer_modified_changed, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp6_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_data ((GObject*) _tmp6_, "notify::readonly", (GCallback) __lambda70__g_object_notify, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+	_tmp7_ = document_tab_get_document (_data9_->tab);
+	g_signal_connect_object (_tmp7_, "cursor-moved", (GCallback) _main_window_update_cursor_position_statusbar_document_cursor_moved, self, 0);
+	gtk_widget_show ((GtkWidget*) _data9_->tab);
+	documents_panel_add_tab (self->priv->documents_panel, _data9_->tab, -1, jump_to);
 	main_window_set_undo_sensitivity (self);
 	main_window_set_redo_sensitivity (self);
 	main_window_selection_changed (self);
-	_tmp7_ = gtk_widget_get_visible ((GtkWidget*) self);
-	if (!_tmp7_) {
+	_tmp8_ = gtk_widget_get_visible ((GtkWidget*) self);
+	if (!_tmp8_) {
 		gtk_window_present ((GtkWindow*) self);
 	}
-	_tmp8_ = _g_object_ref0 (_data8_->tab);
-	result = _tmp8_;
-	block8_data_unref (_data8_);
-	_data8_ = NULL;
+	_tmp9_ = _g_object_ref0 (_data9_->tab);
+	result = _tmp9_;
+	block9_data_unref (_data9_);
+	_data9_ = NULL;
 	return result;
 }
 
@@ -2089,27 +2254,27 @@ gboolean main_window_close_tab (MainWindow* self, DocumentTab* tab, gboolean for
 		const gchar* _tmp3_ = NULL;
 		const gchar* _tmp4_ = NULL;
 		GtkMessageDialog* _tmp5_ = NULL;
-		GtkMessageDialog* dialog;
+		GtkDialog* dialog;
 		const gchar* _tmp6_ = NULL;
 		Document* _tmp7_ = NULL;
 		GFile* _tmp8_ = NULL;
 		_tmp3_ = _ ("Save changes to document \"%s\" before closing?");
 		_tmp4_ = document_tab_get_label_text (tab);
 		_tmp5_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _tmp3_, _tmp4_);
-		dialog = g_object_ref_sink (_tmp5_);
+		dialog = (GtkDialog*) g_object_ref_sink (_tmp5_);
 		_tmp6_ = _ ("Close without Saving");
-		gtk_dialog_add_buttons ((GtkDialog*) dialog, _tmp6_, GTK_RESPONSE_CLOSE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
+		gtk_dialog_add_buttons (dialog, _tmp6_, GTK_RESPONSE_CLOSE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
 		_tmp7_ = document_tab_get_document (tab);
 		_tmp8_ = document_get_location (_tmp7_);
 		if (_tmp8_ == NULL) {
-			gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_SAVE_AS, (gint) GTK_RESPONSE_ACCEPT);
+			gtk_dialog_add_button (dialog, GTK_STOCK_SAVE_AS, (gint) GTK_RESPONSE_ACCEPT);
 		} else {
-			gtk_dialog_add_button ((GtkDialog*) dialog, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_ACCEPT);
+			gtk_dialog_add_button (dialog, GTK_STOCK_SAVE, (gint) GTK_RESPONSE_ACCEPT);
 		}
 		while (TRUE) {
 			gint _tmp9_;
 			gint res;
-			_tmp9_ = gtk_dialog_run ((GtkDialog*) dialog);
+			_tmp9_ = gtk_dialog_run (dialog);
 			res = _tmp9_;
 			if (res == GTK_RESPONSE_CLOSE) {
 				break;
@@ -2770,7 +2935,7 @@ static void main_window_setup_toolbar_open_button (MainWindow* self, GtkToolbar*
 }
 
 
-static void _lambda78_ (GtkRecentChooser* chooser, MainWindow* self) {
+static void _lambda90_ (GtkRecentChooser* chooser, MainWindow* self) {
 	const gchar* _tmp0_ = NULL;
 	gchar* _tmp1_;
 	gchar* uri;
@@ -2792,8 +2957,8 @@ static void _lambda78_ (GtkRecentChooser* chooser, MainWindow* self) {
 }
 
 
-static void __lambda78__gtk_recent_chooser_item_activated (GtkRecentChooser* _sender, gpointer self) {
-	_lambda78_ (_sender, self);
+static void __lambda90__gtk_recent_chooser_item_activated (GtkRecentChooser* _sender, gpointer self) {
+	_lambda90_ (_sender, self);
 }
 
 
@@ -2808,7 +2973,7 @@ static void main_window_configure_recent_chooser (MainWindow* self, GtkRecentCho
 	filter = g_object_ref_sink (_tmp0_);
 	gtk_recent_filter_add_application (filter, "latexila");
 	gtk_recent_chooser_set_filter (recent_chooser, filter);
-	g_signal_connect_object (recent_chooser, "item-activated", (GCallback) __lambda78__gtk_recent_chooser_item_activated, self, 0);
+	g_signal_connect_object (recent_chooser, "item-activated", (GCallback) __lambda90__gtk_recent_chooser_item_activated, self, 0);
 	_g_object_unref0 (filter);
 }
 
@@ -2837,16 +3002,19 @@ void main_window_save_state (MainWindow* self, gboolean sync) {
 	GtkAction* _tmp14_ = NULL;
 	GtkToggleAction* _tmp15_;
 	gboolean _tmp16_;
-	gint _tmp17_;
-	GtkAction* _tmp18_ = NULL;
-	GtkToggleAction* _tmp19_;
-	gboolean _tmp20_;
+	GtkAction* _tmp17_ = NULL;
+	GtkToggleAction* _tmp18_;
+	gboolean _tmp19_;
+	gint _tmp20_;
 	GtkAction* _tmp21_ = NULL;
 	GtkToggleAction* _tmp22_;
 	gboolean _tmp23_;
 	GtkAction* _tmp24_ = NULL;
 	GtkToggleAction* _tmp25_;
 	gboolean _tmp26_;
+	GtkAction* _tmp27_ = NULL;
+	GtkToggleAction* _tmp28_;
+	gboolean _tmp29_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_settings_new ("org.gnome.latexila.state.window");
 	settings_window = _tmp0_;
@@ -2866,46 +3034,52 @@ void main_window_save_state (MainWindow* self, gboolean sync) {
 	g_settings_set_int (settings_window, "side-panel-size", _tmp5_);
 	_tmp6_ = gtk_paned_get_position ((GtkPaned*) self->priv->vpaned);
 	g_settings_set_int (settings_window, "vertical-paned-position", _tmp6_);
+	structure_save_state (self->priv->_structure);
 	_tmp7_ = g_settings_new ("org.gnome.latexila.preferences.ui");
 	settings_ui = _tmp7_;
-	_tmp8_ = gtk_action_group_get_action (self->priv->action_group, "ViewEditToolbar");
+	_tmp8_ = gtk_action_group_get_action (self->priv->action_group, "ViewMainToolbar");
 	_tmp9_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp8_));
 	action = _tmp9_;
 	_tmp10_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "edit-toolbar-visible", _tmp10_);
-	_tmp11_ = gtk_action_group_get_action (self->priv->action_group, "ViewSidePanel");
+	g_settings_set_boolean (settings_ui, "main-toolbar-visible", _tmp10_);
+	_tmp11_ = gtk_action_group_get_action (self->priv->action_group, "ViewEditToolbar");
 	_tmp12_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp11_));
 	_g_object_unref0 (action);
 	action = _tmp12_;
 	_tmp13_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "side-panel-visible", _tmp13_);
-	_tmp14_ = gtk_action_group_get_action (self->priv->action_group, "ViewBottomPanel");
+	g_settings_set_boolean (settings_ui, "edit-toolbar-visible", _tmp13_);
+	_tmp14_ = gtk_action_group_get_action (self->priv->action_group, "ViewSidePanel");
 	_tmp15_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp14_));
 	_g_object_unref0 (action);
 	action = _tmp15_;
 	_tmp16_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "bottom-panel-visible", _tmp16_);
-	_tmp17_ = side_panel_get_active_component (self->priv->side_panel);
-	g_settings_set_int (settings_ui, "side-panel-component", _tmp17_);
-	_tmp18_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowErrors");
-	_tmp19_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp18_));
+	g_settings_set_boolean (settings_ui, "side-panel-visible", _tmp16_);
+	_tmp17_ = gtk_action_group_get_action (self->priv->action_group, "ViewBottomPanel");
+	_tmp18_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp17_));
 	_g_object_unref0 (action);
-	action = _tmp19_;
-	_tmp20_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "show-build-errors", _tmp20_);
-	_tmp21_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowWarnings");
+	action = _tmp18_;
+	_tmp19_ = gtk_toggle_action_get_active (action);
+	g_settings_set_boolean (settings_ui, "bottom-panel-visible", _tmp19_);
+	_tmp20_ = side_panel_get_active_component (self->priv->side_panel);
+	g_settings_set_int (settings_ui, "side-panel-component", _tmp20_);
+	_tmp21_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowErrors");
 	_tmp22_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp21_));
 	_g_object_unref0 (action);
 	action = _tmp22_;
 	_tmp23_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "show-build-warnings", _tmp23_);
-	_tmp24_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowBadBoxes");
+	g_settings_set_boolean (settings_ui, "show-build-errors", _tmp23_);
+	_tmp24_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowWarnings");
 	_tmp25_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp24_));
 	_g_object_unref0 (action);
 	action = _tmp25_;
 	_tmp26_ = gtk_toggle_action_get_active (action);
-	g_settings_set_boolean (settings_ui, "show-build-badboxes", _tmp26_);
-	structure_save_state (self->priv->structure);
+	g_settings_set_boolean (settings_ui, "show-build-warnings", _tmp26_);
+	_tmp27_ = gtk_action_group_get_action (self->priv->action_group, "BuildShowBadBoxes");
+	_tmp28_ = _g_object_ref0 (GTK_TOGGLE_ACTION (_tmp27_));
+	_g_object_unref0 (action);
+	action = _tmp28_;
+	_tmp29_ = gtk_toggle_action_get_active (action);
+	g_settings_set_boolean (settings_ui, "show-build-badboxes", _tmp29_);
 	if (sync) {
 		g_settings_sync ();
 		g_settings_sync ();
@@ -3072,40 +3246,19 @@ void main_window_update_build_tools_menu (MainWindow* self) {
 }
 
 
-static Block9Data* block9_data_ref (Block9Data* _data9_) {
-	g_atomic_int_inc (&_data9_->_ref_count_);
-	return _data9_;
-}
-
-
-static void block9_data_unref (Block9Data* _data9_) {
-	if (g_atomic_int_dec_and_test (&_data9_->_ref_count_)) {
-		_g_object_unref0 (_data9_->self);
-		_g_object_unref0 (_data9_->main_file);
-		g_slice_free (Block9Data, _data9_);
-	}
-}
-
-
-static void _lambda52_ (Block9Data* _data9_) {
-	MainWindow * self;
-	GFile* _tmp0_ = NULL;
-	GFile* _tmp1_;
-	self = _data9_->self;
-	_tmp0_ = g_file_get_parent (_data9_->main_file);
-	_tmp1_ = _tmp0_;
-	file_browser_refresh_if_in_dir (self->priv->file_browser, _tmp1_);
-	_g_object_unref0 (_tmp1_);
+static void _lambda59_ (MainWindow* self) {
+	Document* _tmp0_ = NULL;
+	_tmp0_ = main_window_get_active_document (self);
+	file_browser_refresh_for_document (self->priv->file_browser, _tmp0_);
 }
 
 
-static void __lambda52__build_tool_runner_finished (BuildToolRunner* _sender, gpointer self) {
-	_lambda52_ (self);
+static void __lambda59__build_tool_runner_finished (BuildToolRunner* _sender, gpointer self) {
+	_lambda59_ (self);
 }
 
 
 static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction* action) {
-	Block9Data* _data9_;
 	DocumentTab* _tmp0_ = NULL;
 	Document* _tmp1_ = NULL;
 	GFile* _tmp2_ = NULL;
@@ -3127,12 +3280,10 @@ static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction*
 	BuildTool tool;
 	Document* _tmp23_ = NULL;
 	GFile* _tmp24_ = NULL;
+	GFile* main_file;
 	BuildToolRunner* _tmp25_ = NULL;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (action != NULL);
-	_data9_ = g_slice_new0 (Block9Data);
-	_data9_->_ref_count_ = 1;
-	_data9_->self = g_object_ref (self);
 	_tmp0_ = main_window_get_active_tab (self);
 	g_return_if_fail (_tmp0_ != NULL);
 	_tmp1_ = main_window_get_active_document (self);
@@ -3159,11 +3310,11 @@ static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction*
 	if (tool.compilation) {
 		Document* _tmp14_ = NULL;
 		gint _tmp15_;
-		gint num;
+		gint project_id;
 		_tmp14_ = main_window_get_active_document (self);
 		_tmp15_ = document_get_project_id (_tmp14_);
-		num = _tmp15_;
-		if (num == (-1)) {
+		project_id = _tmp15_;
+		if (project_id == (-1)) {
 			Document* _tmp16_ = NULL;
 			_tmp16_ = main_window_get_active_document (self);
 			document_save (_tmp16_, TRUE, FALSE);
@@ -3191,7 +3342,7 @@ static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction*
 					{
 						gint _tmp22_;
 						_tmp22_ = document_get_project_id (doc);
-						if (_tmp22_ == num) {
+						if (_tmp22_ == project_id) {
 							document_save (doc, TRUE, FALSE);
 						}
 						_g_object_unref0 (doc);
@@ -3203,17 +3354,16 @@ static void main_window_build_tools_menu_activate (MainWindow* self, GtkAction*
 	}
 	_tmp23_ = main_window_get_active_document (self);
 	_tmp24_ = document_get_main_file (_tmp23_);
-	_data9_->main_file = _tmp24_;
-	_tmp25_ = build_tool_runner_new (_data9_->main_file, &tool, self->priv->build_view, self->priv->action_stop_exec);
+	main_file = _tmp24_;
+	_tmp25_ = build_tool_runner_new (main_file, &tool, self->priv->build_view, self->priv->action_stop_exec);
 	_g_object_unref0 (self->priv->build_tool_runner);
 	self->priv->build_tool_runner = _tmp25_;
 	if (tool.compilation) {
-		g_signal_connect_data (self->priv->build_tool_runner, "finished", (GCallback) __lambda52__build_tool_runner_finished, block9_data_ref (_data9_), (GClosureNotify) block9_data_unref, 0);
+		g_signal_connect_object (self->priv->build_tool_runner, "finished", (GCallback) __lambda59__build_tool_runner_finished, self, 0);
 	}
+	_g_object_unref0 (main_file);
 	build_tool_destroy (&tool);
 	_name = (_vala_array_free (_name, _name_length1, (GDestroyNotify) g_free), NULL);
-	block9_data_unref (_data9_);
-	_data9_ = NULL;
 }
 
 
@@ -3615,12 +3765,16 @@ static void main_window_update_build_tools_sensitivity (MainWindow* self) {
 	GtkAction* view_log_action;
 	gboolean _tmp4_ = FALSE;
 	DocumentTab* _tmp5_ = NULL;
-	Document* _tmp10_ = NULL;
-	GFile* _tmp11_ = NULL;
-	gchar* _tmp12_ = NULL;
-	gchar* _tmp13_;
+	Document* _tmp9_ = NULL;
+	gboolean _tmp10_;
+	gboolean is_tex;
+	Document* _tmp11_ = NULL;
+	GFile* _tmp12_ = NULL;
+	GFile* _tmp13_;
 	gchar* _tmp14_ = NULL;
 	gchar* _tmp15_;
+	gchar* path;
+	gchar* _tmp16_ = NULL;
 	gchar* ext;
 	gint i;
 	g_return_if_fail (self != NULL);
@@ -3636,9 +3790,12 @@ static void main_window_update_build_tools_sensitivity (MainWindow* self) {
 	} else {
 		Document* _tmp6_ = NULL;
 		GFile* _tmp7_ = NULL;
+		GFile* _tmp8_;
 		_tmp6_ = main_window_get_active_document (self);
-		_tmp7_ = document_get_location (_tmp6_);
-		_tmp4_ = _tmp7_ == NULL;
+		_tmp7_ = document_get_main_file (_tmp6_);
+		_tmp8_ = _tmp7_;
+		_tmp4_ = _tmp8_ == NULL;
+		_g_object_unref0 (_tmp8_);
 	}
 	if (_tmp4_) {
 		gtk_action_group_set_sensitive (self->priv->build_tools_action_group, FALSE);
@@ -3647,99 +3804,96 @@ static void main_window_update_build_tools_sensitivity (MainWindow* self) {
 		_g_object_unref0 (view_log_action);
 		_g_object_unref0 (clean_action);
 		return;
-	} else {
-		Document* _tmp8_ = NULL;
-		gboolean _tmp9_;
-		gboolean is_tex;
-		gtk_action_group_set_sensitive (self->priv->build_tools_action_group, TRUE);
-		_tmp8_ = main_window_get_active_document (self);
-		_tmp9_ = document_is_tex_document (_tmp8_);
-		is_tex = _tmp9_;
-		gtk_action_set_sensitive (clean_action, is_tex);
-		gtk_action_set_sensitive (view_log_action, is_tex);
 	}
-	_tmp10_ = main_window_get_active_document (self);
-	_tmp11_ = document_get_location (_tmp10_);
-	_tmp12_ = g_file_get_parse_name (_tmp11_);
+	gtk_action_group_set_sensitive (self->priv->build_tools_action_group, TRUE);
+	_tmp9_ = main_window_get_active_document (self);
+	_tmp10_ = document_is_main_file_a_tex_file (_tmp9_);
+	is_tex = _tmp10_;
+	gtk_action_set_sensitive (clean_action, is_tex);
+	gtk_action_set_sensitive (view_log_action, is_tex);
+	_tmp11_ = main_window_get_active_document (self);
+	_tmp12_ = document_get_main_file (_tmp11_);
 	_tmp13_ = _tmp12_;
-	_tmp14_ = utils_get_extension (_tmp13_);
+	_tmp14_ = g_file_get_parse_name (_tmp13_);
 	_tmp15_ = _tmp14_;
-	_g_free0 (_tmp13_);
-	ext = _tmp15_;
+	_g_object_unref0 (_tmp13_);
+	path = _tmp15_;
+	_tmp16_ = utils_get_extension (path);
+	ext = _tmp16_;
 	i = 0;
 	{
-		BuildTools* _tmp16_ = NULL;
-		BuildTools* _tmp17_;
-		GeeIterator* _tmp18_ = NULL;
-		GeeIterator* _tmp19_;
+		BuildTools* _tmp17_ = NULL;
+		BuildTools* _tmp18_;
+		GeeIterator* _tmp19_ = NULL;
+		GeeIterator* _tmp20_;
 		GeeIterator* _tool_it;
-		_tmp16_ = build_tools_get_default ();
-		_tmp17_ = _tmp16_;
-		_tmp18_ = build_tools_iterator (_tmp17_);
-		_tmp19_ = _tmp18_;
-		_build_tools_unref0 (_tmp17_);
-		_tool_it = _tmp19_;
+		_tmp17_ = build_tools_get_default ();
+		_tmp18_ = _tmp17_;
+		_tmp19_ = build_tools_iterator (_tmp18_);
+		_tmp20_ = _tmp19_;
+		_build_tools_unref0 (_tmp18_);
+		_tool_it = _tmp20_;
 		while (TRUE) {
-			gboolean _tmp20_;
-			gpointer _tmp21_ = NULL;
-			BuildTool* _tmp22_;
-			BuildTool _tmp23_;
-			BuildTool _tmp24_ = {0};
-			BuildTool _tmp25_;
+			gboolean _tmp21_;
+			gpointer _tmp22_ = NULL;
+			BuildTool* _tmp23_;
+			BuildTool _tmp24_;
+			BuildTool _tmp25_ = {0};
+			BuildTool _tmp26_;
 			BuildTool tool;
-			gchar** _tmp26_;
-			gchar** _tmp27_ = NULL;
+			gchar** _tmp27_;
+			gchar** _tmp28_ = NULL;
 			gchar** extensions;
 			gint extensions_length1;
 			gint _extensions_size_;
-			gboolean _tmp28_ = FALSE;
-			gint _tmp29_;
+			gboolean _tmp29_ = FALSE;
+			gint _tmp30_;
 			gboolean sensitive;
-			gchar* _tmp30_ = NULL;
-			gchar* _tmp31_;
-			gchar* _tmp32_ = NULL;
-			gchar* _tmp33_;
-			GtkAction* _tmp34_ = NULL;
-			GtkAction* _tmp35_;
+			gchar* _tmp31_ = NULL;
+			gchar* _tmp32_;
+			gchar* _tmp33_ = NULL;
+			gchar* _tmp34_;
+			GtkAction* _tmp35_ = NULL;
 			GtkAction* _tmp36_;
+			GtkAction* _tmp37_;
 			GtkAction* action;
-			_tmp20_ = gee_iterator_next (_tool_it);
-			if (!_tmp20_) {
+			_tmp21_ = gee_iterator_next (_tool_it);
+			if (!_tmp21_) {
 				break;
 			}
-			_tmp21_ = gee_iterator_get (_tool_it);
-			_tmp22_ = (BuildTool*) _tmp21_;
-			build_tool_copy (_tmp22_, &_tmp24_);
-			_tmp23_ = _tmp24_;
-			_tmp25_ = _tmp23_;
-			_build_tool_free0 (_tmp22_);
-			tool = _tmp25_;
+			_tmp22_ = gee_iterator_get (_tool_it);
+			_tmp23_ = (BuildTool*) _tmp22_;
+			build_tool_copy (_tmp23_, &_tmp25_);
+			_tmp24_ = _tmp25_;
+			_tmp26_ = _tmp24_;
+			_build_tool_free0 (_tmp23_);
+			tool = _tmp26_;
 			if (!tool.show) {
 				i++;
 				build_tool_destroy (&tool);
 				continue;
 			}
-			_tmp27_ = _tmp26_ = g_strsplit (tool.extensions, " ", 0);
-			extensions = _tmp27_;
-			extensions_length1 = _vala_array_length (_tmp26_);
-			_extensions_size_ = _vala_array_length (_tmp26_);
-			_tmp29_ = strlen (tool.extensions);
-			if (_tmp29_ == 0) {
-				_tmp28_ = TRUE;
+			_tmp28_ = _tmp27_ = g_strsplit (tool.extensions, " ", 0);
+			extensions = _tmp28_;
+			extensions_length1 = _vala_array_length (_tmp27_);
+			_extensions_size_ = _vala_array_length (_tmp27_);
+			_tmp30_ = strlen (tool.extensions);
+			if (_tmp30_ == 0) {
+				_tmp29_ = TRUE;
 			} else {
-				_tmp28_ = _vala_string_array_contains (extensions, extensions_length1, ext);
+				_tmp29_ = _vala_string_array_contains (extensions, extensions_length1, ext);
 			}
-			sensitive = _tmp28_;
-			_tmp30_ = g_strdup_printf ("%i", i);
-			_tmp31_ = _tmp30_;
-			_tmp32_ = g_strconcat ("BuildTool_", _tmp31_, NULL);
-			_tmp33_ = _tmp32_;
-			_tmp34_ = gtk_action_group_get_action (self->priv->build_tools_action_group, _tmp33_);
-			_tmp35_ = _g_object_ref0 (_tmp34_);
-			_tmp36_ = _tmp35_;
-			_g_free0 (_tmp33_);
-			_g_free0 (_tmp31_);
-			action = _tmp36_;
+			sensitive = _tmp29_;
+			_tmp31_ = g_strdup_printf ("%i", i);
+			_tmp32_ = _tmp31_;
+			_tmp33_ = g_strconcat ("BuildTool_", _tmp32_, NULL);
+			_tmp34_ = _tmp33_;
+			_tmp35_ = gtk_action_group_get_action (self->priv->build_tools_action_group, _tmp34_);
+			_tmp36_ = _g_object_ref0 (_tmp35_);
+			_tmp37_ = _tmp36_;
+			_g_free0 (_tmp34_);
+			_g_free0 (_tmp32_);
+			action = _tmp37_;
 			gtk_action_set_sensitive (action, sensitive);
 			i++;
 			_g_object_unref0 (action);
@@ -3749,6 +3903,7 @@ static void main_window_update_build_tools_sensitivity (MainWindow* self) {
 		_g_object_unref0 (_tool_it);
 	}
 	_g_free0 (ext);
+	_g_free0 (path);
 	_g_object_unref0 (view_log_action);
 	_g_object_unref0 (clean_action);
 }
@@ -4208,6 +4363,23 @@ void main_window_on_show_bottom_panel (MainWindow* self, GtkAction* action) {
 }
 
 
+void main_window_on_show_main_toolbar (MainWindow* self, GtkAction* action) {
+	GtkAction* _tmp0_;
+	gboolean _tmp1_;
+	gboolean show;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (action != NULL);
+	_tmp0_ = action;
+	_tmp1_ = gtk_toggle_action_get_active (GTK_IS_TOGGLE_ACTION (_tmp0_) ? ((GtkToggleAction*) _tmp0_) : NULL);
+	show = _tmp1_;
+	if (show) {
+		gtk_widget_show_all ((GtkWidget*) self->priv->main_toolbar);
+	} else {
+		gtk_widget_hide ((GtkWidget*) self->priv->main_toolbar);
+	}
+}
+
+
 void main_window_on_show_edit_toolbar (MainWindow* self, GtkAction* action) {
 	GtkAction* _tmp0_;
 	gboolean _tmp1_;
@@ -4296,27 +4468,22 @@ void main_window_on_build_stop_execution (MainWindow* self) {
 void main_window_on_build_clean (MainWindow* self) {
 	DocumentTab* _tmp0_ = NULL;
 	Document* _tmp1_ = NULL;
-	gboolean _tmp2_;
+	CleanBuildFiles* _tmp2_ = NULL;
+	CleanBuildFiles* build_files;
+	gboolean _tmp3_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = main_window_get_active_tab (self);
 	g_return_if_fail (_tmp0_ != NULL);
 	_tmp1_ = main_window_get_active_document (self);
-	_tmp2_ = document_clean_build_files (_tmp1_, self);
-	if (_tmp2_) {
-		Document* _tmp3_ = NULL;
-		GFile* _tmp4_ = NULL;
-		GFile* _tmp5_;
-		GFile* _tmp6_ = NULL;
-		GFile* _tmp7_;
-		_tmp3_ = main_window_get_active_document (self);
-		_tmp4_ = document_get_main_file (_tmp3_);
-		_tmp5_ = _tmp4_;
-		_tmp6_ = g_file_get_parent (_tmp5_);
-		_tmp7_ = _tmp6_;
-		file_browser_refresh_if_in_dir (self->priv->file_browser, _tmp7_);
-		_g_object_unref0 (_tmp7_);
-		_g_object_unref0 (_tmp5_);
+	_tmp2_ = clean_build_files_new (self, _tmp1_);
+	build_files = _tmp2_;
+	_tmp3_ = clean_build_files_clean (build_files);
+	if (_tmp3_) {
+		Document* _tmp4_ = NULL;
+		_tmp4_ = main_window_get_active_document (self);
+		file_browser_refresh_for_document (self->priv->file_browser, _tmp4_);
 	}
+	_g_object_unref0 (build_files);
 }
 
 
@@ -4344,7 +4511,7 @@ void main_window_on_build_view_log (MainWindow* self) {
 	_tmp0_ = main_window_get_active_tab (self);
 	g_return_if_fail (_tmp0_ != NULL);
 	_tmp1_ = main_window_get_active_document (self);
-	_tmp2_ = document_is_tex_document (_tmp1_);
+	_tmp2_ = document_is_main_file_a_tex_file (_tmp1_);
 	g_return_if_fail (_tmp2_);
 	_tmp3_ = main_window_get_active_document (self);
 	_tmp4_ = document_get_main_file (_tmp3_);
@@ -4500,12 +4667,89 @@ void main_window_on_projects_manage (MainWindow* self) {
 }
 
 
+void main_window_on_structure_cut (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_CUT);
+}
+
+
+void main_window_on_structure_copy (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_COPY);
+}
+
+
+void main_window_on_structure_delete (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_DELETE);
+}
+
+
+void main_window_on_structure_select (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_SELECT);
+}
+
+
+void main_window_on_structure_comment (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_COMMENT);
+}
+
+
+void main_window_on_structure_shift_left (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_SHIFT_LEFT);
+}
+
+
+void main_window_on_structure_shift_right (MainWindow* self) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (self->priv->_structure != NULL);
+	structure_do_action (self->priv->_structure, STRUCT_ACTION_SHIFT_RIGHT);
+}
+
+
+void main_window_on_help_contents (MainWindow* self) {
+	GdkScreen* _tmp0_ = NULL;
+	GError * _inner_error_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = gtk_window_get_screen ((GtkWindow*) self);
+	gtk_show_uri (_tmp0_, "ghelp:" HELP_DIR, (guint32) GDK_CURRENT_TIME, &_inner_error_);
+	if (_inner_error_ != NULL) {
+		goto __catch6_g_error;
+	}
+	goto __finally6;
+	__catch6_g_error:
+	{
+		GError * e;
+		e = _inner_error_;
+		_inner_error_ = NULL;
+		fprintf (stderr, "Impossible to open the documentation: %s\n", e->message);
+		_g_error_free0 (e);
+	}
+	__finally6:
+	if (_inner_error_ != NULL) {
+		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return;
+	}
+}
+
+
 void main_window_on_help_latex_reference (MainWindow* self) {
 	gchar* _tmp0_ = NULL;
 	gchar* _tmp1_;
 	gchar* _tmp2_ = NULL;
 	gchar* _tmp3_;
 	gchar* uri;
+	GdkScreen* _tmp4_ = NULL;
 	GError * _inner_error_ = NULL;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_build_filename (DATA_DIR, "latexhelp.html", NULL, NULL);
@@ -4515,16 +4759,17 @@ void main_window_on_help_latex_reference (MainWindow* self) {
 	_g_free0 (_tmp1_);
 	uri = _tmp3_;
 	if (_inner_error_ != NULL) {
-		goto __catch6_g_error;
+		goto __catch7_g_error;
 	}
-	gtk_show_uri (NULL, uri, (guint32) GDK_CURRENT_TIME, &_inner_error_);
+	_tmp4_ = gtk_window_get_screen ((GtkWindow*) self);
+	gtk_show_uri (_tmp4_, uri, (guint32) GDK_CURRENT_TIME, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_free0 (uri);
-		goto __catch6_g_error;
+		goto __catch7_g_error;
 	}
 	_g_free0 (uri);
-	goto __finally6;
-	__catch6_g_error:
+	goto __finally7;
+	__catch7_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -4532,7 +4777,7 @@ void main_window_on_help_latex_reference (MainWindow* self) {
 		fprintf (stderr, "Impossible to open the LaTeX reference: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally6:
+	__finally7:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -4590,7 +4835,7 @@ void main_window_on_about_dialog (MainWindow* self) {
 "You should have received a copy of the GNU General Public License\n" \
 "along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.");
 	licence = _tmp3_;
-	_tmp4_ = g_strdup ("http://latexila.sourceforge.net/";);
+	_tmp4_ = g_strdup ("http://projects.gnome.org/latexila/";);
 	website = _tmp4_;
 	_tmp5_ = g_strdup ("SÃbastien Wilmet <sebastien wilmet gmail com>");
 	_tmp6_ = g_new0 (gchar*, 2 + 1);
@@ -4618,12 +4863,12 @@ void main_window_on_about_dialog (MainWindow* self) {
 	_tmp13_ = gdk_pixbuf_new_from_file (DATA_DIR "/images/app/logo.png", &_inner_error_);
 	_tmp14_ = _tmp13_;
 	if (_inner_error_ != NULL) {
-		goto __catch7_g_error;
+		goto __catch8_g_error;
 	}
 	_g_object_unref0 (logo);
 	logo = _tmp14_;
-	goto __finally7;
-	__catch7_g_error:
+	goto __finally8;
+	__catch8_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -4631,7 +4876,7 @@ void main_window_on_about_dialog (MainWindow* self) {
 		fprintf (stderr, "Error with the logo: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally7:
+	__finally8:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (logo);
 		artists = (_vala_array_free (artists, artists_length1, (GDestroyNotify) g_free), NULL);
@@ -4753,11 +4998,12 @@ static void main_window_finalize (GObject* obj) {
 	_g_object_unref0 (self->priv->goto_line);
 	_g_object_unref0 (self->priv->search_and_replace);
 	_g_object_unref0 (self->priv->build_view);
+	_g_object_unref0 (self->priv->main_toolbar);
 	_g_object_unref0 (self->priv->edit_toolbar);
 	_g_object_unref0 (self->priv->side_panel);
 	_g_object_unref0 (self->priv->symbols);
 	_g_object_unref0 (self->priv->file_browser);
-	_g_object_unref0 (self->priv->structure);
+	_g_object_unref0 (self->priv->_structure);
 	_g_object_unref0 (self->priv->main_hpaned);
 	_g_object_unref0 (self->priv->vpaned);
 	_g_object_unref0 (self->priv->ui_manager);
diff --git a/src/C/menu_in_toolbar.c b/src/C/menu_in_toolbar.c
index 8a7abb4..0cc9248 100644
--- a/src/C/menu_in_toolbar.c
+++ b/src/C/menu_in_toolbar.c
@@ -1,4 +1,4 @@
-/* menu_in_toolbar.c generated by valac 0.12.0, the Vala compiler
+/* menu_in_toolbar.c generated by valac 0.12.1, the Vala compiler
  * generated from menu_in_toolbar.vala, do not modify */
 
 /*
diff --git a/src/C/most_used_symbols.c b/src/C/most_used_symbols.c
index c835e75..d840acb 100644
--- a/src/C/most_used_symbols.c
+++ b/src/C/most_used_symbols.c
@@ -1,4 +1,4 @@
-/* most_used_symbols.c generated by valac 0.12.0, the Vala compiler
+/* most_used_symbols.c generated by valac 0.12.1, the Vala compiler
  * generated from most_used_symbols.vala, do not modify */
 
 /*
@@ -182,7 +182,7 @@ static MostUsedSymbols* most_used_symbols_construct (GType object_type) {
 	contents = _tmp4_;
 	if (_inner_error_ != NULL) {
 		_g_free0 (contents);
-		goto __catch48_g_error;
+		goto __catch51_g_error;
 	}
 	_tmp5_.start_element = _most_used_symbols_parser_start_gmarkup_parser_start_element_func;
 	_tmp5_.end_element = NULL;
@@ -196,12 +196,12 @@ static MostUsedSymbols* most_used_symbols_construct (GType object_type) {
 	if (_inner_error_ != NULL) {
 		_g_markup_parse_context_free0 (context);
 		_g_free0 (contents);
-		goto __catch48_g_error;
+		goto __catch51_g_error;
 	}
 	_g_markup_parse_context_free0 (context);
 	_g_free0 (contents);
-	goto __finally48;
-	__catch48_g_error:
+	goto __finally51;
+	__catch51_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -209,7 +209,7 @@ static MostUsedSymbols* most_used_symbols_construct (GType object_type) {
 		fprintf (stderr, "Warning: impossible to load most used symbols: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally48:
+	__finally51:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (file);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -712,18 +712,18 @@ void most_used_symbols_save (MostUsedSymbols* self) {
 		g_file_make_directory_with_parents (parent, NULL, &_inner_error_);
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (parent);
-			goto __catch49_g_error;
+			goto __catch52_g_error;
 		}
 	}
 	_tmp20_ = strlen (content);
 	g_file_replace_contents (file, content, (gsize) _tmp20_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (parent);
-		goto __catch49_g_error;
+		goto __catch52_g_error;
 	}
 	_g_object_unref0 (parent);
-	goto __finally49;
-	__catch49_g_error:
+	goto __finally52;
+	__catch52_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -731,7 +731,7 @@ void most_used_symbols_save (MostUsedSymbols* self) {
 		fprintf (stderr, "Warning: impossible to save most used symbols: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally49:
+	__finally52:
 	if (_inner_error_ != NULL) {
 		_g_free0 (content);
 		_g_object_unref0 (file);
diff --git a/src/C/post_processors.c b/src/C/post_processors.c
index b068cbe..2d665dc 100644
--- a/src/C/post_processors.c
+++ b/src/C/post_processors.c
@@ -1,4 +1,4 @@
-/* post_processors.c generated by valac 0.12.0, the Vala compiler
+/* post_processors.c generated by valac 0.12.1, the Vala compiler
  * generated from post_processors.vala, do not modify */
 
 /*
@@ -282,13 +282,13 @@ enum  {
 LatexmkPostProcessor* latexmk_post_processor_new (gboolean show_all);
 LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gboolean show_all);
 static void latexmk_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output, gint status);
-static void _vala_array_add8 (PostProcessorIssues** array, int* length, int* size, const PostProcessorIssues* value);
+static void _vala_array_add10 (PostProcessorIssues** array, int* length, int* size, const PostProcessorIssues* value);
 LatexPostProcessor* latex_post_processor_new (void);
 LatexPostProcessor* latex_post_processor_construct (GType object_type);
 GType latex_post_processor_get_type (void) G_GNUC_CONST;
-static PostProcessorIssues* _vala_array_dup4 (PostProcessorIssues* self, int length);
-static PostProcessorIssues* latexmk_post_processor_real_get_issues (PostProcessor* base, int* result_length1);
 static PostProcessorIssues* _vala_array_dup5 (PostProcessorIssues* self, int length);
+static PostProcessorIssues* latexmk_post_processor_real_get_issues (PostProcessor* base, int* result_length1);
+static PostProcessorIssues* _vala_array_dup6 (PostProcessorIssues* self, int length);
 static void latexmk_post_processor_finalize (GObject* obj);
 static void _vala_latexmk_post_processor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 static void _vala_latexmk_post_processor_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
@@ -416,7 +416,9 @@ static PostProcessorIssues* no_output_post_processor_real_get_issues (PostProces
 	issues_length1 = 0;
 	_issues_size_ = 0;
 	_tmp1_ = issues;
-	*result_length1 = issues_length1;
+	if (result_length1) {
+		*result_length1 = issues_length1;
+	}
 	result = _tmp1_;
 	return result;
 }
@@ -606,7 +608,9 @@ static PostProcessorIssues* all_output_post_processor_real_get_issues (PostProce
 	_g_object_unref0 (pp_issues[0].issues);
 	pp_issues[0].issues = _tmp1_;
 	_tmp2_ = pp_issues;
-	*result_length1 = pp_issues_length1;
+	if (result_length1) {
+		*result_length1 = pp_issues_length1;
+	}
 	result = _tmp2_;
 	return result;
 }
@@ -729,7 +733,7 @@ RubberPostProcessor* rubber_post_processor_construct (GType object_type) {
 		_tmp1_ = _tmp0_;
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch27_g_regex_error;
+				goto __catch29_g_regex_error;
 			}
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -737,8 +741,8 @@ RubberPostProcessor* rubber_post_processor_construct (GType object_type) {
 		}
 		_g_regex_unref0 (rubber_post_processor_pattern);
 		rubber_post_processor_pattern = _tmp1_;
-		goto __finally27;
-		__catch27_g_regex_error:
+		goto __finally29;
+		__catch29_g_regex_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -746,7 +750,7 @@ RubberPostProcessor* rubber_post_processor_construct (GType object_type) {
 			fprintf (stderr, "RubberPostProcessor: %s\n", e->message);
 			_g_error_free0 (e);
 		}
-		__finally27:
+		__finally29:
 		if (_inner_error_ != NULL) {
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -783,8 +787,13 @@ static gchar string_get (const gchar* self, glong index) {
 
 static void rubber_post_processor_real_process (PostProcessor* base, GFile* file, const gchar* output, gint status) {
 	RubberPostProcessor * self;
+	GFile* _tmp0_ = NULL;
+	GFile* _tmp1_;
+	gchar* _tmp2_ = NULL;
+	gchar* _tmp3_;
+	gchar* parent_path;
 	GMatchInfo* match_info = NULL;
-	GMatchInfo* _tmp0_ = NULL;
+	GMatchInfo* _tmp4_ = NULL;
 	GError * _inner_error_ = NULL;
 	self = (RubberPostProcessor*) base;
 	g_return_if_fail (file != NULL);
@@ -793,125 +802,122 @@ static void rubber_post_processor_real_process (PostProcessor* base, GFile* file
 	if (rubber_post_processor_pattern == NULL) {
 		return;
 	}
-	g_regex_match (rubber_post_processor_pattern, output, 0, &_tmp0_);
+	_tmp0_ = g_file_get_parent (file);
+	_tmp1_ = _tmp0_;
+	_tmp2_ = g_file_get_parse_name (_tmp1_);
+	_tmp3_ = _tmp2_;
+	_g_object_unref0 (_tmp1_);
+	parent_path = _tmp3_;
+	g_regex_match (rubber_post_processor_pattern, output, 0, &_tmp4_);
 	_g_match_info_free0 (match_info);
-	match_info = _tmp0_;
+	match_info = _tmp4_;
 	while (TRUE) {
-		gboolean _tmp1_;
+		gboolean _tmp5_;
 		BuildIssue issue = {0};
-		gchar* _tmp2_ = NULL;
-		gchar* _tmp3_;
+		gchar* _tmp6_ = NULL;
+		gchar* _tmp7_;
 		gchar* text;
-		gboolean _tmp4_ = FALSE;
-		gboolean _tmp5_;
-		gchar* _tmp7_ = NULL;
-		gchar* line;
 		gboolean _tmp8_ = FALSE;
-		gchar* _tmp17_ = NULL;
-		gchar _tmp18_;
-		_tmp1_ = g_match_info_matches (match_info);
-		if (!_tmp1_) {
+		gboolean _tmp9_;
+		gchar* _tmp11_ = NULL;
+		gchar* line;
+		gboolean _tmp12_ = FALSE;
+		gchar* _tmp21_ = NULL;
+		gchar _tmp22_;
+		_tmp5_ = g_match_info_matches (match_info);
+		if (!_tmp5_) {
 			break;
 		}
 		memset (&issue, 0, sizeof (BuildIssue));
-		_tmp2_ = g_match_info_fetch_named (match_info, "text");
+		_tmp6_ = g_match_info_fetch_named (match_info, "text");
 		_g_free0 (issue.message);
-		issue.message = _tmp2_;
-		_tmp3_ = g_strdup (issue.message);
-		text = _tmp3_;
+		issue.message = _tmp6_;
+		_tmp7_ = g_strdup (issue.message);
+		text = _tmp7_;
 		issue.message_type = BUILD_MESSAGE_TYPE_ERROR;
-		_tmp5_ = string_contains (text, "Underfull");
-		if (_tmp5_) {
-			_tmp4_ = TRUE;
+		_tmp9_ = string_contains (text, "Underfull");
+		if (_tmp9_) {
+			_tmp8_ = TRUE;
 		} else {
-			gboolean _tmp6_;
-			_tmp6_ = string_contains (text, "Overfull");
-			_tmp4_ = _tmp6_;
+			gboolean _tmp10_;
+			_tmp10_ = string_contains (text, "Overfull");
+			_tmp8_ = _tmp10_;
 		}
-		if (_tmp4_) {
+		if (_tmp8_) {
 			issue.message_type = BUILD_MESSAGE_TYPE_BADBOX;
 		}
 		issue.end_line = -1;
 		issue.start_line = issue.end_line;
-		_tmp7_ = g_match_info_fetch_named (match_info, "line");
-		line = _tmp7_;
+		_tmp11_ = g_match_info_fetch_named (match_info, "line");
+		line = _tmp11_;
 		if (line != NULL) {
-			gint _tmp9_;
-			_tmp9_ = strlen (line);
-			_tmp8_ = _tmp9_ > 0;
+			gint _tmp13_;
+			_tmp13_ = strlen (line);
+			_tmp12_ = _tmp13_ > 0;
 		} else {
-			_tmp8_ = FALSE;
+			_tmp12_ = FALSE;
 		}
-		if (_tmp8_) {
-			gchar** _tmp10_;
-			gchar** _tmp11_ = NULL;
+		if (_tmp12_) {
+			gchar** _tmp14_;
+			gchar** _tmp15_ = NULL;
 			gchar** parts;
 			gint parts_length1;
 			gint _parts_size_;
-			gint _tmp12_;
-			gboolean _tmp13_ = FALSE;
-			gboolean _tmp14_ = FALSE;
-			_tmp11_ = _tmp10_ = g_strsplit (line, "-", 0);
-			parts = _tmp11_;
-			parts_length1 = _vala_array_length (_tmp10_);
-			_parts_size_ = _vala_array_length (_tmp10_);
-			_tmp12_ = atoi (parts[0]);
-			issue.start_line = _tmp12_;
+			gint _tmp16_;
+			gboolean _tmp17_ = FALSE;
+			gboolean _tmp18_ = FALSE;
+			_tmp15_ = _tmp14_ = g_strsplit (line, "-", 0);
+			parts = _tmp15_;
+			parts_length1 = _vala_array_length (_tmp14_);
+			_parts_size_ = _vala_array_length (_tmp14_);
+			_tmp16_ = atoi (parts[0]);
+			issue.start_line = _tmp16_;
 			if (parts_length1 > 1) {
-				_tmp14_ = parts[1] != NULL;
+				_tmp18_ = parts[1] != NULL;
 			} else {
-				_tmp14_ = FALSE;
+				_tmp18_ = FALSE;
 			}
-			if (_tmp14_) {
-				gint _tmp15_;
-				_tmp15_ = strlen (parts[1]);
-				_tmp13_ = _tmp15_ > 0;
+			if (_tmp18_) {
+				gint _tmp19_;
+				_tmp19_ = strlen (parts[1]);
+				_tmp17_ = _tmp19_ > 0;
 			} else {
-				_tmp13_ = FALSE;
+				_tmp17_ = FALSE;
 			}
-			if (_tmp13_) {
-				gint _tmp16_;
-				_tmp16_ = atoi (parts[1]);
-				issue.end_line = _tmp16_;
+			if (_tmp17_) {
+				gint _tmp20_;
+				_tmp20_ = atoi (parts[1]);
+				issue.end_line = _tmp20_;
 			}
 			parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
 		}
-		_tmp17_ = g_match_info_fetch_named (match_info, "file");
+		_tmp21_ = g_match_info_fetch_named (match_info, "file");
 		_g_free0 (issue.filename);
-		issue.filename = _tmp17_;
-		_tmp18_ = string_get (issue.filename, (glong) 0);
-		if (_tmp18_ != '/') {
-			GFile* _tmp19_ = NULL;
-			GFile* _tmp20_;
-			gchar* _tmp21_ = NULL;
-			gchar* _tmp22_;
+		issue.filename = _tmp21_;
+		_tmp22_ = string_get (issue.filename, (glong) 0);
+		if (_tmp22_ != '/') {
 			gchar* _tmp23_ = NULL;
-			_tmp19_ = g_file_get_parent (file);
-			_tmp20_ = _tmp19_;
-			_tmp21_ = g_file_get_parse_name (_tmp20_);
-			_tmp22_ = _tmp21_;
-			_tmp23_ = g_strdup_printf ("%s/%s", _tmp22_, issue.filename);
+			_tmp23_ = g_strdup_printf ("%s/%s", parent_path, issue.filename);
 			_g_free0 (issue.filename);
 			issue.filename = _tmp23_;
-			_g_free0 (_tmp22_);
-			_g_object_unref0 (_tmp20_);
 		}
 		gee_abstract_collection_add ((GeeAbstractCollection*) self->priv->issues, &issue);
 		g_match_info_next (match_info, &_inner_error_);
 		if (_inner_error_ != NULL) {
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch28_g_regex_error;
+				goto __catch30_g_regex_error;
 			}
 			_g_free0 (line);
 			_g_free0 (text);
 			build_issue_destroy (&issue);
 			_g_match_info_free0 (match_info);
+			_g_free0 (parent_path);
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
 			return;
 		}
-		goto __finally28;
-		__catch28_g_regex_error:
+		goto __finally30;
+		__catch30_g_regex_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -923,12 +929,13 @@ static void rubber_post_processor_real_process (PostProcessor* base, GFile* file
 			build_issue_destroy (&issue);
 			break;
 		}
-		__finally28:
+		__finally30:
 		if (_inner_error_ != NULL) {
 			_g_free0 (line);
 			_g_free0 (text);
 			build_issue_destroy (&issue);
 			_g_match_info_free0 (match_info);
+			_g_free0 (parent_path);
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
 			return;
@@ -938,6 +945,7 @@ static void rubber_post_processor_real_process (PostProcessor* base, GFile* file
 		build_issue_destroy (&issue);
 	}
 	_g_match_info_free0 (match_info);
+	_g_free0 (parent_path);
 }
 
 
@@ -961,7 +969,9 @@ static PostProcessorIssues* rubber_post_processor_real_get_issues (PostProcessor
 	_g_object_unref0 (pp_issues[0].issues);
 	pp_issues[0].issues = _tmp1_;
 	_tmp2_ = pp_issues;
-	*result_length1 = pp_issues_length1;
+	if (result_length1) {
+		*result_length1 = pp_issues_length1;
+	}
 	result = _tmp2_;
 	return result;
 }
@@ -1116,7 +1126,7 @@ LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gbool
 		if (_inner_error_ != NULL) {
 			_g_free0 (reg_rule_str);
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch29_g_regex_error;
+				goto __catch31_g_regex_error;
 			}
 			_g_free0 (reg_rule_str);
 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1139,7 +1149,7 @@ LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gbool
 			_g_free0 (reg_no_rule_str);
 			_g_free0 (reg_rule_str);
 			if (_inner_error_->domain == G_REGEX_ERROR) {
-				goto __catch29_g_regex_error;
+				goto __catch31_g_regex_error;
 			}
 			_g_free0 (reg_no_rule_str);
 			_g_free0 (reg_rule_str);
@@ -1151,8 +1161,8 @@ LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gbool
 		latexmk_post_processor_reg_no_rule = _tmp15_;
 		_g_free0 (reg_no_rule_str);
 		_g_free0 (reg_rule_str);
-		goto __finally29;
-		__catch29_g_regex_error:
+		goto __finally31;
+		__catch31_g_regex_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -1160,7 +1170,7 @@ LatexmkPostProcessor* latexmk_post_processor_construct (GType object_type, gbool
 			fprintf (stderr, "LatexmkPostProcessor: %s\n", e->message);
 			_g_error_free0 (e);
 		}
-		__finally29:
+		__finally31:
 		if (_inner_error_ != NULL) {
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -1176,7 +1186,7 @@ LatexmkPostProcessor* latexmk_post_processor_new (gboolean show_all) {
 }
 
 
-static void _vala_array_add8 (PostProcessorIssues** array, int* length, int* size, const PostProcessorIssues* value) {
+static void _vala_array_add10 (PostProcessorIssues** array, int* length, int* size, const PostProcessorIssues* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (PostProcessorIssues, *array, *size);
@@ -1185,7 +1195,7 @@ static void _vala_array_add8 (PostProcessorIssues** array, int* length, int* siz
 }
 
 
-static PostProcessorIssues* _vala_array_dup4 (PostProcessorIssues* self, int length) {
+static PostProcessorIssues* _vala_array_dup5 (PostProcessorIssues* self, int length) {
 	PostProcessorIssues* result;
 	int i;
 	result = g_new0 (PostProcessorIssues, length);
@@ -1318,11 +1328,11 @@ static void latexmk_post_processor_real_process (PostProcessor* base, GFile* fil
 			pp_issues.issues = _tmp17_;
 			post_processor_issues_copy (&pp_issues, &_tmp19_);
 			_tmp18_ = _tmp19_;
-			_vala_array_add8 (&self->priv->all_issues, &self->priv->all_issues_length1, &self->priv->_all_issues_size_, &_tmp18_);
+			_vala_array_add10 (&self->priv->all_issues, &self->priv->all_issues_length1, &self->priv->_all_issues_size_, &_tmp18_);
 			g_match_info_next (match_info, &_inner_error_);
 			if (_inner_error_ != NULL) {
 				if (_inner_error_->domain == G_REGEX_ERROR) {
-					goto __catch30_g_regex_error;
+					goto __catch32_g_regex_error;
 				}
 				_g_free0 (rule);
 				build_issue_destroy (&issue);
@@ -1334,8 +1344,8 @@ static void latexmk_post_processor_real_process (PostProcessor* base, GFile* fil
 				g_clear_error (&_inner_error_);
 				return;
 			}
-			goto __finally30;
-			__catch30_g_regex_error:
+			goto __finally32;
+			__catch32_g_regex_error:
 			{
 				GError * e;
 				e = _inner_error_;
@@ -1348,7 +1358,7 @@ static void latexmk_post_processor_real_process (PostProcessor* base, GFile* fil
 				post_processor_issues_destroy (&pp_issues);
 				break;
 			}
-			__finally30:
+			__finally32:
 			if (_inner_error_ != NULL) {
 				_g_free0 (rule);
 				build_issue_destroy (&issue);
@@ -1405,7 +1415,7 @@ static void latexmk_post_processor_real_process (PostProcessor* base, GFile* fil
 		if (_tmp24_) {
 			PostProcessorIssues* _tmp27_;
 			PostProcessorIssues* _tmp28_;
-			_tmp27_ = (_tmp28_ = latex_issues, (_tmp28_ == NULL) ? ((gpointer) _tmp28_) : _vala_array_dup4 (_tmp28_, latex_issues_length1));
+			_tmp27_ = (_tmp28_ = latex_issues, (_tmp28_ == NULL) ? ((gpointer) _tmp28_) : _vala_array_dup5 (_tmp28_, latex_issues_length1));
 			self->priv->all_issues = (_vala_PostProcessorIssues_array_free (self->priv->all_issues, self->priv->all_issues_length1), NULL);
 			self->priv->all_issues = _tmp27_;
 			self->priv->all_issues_length1 = latex_issues_length1;
@@ -1447,7 +1457,7 @@ static void latexmk_post_processor_real_process (PostProcessor* base, GFile* fil
 }
 
 
-static PostProcessorIssues* _vala_array_dup5 (PostProcessorIssues* self, int length) {
+static PostProcessorIssues* _vala_array_dup6 (PostProcessorIssues* self, int length) {
 	PostProcessorIssues* result;
 	int i;
 	result = g_new0 (PostProcessorIssues, length);
@@ -1467,9 +1477,11 @@ static PostProcessorIssues* latexmk_post_processor_real_get_issues (PostProcesso
 	PostProcessorIssues* _tmp1_;
 	PostProcessorIssues* _tmp2_;
 	self = (LatexmkPostProcessor*) base;
-	_tmp0_ = (_tmp1_ = self->priv->all_issues, (_tmp1_ == NULL) ? ((gpointer) _tmp1_) : _vala_array_dup5 (_tmp1_, self->priv->all_issues_length1));
+	_tmp0_ = (_tmp1_ = self->priv->all_issues, (_tmp1_ == NULL) ? ((gpointer) _tmp1_) : _vala_array_dup6 (_tmp1_, self->priv->all_issues_length1));
 	_tmp2_ = _tmp0_;
-	*result_length1 = self->priv->all_issues_length1;
+	if (result_length1) {
+		*result_length1 = self->priv->all_issues_length1;
+	}
 	result = _tmp2_;
 	return result;
 }
diff --git a/src/C/preferences_dialog.c b/src/C/preferences_dialog.c
index 869ee82..1aecb51 100644
--- a/src/C/preferences_dialog.c
+++ b/src/C/preferences_dialog.c
@@ -1,4 +1,4 @@
-/* preferences_dialog.c generated by valac 0.12.0, the Vala compiler
+/* preferences_dialog.c generated by valac 0.12.1, the Vala compiler
  * generated from preferences_dialog.vala, do not modify */
 
 /*
@@ -84,9 +84,6 @@ typedef struct _Block2Data Block2Data;
 
 typedef struct _BuildTools BuildTools;
 typedef struct _BuildToolsClass BuildToolsClass;
-#define _build_tools_unref0(var) ((var == NULL) ? NULL : (var = (build_tools_unref (var), NULL)))
-typedef struct _Block3Data Block3Data;
-typedef struct _Block4Data Block4Data;
 
 #define TYPE_BUILD_TOOL (build_tool_get_type ())
 
@@ -96,6 +93,10 @@ typedef struct _Block4Data Block4Data;
 typedef struct _BuildJob BuildJob;
 typedef struct _BuildTool BuildTool;
 #define _build_tool_free0(var) ((var == NULL) ? NULL : (var = (build_tool_free (var), NULL)))
+#define _build_tools_unref0(var) ((var == NULL) ? NULL : (var = (build_tools_unref (var), NULL)))
+typedef struct _Block3Data Block3Data;
+typedef struct _Block4Data Block4Data;
+typedef struct _Block5Data Block5Data;
 
 struct _PreferencesDialog {
 	GtkDialog parent_instance;
@@ -138,21 +139,6 @@ struct _Block2Data {
 	GtkTreeView* build_tools_view;
 };
 
-struct _Block3Data {
-	int _ref_count_;
-	PreferencesDialog * self;
-	GtkWidget* widget;
-	gboolean must_be_enabled;
-};
-
-struct _Block4Data {
-	int _ref_count_;
-	PreferencesDialog * self;
-	GtkLabel* label;
-	gchar* msg_singular;
-	gchar* msg_plural;
-};
-
 typedef enum  {
 	POST_PROCESSOR_TYPE_ALL_OUTPUT = 0,
 	POST_PROCESSOR_TYPE_LATEX,
@@ -180,6 +166,27 @@ struct _BuildTool {
 	GList* jobs;
 };
 
+struct _Block3Data {
+	int _ref_count_;
+	PreferencesDialog * self;
+	GtkWidget* widget;
+	gboolean must_be_enabled;
+};
+
+struct _Block4Data {
+	int _ref_count_;
+	PreferencesDialog * self;
+	GtkLabel* label;
+	gchar* msg_singular;
+	gchar* msg_plural;
+};
+
+struct _Block5Data {
+	int _ref_count_;
+	PreferencesDialog * self;
+	GtkTreeViewColumn* label_column;
+};
+
 
 static gpointer preferences_dialog_parent_class = NULL;
 static PreferencesDialog* preferences_dialog_preferences_dialog;
@@ -203,8 +210,8 @@ static void preferences_dialog_init_latex_tab (PreferencesDialog* self, GtkBuild
 static void preferences_dialog_init_other_tab (PreferencesDialog* self, GtkBuilder* builder);
 GType main_window_get_type (void) G_GNUC_CONST;
 void preferences_dialog_show_me (MainWindow* parent);
-static void _lambda73_ (void);
-static void __lambda73__gtk_object_destroy (GtkObject* _sender, gpointer self);
+static void _lambda85_ (void);
+static void __lambda85__gtk_object_destroy (GtkObject* _sender, gpointer self);
 static GtkDialog* preferences_dialog_get_reset_all_confirm_dialog (PreferencesDialog* self, const gchar* msg);
 static void preferences_dialog_set_sensitivity (PreferencesDialog* self, GSettings* settings, const gchar* key, GtkWidget* widget, gboolean must_be_enabled);
 static void preferences_dialog_set_plural (PreferencesDialog* self, GtkLabel* label, GSettings* settings, const gchar* key, const gchar* msg_singular, const gchar* msg_plural);
@@ -213,23 +220,23 @@ static void block1_data_unref (Block1Data* _data1_);
 static void preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button);
 GType app_settings_get_type (void) G_GNUC_CONST;
 AppSettings* app_settings_get_default (void);
-static void _lambda99_ (Block1Data* _data1_);
-static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _lambda113_ (Block1Data* _data1_);
+static void __lambda113__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, GtkTreeView* treeview, const gchar* current_id);
-static void _lambda100_ (GtkTreeView* treeview, Block1Data* _data1_);
-static void __lambda100__gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self);
-static void _lambda101_ (GSettings* setting, const gchar* key, Block1Data* _data1_);
-static void __lambda101__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
+static void _lambda114_ (GtkTreeView* treeview, Block1Data* _data1_);
+static void __lambda114__gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self);
+static void _lambda115_ (GSettings* setting, const gchar* key, Block1Data* _data1_);
+static void __lambda115__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
 static Block2Data* block2_data_ref (Block2Data* _data2_);
 static void block2_data_unref (Block2Data* _data2_);
 static void preferences_dialog_init_build_tools_treeview (PreferencesDialog* self, GtkTreeView* build_tools_view);
-static void _lambda103_ (PreferencesDialog* self);
+static void _lambda125_ (Block2Data* _data2_);
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
 static void preferences_dialog_run_build_tool_dialog (PreferencesDialog* self, gint num);
-static void __lambda103__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda111_ (Block2Data* _data2_);
-gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set);
-static void __lambda111__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda112_ (Block2Data* _data2_);
+static void __lambda125__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda126_ (PreferencesDialog* self);
+static void __lambda126__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda127_ (Block2Data* _data2_);
 gpointer build_tools_ref (gpointer instance);
 void build_tools_unref (gpointer instance);
 GParamSpec* param_spec_build_tools (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
@@ -238,19 +245,34 @@ void value_take_build_tools (GValue* value, gpointer v_object);
 gpointer value_get_build_tools (const GValue* value);
 GType build_tools_get_type (void) G_GNUC_CONST;
 BuildTools* build_tools_get_default (void);
-void build_tools_delete (BuildTools* self, gint num);
-static void __lambda112__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda113_ (Block2Data* _data2_);
+GType build_tool_get_type (void) G_GNUC_CONST;
+GType build_job_get_type (void) G_GNUC_CONST;
+GType post_processor_type_get_type (void) G_GNUC_CONST;
+BuildJob* build_job_dup (const BuildJob* self);
+void build_job_free (BuildJob* self);
+void build_job_copy (const BuildJob* self, BuildJob* dest);
+void build_job_destroy (BuildJob* self);
+BuildTool* build_tool_dup (const BuildTool* self);
+void build_tool_free (BuildTool* self);
+void build_tool_copy (const BuildTool* self, BuildTool* dest);
+void build_tool_destroy (BuildTool* self);
+BuildTool* build_tools_get (BuildTools* self, gint id);
+void build_tools_insert (BuildTools* self, gint pos, BuildTool* tool);
+static void preferences_dialog_update_build_tools_store (PreferencesDialog* self);
+static void __lambda127__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda128_ (Block2Data* _data2_);
 gboolean utils_tree_model_iter_prev (GtkTreeModel* model, GtkTreeIter* iter);
 void build_tools_move_up (BuildTools* self, gint num);
-static void __lambda113__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda114_ (Block2Data* _data2_);
+static void __lambda128__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda129_ (Block2Data* _data2_);
 void build_tools_move_down (BuildTools* self, gint num);
-static void __lambda114__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda115_ (PreferencesDialog* self);
+static void __lambda129__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda130_ (Block2Data* _data2_);
+void build_tools_delete (BuildTools* self, gint num);
+static void __lambda130__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda131_ (PreferencesDialog* self);
 void build_tools_reset_all (BuildTools* self);
-static void preferences_dialog_update_build_tools_store (PreferencesDialog* self);
-static void __lambda115__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda131__gtk_button_clicked (GtkButton* _sender, gpointer self);
 static Block3Data* block3_data_ref (Block3Data* _data3_);
 static void block3_data_unref (Block3Data* _data3_);
 static void _lambda1_ (GSettings* setting, const gchar* k, Block3Data* _data3_);
@@ -260,21 +282,13 @@ static Block4Data* block4_data_ref (Block4Data* _data4_);
 static void block4_data_unref (Block4Data* _data4_);
 static void _lambda2_ (GSettings* setting, const gchar* k, Block4Data* _data4_);
 static void __lambda2__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
-static void _lambda102_ (const gchar* path_string, PreferencesDialog* self);
-GType build_tool_get_type (void) G_GNUC_CONST;
-GType build_job_get_type (void) G_GNUC_CONST;
-GType post_processor_type_get_type (void) G_GNUC_CONST;
-BuildJob* build_job_dup (const BuildJob* self);
-void build_job_free (BuildJob* self);
-void build_job_copy (const BuildJob* self, BuildJob* dest);
-void build_job_destroy (BuildJob* self);
-BuildTool* build_tool_dup (const BuildTool* self);
-void build_tool_free (BuildTool* self);
-void build_tool_copy (const BuildTool* self, BuildTool* dest);
-void build_tool_destroy (BuildTool* self);
-BuildTool* build_tools_get (BuildTools* self, gint id);
+static Block5Data* block5_data_ref (Block5Data* _data5_);
+static void block5_data_unref (Block5Data* _data5_);
+static void _lambda116_ (const gchar* path_string, PreferencesDialog* self);
 void build_tools_update (BuildTools* self, gint num, BuildTool* tool, gboolean keep_show);
-static void __lambda102__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
+static void __lambda116__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self);
+static void _lambda117_ (GtkTreePath* path, GtkTreeViewColumn* column, Block5Data* _data5_);
+static void __lambda117__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
 GeeIterator* build_tools_iterator (BuildTools* self);
 gboolean build_tool_dialog_show_me (GtkWindow* parent, gint num);
 static void preferences_dialog_finalize (GObject* obj);
@@ -343,15 +357,16 @@ static PreferencesDialog* preferences_dialog_construct (GType object_type) {
 	GtkButton* reset_button;
 	GtkImage* _tmp3_ = NULL;
 	GtkImage* image;
-	GtkBuilder* _tmp4_ = NULL;
+	const gchar* _tmp4_ = NULL;
+	GtkBuilder* _tmp5_ = NULL;
 	GtkBuilder* builder;
-	gchar* _tmp5_ = NULL;
+	gchar* _tmp6_ = NULL;
 	gchar* ui_path;
-	GObject* _tmp10_ = NULL;
-	GtkNotebook* _tmp11_;
+	GObject* _tmp11_ = NULL;
+	GtkNotebook* _tmp12_;
 	GtkNotebook* notebook;
-	GtkWidget* _tmp12_ = NULL;
-	GtkBox* _tmp13_;
+	GtkWidget* _tmp13_ = NULL;
+	GtkBox* _tmp14_;
 	GtkBox* content_area;
 	GError * _inner_error_ = NULL;
 	self = (PreferencesDialog*) g_object_new (object_type, NULL);
@@ -366,14 +381,16 @@ static PreferencesDialog* preferences_dialog_construct (GType object_type) {
 	_tmp3_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
 	image = g_object_ref_sink (_tmp3_);
 	gtk_button_set_image (reset_button, (GtkWidget*) image);
+	_tmp4_ = _ ("Reset all preferences");
+	gtk_widget_set_tooltip_text ((GtkWidget*) reset_button, _tmp4_);
 	gtk_widget_show_all ((GtkWidget*) reset_button);
 	gtk_dialog_add_action_widget ((GtkDialog*) self, (GtkWidget*) reset_button, (gint) GTK_RESPONSE_APPLY);
 	gtk_dialog_add_button ((GtkDialog*) self, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
 	g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) __lambda0__gtk_dialog_response, self, 0);
-	_tmp4_ = gtk_builder_new ();
-	builder = _tmp4_;
-	_tmp5_ = g_build_filename (DATA_DIR, "ui", "preferences_dialog.ui", NULL);
-	ui_path = _tmp5_;
+	_tmp5_ = gtk_builder_new ();
+	builder = _tmp5_;
+	_tmp6_ = g_build_filename (DATA_DIR, "ui", "preferences_dialog.ui", NULL);
+	ui_path = _tmp6_;
 	gtk_builder_add_from_file (builder, ui_path, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_free0 (ui_path);
@@ -384,24 +401,24 @@ static PreferencesDialog* preferences_dialog_construct (GType object_type) {
 	__catch0_g_error:
 	{
 		GError * e;
-		gchar* _tmp6_ = NULL;
+		gchar* _tmp7_ = NULL;
 		gchar* message;
-		GtkLabel* _tmp7_ = NULL;
+		GtkLabel* _tmp8_ = NULL;
 		GtkLabel* label_error;
-		GtkWidget* _tmp8_ = NULL;
-		GtkBox* _tmp9_;
+		GtkWidget* _tmp9_ = NULL;
+		GtkBox* _tmp10_;
 		GtkBox* content_area;
 		e = _inner_error_;
 		_inner_error_ = NULL;
-		_tmp6_ = g_strdup_printf ("Error: %s", e->message);
-		message = _tmp6_;
+		_tmp7_ = g_strdup_printf ("Error: %s", e->message);
+		message = _tmp7_;
 		fprintf (stderr, "%s\n", message);
-		_tmp7_ = (GtkLabel*) gtk_label_new (message);
-		label_error = g_object_ref_sink (_tmp7_);
+		_tmp8_ = (GtkLabel*) gtk_label_new (message);
+		label_error = g_object_ref_sink (_tmp8_);
 		gtk_label_set_line_wrap (label_error, TRUE);
-		_tmp8_ = gtk_dialog_get_content_area ((GtkDialog*) self);
-		_tmp9_ = _g_object_ref0 (GTK_BOX (_tmp8_));
-		content_area = _tmp9_;
+		_tmp9_ = gtk_dialog_get_content_area ((GtkDialog*) self);
+		_tmp10_ = _g_object_ref0 (GTK_BOX (_tmp9_));
+		content_area = _tmp10_;
 		gtk_box_pack_start (content_area, (GtkWidget*) label_error, TRUE, TRUE, (guint) 0);
 		gtk_widget_show_all ((GtkWidget*) content_area);
 		_g_object_unref0 (content_area);
@@ -426,12 +443,12 @@ static PreferencesDialog* preferences_dialog_construct (GType object_type) {
 	preferences_dialog_init_font_and_colors_tab (self, builder);
 	preferences_dialog_init_latex_tab (self, builder);
 	preferences_dialog_init_other_tab (self, builder);
-	_tmp10_ = gtk_builder_get_object (builder, "notebook");
-	_tmp11_ = _g_object_ref0 (GTK_NOTEBOOK (_tmp10_));
-	notebook = _tmp11_;
-	_tmp12_ = gtk_dialog_get_content_area ((GtkDialog*) self);
-	_tmp13_ = _g_object_ref0 (GTK_BOX (_tmp12_));
-	content_area = _tmp13_;
+	_tmp11_ = gtk_builder_get_object (builder, "notebook");
+	_tmp12_ = _g_object_ref0 (GTK_NOTEBOOK (_tmp11_));
+	notebook = _tmp12_;
+	_tmp13_ = gtk_dialog_get_content_area ((GtkDialog*) self);
+	_tmp14_ = _g_object_ref0 (GTK_BOX (_tmp13_));
+	content_area = _tmp14_;
 	gtk_box_pack_start (content_area, (GtkWidget*) notebook, TRUE, TRUE, (guint) 0);
 	_g_object_unref0 (content_area);
 	_g_object_unref0 (notebook);
@@ -447,7 +464,7 @@ static PreferencesDialog* preferences_dialog_new (void) {
 }
 
 
-static void _lambda73_ (void) {
+static void _lambda85_ (void) {
 	if (preferences_dialog_preferences_dialog != NULL) {
 		_g_object_unref0 (preferences_dialog_preferences_dialog);
 		preferences_dialog_preferences_dialog = NULL;
@@ -455,8 +472,8 @@ static void _lambda73_ (void) {
 }
 
 
-static void __lambda73__gtk_object_destroy (GtkObject* _sender, gpointer self) {
-	_lambda73_ ();
+static void __lambda85__gtk_object_destroy (GtkObject* _sender, gpointer self) {
+	_lambda85_ ();
 }
 
 
@@ -468,7 +485,7 @@ void preferences_dialog_show_me (MainWindow* parent) {
 		_tmp0_ = preferences_dialog_new ();
 		_g_object_unref0 (preferences_dialog_preferences_dialog);
 		preferences_dialog_preferences_dialog = g_object_ref_sink (_tmp0_);
-		g_signal_connect ((GtkObject*) preferences_dialog_preferences_dialog, "destroy", (GCallback) __lambda73__gtk_object_destroy, NULL);
+		g_signal_connect ((GtkObject*) preferences_dialog_preferences_dialog, "destroy", (GCallback) __lambda85__gtk_object_destroy, NULL);
 	}
 	_tmp1_ = gtk_window_get_transient_for ((GtkWindow*) preferences_dialog_preferences_dialog);
 	if (GTK_WINDOW (parent) != _tmp1_) {
@@ -687,19 +704,19 @@ static void block1_data_unref (Block1Data* _data1_) {
 }
 
 
-static void _lambda99_ (Block1Data* _data1_) {
+static void _lambda113_ (Block1Data* _data1_) {
 	PreferencesDialog * self;
 	self = _data1_->self;
 	preferences_dialog_set_system_font_label (self, _data1_->default_font_checkbutton);
 }
 
 
-static void __lambda99__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	_lambda99_ (self);
+static void __lambda113__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda113_ (self);
 }
 
 
-static void _lambda100_ (GtkTreeView* treeview, Block1Data* _data1_) {
+static void _lambda114_ (GtkTreeView* treeview, Block1Data* _data1_) {
 	PreferencesDialog * self;
 	GtkTreePath* tree_path = NULL;
 	GtkTreeIter iter = {0};
@@ -727,12 +744,12 @@ static void _lambda100_ (GtkTreeView* treeview, Block1Data* _data1_) {
 }
 
 
-static void __lambda100__gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self) {
-	_lambda100_ (_sender, self);
+static void __lambda114__gtk_tree_view_cursor_changed (GtkTreeView* _sender, gpointer self) {
+	_lambda114_ (_sender, self);
 }
 
 
-static void _lambda101_ (GSettings* setting, const gchar* key, Block1Data* _data1_) {
+static void _lambda115_ (GSettings* setting, const gchar* key, Block1Data* _data1_) {
 	PreferencesDialog * self;
 	gchar* _tmp0_ = NULL;
 	gchar* val;
@@ -784,8 +801,8 @@ static void _lambda101_ (GSettings* setting, const gchar* key, Block1Data* _data
 }
 
 
-static void __lambda101__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
-	_lambda101_ (_sender, key, self);
+static void __lambda115__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
+	_lambda115_ (_sender, key, self);
 }
 
 
@@ -820,7 +837,7 @@ static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self
 	preferences_dialog_set_system_font_label (self, _data1_->default_font_checkbutton);
 	_tmp3_ = app_settings_get_default ();
 	app_settings = _tmp3_;
-	g_signal_connect_data ((GObject*) app_settings, "notify::system-font", (GCallback) __lambda99__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
+	g_signal_connect_data ((GObject*) app_settings, "notify::system-font", (GCallback) __lambda113__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
 	_tmp4_ = gtk_builder_get_object (builder, "font_button");
 	_tmp5_ = _g_object_ref0 (_tmp4_);
 	font_button = _tmp5_;
@@ -835,8 +852,8 @@ static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self
 	_tmp10_ = g_settings_get_string (_data1_->settings, "scheme");
 	current_scheme_id = _tmp10_;
 	preferences_dialog_init_schemes_treeview (self, _data1_->schemes_treeview, current_scheme_id);
-	g_signal_connect_data (_data1_->schemes_treeview, "cursor-changed", (GCallback) __lambda100__gtk_tree_view_cursor_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
-	g_signal_connect_data (_data1_->settings, "changed::scheme", (GCallback) __lambda101__g_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
+	g_signal_connect_data (_data1_->schemes_treeview, "cursor-changed", (GCallback) __lambda114__gtk_tree_view_cursor_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
+	g_signal_connect_data (_data1_->settings, "changed::scheme", (GCallback) __lambda115__g_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
 	_g_free0 (current_scheme_id);
 	_g_object_unref0 (font_hbox);
 	_g_object_unref0 (font_button);
@@ -861,82 +878,73 @@ static void block2_data_unref (Block2Data* _data2_) {
 }
 
 
-static void _lambda103_ (PreferencesDialog* self) {
-	preferences_dialog_run_build_tool_dialog (self, -1);
-}
-
-
-static void __lambda103__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda103_ (self);
-}
-
-
-static void _lambda111_ (Block2Data* _data2_) {
+static void _lambda125_ (Block2Data* _data2_) {
 	PreferencesDialog * self;
 	gint _tmp0_;
 	gint num;
 	self = _data2_->self;
 	_tmp0_ = utils_get_selected_row (_data2_->build_tools_view, NULL);
 	num = _tmp0_;
-	preferences_dialog_run_build_tool_dialog (self, num);
+	if (0 <= num) {
+		preferences_dialog_run_build_tool_dialog (self, num);
+	}
 }
 
 
-static void __lambda111__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda111_ (self);
+static void __lambda125__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda125_ (self);
+}
+
+
+static void _lambda126_ (PreferencesDialog* self) {
+	preferences_dialog_run_build_tool_dialog (self, -1);
 }
 
 
-static void _lambda112_ (Block2Data* _data2_) {
+static void __lambda126__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda126_ (self);
+}
+
+
+static void _lambda127_ (Block2Data* _data2_) {
 	PreferencesDialog * self;
-	GtkTreeIter iter = {0};
-	GtkTreeIter _tmp0_ = {0};
-	gint _tmp1_;
-	gint i;
-	gchar* label = NULL;
-	GtkTreeModel* _tmp2_;
-	GtkTreeModel* model;
+	gint _tmp0_;
+	gint selected_row;
+	BuildTools* _tmp1_ = NULL;
+	BuildTools* build_tools;
+	BuildTool* _tmp2_ = NULL;
+	BuildTool* tool;
 	const gchar* _tmp3_ = NULL;
-	GtkMessageDialog* _tmp4_ = NULL;
-	GtkDialog* dialog;
-	gint _tmp5_;
+	gchar* _tmp4_ = NULL;
 	self = _data2_->self;
-	_tmp1_ = utils_get_selected_row (_data2_->build_tools_view, &_tmp0_);
-	iter = _tmp0_;
-	i = _tmp1_;
-	if (i == (-1)) {
+	_tmp0_ = utils_get_selected_row (_data2_->build_tools_view, NULL);
+	selected_row = _tmp0_;
+	if (selected_row < 0) {
 		return;
 	}
-	_tmp2_ = _g_object_ref0 (GTK_TREE_MODEL (self->priv->build_tools_store));
-	model = _tmp2_;
-	gtk_tree_model_get (model, &iter, PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_LABEL, &label, -1, -1);
-	_tmp3_ = _ ("Do you really want to delete the build tool \"%s\"?");
-	_tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _tmp3_, label);
-	dialog = (GtkDialog*) g_object_ref_sink (_tmp4_);
-	gtk_dialog_add_buttons (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_YES, NULL);
-	_tmp5_ = gtk_dialog_run (dialog);
-	if (_tmp5_ == GTK_RESPONSE_YES) {
-		BuildTools* _tmp6_ = NULL;
-		BuildTools* _tmp7_;
-		gtk_list_store_remove (self->priv->build_tools_store, &iter);
-		_tmp6_ = build_tools_get_default ();
-		_tmp7_ = _tmp6_;
-		build_tools_delete (_tmp7_, i);
-		_build_tools_unref0 (_tmp7_);
-	}
-	gtk_object_destroy ((GtkObject*) dialog);
-	_g_object_unref0 (dialog);
-	_g_object_unref0 (model);
-	_g_free0 (label);
+	_tmp1_ = build_tools_get_default ();
+	build_tools = _tmp1_;
+	_tmp2_ = build_tools_get (build_tools, selected_row);
+	tool = _tmp2_;
+	g_return_if_fail (tool != NULL);
+	(*tool).show = FALSE;
+	_tmp3_ = _ ("%s [copy]");
+	_tmp4_ = g_strdup_printf (_tmp3_, (*tool).label);
+	_g_free0 ((*tool).label);
+	(*tool).label = _tmp4_;
+	build_tools_insert (build_tools, selected_row + 1, tool);
+	preferences_dialog_update_build_tools_store (self);
+	_build_tool_free0 (tool);
+	_build_tools_unref0 (build_tools);
 }
 
 
-static void __lambda112__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda112_ (self);
+static void __lambda127__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda127_ (self);
 }
 
 
-static void _lambda113_ (Block2Data* _data2_) {
+static void _lambda128_ (Block2Data* _data2_) {
 	PreferencesDialog * self;
 	GtkTreeIter iter1 = {0};
 	GtkTreeIter iter2 = {0};
@@ -970,12 +978,12 @@ static void _lambda113_ (Block2Data* _data2_) {
 }
 
 
-static void __lambda113__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda113_ (self);
+static void __lambda128__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda128_ (self);
 }
 
 
-static void _lambda114_ (Block2Data* _data2_) {
+static void _lambda129_ (Block2Data* _data2_) {
 	PreferencesDialog * self;
 	GtkTreeIter iter1 = {0};
 	GtkTreeIter iter2 = {0};
@@ -1003,12 +1011,61 @@ static void _lambda114_ (Block2Data* _data2_) {
 }
 
 
-static void __lambda114__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda114_ (self);
+static void __lambda129__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda129_ (self);
 }
 
 
-static void _lambda115_ (PreferencesDialog* self) {
+static void _lambda130_ (Block2Data* _data2_) {
+	PreferencesDialog * self;
+	GtkTreeIter iter = {0};
+	GtkTreeIter _tmp0_ = {0};
+	gint _tmp1_;
+	gint selected_row;
+	gchar* label = NULL;
+	GtkTreeModel* _tmp2_;
+	GtkTreeModel* model;
+	const gchar* _tmp3_ = NULL;
+	GtkMessageDialog* _tmp4_ = NULL;
+	GtkDialog* dialog;
+	gint _tmp5_;
+	self = _data2_->self;
+	_tmp1_ = utils_get_selected_row (_data2_->build_tools_view, &_tmp0_);
+	iter = _tmp0_;
+	selected_row = _tmp1_;
+	if (selected_row == (-1)) {
+		return;
+	}
+	_tmp2_ = _g_object_ref0 (GTK_TREE_MODEL (self->priv->build_tools_store));
+	model = _tmp2_;
+	gtk_tree_model_get (model, &iter, PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_LABEL, &label, -1, -1);
+	_tmp3_ = _ ("Do you really want to delete the build tool \"%s\"?");
+	_tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _tmp3_, label);
+	dialog = (GtkDialog*) g_object_ref_sink (_tmp4_);
+	gtk_dialog_add_buttons (dialog, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_DELETE, GTK_RESPONSE_YES, NULL);
+	_tmp5_ = gtk_dialog_run (dialog);
+	if (_tmp5_ == GTK_RESPONSE_YES) {
+		BuildTools* _tmp6_ = NULL;
+		BuildTools* _tmp7_;
+		gtk_list_store_remove (self->priv->build_tools_store, &iter);
+		_tmp6_ = build_tools_get_default ();
+		_tmp7_ = _tmp6_;
+		build_tools_delete (_tmp7_, selected_row);
+		_build_tools_unref0 (_tmp7_);
+	}
+	gtk_object_destroy ((GtkObject*) dialog);
+	_g_object_unref0 (dialog);
+	_g_object_unref0 (model);
+	_g_free0 (label);
+}
+
+
+static void __lambda130__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda130_ (self);
+}
+
+
+static void _lambda131_ (PreferencesDialog* self) {
 	const gchar* _tmp0_ = NULL;
 	GtkDialog* _tmp1_ = NULL;
 	GtkDialog* dialog;
@@ -1031,8 +1088,8 @@ static void _lambda115_ (PreferencesDialog* self) {
 }
 
 
-static void __lambda115__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda115_ (self);
+static void __lambda131__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda131_ (self);
 }
 
 
@@ -1060,22 +1117,32 @@ static void preferences_dialog_init_latex_tab (PreferencesDialog* self, GtkBuild
 	GObject* _tmp13_ = NULL;
 	GtkTreeView* _tmp14_;
 	GObject* _tmp15_ = NULL;
-	GtkButton* _tmp16_;
-	GtkButton* bt_new;
-	GObject* _tmp17_ = NULL;
-	GtkButton* _tmp18_;
+	GObject* _tmp16_;
+	GtkButton* _tmp17_;
 	GtkButton* bt_properties;
-	GObject* _tmp19_ = NULL;
+	GObject* _tmp18_ = NULL;
+	GObject* _tmp19_;
 	GtkButton* _tmp20_;
-	GtkButton* bt_delete;
+	GtkButton* bt_new;
 	GObject* _tmp21_ = NULL;
-	GtkButton* _tmp22_;
+	GObject* _tmp22_;
+	GtkButton* _tmp23_;
+	GtkButton* bt_copy;
+	GObject* _tmp24_ = NULL;
+	GObject* _tmp25_;
+	GtkButton* _tmp26_;
 	GtkButton* bt_up;
-	GObject* _tmp23_ = NULL;
-	GtkButton* _tmp24_;
+	GObject* _tmp27_ = NULL;
+	GObject* _tmp28_;
+	GtkButton* _tmp29_;
 	GtkButton* bt_down;
-	GObject* _tmp25_ = NULL;
-	GtkButton* _tmp26_;
+	GObject* _tmp30_ = NULL;
+	GObject* _tmp31_;
+	GtkButton* _tmp32_;
+	GtkButton* bt_delete;
+	GObject* _tmp33_ = NULL;
+	GObject* _tmp34_;
+	GtkButton* _tmp35_;
 	GtkButton* bt_reset;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (builder != NULL);
@@ -1111,36 +1178,48 @@ static void preferences_dialog_init_latex_tab (PreferencesDialog* self, GtkBuild
 	_tmp14_ = _g_object_ref0 (GTK_TREE_VIEW (_tmp13_));
 	_data2_->build_tools_view = _tmp14_;
 	preferences_dialog_init_build_tools_treeview (self, _data2_->build_tools_view);
-	_tmp15_ = gtk_builder_get_object (builder, "build_tool_new");
-	_tmp16_ = _g_object_ref0 (GTK_BUTTON (_tmp15_));
-	bt_new = _tmp16_;
-	g_signal_connect_object (bt_new, "clicked", (GCallback) __lambda103__gtk_button_clicked, self, 0);
-	_tmp17_ = gtk_builder_get_object (builder, "build_tool_properties");
-	_tmp18_ = _g_object_ref0 (GTK_BUTTON (_tmp17_));
-	bt_properties = _tmp18_;
-	g_signal_connect_data (bt_properties, "clicked", (GCallback) __lambda111__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
-	_tmp19_ = gtk_builder_get_object (builder, "build_tool_delete");
-	_tmp20_ = _g_object_ref0 (GTK_BUTTON (_tmp19_));
-	bt_delete = _tmp20_;
-	g_signal_connect_data (bt_delete, "clicked", (GCallback) __lambda112__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
-	_tmp21_ = gtk_builder_get_object (builder, "build_tool_up");
-	_tmp22_ = _g_object_ref0 (GTK_BUTTON (_tmp21_));
-	bt_up = _tmp22_;
-	g_signal_connect_data (bt_up, "clicked", (GCallback) __lambda113__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
-	_tmp23_ = gtk_builder_get_object (builder, "build_tool_down");
-	_tmp24_ = _g_object_ref0 (GTK_BUTTON (_tmp23_));
-	bt_down = _tmp24_;
-	g_signal_connect_data (bt_down, "clicked", (GCallback) __lambda114__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
-	_tmp25_ = gtk_builder_get_object (builder, "build_tool_reset");
-	_tmp26_ = _g_object_ref0 (GTK_BUTTON (_tmp25_));
-	bt_reset = _tmp26_;
-	g_signal_connect_object (bt_reset, "clicked", (GCallback) __lambda115__gtk_button_clicked, self, 0);
+	_tmp15_ = gtk_builder_get_object (builder, "build_tool_properties");
+	_tmp16_ = _tmp15_;
+	_tmp17_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp16_) ? ((GtkButton*) _tmp16_) : NULL);
+	bt_properties = _tmp17_;
+	g_signal_connect_data (bt_properties, "clicked", (GCallback) __lambda125__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
+	_tmp18_ = gtk_builder_get_object (builder, "build_tool_new");
+	_tmp19_ = _tmp18_;
+	_tmp20_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp19_) ? ((GtkButton*) _tmp19_) : NULL);
+	bt_new = _tmp20_;
+	g_signal_connect_object (bt_new, "clicked", (GCallback) __lambda126__gtk_button_clicked, self, 0);
+	_tmp21_ = gtk_builder_get_object (builder, "build_tool_copy");
+	_tmp22_ = _tmp21_;
+	_tmp23_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp22_) ? ((GtkButton*) _tmp22_) : NULL);
+	bt_copy = _tmp23_;
+	g_signal_connect_data (bt_copy, "clicked", (GCallback) __lambda127__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
+	_tmp24_ = gtk_builder_get_object (builder, "build_tool_up");
+	_tmp25_ = _tmp24_;
+	_tmp26_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp25_) ? ((GtkButton*) _tmp25_) : NULL);
+	bt_up = _tmp26_;
+	g_signal_connect_data (bt_up, "clicked", (GCallback) __lambda128__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
+	_tmp27_ = gtk_builder_get_object (builder, "build_tool_down");
+	_tmp28_ = _tmp27_;
+	_tmp29_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp28_) ? ((GtkButton*) _tmp28_) : NULL);
+	bt_down = _tmp29_;
+	g_signal_connect_data (bt_down, "clicked", (GCallback) __lambda129__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
+	_tmp30_ = gtk_builder_get_object (builder, "build_tool_delete");
+	_tmp31_ = _tmp30_;
+	_tmp32_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp31_) ? ((GtkButton*) _tmp31_) : NULL);
+	bt_delete = _tmp32_;
+	g_signal_connect_data (bt_delete, "clicked", (GCallback) __lambda130__gtk_button_clicked, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
+	_tmp33_ = gtk_builder_get_object (builder, "build_tool_reset");
+	_tmp34_ = _tmp33_;
+	_tmp35_ = _g_object_ref0 (GTK_IS_BUTTON (_tmp34_) ? ((GtkButton*) _tmp34_) : NULL);
+	bt_reset = _tmp35_;
+	g_signal_connect_object (bt_reset, "clicked", (GCallback) __lambda131__gtk_button_clicked, self, 0);
 	_g_object_unref0 (bt_reset);
+	_g_object_unref0 (bt_delete);
 	_g_object_unref0 (bt_down);
 	_g_object_unref0 (bt_up);
-	_g_object_unref0 (bt_delete);
-	_g_object_unref0 (bt_properties);
+	_g_object_unref0 (bt_copy);
 	_g_object_unref0 (bt_new);
+	_g_object_unref0 (bt_properties);
 	_g_object_unref0 (latexmk_checkbutton);
 	_g_object_unref0 (document_view_program);
 	_g_object_unref0 (interactive_comp_label);
@@ -1494,7 +1573,22 @@ static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, G
 }
 
 
-static void _lambda102_ (const gchar* path_string, PreferencesDialog* self) {
+static Block5Data* block5_data_ref (Block5Data* _data5_) {
+	g_atomic_int_inc (&_data5_->_ref_count_);
+	return _data5_;
+}
+
+
+static void block5_data_unref (Block5Data* _data5_) {
+	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
+		_g_object_unref0 (_data5_->self);
+		_g_object_unref0 (_data5_->label_column);
+		g_slice_free (Block5Data, _data5_);
+	}
+}
+
+
+static void _lambda116_ (const gchar* path_string, PreferencesDialog* self) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gboolean val = FALSE;
@@ -1537,62 +1631,94 @@ static void _lambda102_ (const gchar* path_string, PreferencesDialog* self) {
 }
 
 
-static void __lambda102__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
-	_lambda102_ (path, self);
+static void __lambda116__gtk_cell_renderer_toggle_toggled (GtkCellRendererToggle* _sender, const gchar* path, gpointer self) {
+	_lambda116_ (path, self);
+}
+
+
+static void _lambda117_ (GtkTreePath* path, GtkTreeViewColumn* column, Block5Data* _data5_) {
+	PreferencesDialog * self;
+	self = _data5_->self;
+	g_return_if_fail (path != NULL);
+	g_return_if_fail (column != NULL);
+	if (column == _data5_->label_column) {
+		gint* _tmp0_ = NULL;
+		gint num;
+		_tmp0_ = gtk_tree_path_get_indices (path);
+		num = _tmp0_[0];
+		preferences_dialog_run_build_tool_dialog (self, num);
+	}
+}
+
+
+static void __lambda117__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+	_lambda117_ (path, column, self);
 }
 
 
 static void preferences_dialog_init_build_tools_treeview (PreferencesDialog* self, GtkTreeView* build_tools_view) {
+	Block5Data* _data5_;
 	GtkListStore* _tmp0_ = NULL;
 	GtkTreeViewColumn* _tmp1_ = NULL;
-	GtkTreeViewColumn* column;
-	GtkCellRendererToggle* _tmp2_ = NULL;
+	GtkTreeViewColumn* active_column;
+	const gchar* _tmp2_ = NULL;
+	GtkCellRendererToggle* _tmp3_ = NULL;
 	GtkCellRendererToggle* toggle_renderer;
-	GtkTreeViewColumn* _tmp3_ = NULL;
-	GtkCellRendererPixbuf* _tmp4_ = NULL;
+	GtkTreeViewColumn* _tmp4_ = NULL;
+	const gchar* _tmp5_ = NULL;
+	GtkCellRendererPixbuf* _tmp6_ = NULL;
 	GtkCellRendererPixbuf* pixbuf_renderer;
-	GtkCellRendererText* _tmp5_ = NULL;
+	GtkCellRendererText* _tmp7_ = NULL;
 	GtkCellRendererText* text_renderer;
-	GtkTreeSelection* _tmp6_ = NULL;
-	GtkTreeSelection* _tmp7_;
+	GtkTreeSelection* _tmp8_ = NULL;
+	GtkTreeSelection* _tmp9_;
 	GtkTreeSelection* select;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (build_tools_view != NULL);
+	_data5_ = g_slice_new0 (Block5Data);
+	_data5_->_ref_count_ = 1;
+	_data5_->self = g_object_ref (self);
 	_tmp0_ = gtk_list_store_new ((gint) PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_N_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
 	_g_object_unref0 (self->priv->build_tools_store);
 	self->priv->build_tools_store = _tmp0_;
 	gtk_tree_view_set_model (build_tools_view, (GtkTreeModel*) self->priv->build_tools_store);
 	_tmp1_ = gtk_tree_view_column_new ();
-	column = g_object_ref_sink (_tmp1_);
-	gtk_tree_view_append_column (build_tools_view, column);
-	_tmp2_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
-	toggle_renderer = g_object_ref_sink (_tmp2_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) toggle_renderer, FALSE);
-	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) toggle_renderer, "active", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_SHOW, NULL, NULL);
-	_tmp3_ = gtk_tree_view_column_new ();
-	_g_object_unref0 (column);
-	column = g_object_ref_sink (_tmp3_);
-	gtk_tree_view_append_column (build_tools_view, column);
-	_tmp4_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
-	pixbuf_renderer = g_object_ref_sink (_tmp4_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
-	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_PIXBUF, NULL, NULL);
-	_tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
-	text_renderer = g_object_ref_sink (_tmp5_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
-	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_LABEL, NULL, NULL);
+	active_column = g_object_ref_sink (_tmp1_);
+	_tmp2_ = _ ("Active");
+	gtk_tree_view_column_set_title (active_column, _tmp2_);
+	gtk_tree_view_append_column (build_tools_view, active_column);
+	_tmp3_ = (GtkCellRendererToggle*) gtk_cell_renderer_toggle_new ();
+	toggle_renderer = g_object_ref_sink (_tmp3_);
+	gtk_cell_layout_pack_start ((GtkCellLayout*) active_column, (GtkCellRenderer*) toggle_renderer, FALSE);
+	gtk_tree_view_column_set_attributes (active_column, (GtkCellRenderer*) toggle_renderer, "active", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_SHOW, NULL, NULL);
+	_tmp4_ = gtk_tree_view_column_new ();
+	_data5_->label_column = g_object_ref_sink (_tmp4_);
+	_tmp5_ = _ ("Label");
+	gtk_tree_view_column_set_title (_data5_->label_column, _tmp5_);
+	gtk_tree_view_append_column (build_tools_view, _data5_->label_column);
+	_tmp6_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
+	pixbuf_renderer = g_object_ref_sink (_tmp6_);
+	gtk_cell_layout_pack_start ((GtkCellLayout*) _data5_->label_column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
+	gtk_tree_view_column_set_attributes (_data5_->label_column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_PIXBUF, NULL, NULL);
+	_tmp7_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+	text_renderer = g_object_ref_sink (_tmp7_);
+	gtk_cell_layout_pack_start ((GtkCellLayout*) _data5_->label_column, (GtkCellRenderer*) text_renderer, TRUE);
+	gtk_tree_view_column_set_attributes (_data5_->label_column, (GtkCellRenderer*) text_renderer, "text", PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_LABEL, NULL, NULL);
 	gtk_tree_view_set_tooltip_column (build_tools_view, (gint) PREFERENCES_DIALOG_BUILD_TOOL_COLUMN_DESCRIPTION);
-	_tmp6_ = gtk_tree_view_get_selection (build_tools_view);
-	_tmp7_ = _g_object_ref0 (_tmp6_);
-	select = _tmp7_;
+	_tmp8_ = gtk_tree_view_get_selection (build_tools_view);
+	_tmp9_ = _g_object_ref0 (_tmp8_);
+	select = _tmp9_;
 	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
 	preferences_dialog_update_build_tools_store (self);
-	g_signal_connect_object (toggle_renderer, "toggled", (GCallback) __lambda102__gtk_cell_renderer_toggle_toggled, self, 0);
+	g_signal_connect_object (toggle_renderer, "toggled", (GCallback) __lambda116__gtk_cell_renderer_toggle_toggled, self, 0);
+	g_signal_connect_data (build_tools_view, "row-activated", (GCallback) __lambda117__gtk_tree_view_row_activated, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
 	_g_object_unref0 (select);
 	_g_object_unref0 (text_renderer);
 	_g_object_unref0 (pixbuf_renderer);
 	_g_object_unref0 (toggle_renderer);
-	_g_object_unref0 (column);
+	_g_object_unref0 (active_column);
+	block5_data_unref (_data5_);
+	_data5_ = NULL;
 }
 
 
diff --git a/src/C/project_dialogs.c b/src/C/project_dialogs.c
index 300f7db..184f603 100644
--- a/src/C/project_dialogs.c
+++ b/src/C/project_dialogs.c
@@ -1,4 +1,4 @@
-/* project_dialogs.c generated by valac 0.12.0, the Vala compiler
+/* project_dialogs.c generated by valac 0.12.1, the Vala compiler
  * generated from project_dialogs.vala, do not modify */
 
 /*
@@ -103,8 +103,8 @@ GType main_window_get_type (void) G_GNUC_CONST;
 void project_dialogs_new_project (MainWindow* main_window);
 static Block11Data* block11_data_ref (Block11Data* _data11_);
 static void block11_data_unref (Block11Data* _data11_);
-static void _lambda74_ (Block11Data* _data11_);
-static void __lambda74__gtk_file_chooser_button_file_set (GtkFileChooserButton* _sender, gpointer self);
+static void _lambda86_ (Block11Data* _data11_);
+static void __lambda86__gtk_file_chooser_button_file_set (GtkFileChooserButton* _sender, gpointer self);
 GType document_get_type (void) G_GNUC_CONST;
 Document* main_window_get_active_document (MainWindow* self);
 GFile* document_get_location (Document* self);
@@ -133,15 +133,15 @@ static Block12Data* block12_data_ref (Block12Data* _data12_);
 static void block12_data_unref (Block12Data* _data12_);
 void project_dialogs_update_model (GtkListStore* model);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
-static void _lambda75_ (Block12Data* _data12_);
-gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set);
-static void __lambda75__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda76_ (Block12Data* _data12_);
+static void _lambda87_ (Block12Data* _data12_);
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
+static void __lambda87__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda88_ (Block12Data* _data12_);
 void projects_delete (Projects* self, gint num);
-static void __lambda76__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda77_ (Block12Data* _data12_);
+static void __lambda88__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda89_ (Block12Data* _data12_);
 void projects_clear_all (Projects* self);
-static void __lambda77__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda89__gtk_button_clicked (GtkButton* _sender, gpointer self);
 GeeIterator* projects_iterator (Projects* self);
 
 
@@ -165,7 +165,7 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda74_ (Block11Data* _data11_) {
+static void _lambda86_ (Block11Data* _data11_) {
 	GFile* _tmp0_ = NULL;
 	GFile* _tmp1_;
 	GFile* dir;
@@ -175,17 +175,17 @@ static void _lambda74_ (Block11Data* _data11_) {
 	dir = _tmp1_;
 	gtk_file_chooser_set_current_folder_file ((GtkFileChooser*) _data11_->file_chooser_button2, dir, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		goto __catch23_g_error;
+		goto __catch24_g_error;
 	}
-	goto __finally23;
-	__catch23_g_error:
+	goto __finally24;
+	__catch24_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
 		_inner_error_ = NULL;
 		_g_error_free0 (e);
 	}
-	__finally23:
+	__finally24:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (dir);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -196,8 +196,8 @@ static void _lambda74_ (Block11Data* _data11_) {
 }
 
 
-static void __lambda74__gtk_file_chooser_button_file_set (GtkFileChooserButton* _sender, gpointer self) {
-	_lambda74_ (self);
+static void __lambda86__gtk_file_chooser_button_file_set (GtkFileChooserButton* _sender, gpointer self) {
+	_lambda86_ (self);
 }
 
 
@@ -287,7 +287,7 @@ void project_dialogs_new_project (MainWindow* main_window) {
 	gtk_box_pack_start ((GtkBox*) vbox2, (GtkWidget*) _data11_->file_chooser_button2, TRUE, TRUE, (guint) 0);
 	gtk_box_pack_start ((GtkBox*) content_area, (GtkWidget*) hbox, TRUE, TRUE, (guint) 0);
 	gtk_widget_show_all ((GtkWidget*) content_area);
-	g_signal_connect_data (_data11_->file_chooser_button1, "file-set", (GCallback) __lambda74__gtk_file_chooser_button_file_set, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
+	g_signal_connect_data (_data11_->file_chooser_button1, "file-set", (GCallback) __lambda86__gtk_file_chooser_button_file_set, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
 	_tmp23_ = main_window_get_active_document (main_window);
 	_tmp24_ = _g_object_ref0 (_tmp23_);
 	doc = _tmp24_;
@@ -302,22 +302,22 @@ void project_dialogs_new_project (MainWindow* main_window) {
 		gtk_file_chooser_set_file ((GtkFileChooser*) _data11_->file_chooser_button1, _tmp27_, &_inner_error_);
 		_g_object_unref0 (_tmp27_);
 		if (_inner_error_ != NULL) {
-			goto __catch24_g_error;
+			goto __catch25_g_error;
 		}
 		_tmp28_ = document_get_location (doc);
 		gtk_file_chooser_set_file ((GtkFileChooser*) _data11_->file_chooser_button2, _tmp28_, &_inner_error_);
 		if (_inner_error_ != NULL) {
-			goto __catch24_g_error;
+			goto __catch25_g_error;
 		}
-		goto __finally24;
-		__catch24_g_error:
+		goto __finally25;
+		__catch25_g_error:
 		{
 			GError * e;
 			e = _inner_error_;
 			_inner_error_ = NULL;
 			_g_error_free0 (e);
 		}
-		__finally24:
+		__finally25:
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (doc);
 			_g_object_unref0 (label2);
@@ -526,17 +526,17 @@ gboolean project_dialogs_configure_project (GtkWindow* main_window, gint project
 	gtk_widget_show_all ((GtkWidget*) content_area);
 	gtk_file_chooser_set_file ((GtkFileChooser*) file_chooser_button, (*project).main_file, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		goto __catch25_g_error;
+		goto __catch26_g_error;
 	}
-	goto __finally25;
-	__catch25_g_error:
+	goto __finally26;
+	__catch26_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
 		_inner_error_ = NULL;
 		_g_error_free0 (e);
 	}
-	__finally25:
+	__finally26:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (file_chooser_button);
 		_g_object_unref0 (label);
@@ -624,7 +624,7 @@ static void block12_data_unref (Block12Data* _data12_) {
 }
 
 
-static void _lambda75_ (Block12Data* _data12_) {
+static void _lambda87_ (Block12Data* _data12_) {
 	gint _tmp0_;
 	gint i;
 	gboolean _tmp1_ = FALSE;
@@ -643,12 +643,12 @@ static void _lambda75_ (Block12Data* _data12_) {
 }
 
 
-static void __lambda75__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda75_ (self);
+static void __lambda87__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda87_ (self);
 }
 
 
-static void _lambda76_ (Block12Data* _data12_) {
+static void _lambda88_ (Block12Data* _data12_) {
 	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gint _tmp1_;
@@ -690,12 +690,12 @@ static void _lambda76_ (Block12Data* _data12_) {
 }
 
 
-static void __lambda76__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda76_ (self);
+static void __lambda88__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda88_ (self);
 }
 
 
-static void _lambda77_ (Block12Data* _data12_) {
+static void _lambda89_ (Block12Data* _data12_) {
 	const gchar* _tmp0_ = NULL;
 	GtkMessageDialog* _tmp1_ = NULL;
 	GtkDialog* clear_dialog;
@@ -734,8 +734,8 @@ static void _lambda77_ (Block12Data* _data12_) {
 }
 
 
-static void __lambda77__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda77_ (self);
+static void __lambda89__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda89_ (self);
 }
 
 
@@ -844,9 +844,9 @@ void project_dialogs_manage_projects (MainWindow* main_window) {
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) delete_button, TRUE, TRUE, (guint) 0);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) clear_all_button, TRUE, TRUE, (guint) 0);
 	gtk_widget_show_all ((GtkWidget*) content_area);
-	g_signal_connect_data (edit_button, "clicked", (GCallback) __lambda75__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
-	g_signal_connect_data (delete_button, "clicked", (GCallback) __lambda76__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
-	g_signal_connect_data (clear_all_button, "clicked", (GCallback) __lambda77__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
+	g_signal_connect_data (edit_button, "clicked", (GCallback) __lambda87__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
+	g_signal_connect_data (delete_button, "clicked", (GCallback) __lambda88__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
+	g_signal_connect_data (clear_all_button, "clicked", (GCallback) __lambda89__gtk_button_clicked, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
 	gtk_dialog_run (_data12_->dialog);
 	gtk_object_destroy ((GtkObject*) _data12_->dialog);
 	_g_object_unref0 (image);
diff --git a/src/C/projects.c b/src/C/projects.c
index 459052a..49db156 100644
--- a/src/C/projects.c
+++ b/src/C/projects.c
@@ -1,4 +1,4 @@
-/* projects.c generated by valac 0.12.0, the Vala compiler
+/* projects.c generated by valac 0.12.1, the Vala compiler
  * generated from projects.vala, do not modify */
 
 /*
@@ -239,7 +239,7 @@ static Projects* projects_construct (GType object_type) {
 	contents = _tmp3_;
 	if (_inner_error_ != NULL) {
 		_g_free0 (contents);
-		goto __catch21_g_error;
+		goto __catch22_g_error;
 	}
 	_tmp4_.start_element = _projects_parser_start_gmarkup_parser_start_element_func;
 	_tmp4_.end_element = NULL;
@@ -253,14 +253,14 @@ static Projects* projects_construct (GType object_type) {
 	if (_inner_error_ != NULL) {
 		_g_markup_parse_context_free0 (context);
 		_g_free0 (contents);
-		goto __catch21_g_error;
+		goto __catch22_g_error;
 	}
 	projects_update_all_documents (self);
 	projects_update_all_menus (self);
 	_g_markup_parse_context_free0 (context);
 	_g_free0 (contents);
-	goto __finally21;
-	__catch21_g_error:
+	goto __finally22;
+	__catch22_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -268,7 +268,7 @@ static Projects* projects_construct (GType object_type) {
 		fprintf (stderr, "Warning: impossible to load projects: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally21:
+	__finally22:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (file);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -948,18 +948,18 @@ void projects_save (Projects* self) {
 		g_file_make_directory_with_parents (parent, NULL, &_inner_error_);
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (parent);
-			goto __catch22_g_error;
+			goto __catch23_g_error;
 		}
 	}
 	_tmp21_ = strlen (content);
 	g_file_replace_contents (file, content, (gsize) _tmp21_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (parent);
-		goto __catch22_g_error;
+		goto __catch23_g_error;
 	}
 	_g_object_unref0 (parent);
-	goto __finally22;
-	__catch22_g_error:
+	goto __finally23;
+	__catch23_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -967,7 +967,7 @@ void projects_save (Projects* self) {
 		fprintf (stderr, "Warning: impossible to save projects: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally22:
+	__finally23:
 	if (_inner_error_ != NULL) {
 		_g_free0 (content);
 		_g_object_unref0 (file);
diff --git a/src/C/search.c b/src/C/search.c
index cda374f..2a2a188 100644
--- a/src/C/search.c
+++ b/src/C/search.c
@@ -1,4 +1,4 @@
-/* search.c generated by valac 0.12.0, the Vala compiler
+/* search.c generated by valac 0.12.1, the Vala compiler
  * generated from search.vala, do not modify */
 
 /*
@@ -87,7 +87,7 @@ typedef struct _DocumentViewClass DocumentViewClass;
 typedef struct _SearchAndReplace SearchAndReplace;
 typedef struct _SearchAndReplaceClass SearchAndReplaceClass;
 typedef struct _SearchAndReplacePrivate SearchAndReplacePrivate;
-typedef struct _Block17Data Block17Data;
+typedef struct _Block15Data Block15Data;
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
 #define TYPE_DOCUMENT_TAB (document_tab_get_type ())
@@ -142,7 +142,7 @@ struct _SearchAndReplacePrivate {
 	gint min_nb_chars_for_incremental_search;
 };
 
-struct _Block17Data {
+struct _Block15Data {
 	int _ref_count_;
 	SearchAndReplace * self;
 	GtkButton* button_clear_find;
@@ -172,12 +172,12 @@ enum  {
 };
 GotoLine* goto_line_new (MainWindow* main_window);
 GotoLine* goto_line_construct (GType object_type, MainWindow* main_window);
-static void _lambda28_ (GotoLine* self);
-static void __lambda28__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda29_ (GotoLine* self);
-static void __lambda29__gtk_entry_activate (GtkEntry* _sender, gpointer self);
-static void _lambda30_ (GotoLine* self);
-static void __lambda30__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
+static void _lambda34_ (GotoLine* self);
+static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda35_ (GotoLine* self);
+static void __lambda35__gtk_entry_activate (GtkEntry* _sender, gpointer self);
+static void _lambda36_ (GotoLine* self);
+static void __lambda36__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
 static void goto_line_on_changed (GotoLine* self);
 static void _goto_line_on_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self);
 void goto_line_show (GotoLine* self);
@@ -196,44 +196,45 @@ enum  {
 };
 SearchAndReplace* search_and_replace_new (MainWindow* main_window);
 SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* main_window);
-static Block17Data* block17_data_ref (Block17Data* _data17_);
-static void block17_data_unref (Block17Data* _data17_);
-static void _lambda31_ (GtkEntryIconPosition icon_pos, GdkEvent* event, Block17Data* _data17_);
-static void __lambda31__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
-static void _lambda32_ (SearchAndReplace* self);
+static Block15Data* block15_data_ref (Block15Data* _data15_);
+static void block15_data_unref (Block15Data* _data15_);
+static void _lambda37_ (GtkEntryIconPosition icon_pos, GdkEvent* event, Block15Data* _data15_);
+static void __lambda37__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self);
+static void _lambda38_ (SearchAndReplace* self);
 static gboolean search_and_replace_get_search_and_replace_mode (SearchAndReplace* self);
-static void __lambda32__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda38__gtk_button_clicked (GtkButton* _sender, gpointer self);
 void search_and_replace_hide (SearchAndReplace* self);
 static void _search_and_replace_hide_gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda33_ (SearchAndReplace* self);
-static void __lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda34_ (SearchAndReplace* self);
-static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda35_ (SearchAndReplace* self);
+static void _lambda39_ (SearchAndReplace* self);
+static void __lambda39__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda40_ (SearchAndReplace* self);
+static void __lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda41_ (SearchAndReplace* self);
 static void search_and_replace_set_search_text (SearchAndReplace* self, gboolean select);
 void document_search_backward (Document* self);
-static void __lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda41__gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void search_and_replace_search_forward (SearchAndReplace* self);
 static void _search_and_replace_search_forward_gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _search_and_replace_search_forward_gtk_entry_activate (GtkEntry* _sender, gpointer self);
-static void _lambda36_ (Block17Data* _data17_);
+static void _lambda42_ (Block15Data* _data15_);
 static void search_and_replace_clear_search (SearchAndReplace* self);
-static void __lambda36__gtk_editable_changed (GtkEditable* _sender, gpointer self);
-static void _lambda37_ (Block17Data* _data17_);
-static void __lambda37__gtk_editable_changed (GtkEditable* _sender, gpointer self);
-static void _lambda38_ (SearchAndReplace* self);
-static void __lambda38__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self);
-static void _lambda39_ (SearchAndReplace* self);
-static void __lambda39__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self);
+static void __lambda42__gtk_editable_changed (GtkEditable* _sender, gpointer self);
+static void _lambda43_ (Block15Data* _data15_);
+static void __lambda43__gtk_editable_changed (GtkEditable* _sender, gpointer self);
+static void _lambda44_ (SearchAndReplace* self);
+static void __lambda44__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self);
+static void _lambda45_ (SearchAndReplace* self);
+static void __lambda45__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self);
 static void search_and_replace_replace (SearchAndReplace* self);
 static void _search_and_replace_replace_gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _search_and_replace_replace_gtk_entry_activate (GtkEntry* _sender, gpointer self);
-static void _lambda40_ (SearchAndReplace* self);
+static void _lambda46_ (SearchAndReplace* self);
 void document_replace_all (Document* self, const gchar* text);
-static void __lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static gboolean _lambda41_ (GdkEventKey* event, SearchAndReplace* self);
+static void __lambda46__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static gboolean _lambda47_ (GdkEventKey* event, SearchAndReplace* self);
 void search_and_replace_show_search_and_replace (SearchAndReplace* self);
-static gboolean __lambda41__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
+static void search_and_replace_select_selected_search_text (SearchAndReplace* self);
+static gboolean __lambda47__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self);
 GtkWidget* search_and_replace_get_widget (SearchAndReplace* self);
 void search_and_replace_show_search (SearchAndReplace* self);
 static void search_and_replace_show (SearchAndReplace* self);
@@ -250,6 +251,7 @@ static void _search_and_replace_on_search_info_updated_document_search_info_upda
 void document_set_search_text (Document* self, const gchar* text, gboolean case_sensitive, gboolean entire_word, guint* nb_matches, guint* num_match, gboolean select);
 static gboolean search_and_replace_get_case_sensitive (SearchAndReplace* self);
 static gboolean search_and_replace_get_entire_word (SearchAndReplace* self);
+void document_select_selected_search_text (Document* self);
 void document_search_forward (Document* self);
 void document_clear_search (Document* self, gboolean disconnect_signals);
 gboolean document_get_readonly (Document* self);
@@ -258,33 +260,33 @@ static void search_and_replace_finalize (GObject* obj);
 static void _vala_search_and_replace_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 
 
-static void _lambda28_ (GotoLine* self) {
+static void _lambda34_ (GotoLine* self) {
 	gtk_widget_hide ((GtkWidget*) self);
 }
 
 
-static void __lambda28__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda28_ (self);
+static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda34_ (self);
 }
 
 
-static void _lambda29_ (GotoLine* self) {
+static void _lambda35_ (GotoLine* self) {
 	gtk_widget_hide ((GtkWidget*) self);
 }
 
 
-static void __lambda29__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
-	_lambda29_ (self);
+static void __lambda35__gtk_entry_activate (GtkEntry* _sender, gpointer self) {
+	_lambda35_ (self);
 }
 
 
-static void _lambda30_ (GotoLine* self) {
+static void _lambda36_ (GotoLine* self) {
 	gtk_widget_hide ((GtkWidget*) self);
 }
 
 
-static void __lambda30__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
-	_lambda30_ (self);
+static void __lambda36__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
+	_lambda36_ (self);
 }
 
 
@@ -315,7 +317,7 @@ GotoLine* goto_line_construct (GType object_type, MainWindow* main_window) {
 	_tmp1_ = (GtkImage*) gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
 	img = g_object_ref_sink (_tmp1_);
 	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) img);
-	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda28__gtk_button_clicked, self, 0);
+	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda34__gtk_button_clicked, self, 0);
 	_tmp2_ = _ ("Go to Line:");
 	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
 	label = g_object_ref_sink (_tmp3_);
@@ -329,8 +331,8 @@ GotoLine* goto_line_construct (GType object_type, MainWindow* main_window) {
 	_tmp5_ = _ ("Line you want to move the cursor to");
 	gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->entry, _tmp5_);
 	gtk_widget_set_size_request ((GtkWidget*) self->priv->entry, 100, -1);
-	g_signal_connect_object (self->priv->entry, "activate", (GCallback) __lambda29__gtk_entry_activate, self, 0);
-	g_signal_connect_object (self->priv->entry, "icon-press", (GCallback) __lambda30__gtk_entry_icon_press, self, 0);
+	g_signal_connect_object (self->priv->entry, "activate", (GCallback) __lambda35__gtk_entry_activate, self, 0);
+	g_signal_connect_object (self->priv->entry, "icon-press", (GCallback) __lambda36__gtk_entry_icon_press, self, 0);
 	g_signal_connect_object ((GtkEditable*) self->priv->entry, "changed", (GCallback) _goto_line_on_changed_gtk_editable_changed, self, 0);
 	_g_object_unref0 (label);
 	_g_object_unref0 (img);
@@ -455,23 +457,23 @@ GType goto_line_get_type (void) {
 }
 
 
-static Block17Data* block17_data_ref (Block17Data* _data17_) {
-	g_atomic_int_inc (&_data17_->_ref_count_);
-	return _data17_;
+static Block15Data* block15_data_ref (Block15Data* _data15_) {
+	g_atomic_int_inc (&_data15_->_ref_count_);
+	return _data15_;
 }
 
 
-static void block17_data_unref (Block17Data* _data17_) {
-	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
-		_g_object_unref0 (_data17_->self);
-		_g_object_unref0 (_data17_->menu);
-		_g_object_unref0 (_data17_->button_next);
-		_g_object_unref0 (_data17_->button_previous);
-		_g_object_unref0 (_data17_->button_replace_all);
-		_g_object_unref0 (_data17_->button_replace);
-		_g_object_unref0 (_data17_->button_clear_replace);
-		_g_object_unref0 (_data17_->button_clear_find);
-		g_slice_free (Block17Data, _data17_);
+static void block15_data_unref (Block15Data* _data15_) {
+	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
+		_g_object_unref0 (_data15_->self);
+		_g_object_unref0 (_data15_->menu);
+		_g_object_unref0 (_data15_->button_next);
+		_g_object_unref0 (_data15_->button_previous);
+		_g_object_unref0 (_data15_->button_replace_all);
+		_g_object_unref0 (_data15_->button_replace);
+		_g_object_unref0 (_data15_->button_clear_replace);
+		_g_object_unref0 (_data15_->button_clear_find);
+		g_slice_free (Block15Data, _data15_);
 	}
 }
 
@@ -481,22 +483,22 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _lambda31_ (GtkEntryIconPosition icon_pos, GdkEvent* event, Block17Data* _data17_) {
+static void _lambda37_ (GtkEntryIconPosition icon_pos, GdkEvent* event, Block15Data* _data15_) {
 	SearchAndReplace * self;
-	self = _data17_->self;
+	self = _data15_->self;
 	g_return_if_fail (event != NULL);
 	if (icon_pos == GTK_ENTRY_ICON_PRIMARY) {
-		gtk_menu_popup (_data17_->menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time);
+		gtk_menu_popup (_data15_->menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time);
 	}
 }
 
 
-static void __lambda31__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
-	_lambda31_ (p0, p1, self);
+static void __lambda37__gtk_entry_icon_press (GtkEntry* _sender, GtkEntryIconPosition p0, GdkEvent* p1, gpointer self) {
+	_lambda37_ (p0, p1, self);
 }
 
 
-static void _lambda32_ (SearchAndReplace* self) {
+static void _lambda38_ (SearchAndReplace* self) {
 	gboolean _tmp0_;
 	_tmp0_ = search_and_replace_get_search_and_replace_mode (self);
 	if (_tmp0_) {
@@ -511,8 +513,8 @@ static void _lambda32_ (SearchAndReplace* self) {
 }
 
 
-static void __lambda32__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda32_ (self);
+static void __lambda38__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda38_ (self);
 }
 
 
@@ -521,35 +523,35 @@ static void _search_and_replace_hide_gtk_button_clicked (GtkButton* _sender, gpo
 }
 
 
-static void _lambda33_ (SearchAndReplace* self) {
+static void _lambda39_ (SearchAndReplace* self) {
 	gtk_entry_set_text (self->priv->entry_find, "");
 }
 
 
-static void __lambda33__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda33_ (self);
+static void __lambda39__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda39_ (self);
 }
 
 
-static void _lambda34_ (SearchAndReplace* self) {
+static void _lambda40_ (SearchAndReplace* self) {
 	gtk_entry_set_text (self->priv->entry_replace, "");
 }
 
 
-static void __lambda34__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda34_ (self);
+static void __lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda40_ (self);
 }
 
 
-static void _lambda35_ (SearchAndReplace* self) {
+static void _lambda41_ (SearchAndReplace* self) {
 	search_and_replace_set_search_text (self, FALSE);
 	g_return_if_fail (self->priv->working_document != NULL);
 	document_search_backward (self->priv->working_document);
 }
 
 
-static void __lambda35__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda35_ (self);
+static void __lambda41__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda41_ (self);
 }
 
 
@@ -563,19 +565,19 @@ static void _search_and_replace_search_forward_gtk_entry_activate (GtkEntry* _se
 }
 
 
-static void _lambda36_ (Block17Data* _data17_) {
+static void _lambda42_ (Block15Data* _data15_) {
 	SearchAndReplace * self;
 	guint _tmp0_;
 	gboolean sensitive;
 	guint _tmp1_;
-	self = _data17_->self;
+	self = _data15_->self;
 	_tmp0_ = gtk_entry_get_text_length (self->priv->entry_find);
 	sensitive = _tmp0_ > 0;
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_clear_find, sensitive);
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_previous, sensitive);
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_next, sensitive);
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_replace, sensitive);
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_replace_all, sensitive);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_clear_find, sensitive);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_previous, sensitive);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_next, sensitive);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_replace, sensitive);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_replace_all, sensitive);
 	_tmp1_ = gtk_entry_get_text_length (self->priv->entry_find);
 	if (_tmp1_ == 0) {
 		gtk_widget_hide ((GtkWidget*) self->priv->label_find_normal);
@@ -591,42 +593,42 @@ static void _lambda36_ (Block17Data* _data17_) {
 }
 
 
-static void __lambda36__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
-	_lambda36_ (self);
+static void __lambda42__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
+	_lambda42_ (self);
 }
 
 
-static void _lambda37_ (Block17Data* _data17_) {
+static void _lambda43_ (Block15Data* _data15_) {
 	SearchAndReplace * self;
 	guint _tmp0_;
-	self = _data17_->self;
+	self = _data15_->self;
 	_tmp0_ = gtk_entry_get_text_length (self->priv->entry_replace);
-	gtk_widget_set_sensitive ((GtkWidget*) _data17_->button_clear_replace, _tmp0_ > 0);
+	gtk_widget_set_sensitive ((GtkWidget*) _data15_->button_clear_replace, _tmp0_ > 0);
 }
 
 
-static void __lambda37__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
-	_lambda37_ (self);
+static void __lambda43__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
+	_lambda43_ (self);
 }
 
 
-static void _lambda38_ (SearchAndReplace* self) {
+static void _lambda44_ (SearchAndReplace* self) {
 	search_and_replace_set_search_text (self, TRUE);
 }
 
 
-static void __lambda38__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self) {
-	_lambda38_ (self);
+static void __lambda44__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self) {
+	_lambda44_ (self);
 }
 
 
-static void _lambda39_ (SearchAndReplace* self) {
+static void _lambda45_ (SearchAndReplace* self) {
 	search_and_replace_set_search_text (self, TRUE);
 }
 
 
-static void __lambda39__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self) {
-	_lambda39_ (self);
+static void __lambda45__gtk_check_menu_item_toggled (GtkCheckMenuItem* _sender, gpointer self) {
+	_lambda45_ (self);
 }
 
 
@@ -640,7 +642,7 @@ static void _search_and_replace_replace_gtk_entry_activate (GtkEntry* _sender, g
 }
 
 
-static void _lambda40_ (SearchAndReplace* self) {
+static void _lambda46_ (SearchAndReplace* self) {
 	guint _tmp0_;
 	const gchar* _tmp1_ = NULL;
 	_tmp0_ = gtk_entry_get_text_length (self->priv->entry_find);
@@ -651,27 +653,40 @@ static void _lambda40_ (SearchAndReplace* self) {
 }
 
 
-static void __lambda40__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda40_ (self);
+static void __lambda46__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda46_ (self);
 }
 
 
-static gboolean _lambda41_ (GdkEventKey* event, SearchAndReplace* self) {
+static gboolean _lambda47_ (GdkEventKey* event, SearchAndReplace* self) {
 	gboolean result = FALSE;
-	if ((*event).keyval == 0xff09) {
-		search_and_replace_show_search_and_replace (self);
-		gtk_widget_grab_focus ((GtkWidget*) self->priv->entry_replace);
-		result = TRUE;
-		return result;
+	switch ((*event).keyval) {
+		case 0xff09:
+		{
+			search_and_replace_show_search_and_replace (self);
+			gtk_widget_grab_focus ((GtkWidget*) self->priv->entry_replace);
+			result = TRUE;
+			return result;
+		}
+		case 0xff1b:
+		{
+			search_and_replace_select_selected_search_text (self);
+			search_and_replace_hide (self);
+			result = TRUE;
+			return result;
+		}
+		default:
+		{
+			result = FALSE;
+			return result;
+		}
 	}
-	result = FALSE;
-	return result;
 }
 
 
-static gboolean __lambda41__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
+static gboolean __lambda47__gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
 	gboolean result;
-	result = _lambda41_ (event, self);
+	result = _lambda47_ (event, self);
 	return result;
 }
 
@@ -680,7 +695,7 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	SearchAndReplace * self = NULL;
 	gchar* _tmp0_ = NULL;
 	gchar* path;
-	Block17Data* _data17_;
+	Block15Data* _data15_;
 	GtkBuilder* _tmp1_ = NULL;
 	GtkBuilder* builder;
 	GObject* _tmp2_ = NULL;
@@ -735,17 +750,17 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	self->priv->main_window = main_window;
 	_tmp0_ = g_build_filename (DATA_DIR, "ui", "search_and_replace.ui", NULL);
 	path = _tmp0_;
-	_data17_ = g_slice_new0 (Block17Data);
-	_data17_->_ref_count_ = 1;
-	_data17_->self = g_object_ref (self);
+	_data15_ = g_slice_new0 (Block15Data);
+	_data15_->_ref_count_ = 1;
+	_data15_->self = g_object_ref (self);
 	_tmp1_ = gtk_builder_new ();
 	builder = _tmp1_;
 	gtk_builder_add_from_file (builder, path, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (builder);
-		block17_data_unref (_data17_);
-		_data17_ = NULL;
-		goto __catch37_g_error;
+		block15_data_unref (_data15_);
+		_data15_ = NULL;
+		goto __catch39_g_error;
 	}
 	_tmp2_ = gtk_builder_get_object (builder, "search_and_replace");
 	_tmp3_ = _g_object_ref0 (GTK_WIDGET (_tmp2_));
@@ -780,7 +795,7 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	eventbox_label2 = _tmp17_;
 	_tmp18_ = gtk_builder_get_object (builder, "button_clear_find");
 	_tmp19_ = _g_object_ref0 (GTK_BUTTON (_tmp18_));
-	_data17_->button_clear_find = _tmp19_;
+	_data15_->button_clear_find = _tmp19_;
 	_tmp20_ = gtk_builder_get_object (builder, "entry_replace");
 	_tmp21_ = _g_object_ref0 (GTK_ENTRY (_tmp20_));
 	_g_object_unref0 (self->priv->entry_replace);
@@ -791,23 +806,23 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	self->priv->frame_replace = _tmp23_;
 	_tmp24_ = gtk_builder_get_object (builder, "button_clear_replace");
 	_tmp25_ = _g_object_ref0 (GTK_BUTTON (_tmp24_));
-	_data17_->button_clear_replace = _tmp25_;
+	_data15_->button_clear_replace = _tmp25_;
 	_tmp26_ = gtk_builder_get_object (builder, "button_replace");
 	_tmp27_ = _g_object_ref0 (GTK_BUTTON (_tmp26_));
-	_data17_->button_replace = _tmp27_;
+	_data15_->button_replace = _tmp27_;
 	_tmp28_ = gtk_builder_get_object (builder, "button_replace_all");
 	_tmp29_ = _g_object_ref0 (GTK_BUTTON (_tmp28_));
-	_data17_->button_replace_all = _tmp29_;
+	_data15_->button_replace_all = _tmp29_;
 	_tmp30_ = gtk_builder_get_object (builder, "hbox_replace");
 	_tmp31_ = _g_object_ref0 (GTK_HBOX (_tmp30_));
 	_g_object_unref0 (self->priv->hbox_replace);
 	self->priv->hbox_replace = _tmp31_;
 	_tmp32_ = gtk_builder_get_object (builder, "button_previous");
 	_tmp33_ = _g_object_ref0 (GTK_BUTTON (_tmp32_));
-	_data17_->button_previous = _tmp33_;
+	_data15_->button_previous = _tmp33_;
 	_tmp34_ = gtk_builder_get_object (builder, "button_next");
 	_tmp35_ = _g_object_ref0 (GTK_BUTTON (_tmp34_));
-	_data17_->button_next = _tmp35_;
+	_data15_->button_next = _tmp35_;
 	_tmp36_ = gtk_builder_get_object (builder, "button_close");
 	_tmp37_ = _g_object_ref0 (GTK_BUTTON (_tmp36_));
 	button_close = _tmp37_;
@@ -816,7 +831,7 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	gtk_widget_modify_bg ((GtkWidget*) eventbox_label1, GTK_STATE_NORMAL, &white);
 	gtk_widget_modify_bg ((GtkWidget*) eventbox_label2, GTK_STATE_NORMAL, &white);
 	_tmp39_ = (GtkMenu*) gtk_menu_new ();
-	_data17_->menu = g_object_ref_sink (_tmp39_);
+	_data15_->menu = g_object_ref_sink (_tmp39_);
 	_tmp40_ = _ ("Case sensitive");
 	_tmp41_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_tmp40_);
 	_g_object_unref0 (self->priv->check_case_sensitive);
@@ -825,33 +840,33 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 	_tmp43_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label (_tmp42_);
 	_g_object_unref0 (self->priv->check_entire_word);
 	self->priv->check_entire_word = g_object_ref_sink (_tmp43_);
-	gtk_menu_shell_append ((GtkMenuShell*) _data17_->menu, (GtkWidget*) ((GtkMenuItem*) self->priv->check_case_sensitive));
-	gtk_menu_shell_append ((GtkMenuShell*) _data17_->menu, (GtkWidget*) ((GtkMenuItem*) self->priv->check_entire_word));
-	gtk_widget_show_all ((GtkWidget*) _data17_->menu);
-	g_signal_connect_data (self->priv->entry_find, "icon-press", (GCallback) __lambda31__gtk_entry_icon_press, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
-	g_signal_connect_object (self->priv->button_arrow, "clicked", (GCallback) __lambda32__gtk_button_clicked, self, 0);
+	gtk_menu_shell_append ((GtkMenuShell*) _data15_->menu, (GtkWidget*) ((GtkMenuItem*) self->priv->check_case_sensitive));
+	gtk_menu_shell_append ((GtkMenuShell*) _data15_->menu, (GtkWidget*) ((GtkMenuItem*) self->priv->check_entire_word));
+	gtk_widget_show_all ((GtkWidget*) _data15_->menu);
+	g_signal_connect_data (self->priv->entry_find, "icon-press", (GCallback) __lambda37__gtk_entry_icon_press, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
+	g_signal_connect_object (self->priv->button_arrow, "clicked", (GCallback) __lambda38__gtk_button_clicked, self, 0);
 	g_signal_connect_object (button_close, "clicked", (GCallback) _search_and_replace_hide_gtk_button_clicked, self, 0);
-	g_signal_connect_object (_data17_->button_clear_find, "clicked", (GCallback) __lambda33__gtk_button_clicked, self, 0);
-	g_signal_connect_object (_data17_->button_clear_replace, "clicked", (GCallback) __lambda34__gtk_button_clicked, self, 0);
-	g_signal_connect_object (_data17_->button_previous, "clicked", (GCallback) __lambda35__gtk_button_clicked, self, 0);
-	g_signal_connect_object (_data17_->button_next, "clicked", (GCallback) _search_and_replace_search_forward_gtk_button_clicked, self, 0);
+	g_signal_connect_object (_data15_->button_clear_find, "clicked", (GCallback) __lambda39__gtk_button_clicked, self, 0);
+	g_signal_connect_object (_data15_->button_clear_replace, "clicked", (GCallback) __lambda40__gtk_button_clicked, self, 0);
+	g_signal_connect_object (_data15_->button_previous, "clicked", (GCallback) __lambda41__gtk_button_clicked, self, 0);
+	g_signal_connect_object (_data15_->button_next, "clicked", (GCallback) _search_and_replace_search_forward_gtk_button_clicked, self, 0);
 	g_signal_connect_object (self->priv->entry_find, "activate", (GCallback) _search_and_replace_search_forward_gtk_entry_activate, self, 0);
-	g_signal_connect_data ((GtkEditable*) self->priv->entry_find, "changed", (GCallback) __lambda36__gtk_editable_changed, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
-	g_signal_connect_data ((GtkEditable*) self->priv->entry_replace, "changed", (GCallback) __lambda37__gtk_editable_changed, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
-	g_signal_connect_object (self->priv->check_case_sensitive, "toggled", (GCallback) __lambda38__gtk_check_menu_item_toggled, self, 0);
-	g_signal_connect_object (self->priv->check_entire_word, "toggled", (GCallback) __lambda39__gtk_check_menu_item_toggled, self, 0);
-	g_signal_connect_object (_data17_->button_replace, "clicked", (GCallback) _search_and_replace_replace_gtk_button_clicked, self, 0);
+	g_signal_connect_data ((GtkEditable*) self->priv->entry_find, "changed", (GCallback) __lambda42__gtk_editable_changed, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
+	g_signal_connect_data ((GtkEditable*) self->priv->entry_replace, "changed", (GCallback) __lambda43__gtk_editable_changed, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
+	g_signal_connect_object (self->priv->check_case_sensitive, "toggled", (GCallback) __lambda44__gtk_check_menu_item_toggled, self, 0);
+	g_signal_connect_object (self->priv->check_entire_word, "toggled", (GCallback) __lambda45__gtk_check_menu_item_toggled, self, 0);
+	g_signal_connect_object (_data15_->button_replace, "clicked", (GCallback) _search_and_replace_replace_gtk_button_clicked, self, 0);
 	g_signal_connect_object (self->priv->entry_replace, "activate", (GCallback) _search_and_replace_replace_gtk_entry_activate, self, 0);
-	g_signal_connect_object (_data17_->button_replace_all, "clicked", (GCallback) __lambda40__gtk_button_clicked, self, 0);
-	g_signal_connect_object ((GtkWidget*) self->priv->entry_find, "key-press-event", (GCallback) __lambda41__gtk_widget_key_press_event, self, 0);
+	g_signal_connect_object (_data15_->button_replace_all, "clicked", (GCallback) __lambda46__gtk_button_clicked, self, 0);
+	g_signal_connect_object ((GtkWidget*) self->priv->entry_find, "key-press-event", (GCallback) __lambda47__gtk_widget_key_press_event, self, 0);
 	_g_object_unref0 (button_close);
 	_g_object_unref0 (eventbox_label2);
 	_g_object_unref0 (eventbox_label1);
 	_g_object_unref0 (builder);
-	block17_data_unref (_data17_);
-	_data17_ = NULL;
-	goto __finally37;
-	__catch37_g_error:
+	block15_data_unref (_data15_);
+	_data15_ = NULL;
+	goto __finally39;
+	__catch39_g_error:
 	{
 		GError * e;
 		GtkLabel* _tmp44_ = NULL;
@@ -869,7 +884,7 @@ SearchAndReplace* search_and_replace_construct (GType object_type, MainWindow* m
 		_g_object_unref0 (label);
 		_g_error_free0 (e);
 	}
-	__finally37:
+	__finally39:
 	if (_inner_error_ != NULL) {
 		_g_free0 (path);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -957,15 +972,22 @@ static void search_and_replace_show (SearchAndReplace* self) {
 
 
 void search_and_replace_hide (SearchAndReplace* self) {
-	guint _tmp0_;
-	GQuark _tmp1_;
+	DocumentView* _tmp0_ = NULL;
+	guint _tmp2_;
+	GQuark _tmp3_;
 	g_return_if_fail (self != NULL);
 	gtk_widget_hide (self->priv->widget);
 	if (self->priv->working_document != NULL) {
 		search_and_replace_clear_search (self);
 	}
-	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
-	g_signal_handlers_disconnect_matched ((GObject*) self->priv->main_window, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) _search_and_replace_active_document_changed_g_object_notify, self);
+	_tmp0_ = main_window_get_active_view (self->priv->main_window);
+	if (_tmp0_ != NULL) {
+		DocumentView* _tmp1_ = NULL;
+		_tmp1_ = main_window_get_active_view (self->priv->main_window);
+		gtk_widget_grab_focus ((GtkWidget*) _tmp1_);
+	}
+	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp2_, &_tmp3_, TRUE);
+	g_signal_handlers_disconnect_matched ((GObject*) self->priv->main_window, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, _tmp3_, NULL, (GCallback) _search_and_replace_active_document_changed_g_object_notify, self);
 }
 
 
@@ -1030,6 +1052,17 @@ static void search_and_replace_set_search_text (SearchAndReplace* self, gboolean
 }
 
 
+static void search_and_replace_select_selected_search_text (SearchAndReplace* self) {
+	Document* _tmp0_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = main_window_get_active_document (self->priv->main_window);
+	g_return_if_fail (_tmp0_ != NULL);
+	if (self->priv->working_document != NULL) {
+	}
+	document_select_selected_search_text (self->priv->working_document);
+}
+
+
 static void search_and_replace_search_forward (SearchAndReplace* self) {
 	g_return_if_fail (self != NULL);
 	search_and_replace_set_search_text (self, FALSE);
diff --git a/src/C/side_panel.c b/src/C/side_panel.c
index 6ad3f3e..6cb76e1 100644
--- a/src/C/side_panel.c
+++ b/src/C/side_panel.c
@@ -1,4 +1,4 @@
-/* side_panel.c generated by valac 0.12.0, the Vala compiler
+/* side_panel.c generated by valac 0.12.1, the Vala compiler
  * generated from side_panel.vala, do not modify */
 
 /*
@@ -97,10 +97,10 @@ static void _side_panel_show_active_component_gtk_widget_show (GtkWidget* _sende
 static void side_panel_hide_all_components (SidePanel* self);
 static void _side_panel_hide_all_components_gtk_widget_hide (GtkWidget* _sender, gpointer self);
 void side_panel_add_component (SidePanel* self, const gchar* name, const gchar* stock_id, GtkVBox* component);
-static void _vala_array_add14 (GtkVBox*** array, int* length, int* size, GtkVBox* value);
+static void _vala_array_add16 (GtkVBox*** array, int* length, int* size, GtkVBox* value);
 void side_panel_restore_state (SidePanel* self);
-static void _lambda64_ (SidePanel* self);
-static void __lambda64__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda74_ (SidePanel* self);
+static void __lambda74__gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _side_panel_show_active_component_gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
 gint side_panel_get_active_component (SidePanel* self);
 static void side_panel_finalize (GObject* obj);
@@ -172,7 +172,7 @@ static gpointer _g_object_ref0 (gpointer self) {
 }
 
 
-static void _vala_array_add14 (GtkVBox*** array, int* length, int* size, GtkVBox* value) {
+static void _vala_array_add16 (GtkVBox*** array, int* length, int* size, GtkVBox* value) {
 	if ((*length) == (*size)) {
 		*size = (*size) ? (2 * (*size)) : 4;
 		*array = g_renew (GtkVBox*, *array, (*size) + 1);
@@ -195,7 +195,7 @@ void side_panel_add_component (SidePanel* self, const gchar* name, const gchar*
 	gtk_list_store_set (self->priv->list_store, &iter, SIDE_PANEL_SIDE_PANEL_COLUMN_PIXBUF, stock_id, SIDE_PANEL_SIDE_PANEL_COLUMN_NAME, name, -1, -1);
 	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) component, TRUE, TRUE, (guint) 0);
 	_tmp1_ = _g_object_ref0 (component);
-	_vala_array_add14 (&self->priv->components, &self->priv->components_length1, &self->priv->_components_size_, _tmp1_);
+	_vala_array_add16 (&self->priv->components, &self->priv->components_length1, &self->priv->_components_size_, _tmp1_);
 }
 
 
@@ -217,14 +217,14 @@ void side_panel_restore_state (SidePanel* self) {
 }
 
 
-static void _lambda64_ (SidePanel* self) {
+static void _lambda74_ (SidePanel* self) {
 	gtk_widget_hide ((GtkWidget*) self);
 	gtk_toggle_action_set_active (self->priv->action_view_side_panel, FALSE);
 }
 
 
-static void __lambda64__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda64_ (self);
+static void __lambda74__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda74_ (self);
 }
 
 
@@ -246,7 +246,7 @@ static GtkButton* side_panel_get_close_button (SidePanel* self) {
 	_tmp3_ = g_object_ref_sink (_tmp2_);
 	gtk_container_add ((GtkContainer*) close_button, (GtkWidget*) _tmp3_);
 	_g_object_unref0 (_tmp3_);
-	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda64__gtk_button_clicked, self, 0);
+	g_signal_connect_object (close_button, "clicked", (GCallback) __lambda74__gtk_button_clicked, self, 0);
 	result = close_button;
 	return result;
 }
diff --git a/src/C/structure.c b/src/C/structure.c
index ec25ff4..dca46ef 100644
--- a/src/C/structure.c
+++ b/src/C/structure.c
@@ -1,4 +1,4 @@
-/* structure.c generated by valac 0.12.0, the Vala compiler
+/* structure.c generated by valac 0.12.1, the Vala compiler
  * generated from structure.vala, do not modify */
 
 /*
@@ -23,19 +23,20 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtk.h>
-#include <gio/gio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <gtksourceview/gtksourceview.h>
 #include <glib/gi18n-lib.h>
+#include <gtksourceview/gtksourceview.h>
+#include <gio/gio.h>
+#include <gdk/gdk.h>
 #include <float.h>
 #include <math.h>
 
 
-#define TYPE_STRUCT_ITEM (struct_item_get_type ())
-
 #define TYPE_STRUCT_TYPE (struct_type_get_type ())
 
+#define TYPE_STRUCT_ACTION (struct_action_get_type ())
+
 #define TYPE_STRUCTURE (structure_get_type ())
 #define STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE, Structure))
 #define STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE, StructureClass))
@@ -57,7 +58,25 @@ typedef struct _StructurePrivate StructurePrivate;
 typedef struct _MainWindow MainWindow;
 typedef struct _MainWindowClass MainWindowClass;
 
-#define STRUCTURE_TYPE_MIN_LEVEL_COLUMN (structure_min_level_column_get_type ())
+#define TYPE_DOCUMENT_STRUCTURE (document_structure_get_type ())
+#define DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructure))
+#define DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))
+#define IS_DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_STRUCTURE))
+#define IS_DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_STRUCTURE))
+#define DOCUMENT_STRUCTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))
+
+typedef struct _DocumentStructure DocumentStructure;
+typedef struct _DocumentStructureClass DocumentStructureClass;
+
+#define TYPE_STRUCTURE_MODEL (structure_model_get_type ())
+#define STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE_MODEL, StructureModel))
+#define STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE_MODEL, StructureModelClass))
+#define IS_STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STRUCTURE_MODEL))
+#define IS_STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STRUCTURE_MODEL))
+#define STRUCTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STRUCTURE_MODEL, StructureModelClass))
+
+typedef struct _StructureModel StructureModel;
+typedef struct _StructureModelClass StructureModelClass;
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
 #define TYPE_DOCUMENT (document_get_type ())
@@ -71,7 +90,12 @@ typedef struct _Document Document;
 typedef struct _DocumentClass DocumentClass;
 typedef struct _Block13Data Block13Data;
 #define _g_free0(var) (var = (g_free (var), NULL))
-typedef struct _Block14Data Block14Data;
+#define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
+#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
+
+#define TYPE_STRUCT_LIST_COLUMN (struct_list_column_get_type ())
+
+#define TYPE_STRUCT_COLUMN (struct_column_get_type ())
 
 #define TYPE_DOCUMENT_VIEW (document_view_get_type ())
 #define DOCUMENT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_VIEW, DocumentView))
@@ -82,29 +106,10 @@ typedef struct _Block14Data Block14Data;
 
 typedef struct _DocumentView DocumentView;
 typedef struct _DocumentViewClass DocumentViewClass;
-
-#define TYPE_DOCUMENT_STRUCTURE (document_structure_get_type ())
-#define DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructure))
-#define DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))
-#define IS_DOCUMENT_STRUCTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT_STRUCTURE))
-#define IS_DOCUMENT_STRUCTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT_STRUCTURE))
-#define DOCUMENT_STRUCTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT_STRUCTURE, DocumentStructureClass))
-
-typedef struct _DocumentStructure DocumentStructure;
-typedef struct _DocumentStructureClass DocumentStructureClass;
-typedef struct _Block15Data Block15Data;
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
 typedef enum  {
-	STRUCT_ITEM_PIXBUF,
-	STRUCT_ITEM_TYPE,
-	STRUCT_ITEM_TEXT,
-	STRUCT_ITEM_TOOLTIP,
-	STRUCT_ITEM_MARK,
-	STRUCT_ITEM_N_COLUMNS
-} StructItem;
-
-typedef enum  {
-	STRUCT_TYPE_PART = 0,
+	STRUCT_TYPE_PART,
 	STRUCT_TYPE_CHAPTER,
 	STRUCT_TYPE_SECTION,
 	STRUCT_TYPE_SUBSECTION,
@@ -113,13 +118,26 @@ typedef enum  {
 	STRUCT_TYPE_SUBPARAGRAPH,
 	STRUCT_TYPE_LABEL,
 	STRUCT_TYPE_INCLUDE,
-	STRUCT_TYPE_TABLE,
-	STRUCT_TYPE_FIGURE,
+	STRUCT_TYPE_IMAGE,
 	STRUCT_TYPE_TODO,
 	STRUCT_TYPE_FIXME,
-	STRUCT_TYPE_N_TYPES
+	STRUCT_TYPE_NB_COMMON_TYPES,
+	STRUCT_TYPE_TABLE,
+	STRUCT_TYPE_FIGURE,
+	STRUCT_TYPE_NB_TYPES
 } StructType;
 
+typedef enum  {
+	STRUCT_ACTION_CUT,
+	STRUCT_ACTION_COPY,
+	STRUCT_ACTION_DELETE,
+	STRUCT_ACTION_SELECT,
+	STRUCT_ACTION_COMMENT,
+	STRUCT_ACTION_SHIFT_LEFT,
+	STRUCT_ACTION_SHIFT_RIGHT,
+	STRUCT_ACTION_NB_ACTIONS
+} StructAction;
+
 struct _Structure {
 	GtkVBox parent_instance;
 	StructurePrivate * priv;
@@ -131,128 +149,178 @@ struct _StructureClass {
 
 struct _StructurePrivate {
 	MainWindow* _main_window;
-	GSettings* _settings;
-	GtkTreeStore* _tree_store;
-	GtkTreeModelFilter* _tree_filter;
+	GtkMenu* _popup_menu;
+	GtkAction* _action_all_menu;
+	GtkAction* _action_cut;
+	GtkAction* _action_copy;
+	GtkAction* _action_delete;
+	GtkAction* _action_select;
+	GtkAction* _action_comment;
+	GtkAction* _action_shift_left;
+	GtkAction* _action_shift_right;
+	GtkToggleButton** _simple_list_buttons;
+	gint _simple_list_buttons_length1;
+	gint __simple_list_buttons_size_;
+	GtkVPaned* _vpaned;
 	GtkTreeView* _tree_view;
-	gboolean* _visible_types;
-	gint _visible_types_length1;
-	gint __visible_types_size_;
+	DocumentStructure* _document_structure;
+	StructureModel* _model;
+	GtkTreeView* _list_view;
+	GtkWidget* _list_view_sw;
+	GtkListStore* _list_store;
+	StructType* _current_list_types;
+	gint _current_list_types_length1;
+	gint __current_list_types_size_;
+	gboolean _list_is_hidden;
+	gboolean _first_select;
 };
 
-typedef enum  {
-	STRUCTURE_MIN_LEVEL_COLUMN_PIXBUF,
-	STRUCTURE_MIN_LEVEL_COLUMN_NAME,
-	STRUCTURE_MIN_LEVEL_COLUMN_TYPE,
-	STRUCTURE_MIN_LEVEL_COLUMN_N_COLUMNS
-} StructureMinLevelColumn;
-
 struct _Block13Data {
 	int _ref_count_;
 	Structure * self;
+	StructType main_type;
 	GtkToggleButton* button;
 	StructType* types;
 	gint types_length1;
 };
 
-struct _Block14Data {
-	int _ref_count_;
-	Structure * self;
-	GtkListStore* list_store;
-	GtkComboBox* combo_box;
-};
+typedef enum  {
+	STRUCT_LIST_COLUMN_PIXBUF,
+	STRUCT_LIST_COLUMN_TEXT,
+	STRUCT_LIST_COLUMN_TOOLTIP,
+	STRUCT_LIST_COLUMN_N_COLUMNS
+} StructListColumn;
 
-struct _Block15Data {
-	int _ref_count_;
-	Structure * self;
-	DocumentStructure* doc_struct;
-};
+typedef enum  {
+	STRUCT_COLUMN_PIXBUF,
+	STRUCT_COLUMN_TEXT,
+	STRUCT_COLUMN_TOOLTIP,
+	STRUCT_COLUMN_START_MARK,
+	STRUCT_COLUMN_END_MARK,
+	STRUCT_COLUMN_TYPE,
+	STRUCT_COLUMN_N_COLUMNS
+} StructColumn;
 
+typedef enum  {
+	STRUCT_ERROR_GENERAL,
+	STRUCT_ERROR_DATA_OUTDATED
+} StructError;
+#define STRUCT_ERROR struct_error_quark ()
 
 static gpointer structure_parent_class = NULL;
+static gchar** structure__icons;
+static gint structure__icons_length1;
+static gchar** structure__icons = NULL;
+static gint structure__icons_length1 = 0;
+static gint _structure__icons_size_ = 0;
+static gchar** structure__names;
+static gint structure__names_length1;
+static gchar** structure__names = NULL;
+static gint structure__names_length1 = 0;
+static gint _structure__names_size_ = 0;
+static gchar** structure__action_names;
+static gint structure__action_names_length1;
+static gchar** structure__action_names = NULL;
+static gint structure__action_names_length1 = 0;
+static gint _structure__action_names_size_ = 0;
 
-GType struct_item_get_type (void) G_GNUC_CONST;
 GType struct_type_get_type (void) G_GNUC_CONST;
+GType struct_action_get_type (void) G_GNUC_CONST;
 GType structure_get_type (void) G_GNUC_CONST;
 GType main_window_get_type (void) G_GNUC_CONST;
+GType document_structure_get_type (void) G_GNUC_CONST;
+GType structure_model_get_type (void) G_GNUC_CONST;
 #define STRUCTURE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_STRUCTURE, StructurePrivate))
 enum  {
 	STRUCTURE_DUMMY_PROPERTY
 };
-static GType structure_min_level_column_get_type (void) G_GNUC_UNUSED;
-Structure* structure_new (MainWindow* main_window);
-Structure* structure_construct (GType object_type, MainWindow* main_window);
-static void structure_init_visible_types (Structure* self);
+Structure* structure_new (MainWindow* main_window, GtkUIManager* ui_manager);
+Structure* structure_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager);
 static void structure_init_toolbar (Structure* self);
-static void structure_init_choose_min_level (Structure* self);
+static void structure_init_vpaned (Structure* self);
+static void structure_init_list_view (Structure* self);
 static void structure_init_tree_view (Structure* self);
 void structure_connect_parsing (Structure* self);
 static void _structure_connect_parsing_gtk_widget_show (GtkWidget* _sender, gpointer self);
+static void _lambda16_ (Structure* self);
 void structure_disconnect_parsing (Structure* self);
-static void _structure_disconnect_parsing_gtk_widget_hide (GtkWidget* _sender, gpointer self);
-void structure_save_state (Structure* self);
+static void __lambda16__gtk_widget_hide (GtkWidget* _sender, gpointer self);
 GtkButton* utils_get_toolbar_button (const gchar* stock_id);
-static void _lambda5_ (Structure* self);
+static void _lambda4_ (Structure* self);
 GType document_get_type (void) G_GNUC_CONST;
-static void structure_parse_document (Structure* self, Document* doc);
+static void structure_show_document (Structure* self, Document* doc, gboolean force_parse);
 Document* main_window_get_active_document (MainWindow* self);
-static void __lambda5__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void __lambda4__gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _lambda7_ (Structure* self);
 static void __lambda7__gtk_button_clicked (GtkButton* _sender, gpointer self);
 static void _lambda8_ (Structure* self);
 static void __lambda8__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static GtkToggleButton* structure_create_show_hide_button (Structure* self, StructType* types, int types_length1, const gchar* tooltip);
+static GtkToggleButton* structure_create_simple_list_button (Structure* self, StructType* types, int types_length1, const gchar* tooltip);
 static StructType* _vala_array_dup3 (StructType* self, int length);
 static Block13Data* block13_data_ref (Block13Data* _data13_);
 static void block13_data_unref (Block13Data* _data13_);
 GtkToggleButton* utils_get_toolbar_toggle_button (const gchar* stock_id);
 gchar* structure_get_icon_from_type (StructType type);
+static void _vala_array_add9 (GtkToggleButton*** array, int* length, int* size, GtkToggleButton* value);
 static void _lambda9_ (Block13Data* _data13_);
-static void __lambda9__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
-static gboolean _lambda11_ (GtkTreeModel* model, GtkTreeIter* iter, Structure* self);
-static gboolean __lambda11__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self);
-static gboolean structure_on_row_selection (Structure* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected);
-static gboolean _structure_on_row_selection_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
+static gboolean _vala_struct_type_array_contains (StructType* stack, int stack_length, StructType needle);
+static StructType* _vala_array_dup4 (StructType* self, int length);
+static void structure_populate_simple_list (Structure* self);
+static void __lambda9__gtk_button_clicked (GtkButton* _sender, gpointer self);
+void structure_model_populate_list (StructureModel* self, GtkListStore* store, StructType type);
+static void _gtk_tree_path_free0_ (gpointer var);
+static void _g_list_free__gtk_tree_path_free0_ (GList* self);
+static void structure_select_simple_list_item (Structure* self, GtkTreeIter* tree_iter);
+void structure_save_state (Structure* self);
+static GtkTreeView* structure_get_new_tree_view (Structure* self, gint pixbuf_col, gint text_col, gint tooltip_col);
+GType struct_list_column_get_type (void) G_GNUC_CONST;
+static gboolean _lambda10_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, Structure* self);
+static gboolean structure_select_list_row (Structure* self, GtkTreePath* list_path);
+static gboolean __lambda10__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
+static void _lambda11_ (GtkTreePath* path, Structure* self);
+static void __lambda11__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
-static Block14Data* block14_data_ref (Block14Data* _data14_);
-static void block14_data_unref (Block14Data* _data14_);
-gchar* structure_get_type_name (StructType type);
-static void _lambda10_ (Block14Data* _data14_);
-static void __lambda10__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
+GType struct_column_get_type (void) G_GNUC_CONST;
+static gboolean _lambda12_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, Structure* self);
+static gboolean structure_select_tree_row (Structure* self, GtkTreePath* tree_path);
+static gboolean __lambda12__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self);
+static void _lambda13_ (GtkTreePath* path, Structure* self);
+static void __lambda13__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
+static gboolean _lambda14_ (GdkEventButton* event, Structure* self);
+static void structure_show_popup_menu (Structure* self, GdkEventButton* event);
+static gboolean __lambda14__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
+static gboolean _lambda15_ (Structure* self);
+static gboolean __lambda15__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self);
+GtkTreePath* structure_model_get_tree_path_from_list_num (StructureModel* self, StructType list_type, gint num);
 GType document_view_get_type (void) G_GNUC_CONST;
 DocumentView* main_window_get_active_view (MainWindow* self);
-void document_view_scroll_to_cursor (DocumentView* self, gdouble margin);
-static void structure_clear (Structure* self);
-GType document_structure_get_type (void) G_GNUC_CONST;
+static void structure_set_actions_sensitivity (Structure* self, StructType type);
+gint structure_model_get_list_num_from_tree_iter (StructureModel* self, GtkTreeIter* tree_iter);
+static void structure_show_active_document (Structure* self);
+static void structure_set_model (Structure* self, StructureModel* model);
 DocumentStructure* document_get_structure (Document* self);
 void document_structure_parse (DocumentStructure* self);
-static void structure_populate (Structure* self, DocumentStructure* doc_struct);
-static void structure_populate_active_document (Structure* self);
-static Block15Data* block15_data_ref (Block15Data* _data15_);
-static void block15_data_unref (Block15Data* _data15_);
-static gboolean _lambda6_ (Block15Data* _data15_);
-void document_structure_populate_tree_store (DocumentStructure* self, GtkTreeStore* store);
-static gboolean __lambda6__gsource_func (gpointer self);
-static void _structure_populate_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+gboolean document_structure_get_parsing_done (DocumentStructure* self);
+StructureModel* document_structure_get_model (DocumentStructure* self);
+static void _lambda6_ (Structure* self);
+static void __lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+static void _structure_show_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
+gboolean structure_is_section (StructType type);
+void structure_do_action (Structure* self, StructAction action_type);
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
+GQuark struct_error_quark (void);
+void document_structure_do_action (DocumentStructure* self, StructAction action_type, GtkTreeIter* tree_iter, gboolean* refresh_simple_list, GError** error);
+static gchar* structure_get_action_name (StructAction action_type);
+gchar* structure_get_type_name (StructType type);
 static void structure_finalize (GObject* obj);
-
-
-GType struct_item_get_type (void) {
-	static volatile gsize struct_item_type_id__volatile = 0;
-	if (g_once_init_enter (&struct_item_type_id__volatile)) {
-		static const GEnumValue values[] = {{STRUCT_ITEM_PIXBUF, "STRUCT_ITEM_PIXBUF", "pixbuf"}, {STRUCT_ITEM_TYPE, "STRUCT_ITEM_TYPE", "type"}, {STRUCT_ITEM_TEXT, "STRUCT_ITEM_TEXT", "text"}, {STRUCT_ITEM_TOOLTIP, "STRUCT_ITEM_TOOLTIP", "tooltip"}, {STRUCT_ITEM_MARK, "STRUCT_ITEM_MARK", "mark"}, {STRUCT_ITEM_N_COLUMNS, "STRUCT_ITEM_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
-		GType struct_item_type_id;
-		struct_item_type_id = g_enum_register_static ("StructItem", values);
-		g_once_init_leave (&struct_item_type_id__volatile, struct_item_type_id);
-	}
-	return struct_item_type_id__volatile;
-}
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
 
 GType struct_type_get_type (void) {
 	static volatile gsize struct_type_type_id__volatile = 0;
 	if (g_once_init_enter (&struct_type_type_id__volatile)) {
-		static const GEnumValue values[] = {{STRUCT_TYPE_PART, "STRUCT_TYPE_PART", "part"}, {STRUCT_TYPE_CHAPTER, "STRUCT_TYPE_CHAPTER", "chapter"}, {STRUCT_TYPE_SECTION, "STRUCT_TYPE_SECTION", "section"}, {STRUCT_TYPE_SUBSECTION, "STRUCT_TYPE_SUBSECTION", "subsection"}, {STRUCT_TYPE_SUBSUBSECTION, "STRUCT_TYPE_SUBSUBSECTION", "subsubsection"}, {STRUCT_TYPE_PARAGRAPH, "STRUCT_TYPE_PARAGRAPH", "paragraph"}, {STRUCT_TYPE_SUBPARAGRAPH, "STRUCT_TYPE_SUBPARAGRAPH", "subparagraph"}, {STRUCT_TYPE_LABEL, "STRUCT_TYPE_LABEL", "label"}, {STRUCT_TYPE_INCLUDE, "STRUCT_TYPE_INCLUDE", "include"}, {STRUCT_TYPE_TABLE, "STRUCT_TYPE_TABLE", "table"}, {STRUCT_TYPE_FIGURE, "STRUCT_TYPE_FIGURE", "figure"}, {STRUCT_TYPE_TODO, "STRUCT_TYPE_TODO", "todo"}, {STRUCT_TYPE_FIXME, "STRUCT_TYPE_FIXME", "fixme"}, {STRUCT_TYPE_N_TYPES, "STRUCT_TYPE_N_TYPES", "n-types"}, {0, NULL, NULL}};
+		static const GEnumValue values[] = {{STRUCT_TYPE_PART, "STRUCT_TYPE_PART", "part"}, {STRUCT_TYPE_CHAPTER, "STRUCT_TYPE_CHAPTER", "chapter"}, {STRUCT_TYPE_SECTION, "STRUCT_TYPE_SECTION", "section"}, {STRUCT_TYPE_SUBSECTION, "STRUCT_TYPE_SUBSECTION", "subsection"}, {STRUCT_TYPE_SUBSUBSECTION, "STRUCT_TYPE_SUBSUBSECTION", "subsubsection"}, {STRUCT_TYPE_PARAGRAPH, "STRUCT_TYPE_PARAGRAPH", "paragraph"}, {STRUCT_TYPE_SUBPARAGRAPH, "STRUCT_TYPE_SUBPARAGRAPH", "subparagraph"}, {STRUCT_TYPE_LABEL, "STRUCT_TYPE_LABEL", "label"}, {STRUCT_TYPE_INCLUDE, "STRUCT_TYPE_INCLUDE", "include"}, {STRUCT_TYPE_IMAGE, "STRUCT_TYPE_IMAGE", "image"}, {STRUCT_TYPE_TODO, "STRUCT_TYPE_TODO", "todo"}, {STRUCT_TYPE_FIXME, "STRUCT_TYPE_FIXME", "fixme"}, {STRUCT_TYPE_NB_COMMON_TYPES, "STRUCT_TYPE_NB_COMMON_TYPES", "nb-common-types"}, {STRUCT_TYPE_TABLE, "STRUCT_TYPE_TABLE", "table"}, {STRUCT_TYPE_FIGURE, "STRUCT_TYPE_FIGURE", "figure"}, {STRUCT_TYPE_NB_TYPES, "STRUCT_TYPE_NB_TYPES", "nb-types"}, {0, NULL,
  NULL}};
 		GType struct_type_type_id;
 		struct_type_type_id = g_enum_register_static ("StructType", values);
 		g_once_init_leave (&struct_type_type_id__volatile, struct_type_type_id);
@@ -261,15 +329,20 @@ GType struct_type_get_type (void) {
 }
 
 
-static GType structure_min_level_column_get_type (void) {
-	static volatile gsize structure_min_level_column_type_id__volatile = 0;
-	if (g_once_init_enter (&structure_min_level_column_type_id__volatile)) {
-		static const GEnumValue values[] = {{STRUCTURE_MIN_LEVEL_COLUMN_PIXBUF, "STRUCTURE_MIN_LEVEL_COLUMN_PIXBUF", "pixbuf"}, {STRUCTURE_MIN_LEVEL_COLUMN_NAME, "STRUCTURE_MIN_LEVEL_COLUMN_NAME", "name"}, {STRUCTURE_MIN_LEVEL_COLUMN_TYPE, "STRUCTURE_MIN_LEVEL_COLUMN_TYPE", "type"}, {STRUCTURE_MIN_LEVEL_COLUMN_N_COLUMNS, "STRUCTURE_MIN_LEVEL_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
-		GType structure_min_level_column_type_id;
-		structure_min_level_column_type_id = g_enum_register_static ("StructureMinLevelColumn", values);
-		g_once_init_leave (&structure_min_level_column_type_id__volatile, structure_min_level_column_type_id);
+GType struct_action_get_type (void) {
+	static volatile gsize struct_action_type_id__volatile = 0;
+	if (g_once_init_enter (&struct_action_type_id__volatile)) {
+		static const GEnumValue values[] = {{STRUCT_ACTION_CUT, "STRUCT_ACTION_CUT", "cut"}, {STRUCT_ACTION_COPY, "STRUCT_ACTION_COPY", "copy"}, {STRUCT_ACTION_DELETE, "STRUCT_ACTION_DELETE", "delete"}, {STRUCT_ACTION_SELECT, "STRUCT_ACTION_SELECT", "select"}, {STRUCT_ACTION_COMMENT, "STRUCT_ACTION_COMMENT", "comment"}, {STRUCT_ACTION_SHIFT_LEFT, "STRUCT_ACTION_SHIFT_LEFT", "shift-left"}, {STRUCT_ACTION_SHIFT_RIGHT, "STRUCT_ACTION_SHIFT_RIGHT", "shift-right"}, {STRUCT_ACTION_NB_ACTIONS, "STRUCT_ACTION_NB_ACTIONS", "nb-actions"}, {0, NULL, NULL}};
+		GType struct_action_type_id;
+		struct_action_type_id = g_enum_register_static ("StructAction", values);
+		g_once_init_leave (&struct_action_type_id__volatile, struct_action_type_id);
 	}
-	return structure_min_level_column_type_id__volatile;
+	return struct_action_type_id__volatile;
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+	return self ? g_object_ref (self) : NULL;
 }
 
 
@@ -278,109 +351,103 @@ static void _structure_connect_parsing_gtk_widget_show (GtkWidget* _sender, gpoi
 }
 
 
-static void _structure_disconnect_parsing_gtk_widget_hide (GtkWidget* _sender, gpointer self) {
+static void _lambda16_ (Structure* self) {
 	structure_disconnect_parsing (self);
+	gtk_action_set_sensitive (self->priv->_action_all_menu, FALSE);
 }
 
 
-Structure* structure_construct (GType object_type, MainWindow* main_window) {
+static void __lambda16__gtk_widget_hide (GtkWidget* _sender, gpointer self) {
+	_lambda16_ (self);
+}
+
+
+Structure* structure_construct (GType object_type, MainWindow* main_window, GtkUIManager* ui_manager) {
 	Structure * self = NULL;
-	GSettings* _tmp0_ = NULL;
+	GtkWidget* _tmp0_ = NULL;
+	GtkMenu* _tmp1_;
+	GtkAction* _tmp2_ = NULL;
+	GtkAction* _tmp3_;
+	GtkAction* _tmp4_ = NULL;
+	GtkAction* _tmp5_;
+	GtkAction* _tmp6_ = NULL;
+	GtkAction* _tmp7_;
+	GtkAction* _tmp8_ = NULL;
+	GtkAction* _tmp9_;
+	GtkAction* _tmp10_ = NULL;
+	GtkAction* _tmp11_;
+	GtkAction* _tmp12_ = NULL;
+	GtkAction* _tmp13_;
+	GtkAction* _tmp14_ = NULL;
+	GtkAction* _tmp15_;
+	GtkAction* _tmp16_ = NULL;
+	GtkAction* _tmp17_;
 	g_return_val_if_fail (main_window != NULL, NULL);
+	g_return_val_if_fail (ui_manager != NULL, NULL);
 	self = (Structure*) g_object_new (object_type, "spacing", 3, NULL);
 	self->priv->_main_window = main_window;
-	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.ui");
-	_g_object_unref0 (self->priv->_settings);
-	self->priv->_settings = _tmp0_;
-	structure_init_visible_types (self);
+	_tmp0_ = gtk_ui_manager_get_widget (ui_manager, "/StructurePopup");
+	_tmp1_ = _g_object_ref0 (GTK_MENU (_tmp0_));
+	_g_object_unref0 (self->priv->_popup_menu);
+	self->priv->_popup_menu = _tmp1_;
+	_tmp2_ = gtk_ui_manager_get_action (ui_manager, "/MainMenu/Structure");
+	_tmp3_ = _g_object_ref0 (_tmp2_);
+	_g_object_unref0 (self->priv->_action_all_menu);
+	self->priv->_action_all_menu = _tmp3_;
+	_tmp4_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureCut");
+	_tmp5_ = _g_object_ref0 (_tmp4_);
+	_g_object_unref0 (self->priv->_action_cut);
+	self->priv->_action_cut = _tmp5_;
+	_tmp6_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureCopy");
+	_tmp7_ = _g_object_ref0 (_tmp6_);
+	_g_object_unref0 (self->priv->_action_copy);
+	self->priv->_action_copy = _tmp7_;
+	_tmp8_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureDelete");
+	_tmp9_ = _g_object_ref0 (_tmp8_);
+	_g_object_unref0 (self->priv->_action_delete);
+	self->priv->_action_delete = _tmp9_;
+	_tmp10_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureSelect");
+	_tmp11_ = _g_object_ref0 (_tmp10_);
+	_g_object_unref0 (self->priv->_action_select);
+	self->priv->_action_select = _tmp11_;
+	_tmp12_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureComment");
+	_tmp13_ = _g_object_ref0 (_tmp12_);
+	_g_object_unref0 (self->priv->_action_comment);
+	self->priv->_action_comment = _tmp13_;
+	_tmp14_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureShiftLeft");
+	_tmp15_ = _g_object_ref0 (_tmp14_);
+	_g_object_unref0 (self->priv->_action_shift_left);
+	self->priv->_action_shift_left = _tmp15_;
+	_tmp16_ = gtk_ui_manager_get_action (ui_manager, "/StructurePopup/StructureShiftRight");
+	_tmp17_ = _g_object_ref0 (_tmp16_);
+	_g_object_unref0 (self->priv->_action_shift_right);
+	self->priv->_action_shift_right = _tmp17_;
 	structure_init_toolbar (self);
-	structure_init_choose_min_level (self);
+	structure_init_vpaned (self);
+	structure_init_list_view (self);
 	structure_init_tree_view (self);
 	gtk_widget_show_all ((GtkWidget*) self);
+	gtk_widget_hide (self->priv->_list_view_sw);
 	g_signal_connect_object ((GtkWidget*) self, "show", (GCallback) _structure_connect_parsing_gtk_widget_show, self, 0);
-	g_signal_connect_object ((GtkWidget*) self, "hide", (GCallback) _structure_disconnect_parsing_gtk_widget_hide, self, 0);
+	g_signal_connect_object ((GtkWidget*) self, "hide", (GCallback) __lambda16__gtk_widget_hide, self, 0);
 	return self;
 }
 
 
-Structure* structure_new (MainWindow* main_window) {
-	return structure_construct (TYPE_STRUCTURE, main_window);
+Structure* structure_new (MainWindow* main_window, GtkUIManager* ui_manager) {
+	return structure_construct (TYPE_STRUCTURE, main_window, ui_manager);
 }
 
 
-static void structure_init_visible_types (Structure* self) {
-	gboolean* _tmp0_ = NULL;
-	gboolean _tmp1_;
-	gboolean _tmp2_;
-	gboolean _tmp3_;
-	gboolean _tmp4_;
-	gboolean _tmp5_;
-	gboolean _tmp6_;
-	g_return_if_fail (self != NULL);
-	_tmp0_ = g_new0 (gboolean, STRUCT_TYPE_N_TYPES);
-	self->priv->_visible_types = (g_free (self->priv->_visible_types), NULL);
-	self->priv->_visible_types = _tmp0_;
-	self->priv->_visible_types_length1 = STRUCT_TYPE_N_TYPES;
-	self->priv->__visible_types_size_ = STRUCT_TYPE_N_TYPES;
-	_tmp1_ = g_settings_get_boolean (self->priv->_settings, "structure-show-label");
-	self->priv->_visible_types[STRUCT_TYPE_LABEL] = _tmp1_;
-	_tmp2_ = g_settings_get_boolean (self->priv->_settings, "structure-show-include");
-	self->priv->_visible_types[STRUCT_TYPE_INCLUDE] = _tmp2_;
-	_tmp3_ = g_settings_get_boolean (self->priv->_settings, "structure-show-table");
-	self->priv->_visible_types[STRUCT_TYPE_TABLE] = _tmp3_;
-	_tmp4_ = g_settings_get_boolean (self->priv->_settings, "structure-show-figure");
-	self->priv->_visible_types[STRUCT_TYPE_FIGURE] = _tmp4_;
-	_tmp5_ = g_settings_get_boolean (self->priv->_settings, "structure-show-todo");
-	self->priv->_visible_types[STRUCT_TYPE_TODO] = _tmp5_;
-	_tmp6_ = g_settings_get_boolean (self->priv->_settings, "structure-show-fixme");
-	self->priv->_visible_types[STRUCT_TYPE_FIXME] = _tmp6_;
-}
-
-
-void structure_save_state (Structure* self) {
-	gint min_level;
-	g_return_if_fail (self != NULL);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-label", self->priv->_visible_types[STRUCT_TYPE_LABEL]);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-include", self->priv->_visible_types[STRUCT_TYPE_INCLUDE]);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-table", self->priv->_visible_types[STRUCT_TYPE_TABLE]);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-figure", self->priv->_visible_types[STRUCT_TYPE_FIGURE]);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-todo", self->priv->_visible_types[STRUCT_TYPE_TODO]);
-	g_settings_set_boolean (self->priv->_settings, "structure-show-fixme", self->priv->_visible_types[STRUCT_TYPE_FIXME]);
-	min_level = (gint) STRUCT_TYPE_PART;
-	{
-		gint level;
-		level = 0;
-		{
-			gboolean _tmp0_;
-			_tmp0_ = TRUE;
-			while (TRUE) {
-				if (!_tmp0_) {
-					level++;
-				}
-				_tmp0_ = FALSE;
-				if (!(level <= STRUCT_TYPE_SUBPARAGRAPH)) {
-					break;
-				}
-				if (!self->priv->_visible_types[level]) {
-					break;
-				}
-				min_level = level;
-			}
-		}
-	}
-	g_settings_set_int (self->priv->_settings, "structure-min-level", min_level);
-}
-
-
-static void _lambda5_ (Structure* self) {
+static void _lambda4_ (Structure* self) {
 	Document* _tmp0_ = NULL;
 	_tmp0_ = main_window_get_active_document (self->priv->_main_window);
-	structure_parse_document (self, _tmp0_);
+	structure_show_document (self, _tmp0_, TRUE);
 }
 
 
-static void __lambda5__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda5_ (self);
+static void __lambda4__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda4_ (self);
 }
 
 
@@ -409,113 +476,128 @@ static void structure_init_toolbar (Structure* self) {
 	GtkHBox* hbox;
 	GtkButton* _tmp1_ = NULL;
 	GtkButton* refresh_button;
-	GtkButton* _tmp2_ = NULL;
-	GtkButton* expand_button;
-	const gchar* _tmp3_ = NULL;
+	const gchar* _tmp2_ = NULL;
+	GtkSeparatorToolItem* _tmp3_ = NULL;
+	GtkSeparatorToolItem* sep;
 	GtkButton* _tmp4_ = NULL;
-	GtkButton* collapse_button;
+	GtkButton* expand_button;
 	const gchar* _tmp5_ = NULL;
-	StructType* _tmp6_ = NULL;
-	StructType* _tmp7_;
-	gint _tmp7__length1;
-	const gchar* _tmp8_ = NULL;
-	GtkToggleButton* _tmp9_ = NULL;
-	GtkToggleButton* _tmp10_;
+	GtkButton* _tmp6_ = NULL;
+	GtkButton* collapse_button;
+	const gchar* _tmp7_ = NULL;
+	GtkSeparatorToolItem* _tmp8_ = NULL;
+	StructType* _tmp9_ = NULL;
+	StructType* _tmp10_;
+	gint _tmp10__length1;
+	const gchar* _tmp11_ = NULL;
+	GtkToggleButton* _tmp12_ = NULL;
+	GtkToggleButton* _tmp13_;
 	GtkToggleButton* toggle_button;
-	StructType* _tmp11_ = NULL;
-	StructType* _tmp12_;
-	gint _tmp12__length1;
-	const gchar* _tmp13_ = NULL;
-	GtkToggleButton* _tmp14_ = NULL;
-	StructType* _tmp15_ = NULL;
-	StructType* _tmp16_;
-	gint _tmp16__length1;
-	const gchar* _tmp17_ = NULL;
-	GtkToggleButton* _tmp18_ = NULL;
-	StructType* _tmp19_ = NULL;
-	StructType* _tmp20_;
-	gint _tmp20__length1;
-	const gchar* _tmp21_ = NULL;
-	GtkToggleButton* _tmp22_ = NULL;
-	StructType* _tmp23_ = NULL;
-	StructType* _tmp24_;
-	gint _tmp24__length1;
-	const gchar* _tmp25_ = NULL;
-	GtkToggleButton* _tmp26_ = NULL;
+	StructType* _tmp14_ = NULL;
+	StructType* _tmp15_;
+	gint _tmp15__length1;
+	const gchar* _tmp16_ = NULL;
+	GtkToggleButton* _tmp17_ = NULL;
+	StructType* _tmp18_ = NULL;
+	StructType* _tmp19_;
+	gint _tmp19__length1;
+	const gchar* _tmp20_ = NULL;
+	GtkToggleButton* _tmp21_ = NULL;
+	StructType* _tmp22_ = NULL;
+	StructType* _tmp23_;
+	gint _tmp23__length1;
+	const gchar* _tmp24_ = NULL;
+	GtkToggleButton* _tmp25_ = NULL;
+	StructType* _tmp26_ = NULL;
+	StructType* _tmp27_;
+	gint _tmp27__length1;
+	const gchar* _tmp28_ = NULL;
+	GtkToggleButton* _tmp29_ = NULL;
 	g_return_if_fail (self != NULL);
-	_tmp0_ = (GtkHBox*) gtk_hbox_new (TRUE, 0);
+	_tmp0_ = (GtkHBox*) gtk_hbox_new (FALSE, 0);
 	hbox = g_object_ref_sink (_tmp0_);
 	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) hbox, FALSE, FALSE, (guint) 0);
 	_tmp1_ = utils_get_toolbar_button (GTK_STOCK_REFRESH);
 	refresh_button = _tmp1_;
+	_tmp2_ = _ ("Refresh");
+	gtk_widget_set_tooltip_text ((GtkWidget*) refresh_button, _tmp2_);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) refresh_button, TRUE, TRUE, (guint) 0);
-	g_signal_connect_object (refresh_button, "clicked", (GCallback) __lambda5__gtk_button_clicked, self, 0);
-	_tmp2_ = utils_get_toolbar_button (GTK_STOCK_ZOOM_IN);
-	expand_button = _tmp2_;
-	_tmp3_ = _ ("Expand All");
-	gtk_widget_set_tooltip_text ((GtkWidget*) expand_button, _tmp3_);
+	g_signal_connect_object (refresh_button, "clicked", (GCallback) __lambda4__gtk_button_clicked, self, 0);
+	_tmp3_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
+	sep = g_object_ref_sink (_tmp3_);
+	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) sep, FALSE, TRUE, (guint) 0);
+	_tmp4_ = utils_get_toolbar_button (GTK_STOCK_ZOOM_IN);
+	expand_button = _tmp4_;
+	_tmp5_ = _ ("Expand All");
+	gtk_widget_set_tooltip_text ((GtkWidget*) expand_button, _tmp5_);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) expand_button, TRUE, TRUE, (guint) 0);
 	g_signal_connect_object (expand_button, "clicked", (GCallback) __lambda7__gtk_button_clicked, self, 0);
-	_tmp4_ = utils_get_toolbar_button (GTK_STOCK_ZOOM_OUT);
-	collapse_button = _tmp4_;
-	_tmp5_ = _ ("Collapse All");
-	gtk_widget_set_tooltip_text ((GtkWidget*) collapse_button, _tmp5_);
+	_tmp6_ = utils_get_toolbar_button (GTK_STOCK_ZOOM_OUT);
+	collapse_button = _tmp6_;
+	_tmp7_ = _ ("Collapse All");
+	gtk_widget_set_tooltip_text ((GtkWidget*) collapse_button, _tmp7_);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) collapse_button, TRUE, TRUE, (guint) 0);
 	g_signal_connect_object (collapse_button, "clicked", (GCallback) __lambda8__gtk_button_clicked, self, 0);
-	_tmp6_ = g_new0 (StructType, 1);
-	_tmp6_[0] = STRUCT_TYPE_LABEL;
-	_tmp7_ = _tmp6_;
-	_tmp7__length1 = 1;
-	_tmp8_ = _ ("Show labels");
-	_tmp9_ = structure_create_show_hide_button (self, _tmp7_, 1, _tmp8_);
+	_tmp8_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
+	_g_object_unref0 (sep);
+	sep = g_object_ref_sink (_tmp8_);
+	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) sep, FALSE, TRUE, (guint) 0);
+	_tmp9_ = g_new0 (StructType, 1);
+	_tmp9_[0] = STRUCT_TYPE_LABEL;
 	_tmp10_ = _tmp9_;
-	_tmp7_ = (g_free (_tmp7_), NULL);
-	toggle_button = _tmp10_;
+	_tmp10__length1 = 1;
+	_tmp11_ = _ ("Show labels");
+	_tmp12_ = structure_create_simple_list_button (self, _tmp10_, 1, _tmp11_);
+	_tmp13_ = _tmp12_;
+	_tmp10_ = (g_free (_tmp10_), NULL);
+	toggle_button = _tmp13_;
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) toggle_button, TRUE, TRUE, (guint) 0);
-	_tmp11_ = g_new0 (StructType, 1);
-	_tmp11_[0] = STRUCT_TYPE_INCLUDE;
-	_tmp12_ = _tmp11_;
-	_tmp12__length1 = 1;
-	_tmp13_ = _ ("Show files included");
-	_tmp14_ = structure_create_show_hide_button (self, _tmp12_, 1, _tmp13_);
+	_tmp14_ = g_new0 (StructType, 1);
+	_tmp14_[0] = STRUCT_TYPE_INCLUDE;
+	_tmp15_ = _tmp14_;
+	_tmp15__length1 = 1;
+	_tmp16_ = _ ("Show files included");
+	_tmp17_ = structure_create_simple_list_button (self, _tmp15_, 1, _tmp16_);
 	_g_object_unref0 (toggle_button);
-	toggle_button = _tmp14_;
-	_tmp12_ = (g_free (_tmp12_), NULL);
+	toggle_button = _tmp17_;
+	_tmp15_ = (g_free (_tmp15_), NULL);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) toggle_button, TRUE, TRUE, (guint) 0);
-	_tmp15_ = g_new0 (StructType, 1);
-	_tmp15_[0] = STRUCT_TYPE_TABLE;
-	_tmp16_ = _tmp15_;
-	_tmp16__length1 = 1;
-	_tmp17_ = _ ("Show tables");
-	_tmp18_ = structure_create_show_hide_button (self, _tmp16_, 1, _tmp17_);
+	_tmp18_ = g_new0 (StructType, 1);
+	_tmp18_[0] = STRUCT_TYPE_TABLE;
+	_tmp19_ = _tmp18_;
+	_tmp19__length1 = 1;
+	_tmp20_ = _ ("Show tables");
+	_tmp21_ = structure_create_simple_list_button (self, _tmp19_, 1, _tmp20_);
 	_g_object_unref0 (toggle_button);
-	toggle_button = _tmp18_;
-	_tmp16_ = (g_free (_tmp16_), NULL);
+	toggle_button = _tmp21_;
+	_tmp19_ = (g_free (_tmp19_), NULL);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) toggle_button, TRUE, TRUE, (guint) 0);
-	_tmp19_ = g_new0 (StructType, 1);
-	_tmp19_[0] = STRUCT_TYPE_FIGURE;
-	_tmp20_ = _tmp19_;
-	_tmp20__length1 = 1;
-	_tmp21_ = _ ("Show figures");
-	_tmp22_ = structure_create_show_hide_button (self, _tmp20_, 1, _tmp21_);
+	_tmp22_ = g_new0 (StructType, 2);
+	_tmp22_[0] = STRUCT_TYPE_FIGURE;
+	_tmp22_[1] = STRUCT_TYPE_IMAGE;
+	_tmp23_ = _tmp22_;
+	_tmp23__length1 = 2;
+	_tmp24_ = _ ("Show figures and images");
+	_tmp25_ = structure_create_simple_list_button (self, _tmp23_, 2, _tmp24_);
 	_g_object_unref0 (toggle_button);
-	toggle_button = _tmp22_;
-	_tmp20_ = (g_free (_tmp20_), NULL);
+	toggle_button = _tmp25_;
+	_tmp23_ = (g_free (_tmp23_), NULL);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) toggle_button, TRUE, TRUE, (guint) 0);
-	_tmp23_ = g_new0 (StructType, 2);
-	_tmp23_[0] = STRUCT_TYPE_TODO;
-	_tmp23_[1] = STRUCT_TYPE_FIXME;
-	_tmp24_ = _tmp23_;
-	_tmp24__length1 = 2;
-	_tmp25_ = _ ("Show TODOs and FIXMEs");
-	_tmp26_ = structure_create_show_hide_button (self, _tmp24_, 2, _tmp25_);
+	_tmp26_ = g_new0 (StructType, 2);
+	_tmp26_[0] = STRUCT_TYPE_TODO;
+	_tmp26_[1] = STRUCT_TYPE_FIXME;
+	_tmp27_ = _tmp26_;
+	_tmp27__length1 = 2;
+	_tmp28_ = _ ("Show TODOs and FIXMEs");
+	_tmp29_ = structure_create_simple_list_button (self, _tmp27_, 2, _tmp28_);
 	_g_object_unref0 (toggle_button);
-	toggle_button = _tmp26_;
-	_tmp24_ = (g_free (_tmp24_), NULL);
+	toggle_button = _tmp29_;
+	_tmp27_ = (g_free (_tmp27_), NULL);
 	gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) toggle_button, TRUE, TRUE, (guint) 0);
 	_g_object_unref0 (toggle_button);
 	_g_object_unref0 (collapse_button);
 	_g_object_unref0 (expand_button);
+	_g_object_unref0 (sep);
 	_g_object_unref0 (refresh_button);
 	_g_object_unref0 (hbox);
 }
@@ -542,42 +624,90 @@ static void block13_data_unref (Block13Data* _data13_) {
 }
 
 
+static void _vala_array_add9 (GtkToggleButton*** array, int* length, int* size, GtkToggleButton* value) {
+	if ((*length) == (*size)) {
+		*size = (*size) ? (2 * (*size)) : 4;
+		*array = g_renew (GtkToggleButton*, *array, (*size) + 1);
+	}
+	(*array)[(*length)++] = value;
+	(*array)[*length] = NULL;
+}
+
+
+static gboolean _vala_struct_type_array_contains (StructType* stack, int stack_length, StructType needle) {
+	int i;
+	for (i = 0; i < stack_length; i++) {
+		if (needle == stack[i]) {
+			return TRUE;
+		}
+	}
+	return FALSE;
+}
+
+
+static StructType* _vala_array_dup4 (StructType* self, int length) {
+	return g_memdup (self, length * sizeof (StructType));
+}
+
+
 static void _lambda9_ (Block13Data* _data13_) {
 	Structure * self;
+	gboolean _tmp0_;
+	StructType* _tmp2_;
+	StructType* _tmp3_;
 	self = _data13_->self;
+	_tmp0_ = gtk_toggle_button_get_active (_data13_->button);
+	if (!_tmp0_) {
+		gboolean _tmp1_ = FALSE;
+		if (!self->priv->_list_is_hidden) {
+			_tmp1_ = _vala_struct_type_array_contains (self->priv->_current_list_types, self->priv->_current_list_types_length1, _data13_->main_type);
+		} else {
+			_tmp1_ = FALSE;
+		}
+		if (_tmp1_) {
+			self->priv->_list_is_hidden = TRUE;
+			gtk_widget_hide (self->priv->_list_view_sw);
+		}
+		return;
+	}
+	_tmp2_ = (_tmp3_ = _data13_->types, (_tmp3_ == NULL) ? ((gpointer) _tmp3_) : _vala_array_dup4 (_tmp3_, _data13_->types_length1));
+	self->priv->_current_list_types = (g_free (self->priv->_current_list_types), NULL);
+	self->priv->_current_list_types = _tmp2_;
+	self->priv->_current_list_types_length1 = _data13_->types_length1;
+	self->priv->__current_list_types_size_ = _data13_->types_length1;
+	self->priv->_list_is_hidden = FALSE;
+	gtk_widget_show_all (self->priv->_list_view_sw);
+	structure_populate_simple_list (self);
 	{
-		StructType* type_collection;
-		int type_collection_length1;
-		int type_it;
-		type_collection = _data13_->types;
-		type_collection_length1 = _data13_->types_length1;
-		for (type_it = 0; type_it < _data13_->types_length1; type_it = type_it + 1) {
-			StructType type;
-			type = type_collection[type_it];
+		GtkToggleButton** simple_list_button_collection;
+		int simple_list_button_collection_length1;
+		int simple_list_button_it;
+		simple_list_button_collection = self->priv->_simple_list_buttons;
+		simple_list_button_collection_length1 = self->priv->_simple_list_buttons_length1;
+		for (simple_list_button_it = 0; simple_list_button_it < self->priv->_simple_list_buttons_length1; simple_list_button_it = simple_list_button_it + 1) {
+			GtkToggleButton* _tmp4_;
+			GtkToggleButton* simple_list_button;
+			_tmp4_ = _g_object_ref0 (simple_list_button_collection[simple_list_button_it]);
+			simple_list_button = _tmp4_;
 			{
-				gboolean _tmp0_;
-				_tmp0_ = gtk_toggle_button_get_active (_data13_->button);
-				self->priv->_visible_types[type] = _tmp0_;
+				if (simple_list_button == _data13_->button) {
+					_g_object_unref0 (simple_list_button);
+					continue;
+				}
+				gtk_toggle_button_set_active (simple_list_button, FALSE);
+				_g_object_unref0 (simple_list_button);
 			}
 		}
 	}
-	if (self->priv->_tree_filter != NULL) {
-		gtk_tree_model_filter_refilter (self->priv->_tree_filter);
-	}
 }
 
 
-static void __lambda9__gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
+static void __lambda9__gtk_button_clicked (GtkButton* _sender, gpointer self) {
 	_lambda9_ (self);
 }
 
 
-static gpointer _g_object_ref0 (gpointer self) {
-	return self ? g_object_ref (self) : NULL;
-}
-
-
-static GtkToggleButton* structure_create_show_hide_button (Structure* self, StructType* types, int types_length1, const gchar* tooltip) {
+static GtkToggleButton* structure_create_simple_list_button (Structure* self, StructType* types, int types_length1, const gchar* tooltip) {
 	GtkToggleButton* result = NULL;
 	Block13Data* _data13_;
 	StructType* _tmp0_;
@@ -586,6 +716,7 @@ static GtkToggleButton* structure_create_show_hide_button (Structure* self, Stru
 	GtkToggleButton* _tmp3_ = NULL;
 	GtkToggleButton* _tmp4_;
 	GtkToggleButton* _tmp5_;
+	GtkToggleButton* _tmp6_;
 	g_return_val_if_fail (self != NULL, NULL);
 	g_return_val_if_fail (tooltip != NULL, NULL);
 	_data13_ = g_slice_new0 (Block13Data);
@@ -594,250 +725,372 @@ static GtkToggleButton* structure_create_show_hide_button (Structure* self, Stru
 	_data13_->types = (_tmp0_ = types, (_tmp0_ == NULL) ? ((gpointer) _tmp0_) : _vala_array_dup3 (_tmp0_, types_length1));
 	_data13_->types_length1 = types_length1;
 	g_return_val_if_fail (_data13_->types_length1 > 0, NULL);
-	_tmp1_ = structure_get_icon_from_type (_data13_->types[0]);
+	_data13_->main_type = _data13_->types[0];
+	_tmp1_ = structure_get_icon_from_type (_data13_->main_type);
 	_tmp2_ = _tmp1_;
 	_tmp3_ = utils_get_toolbar_toggle_button (_tmp2_);
 	_tmp4_ = _tmp3_;
 	_g_free0 (_tmp2_);
 	_data13_->button = _tmp4_;
 	gtk_widget_set_tooltip_text ((GtkWidget*) _data13_->button, tooltip);
-	gtk_toggle_button_set_active (_data13_->button, self->priv->_visible_types[_data13_->types[0]]);
-	g_signal_connect_data (_data13_->button, "toggled", (GCallback) __lambda9__gtk_toggle_button_toggled, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
 	_tmp5_ = _g_object_ref0 (_data13_->button);
-	result = _tmp5_;
+	_vala_array_add9 (&self->priv->_simple_list_buttons, &self->priv->_simple_list_buttons_length1, &self->priv->__simple_list_buttons_size_, _tmp5_);
+	g_signal_connect_data ((GtkButton*) _data13_->button, "clicked", (GCallback) __lambda9__gtk_button_clicked, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
+	_tmp6_ = _g_object_ref0 (_data13_->button);
+	result = _tmp6_;
 	block13_data_unref (_data13_);
 	_data13_ = NULL;
 	return result;
 }
 
 
-static gboolean _lambda11_ (GtkTreeModel* model, GtkTreeIter* iter, Structure* self) {
+static void _gtk_tree_path_free0_ (gpointer var) {
+	(var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
+}
+
+
+static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
+	g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
+	g_list_free (self);
+}
+
+
+static gpointer _gtk_tree_path_copy0 (gpointer self) {
+	return self ? gtk_tree_path_copy (self) : NULL;
+}
+
+
+static void structure_populate_simple_list (Structure* self) {
+	gboolean _tmp0_ = FALSE;
+	GtkTreeSelection* _tmp1_ = NULL;
+	GtkTreeSelection* _tmp2_;
+	GtkTreeSelection* tree_select;
+	GList* _tmp3_ = NULL;
+	GList* selected_rows;
+	guint _tmp4_;
+	gconstpointer _tmp5_ = NULL;
+	GtkTreePath* _tmp6_;
+	GtkTreePath* tree_path;
+	GtkTreeIter tree_iter = {0};
+	GtkTreeIter _tmp7_ = {0};
+	gboolean _tmp8_;
+	g_return_if_fail (self != NULL);
+	gtk_list_store_clear (self->priv->_list_store);
+	if (self->priv->_model == NULL) {
+		_tmp0_ = TRUE;
+	} else {
+		_tmp0_ = self->priv->_list_is_hidden;
+	}
+	if (_tmp0_) {
+		return;
+	}
+	structure_model_populate_list (self->priv->_model, self->priv->_list_store, self->priv->_current_list_types[0]);
+	_tmp1_ = gtk_tree_view_get_selection (self->priv->_tree_view);
+	_tmp2_ = _g_object_ref0 (_tmp1_);
+	tree_select = _tmp2_;
+	_tmp3_ = gtk_tree_selection_get_selected_rows (tree_select, NULL);
+	selected_rows = _tmp3_;
+	_tmp4_ = g_list_length (selected_rows);
+	if (_tmp4_ != 1) {
+		__g_list_free__gtk_tree_path_free0_0 (selected_rows);
+		_g_object_unref0 (tree_select);
+		return;
+	}
+	_tmp5_ = g_list_nth_data (selected_rows, (guint) 0);
+	_tmp6_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp5_);
+	tree_path = _tmp6_;
+	_tmp8_ = gtk_tree_model_get_iter ((GtkTreeModel*) self->priv->_model, &_tmp7_, tree_path);
+	tree_iter = _tmp7_;
+	if (!_tmp8_) {
+		g_return_if_reached ();
+	}
+	structure_select_simple_list_item (self, &tree_iter);
+	_gtk_tree_path_free0 (tree_path);
+	__g_list_free__gtk_tree_path_free0_0 (selected_rows);
+	_g_object_unref0 (tree_select);
+}
+
+
+static void structure_init_vpaned (Structure* self) {
+	GtkVPaned* _tmp0_ = NULL;
+	GSettings* _tmp1_ = NULL;
+	GSettings* settings;
+	gint _tmp2_;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = (GtkVPaned*) gtk_vpaned_new ();
+	_g_object_unref0 (self->priv->_vpaned);
+	self->priv->_vpaned = g_object_ref_sink (_tmp0_);
+	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) self->priv->_vpaned, TRUE, TRUE, (guint) 0);
+	_tmp1_ = g_settings_new ("org.gnome.latexila.state.window");
+	settings = _tmp1_;
+	_tmp2_ = g_settings_get_int (settings, "structure-paned-position");
+	gtk_paned_set_position ((GtkPaned*) self->priv->_vpaned, _tmp2_);
+	_g_object_unref0 (settings);
+}
+
+
+void structure_save_state (Structure* self) {
+	GSettings* _tmp0_ = NULL;
+	GSettings* settings;
+	gint _tmp1_;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = g_settings_new ("org.gnome.latexila.state.window");
+	settings = _tmp0_;
+	_tmp1_ = gtk_paned_get_position ((GtkPaned*) self->priv->_vpaned);
+	g_settings_set_int (settings, "structure-paned-position", _tmp1_);
+	_g_object_unref0 (settings);
+}
+
+
+static gboolean _lambda10_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, Structure* self) {
 	gboolean result = FALSE;
-	StructType type = 0;
+	gboolean _tmp0_;
+	g_return_val_if_fail (select != NULL, FALSE);
 	g_return_val_if_fail (model != NULL, FALSE);
-	gtk_tree_model_get (model, iter, STRUCT_ITEM_TYPE, &type, -1, -1);
-	result = self->priv->_visible_types[type];
+	g_return_val_if_fail (path != NULL, FALSE);
+	if (path_currently_selected) {
+		result = TRUE;
+		return result;
+	}
+	_tmp0_ = structure_select_list_row (self, path);
+	result = _tmp0_;
 	return result;
 }
 
 
-static gboolean __lambda11__gtk_tree_model_filter_visible_func (GtkTreeModel* model, GtkTreeIter* iter, gpointer self) {
+static gboolean __lambda10__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
 	gboolean result;
-	result = _lambda11_ (model, iter, self);
+	result = _lambda10_ (selection, model, path, path_currently_selected, self);
 	return result;
 }
 
 
-static gboolean _structure_on_row_selection_gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
-	gboolean result;
-	result = structure_on_row_selection (self, selection, model, path, path_currently_selected);
-	return result;
+static void _lambda11_ (GtkTreePath* path, Structure* self) {
+	g_return_if_fail (path != NULL);
+	structure_select_list_row (self, path);
 }
 
 
-static void structure_init_tree_view (Structure* self) {
-	GtkTreeStore* _tmp0_ = NULL;
-	GtkTreeModelFilter* _tmp1_ = NULL;
-	GtkTreeView* _tmp2_ = NULL;
-	GtkTreeViewColumn* _tmp3_ = NULL;
-	GtkTreeViewColumn* column;
-	GtkCellRendererPixbuf* _tmp4_ = NULL;
-	GtkCellRendererPixbuf* pixbuf_renderer;
-	GtkCellRendererText* _tmp5_ = NULL;
-	GtkCellRendererText* text_renderer;
-	GtkTreeSelection* _tmp6_ = NULL;
-	GtkTreeSelection* _tmp7_;
-	GtkTreeSelection* select;
-	GtkWidget* _tmp8_ = NULL;
-	GtkWidget* sw;
-	g_return_if_fail (self != NULL);
-	_tmp0_ = gtk_tree_store_new ((gint) STRUCT_ITEM_N_COLUMNS, G_TYPE_STRING, TYPE_STRUCT_TYPE, G_TYPE_STRING, G_TYPE_STRING, GTK_TYPE_TEXT_MARK);
-	_g_object_unref0 (self->priv->_tree_store);
-	self->priv->_tree_store = _tmp0_;
-	_tmp1_ = (GtkTreeModelFilter*) gtk_tree_model_filter_new ((GtkTreeModel*) self->priv->_tree_store, NULL);
-	_g_object_unref0 (self->priv->_tree_filter);
-	self->priv->_tree_filter = _tmp1_;
-	gtk_tree_model_filter_set_visible_func (self->priv->_tree_filter, __lambda11__gtk_tree_model_filter_visible_func, g_object_ref (self), g_object_unref);
-	_tmp2_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) self->priv->_tree_filter);
-	_g_object_unref0 (self->priv->_tree_view);
-	self->priv->_tree_view = g_object_ref_sink (_tmp2_);
-	gtk_tree_view_set_headers_visible (self->priv->_tree_view, FALSE);
-	_tmp3_ = gtk_tree_view_column_new ();
-	column = g_object_ref_sink (_tmp3_);
-	gtk_tree_view_append_column (self->priv->_tree_view, column);
-	_tmp4_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
-	pixbuf_renderer = g_object_ref_sink (_tmp4_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
-	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", STRUCT_ITEM_PIXBUF, NULL, NULL);
-	_tmp5_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
-	text_renderer = g_object_ref_sink (_tmp5_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
-	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", STRUCT_ITEM_TEXT, NULL, NULL);
-	gtk_tree_view_set_tooltip_column (self->priv->_tree_view, (gint) STRUCT_ITEM_TOOLTIP);
-	_tmp6_ = gtk_tree_view_get_selection (self->priv->_tree_view);
-	_tmp7_ = _g_object_ref0 (_tmp6_);
-	select = _tmp7_;
-	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
-	gtk_tree_selection_set_select_function (select, _structure_on_row_selection_gtk_tree_selection_func, g_object_ref (self), g_object_unref);
-	_tmp8_ = utils_add_scrollbar ((GtkWidget*) self->priv->_tree_view);
-	sw = _tmp8_;
-	gtk_box_pack_start ((GtkBox*) self, sw, TRUE, TRUE, (guint) 0);
-	_g_object_unref0 (sw);
-	_g_object_unref0 (select);
-	_g_object_unref0 (text_renderer);
-	_g_object_unref0 (pixbuf_renderer);
-	_g_object_unref0 (column);
+static void __lambda11__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+	_lambda11_ (path, self);
 }
 
 
-static Block14Data* block14_data_ref (Block14Data* _data14_) {
-	g_atomic_int_inc (&_data14_->_ref_count_);
-	return _data14_;
+static void structure_init_list_view (Structure* self) {
+	GtkTreeView* _tmp0_ = NULL;
+	GtkListStore* _tmp1_ = NULL;
+	GtkTreeSelection* _tmp2_ = NULL;
+	GtkTreeSelection* _tmp3_;
+	GtkTreeSelection* list_select;
+	GtkWidget* _tmp4_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = structure_get_new_tree_view (self, (gint) STRUCT_LIST_COLUMN_PIXBUF, (gint) STRUCT_LIST_COLUMN_TEXT, (gint) STRUCT_LIST_COLUMN_TOOLTIP);
+	_g_object_unref0 (self->priv->_list_view);
+	self->priv->_list_view = _tmp0_;
+	_tmp1_ = gtk_list_store_new ((gint) STRUCT_LIST_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+	_g_object_unref0 (self->priv->_list_store);
+	self->priv->_list_store = _tmp1_;
+	gtk_tree_view_set_model (self->priv->_list_view, (GtkTreeModel*) self->priv->_list_store);
+	_tmp2_ = gtk_tree_view_get_selection (self->priv->_list_view);
+	_tmp3_ = _g_object_ref0 (_tmp2_);
+	list_select = _tmp3_;
+	gtk_tree_selection_set_select_function (list_select, __lambda10__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
+	g_signal_connect_object (self->priv->_list_view, "row-activated", (GCallback) __lambda11__gtk_tree_view_row_activated, self, 0);
+	_tmp4_ = utils_add_scrollbar ((GtkWidget*) self->priv->_list_view);
+	_g_object_unref0 (self->priv->_list_view_sw);
+	self->priv->_list_view_sw = _tmp4_;
+	gtk_paned_add1 ((GtkPaned*) self->priv->_vpaned, self->priv->_list_view_sw);
+	_g_object_unref0 (list_select);
 }
 
 
-static void block14_data_unref (Block14Data* _data14_) {
-	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
-		_g_object_unref0 (_data14_->self);
-		_g_object_unref0 (_data14_->combo_box);
-		_g_object_unref0 (_data14_->list_store);
-		g_slice_free (Block14Data, _data14_);
+static gboolean _lambda12_ (GtkTreeSelection* select, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, Structure* self) {
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	g_return_val_if_fail (select != NULL, FALSE);
+	g_return_val_if_fail (model != NULL, FALSE);
+	g_return_val_if_fail (path != NULL, FALSE);
+	if (path_currently_selected) {
+		result = TRUE;
+		return result;
 	}
+	_tmp0_ = structure_select_tree_row (self, path);
+	result = _tmp0_;
+	return result;
 }
 
 
-static void _lambda10_ (Block14Data* _data14_) {
-	Structure * self;
-	GtkTreeIter iter = {0};
-	GtkTreeIter _tmp0_ = {0};
-	gboolean _tmp1_;
-	StructType selected_type = 0;
-	GtkTreeModel* _tmp2_;
-	GtkTreeModel* model;
-	self = _data14_->self;
-	_tmp1_ = gtk_combo_box_get_active_iter (_data14_->combo_box, &_tmp0_);
-	iter = _tmp0_;
-	if (!_tmp1_) {
-		return;
-	}
-	_tmp2_ = _g_object_ref0 (GTK_TREE_MODEL (_data14_->list_store));
-	model = _tmp2_;
-	gtk_tree_model_get (model, &iter, STRUCTURE_MIN_LEVEL_COLUMN_TYPE, &selected_type, -1, -1);
-	{
-		gint type;
-		type = 0;
-		{
-			gboolean _tmp3_;
-			_tmp3_ = TRUE;
-			while (TRUE) {
-				if (!_tmp3_) {
-					type++;
-				}
-				_tmp3_ = FALSE;
-				if (!(type <= STRUCT_TYPE_SUBPARAGRAPH)) {
-					break;
-				}
-				self->priv->_visible_types[type] = type <= selected_type;
-			}
-		}
-	}
-	if (self->priv->_tree_filter != NULL) {
-		gtk_tree_model_filter_refilter (self->priv->_tree_filter);
+static gboolean __lambda12__gtk_tree_selection_func (GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected, gpointer self) {
+	gboolean result;
+	result = _lambda12_ (selection, model, path, path_currently_selected, self);
+	return result;
+}
+
+
+static void _lambda13_ (GtkTreePath* path, Structure* self) {
+	g_return_if_fail (path != NULL);
+	structure_select_tree_row (self, path);
+}
+
+
+static void __lambda13__gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+	_lambda13_ (path, self);
+}
+
+
+static gboolean _lambda14_ (GdkEventButton* event, Structure* self) {
+	gboolean result = FALSE;
+	gboolean _tmp0_ = FALSE;
+	if ((*event).button == 3) {
+		_tmp0_ = (*event).type == GDK_BUTTON_PRESS;
+	} else {
+		_tmp0_ = FALSE;
 	}
-	if (self->priv->_tree_view != NULL) {
-		gtk_tree_view_expand_all (self->priv->_tree_view);
+	if (_tmp0_) {
+		structure_show_popup_menu (self, event);
 	}
-	_g_object_unref0 (model);
+	result = FALSE;
+	return result;
 }
 
 
-static void __lambda10__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
-	_lambda10_ (self);
+static gboolean __lambda14__gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
+	gboolean result;
+	result = _lambda14_ (event, self);
+	return result;
 }
 
 
-static void structure_init_choose_min_level (Structure* self) {
-	Block14Data* _data14_;
-	GtkListStore* _tmp0_ = NULL;
-	GtkComboBox* _tmp1_ = NULL;
-	const gchar* _tmp2_ = NULL;
-	GtkCellRendererPixbuf* _tmp3_ = NULL;
+static gboolean _lambda15_ (Structure* self) {
+	gboolean result = FALSE;
+	structure_show_popup_menu (self, NULL);
+	result = TRUE;
+	return result;
+}
+
+
+static gboolean __lambda15__gtk_widget_popup_menu (GtkWidget* _sender, gpointer self) {
+	gboolean result;
+	result = _lambda15_ (self);
+	return result;
+}
+
+
+static void structure_init_tree_view (Structure* self) {
+	GtkTreeView* _tmp0_ = NULL;
+	GtkTreeSelection* _tmp1_ = NULL;
+	GtkTreeSelection* _tmp2_;
+	GtkTreeSelection* tree_select;
+	GtkWidget* _tmp3_ = NULL;
+	GtkWidget* sw;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = structure_get_new_tree_view (self, (gint) STRUCT_COLUMN_PIXBUF, (gint) STRUCT_COLUMN_TEXT, (gint) STRUCT_COLUMN_TOOLTIP);
+	_g_object_unref0 (self->priv->_tree_view);
+	self->priv->_tree_view = _tmp0_;
+	gtk_tree_view_set_enable_tree_lines (self->priv->_tree_view, TRUE);
+	_tmp1_ = gtk_tree_view_get_selection (self->priv->_tree_view);
+	_tmp2_ = _g_object_ref0 (_tmp1_);
+	tree_select = _tmp2_;
+	gtk_tree_selection_set_select_function (tree_select, __lambda12__gtk_tree_selection_func, g_object_ref (self), g_object_unref);
+	g_signal_connect_object (self->priv->_tree_view, "row-activated", (GCallback) __lambda13__gtk_tree_view_row_activated, self, 0);
+	gtk_menu_attach_to_widget (self->priv->_popup_menu, (GtkWidget*) self->priv->_tree_view, NULL);
+	g_signal_connect_object ((GtkWidget*) self->priv->_tree_view, "button-press-event", (GCallback) __lambda14__gtk_widget_button_press_event, self, 0);
+	g_signal_connect_object ((GtkWidget*) self->priv->_tree_view, "popup-menu", (GCallback) __lambda15__gtk_widget_popup_menu, self, 0);
+	_tmp3_ = utils_add_scrollbar ((GtkWidget*) self->priv->_tree_view);
+	sw = _tmp3_;
+	gtk_paned_add2 ((GtkPaned*) self->priv->_vpaned, sw);
+	_g_object_unref0 (sw);
+	_g_object_unref0 (tree_select);
+}
+
+
+static GtkTreeView* structure_get_new_tree_view (Structure* self, gint pixbuf_col, gint text_col, gint tooltip_col) {
+	GtkTreeView* result = NULL;
+	GtkTreeView* _tmp0_ = NULL;
+	GtkTreeView* tree_view;
+	GtkTreeViewColumn* _tmp1_ = NULL;
+	GtkTreeViewColumn* column;
+	GtkCellRendererPixbuf* _tmp2_ = NULL;
 	GtkCellRendererPixbuf* pixbuf_renderer;
-	GtkCellRendererText* _tmp4_ = NULL;
+	GtkCellRendererText* _tmp3_ = NULL;
 	GtkCellRendererText* text_renderer;
-	gint _tmp11_;
-	gint min_level;
-	gint _tmp12_;
-	g_return_if_fail (self != NULL);
-	_data14_ = g_slice_new0 (Block14Data);
-	_data14_->_ref_count_ = 1;
-	_data14_->self = g_object_ref (self);
-	_tmp0_ = gtk_list_store_new ((gint) STRUCTURE_MIN_LEVEL_COLUMN_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, TYPE_STRUCT_TYPE);
-	_data14_->list_store = _tmp0_;
-	_tmp1_ = (GtkComboBox*) gtk_combo_box_new_with_model ((GtkTreeModel*) _data14_->list_store);
-	_data14_->combo_box = g_object_ref_sink (_tmp1_);
-	_tmp2_ = _ ("Minimum level");
-	gtk_widget_set_tooltip_text ((GtkWidget*) _data14_->combo_box, _tmp2_);
-	_tmp3_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
-	pixbuf_renderer = g_object_ref_sink (_tmp3_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) _data14_->combo_box, (GtkCellRenderer*) pixbuf_renderer, FALSE);
-	gtk_cell_layout_set_attributes ((GtkCellLayout*) _data14_->combo_box, (GtkCellRenderer*) pixbuf_renderer, "stock-id", STRUCTURE_MIN_LEVEL_COLUMN_PIXBUF, NULL, NULL);
-	_tmp4_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
-	text_renderer = g_object_ref_sink (_tmp4_);
-	gtk_cell_layout_pack_start ((GtkCellLayout*) _data14_->combo_box, (GtkCellRenderer*) text_renderer, TRUE);
-	gtk_cell_layout_set_attributes ((GtkCellLayout*) _data14_->combo_box, (GtkCellRenderer*) text_renderer, "text", STRUCTURE_MIN_LEVEL_COLUMN_NAME, NULL, NULL);
-	{
-		gint type;
-		type = (gint) STRUCT_TYPE_PART;
-		{
-			gboolean _tmp5_;
-			_tmp5_ = TRUE;
-			while (TRUE) {
-				GtkTreeIter iter = {0};
-				GtkTreeIter _tmp6_ = {0};
-				gchar* _tmp7_ = NULL;
-				gchar* _tmp8_;
-				gchar* _tmp9_ = NULL;
-				gchar* _tmp10_;
-				if (!_tmp5_) {
-					type++;
-				}
-				_tmp5_ = FALSE;
-				if (!(type <= STRUCT_TYPE_SUBPARAGRAPH)) {
-					break;
-				}
-				gtk_list_store_append (_data14_->list_store, &_tmp6_);
-				iter = _tmp6_;
-				_tmp7_ = structure_get_icon_from_type ((StructType) type);
-				_tmp8_ = _tmp7_;
-				_tmp9_ = structure_get_type_name ((StructType) type);
-				_tmp10_ = _tmp9_;
-				gtk_list_store_set (_data14_->list_store, &iter, STRUCTURE_MIN_LEVEL_COLUMN_PIXBUF, _tmp8_, STRUCTURE_MIN_LEVEL_COLUMN_NAME, _tmp10_, STRUCTURE_MIN_LEVEL_COLUMN_TYPE, type, -1, -1);
-				_g_free0 (_tmp10_);
-				_g_free0 (_tmp8_);
-			}
-		}
-	}
-	g_signal_connect_data (_data14_->combo_box, "changed", (GCallback) __lambda10__gtk_combo_box_changed, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
-	_tmp11_ = g_settings_get_int (self->priv->_settings, "structure-min-level");
-	min_level = _tmp11_;
-	_tmp12_ = CLAMP (min_level, (gint) STRUCT_TYPE_PART, (gint) STRUCT_TYPE_SUBPARAGRAPH);
-	min_level = _tmp12_;
-	gtk_combo_box_set_active (_data14_->combo_box, min_level);
-	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _data14_->combo_box, FALSE, FALSE, (guint) 0);
+	GtkTreeSelection* _tmp4_ = NULL;
+	GtkTreeSelection* _tmp5_;
+	GtkTreeSelection* select;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = (GtkTreeView*) gtk_tree_view_new ();
+	tree_view = g_object_ref_sink (_tmp0_);
+	gtk_tree_view_set_headers_visible (tree_view, FALSE);
+	_tmp1_ = gtk_tree_view_column_new ();
+	column = g_object_ref_sink (_tmp1_);
+	gtk_tree_view_append_column (tree_view, column);
+	_tmp2_ = (GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ();
+	pixbuf_renderer = g_object_ref_sink (_tmp2_);
+	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) pixbuf_renderer, FALSE);
+	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) pixbuf_renderer, "stock-id", pixbuf_col, NULL, NULL);
+	_tmp3_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
+	text_renderer = g_object_ref_sink (_tmp3_);
+	gtk_cell_layout_pack_start ((GtkCellLayout*) column, (GtkCellRenderer*) text_renderer, TRUE);
+	gtk_tree_view_column_set_attributes (column, (GtkCellRenderer*) text_renderer, "text", text_col, NULL, NULL);
+	gtk_tree_view_set_tooltip_column (tree_view, tooltip_col);
+	_tmp4_ = gtk_tree_view_get_selection (tree_view);
+	_tmp5_ = _g_object_ref0 (_tmp4_);
+	select = _tmp5_;
+	gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
+	result = tree_view;
+	_g_object_unref0 (select);
 	_g_object_unref0 (text_renderer);
 	_g_object_unref0 (pixbuf_renderer);
-	block14_data_unref (_data14_);
-	_data14_ = NULL;
+	_g_object_unref0 (column);
+	return result;
 }
 
 
-static gboolean structure_on_row_selection (Structure* self, GtkTreeSelection* selection, GtkTreeModel* model, GtkTreePath* path, gboolean path_currently_selected) {
+static gboolean structure_select_list_row (Structure* self, GtkTreePath* list_path) {
 	gboolean result = FALSE;
+	GtkTreeSelection* _tmp0_ = NULL;
+	GtkTreeSelection* _tmp1_;
+	GtkTreeSelection* tree_select;
+	gint* _tmp2_ = NULL;
+	gint row_num;
+	GtkTreePath* _tmp3_ = NULL;
+	GtkTreePath* tree_path;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (list_path != NULL, FALSE);
+	if (!self->priv->_first_select) {
+		self->priv->_first_select = TRUE;
+		result = TRUE;
+		return result;
+	}
+	g_return_val_if_fail (self->priv->_model != NULL, FALSE);
+	_tmp0_ = gtk_tree_view_get_selection (self->priv->_tree_view);
+	_tmp1_ = _g_object_ref0 (_tmp0_);
+	tree_select = _tmp1_;
+	gtk_tree_selection_unselect_all (tree_select);
+	_tmp2_ = gtk_tree_path_get_indices (list_path);
+	row_num = _tmp2_[0];
+	_tmp3_ = structure_model_get_tree_path_from_list_num (self->priv->_model, self->priv->_current_list_types[0], row_num);
+	tree_path = _tmp3_;
+	g_return_val_if_fail (tree_path != NULL, FALSE);
+	gtk_tree_view_expand_to_path (self->priv->_tree_view, tree_path);
+	self->priv->_first_select = FALSE;
+	gtk_tree_selection_select_path (tree_select, tree_path);
+	gtk_tree_view_scroll_to_cell (self->priv->_tree_view, tree_path, NULL, TRUE, (gfloat) 0.5, (gfloat) 0);
+	result = TRUE;
+	_gtk_tree_path_free0 (tree_path);
+	_g_object_unref0 (tree_select);
+	return result;
+}
+
+
+static gboolean structure_select_tree_row (Structure* self, GtkTreePath* tree_path) {
+	gboolean result = FALSE;
+	gboolean first_select;
 	GtkTreeIter tree_iter = {0};
 	GtkTreeIter _tmp0_ = {0};
 	gboolean _tmp1_;
 	GtkTextMark* mark = NULL;
+	StructType type = 0;
 	GtkTextBuffer* _tmp2_ = NULL;
 	GtkTextBuffer* _tmp3_;
 	GtkTextBuffer* doc;
@@ -845,17 +1098,17 @@ static gboolean structure_on_row_selection (Structure* self, GtkTreeSelection* s
 	GtkTextIter text_iter = {0};
 	GtkTextIter _tmp5_ = {0};
 	DocumentView* _tmp6_ = NULL;
+	GtkTextMark* _tmp7_ = NULL;
 	g_return_val_if_fail (self != NULL, FALSE);
-	g_return_val_if_fail (selection != NULL, FALSE);
-	g_return_val_if_fail (model != NULL, FALSE);
-	g_return_val_if_fail (path != NULL, FALSE);
-	_tmp1_ = gtk_tree_model_get_iter (model, &_tmp0_, path);
+	g_return_val_if_fail (tree_path != NULL, FALSE);
+	first_select = self->priv->_first_select;
+	self->priv->_first_select = TRUE;
+	_tmp1_ = gtk_tree_model_get_iter ((GtkTreeModel*) self->priv->_model, &_tmp0_, tree_path);
 	tree_iter = _tmp0_;
 	if (!_tmp1_) {
-		result = FALSE;
-		return result;
+		g_return_val_if_reached (FALSE);
 	}
-	gtk_tree_model_get (model, &tree_iter, STRUCT_ITEM_MARK, &mark, -1, -1);
+	gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, &tree_iter, STRUCT_COLUMN_START_MARK, &mark, STRUCT_COLUMN_TYPE, &type, -1, -1);
 	_tmp2_ = gtk_text_mark_get_buffer (mark);
 	_tmp3_ = _g_object_ref0 (_tmp2_);
 	doc = _tmp3_;
@@ -865,7 +1118,16 @@ static gboolean structure_on_row_selection (Structure* self, GtkTreeSelection* s
 	text_iter = _tmp5_;
 	gtk_text_buffer_place_cursor (doc, &text_iter);
 	_tmp6_ = main_window_get_active_view (self->priv->_main_window);
-	document_view_scroll_to_cursor (_tmp6_, 0.25);
+	_tmp7_ = gtk_text_buffer_get_insert (doc);
+	gtk_text_view_scroll_to_mark ((GtkTextView*) _tmp6_, _tmp7_, (gdouble) 0, TRUE, (gdouble) 1, (gdouble) 0);
+	structure_set_actions_sensitivity (self, type);
+	if (!first_select) {
+		result = TRUE;
+		_g_object_unref0 (doc);
+		_g_object_unref0 (mark);
+		return result;
+	}
+	structure_select_simple_list_item (self, &tree_iter);
 	result = TRUE;
 	_g_object_unref0 (doc);
 	_g_object_unref0 (mark);
@@ -873,331 +1135,535 @@ static gboolean structure_on_row_selection (Structure* self, GtkTreeSelection* s
 }
 
 
-static void structure_parse_document (Structure* self, Document* doc) {
-	DocumentStructure* _tmp0_ = NULL;
-	DocumentStructure* doc_struct;
+static void structure_select_simple_list_item (Structure* self, GtkTreeIter* tree_iter) {
+	GtkTreeSelection* _tmp0_ = NULL;
+	GtkTreeSelection* _tmp1_;
+	GtkTreeSelection* list_select;
+	StructType type = 0;
+	gint _tmp2_;
+	gint row_num;
+	GtkTreePath* _tmp3_ = NULL;
+	GtkTreePath* list_path;
 	g_return_if_fail (self != NULL);
-	structure_clear (self);
-	if (doc == NULL) {
+	if (self->priv->_list_is_hidden) {
 		return;
 	}
-	_tmp0_ = document_get_structure (doc);
-	doc_struct = _tmp0_;
-	document_structure_parse (doc_struct);
-	structure_populate (self, doc_struct);
-	_g_object_unref0 (doc_struct);
+	_tmp0_ = gtk_tree_view_get_selection (self->priv->_list_view);
+	_tmp1_ = _g_object_ref0 (_tmp0_);
+	list_select = _tmp1_;
+	gtk_tree_selection_unselect_all (list_select);
+	gtk_tree_model_get ((GtkTreeModel*) self->priv->_model, tree_iter, STRUCT_COLUMN_TYPE, &type, -1, -1);
+	if (!_vala_struct_type_array_contains (self->priv->_current_list_types, self->priv->_current_list_types_length1, type)) {
+		_g_object_unref0 (list_select);
+		return;
+	}
+	_tmp2_ = structure_model_get_list_num_from_tree_iter (self->priv->_model, tree_iter);
+	row_num = _tmp2_;
+	if (row_num == (-1)) {
+		_g_object_unref0 (list_select);
+		return;
+	}
+	_tmp3_ = gtk_tree_path_new_from_indices (row_num, -1, -1);
+	list_path = _tmp3_;
+	self->priv->_first_select = FALSE;
+	gtk_tree_selection_select_path (list_select, list_path);
+	gtk_tree_view_scroll_to_cell (self->priv->_list_view, list_path, NULL, FALSE, (gfloat) 0, (gfloat) 0);
+	_gtk_tree_path_free0 (list_path);
+	_g_object_unref0 (list_select);
 }
 
 
-static void structure_populate_active_document (Structure* self) {
+static void structure_show_active_document (Structure* self) {
 	Document* _tmp0_ = NULL;
-	Document* _tmp1_;
-	Document* doc;
-	DocumentStructure* _tmp2_ = NULL;
-	DocumentStructure* _tmp3_;
 	g_return_if_fail (self != NULL);
-	structure_clear (self);
 	_tmp0_ = main_window_get_active_document (self->priv->_main_window);
-	_tmp1_ = _g_object_ref0 (_tmp0_);
-	doc = _tmp1_;
+	structure_show_document (self, _tmp0_, FALSE);
+}
+
+
+static void _lambda6_ (Structure* self) {
+	gboolean _tmp0_;
+	_tmp0_ = document_structure_get_parsing_done (self->priv->_document_structure);
+	if (_tmp0_) {
+		StructureModel* _tmp1_ = NULL;
+		StructureModel* _tmp2_;
+		_tmp1_ = document_structure_get_model (self->priv->_document_structure);
+		_tmp2_ = _tmp1_;
+		structure_set_model (self, _tmp2_);
+		_g_object_unref0 (_tmp2_);
+	}
+}
+
+
+static void __lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	_lambda6_ (self);
+}
+
+
+static void structure_show_document (Structure* self, Document* doc, gboolean force_parse) {
+	DocumentStructure* _tmp0_ = NULL;
+	gboolean _tmp1_;
+	g_return_if_fail (self != NULL);
+	structure_set_model (self, NULL);
+	gtk_tree_view_columns_autosize (self->priv->_tree_view);
 	if (doc == NULL) {
-		_g_object_unref0 (doc);
 		return;
 	}
-	_tmp2_ = document_get_structure (doc);
-	_tmp3_ = _tmp2_;
-	structure_populate (self, _tmp3_);
-	_g_object_unref0 (_tmp3_);
-	_g_object_unref0 (doc);
+	_tmp0_ = document_get_structure (doc);
+	_g_object_unref0 (self->priv->_document_structure);
+	self->priv->_document_structure = _tmp0_;
+	if (force_parse) {
+		document_structure_parse (self->priv->_document_structure);
+	}
+	_tmp1_ = document_structure_get_parsing_done (self->priv->_document_structure);
+	if (_tmp1_) {
+		StructureModel* _tmp2_ = NULL;
+		StructureModel* _tmp3_;
+		_tmp2_ = document_structure_get_model (self->priv->_document_structure);
+		_tmp3_ = _tmp2_;
+		structure_set_model (self, _tmp3_);
+		_g_object_unref0 (_tmp3_);
+	}
+	g_signal_connect_object ((GObject*) self->priv->_document_structure, "notify::parsing-done", (GCallback) __lambda6__g_object_notify, self, 0);
 }
 
 
-static void structure_clear (Structure* self) {
+static void structure_set_model (Structure* self, StructureModel* model) {
+	StructureModel* _tmp0_;
 	g_return_if_fail (self != NULL);
-	gtk_tree_store_clear (self->priv->_tree_store);
-	gtk_tree_view_columns_autosize (self->priv->_tree_view);
+	_tmp0_ = _g_object_ref0 (model);
+	_g_object_unref0 (self->priv->_model);
+	self->priv->_model = _tmp0_;
+	gtk_tree_view_set_model (self->priv->_tree_view, (GtkTreeModel*) model);
+	gtk_tree_view_expand_all (self->priv->_tree_view);
+	structure_populate_simple_list (self);
 }
 
 
-static Block15Data* block15_data_ref (Block15Data* _data15_) {
-	g_atomic_int_inc (&_data15_->_ref_count_);
-	return _data15_;
+static void _structure_show_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
+	structure_show_active_document (self);
 }
 
 
-static void block15_data_unref (Block15Data* _data15_) {
-	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
-		_g_object_unref0 (_data15_->self);
-		_g_object_unref0 (_data15_->doc_struct);
-		g_slice_free (Block15Data, _data15_);
-	}
+void structure_connect_parsing (Structure* self) {
+	g_return_if_fail (self != NULL);
+	g_signal_connect_object ((GObject*) self->priv->_main_window, "notify::active-document", (GCallback) _structure_show_active_document_g_object_notify, self, 0);
+	structure_show_active_document (self);
 }
 
 
-static gboolean _lambda6_ (Block15Data* _data15_) {
-	Structure * self;
-	gboolean result = FALSE;
-	self = _data15_->self;
-	document_structure_populate_tree_store (_data15_->doc_struct, self->priv->_tree_store);
-	gtk_tree_view_expand_all (self->priv->_tree_view);
-	result = FALSE;
-	return result;
+void structure_disconnect_parsing (Structure* self) {
+	guint _tmp0_;
+	GQuark _tmp1_;
+	g_return_if_fail (self != NULL);
+	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
+	g_signal_handlers_disconnect_matched ((GObject*) self->priv->_main_window, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) _structure_show_active_document_g_object_notify, self);
 }
 
 
-static gboolean __lambda6__gsource_func (gpointer self) {
-	gboolean result;
-	result = _lambda6_ (self);
+gboolean structure_is_section (StructType type) {
+	gboolean result = FALSE;
+	result = type <= STRUCT_TYPE_SUBPARAGRAPH;
 	return result;
 }
 
 
-static void structure_populate (Structure* self, DocumentStructure* doc_struct) {
-	Block15Data* _data15_;
+/*************************************************************************/
+static void structure_show_popup_menu (Structure* self, GdkEventButton* event) {
 	g_return_if_fail (self != NULL);
-	g_return_if_fail (doc_struct != NULL);
-	_data15_ = g_slice_new0 (Block15Data);
-	_data15_->_ref_count_ = 1;
-	_data15_->self = g_object_ref (self);
-	_data15_->doc_struct = _g_object_ref0 (doc_struct);
-	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __lambda6__gsource_func, block15_data_ref (_data15_), block15_data_unref);
-	block15_data_unref (_data15_);
-	_data15_ = NULL;
+	if (event != NULL) {
+		gtk_menu_popup (self->priv->_popup_menu, NULL, NULL, NULL, NULL, (*event).button, (*event).time);
+	} else {
+		guint32 _tmp0_;
+		_tmp0_ = gtk_get_current_event_time ();
+		gtk_menu_popup (self->priv->_popup_menu, NULL, NULL, NULL, NULL, (guint) 0, _tmp0_);
+	}
 }
 
 
-static void _structure_populate_active_document_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
-	structure_populate_active_document (self);
+static void structure_set_actions_sensitivity (Structure* self, StructType type) {
+	gboolean _tmp0_ = FALSE;
+	g_return_if_fail (self != NULL);
+	gtk_action_set_sensitive (self->priv->_action_all_menu, TRUE);
+	gtk_action_set_sensitive (self->priv->_action_cut, TRUE);
+	gtk_action_set_sensitive (self->priv->_action_copy, TRUE);
+	gtk_action_set_sensitive (self->priv->_action_delete, TRUE);
+	gtk_action_set_sensitive (self->priv->_action_select, TRUE);
+	gtk_action_set_sensitive (self->priv->_action_comment, TRUE);
+	if (STRUCT_TYPE_PART < type) {
+		_tmp0_ = type <= STRUCT_TYPE_SUBPARAGRAPH;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	gtk_action_set_sensitive (self->priv->_action_shift_left, _tmp0_);
+	gtk_action_set_sensitive (self->priv->_action_shift_right, type < STRUCT_TYPE_SUBPARAGRAPH);
 }
 
 
-void structure_connect_parsing (Structure* self) {
+void structure_do_action (Structure* self, StructAction action_type) {
+	GtkTreeIter selected_iter = {0};
+	GtkTreeIter _tmp0_ = {0};
+	gint _tmp1_;
+	gint selected_row;
+	gboolean refresh_simple_list;
+	gboolean _tmp2_;
+	GError * _inner_error_ = NULL;
 	g_return_if_fail (self != NULL);
-	g_signal_connect_object ((GObject*) self->priv->_main_window, "notify::active-document", (GCallback) _structure_populate_active_document_g_object_notify, self, 0);
-	structure_populate_active_document (self);
+	_tmp1_ = utils_get_selected_row (self->priv->_tree_view, &_tmp0_);
+	selected_iter = _tmp0_;
+	selected_row = _tmp1_;
+	g_return_if_fail (selected_row != (-1));
+	refresh_simple_list = FALSE;
+	document_structure_do_action (self->priv->_document_structure, action_type, &selected_iter, &_tmp2_, &_inner_error_);
+	refresh_simple_list = _tmp2_;
+	if (_inner_error_ != NULL) {
+		if (_inner_error_->domain == STRUCT_ERROR) {
+			goto __catch27_struct_error;
+		}
+		g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return;
+	}
+	goto __finally27;
+	__catch27_struct_error:
+	{
+		GError * e;
+		const gchar* _tmp3_ = NULL;
+		gchar* _tmp4_ = NULL;
+		gchar* _tmp5_;
+		GtkMessageDialog* _tmp6_ = NULL;
+		GtkMessageDialog* _tmp7_;
+		GtkMessageDialog* dialog;
+		e = _inner_error_;
+		_inner_error_ = NULL;
+		_tmp3_ = _ ("Structure action error: %s");
+		_tmp4_ = structure_get_action_name (action_type);
+		_tmp5_ = _tmp4_;
+		_tmp6_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self->priv->_main_window, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _tmp3_, _tmp5_);
+		_tmp7_ = g_object_ref_sink (_tmp6_);
+		_g_free0 (_tmp5_);
+		dialog = _tmp7_;
+		if (g_error_matches (e, STRUCT_ERROR, STRUCT_ERROR_DATA_OUTDATED)) {
+			const gchar* _tmp8_ = NULL;
+			_tmp8_ = _ ("The structure data seems outdated. Please refresh the structure.");
+			g_object_set (dialog, "secondary-text", _tmp8_, NULL);
+		} else {
+			g_object_set (dialog, "secondary-text", e->message, NULL);
+		}
+		gtk_dialog_run ((GtkDialog*) dialog);
+		gtk_object_destroy ((GtkObject*) dialog);
+		_g_object_unref0 (dialog);
+		_g_error_free0 (e);
+		return;
+	}
+	__finally27:
+	if (_inner_error_ != NULL) {
+		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+		g_clear_error (&_inner_error_);
+		return;
+	}
+	if (refresh_simple_list) {
+		structure_populate_simple_list (self);
+	}
 }
 
 
-void structure_disconnect_parsing (Structure* self) {
-	guint _tmp0_;
-	GQuark _tmp1_;
-	g_return_if_fail (self != NULL);
-	g_signal_parse_name ("notify::active-document", G_TYPE_OBJECT, &_tmp0_, &_tmp1_, TRUE);
-	g_signal_handlers_disconnect_matched ((GObject*) self->priv->_main_window, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, _tmp1_, NULL, (GCallback) _structure_populate_active_document_g_object_notify, self);
+static gchar* structure_get_action_name (StructAction action_type) {
+	gchar* result = NULL;
+	gchar* _tmp22_;
+	if (structure__action_names == NULL) {
+		gchar** _tmp0_ = NULL;
+		const gchar* _tmp1_ = NULL;
+		gchar* _tmp2_;
+		gchar* _tmp3_;
+		const gchar* _tmp4_ = NULL;
+		gchar* _tmp5_;
+		gchar* _tmp6_;
+		const gchar* _tmp7_ = NULL;
+		gchar* _tmp8_;
+		gchar* _tmp9_;
+		const gchar* _tmp10_ = NULL;
+		gchar* _tmp11_;
+		gchar* _tmp12_;
+		const gchar* _tmp13_ = NULL;
+		gchar* _tmp14_;
+		gchar* _tmp15_;
+		const gchar* _tmp16_ = NULL;
+		gchar* _tmp17_;
+		gchar* _tmp18_;
+		const gchar* _tmp19_ = NULL;
+		gchar* _tmp20_;
+		gchar* _tmp21_;
+		_tmp0_ = g_new0 (gchar*, STRUCT_ACTION_NB_ACTIONS + 1);
+		structure__action_names = (_vala_array_free (structure__action_names, structure__action_names_length1, (GDestroyNotify) g_free), NULL);
+		structure__action_names = _tmp0_;
+		structure__action_names_length1 = STRUCT_ACTION_NB_ACTIONS;
+		_structure__action_names_size_ = STRUCT_ACTION_NB_ACTIONS;
+		_tmp1_ = _ ("cut");
+		_tmp2_ = g_strdup (_tmp1_);
+		_tmp3_ = _tmp2_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_CUT]);
+		structure__action_names[STRUCT_ACTION_CUT] = _tmp3_;
+		_tmp4_ = _ ("copy");
+		_tmp5_ = g_strdup (_tmp4_);
+		_tmp6_ = _tmp5_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_COPY]);
+		structure__action_names[STRUCT_ACTION_COPY] = _tmp6_;
+		_tmp7_ = _ ("delete");
+		_tmp8_ = g_strdup (_tmp7_);
+		_tmp9_ = _tmp8_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_DELETE]);
+		structure__action_names[STRUCT_ACTION_DELETE] = _tmp9_;
+		_tmp10_ = _ ("select");
+		_tmp11_ = g_strdup (_tmp10_);
+		_tmp12_ = _tmp11_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_SELECT]);
+		structure__action_names[STRUCT_ACTION_SELECT] = _tmp12_;
+		_tmp13_ = _ ("comment");
+		_tmp14_ = g_strdup (_tmp13_);
+		_tmp15_ = _tmp14_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_COMMENT]);
+		structure__action_names[STRUCT_ACTION_COMMENT] = _tmp15_;
+		_tmp16_ = _ ("shift left");
+		_tmp17_ = g_strdup (_tmp16_);
+		_tmp18_ = _tmp17_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_SHIFT_LEFT]);
+		structure__action_names[STRUCT_ACTION_SHIFT_LEFT] = _tmp18_;
+		_tmp19_ = _ ("shift right");
+		_tmp20_ = g_strdup (_tmp19_);
+		_tmp21_ = _tmp20_;
+		_g_free0 (structure__action_names[STRUCT_ACTION_SHIFT_RIGHT]);
+		structure__action_names[STRUCT_ACTION_SHIFT_RIGHT] = _tmp21_;
+	}
+	_tmp22_ = g_strdup (structure__action_names[action_type]);
+	result = _tmp22_;
+	return result;
 }
 
 
 gchar* structure_get_icon_from_type (StructType type) {
 	gchar* result = NULL;
-	switch (type) {
-		case STRUCT_TYPE_PART:
-		{
-			gchar* _tmp0_;
-			_tmp0_ = g_strdup ("tree_part");
-			result = _tmp0_;
-			return result;
-		}
-		case STRUCT_TYPE_CHAPTER:
-		{
-			gchar* _tmp1_;
-			_tmp1_ = g_strdup ("tree_chapter");
-			result = _tmp1_;
-			return result;
-		}
-		case STRUCT_TYPE_SECTION:
-		{
-			gchar* _tmp2_;
-			_tmp2_ = g_strdup ("tree_section");
-			result = _tmp2_;
-			return result;
-		}
-		case STRUCT_TYPE_SUBSECTION:
-		{
-			gchar* _tmp3_;
-			_tmp3_ = g_strdup ("tree_subsection");
-			result = _tmp3_;
-			return result;
-		}
-		case STRUCT_TYPE_SUBSUBSECTION:
-		{
-			gchar* _tmp4_;
-			_tmp4_ = g_strdup ("tree_subsubsection");
-			result = _tmp4_;
-			return result;
-		}
-		case STRUCT_TYPE_PARAGRAPH:
-		case STRUCT_TYPE_SUBPARAGRAPH:
-		{
-			gchar* _tmp5_;
-			_tmp5_ = g_strdup ("tree_paragraph");
-			result = _tmp5_;
-			return result;
-		}
-		case STRUCT_TYPE_LABEL:
-		{
-			gchar* _tmp6_;
-			_tmp6_ = g_strdup ("tree_label");
-			result = _tmp6_;
-			return result;
-		}
-		case STRUCT_TYPE_TODO:
-		case STRUCT_TYPE_FIXME:
-		{
-			gchar* _tmp7_;
-			_tmp7_ = g_strdup ("tree_todo");
-			result = _tmp7_;
-			return result;
-		}
-		case STRUCT_TYPE_TABLE:
-		{
-			gchar* _tmp8_;
-			_tmp8_ = g_strdup ("table");
-			result = _tmp8_;
-			return result;
-		}
-		case STRUCT_TYPE_FIGURE:
-		{
-			gchar* _tmp9_;
-			_tmp9_ = g_strdup ("image");
-			result = _tmp9_;
-			return result;
-		}
-		case STRUCT_TYPE_INCLUDE:
-		{
-			gchar* _tmp10_;
-			_tmp10_ = g_strdup ("tree_include");
-			result = _tmp10_;
-			return result;
-		}
-		default:
-		{
-			g_return_val_if_reached (NULL);
-		}
+	gchar* _tmp29_;
+	if (structure__icons == NULL) {
+		gchar** _tmp0_ = NULL;
+		gchar* _tmp1_;
+		gchar* _tmp2_;
+		gchar* _tmp3_;
+		gchar* _tmp4_;
+		gchar* _tmp5_;
+		gchar* _tmp6_;
+		gchar* _tmp7_;
+		gchar* _tmp8_;
+		gchar* _tmp9_;
+		gchar* _tmp10_;
+		gchar* _tmp11_;
+		gchar* _tmp12_;
+		gchar* _tmp13_;
+		gchar* _tmp14_;
+		gchar* _tmp15_;
+		gchar* _tmp16_;
+		gchar* _tmp17_;
+		gchar* _tmp18_;
+		gchar* _tmp19_;
+		gchar* _tmp20_;
+		gchar* _tmp21_;
+		gchar* _tmp22_;
+		gchar* _tmp23_;
+		gchar* _tmp24_;
+		gchar* _tmp25_;
+		gchar* _tmp26_;
+		gchar* _tmp27_;
+		gchar* _tmp28_;
+		_tmp0_ = g_new0 (gchar*, STRUCT_TYPE_NB_TYPES + 1);
+		structure__icons = (_vala_array_free (structure__icons, structure__icons_length1, (GDestroyNotify) g_free), NULL);
+		structure__icons = _tmp0_;
+		structure__icons_length1 = STRUCT_TYPE_NB_TYPES;
+		_structure__icons_size_ = STRUCT_TYPE_NB_TYPES;
+		_tmp1_ = g_strdup ("tree_part");
+		_tmp2_ = _tmp1_;
+		_g_free0 (structure__icons[STRUCT_TYPE_PART]);
+		structure__icons[STRUCT_TYPE_PART] = _tmp2_;
+		_tmp3_ = g_strdup ("tree_chapter");
+		_tmp4_ = _tmp3_;
+		_g_free0 (structure__icons[STRUCT_TYPE_CHAPTER]);
+		structure__icons[STRUCT_TYPE_CHAPTER] = _tmp4_;
+		_tmp5_ = g_strdup ("tree_section");
+		_tmp6_ = _tmp5_;
+		_g_free0 (structure__icons[STRUCT_TYPE_SECTION]);
+		structure__icons[STRUCT_TYPE_SECTION] = _tmp6_;
+		_tmp7_ = g_strdup ("tree_subsection");
+		_tmp8_ = _tmp7_;
+		_g_free0 (structure__icons[STRUCT_TYPE_SUBSECTION]);
+		structure__icons[STRUCT_TYPE_SUBSECTION] = _tmp8_;
+		_tmp9_ = g_strdup ("tree_subsubsection");
+		_tmp10_ = _tmp9_;
+		_g_free0 (structure__icons[STRUCT_TYPE_SUBSUBSECTION]);
+		structure__icons[STRUCT_TYPE_SUBSUBSECTION] = _tmp10_;
+		_tmp11_ = g_strdup ("tree_paragraph");
+		_tmp12_ = _tmp11_;
+		_g_free0 (structure__icons[STRUCT_TYPE_PARAGRAPH]);
+		structure__icons[STRUCT_TYPE_PARAGRAPH] = _tmp12_;
+		_tmp13_ = g_strdup ("tree_paragraph");
+		_tmp14_ = _tmp13_;
+		_g_free0 (structure__icons[STRUCT_TYPE_SUBPARAGRAPH]);
+		structure__icons[STRUCT_TYPE_SUBPARAGRAPH] = _tmp14_;
+		_tmp15_ = g_strdup ("tree_label");
+		_tmp16_ = _tmp15_;
+		_g_free0 (structure__icons[STRUCT_TYPE_LABEL]);
+		structure__icons[STRUCT_TYPE_LABEL] = _tmp16_;
+		_tmp17_ = g_strdup ("tree_todo");
+		_tmp18_ = _tmp17_;
+		_g_free0 (structure__icons[STRUCT_TYPE_TODO]);
+		structure__icons[STRUCT_TYPE_TODO] = _tmp18_;
+		_tmp19_ = g_strdup ("tree_todo");
+		_tmp20_ = _tmp19_;
+		_g_free0 (structure__icons[STRUCT_TYPE_FIXME]);
+		structure__icons[STRUCT_TYPE_FIXME] = _tmp20_;
+		_tmp21_ = g_strdup ("table");
+		_tmp22_ = _tmp21_;
+		_g_free0 (structure__icons[STRUCT_TYPE_TABLE]);
+		structure__icons[STRUCT_TYPE_TABLE] = _tmp22_;
+		_tmp23_ = g_strdup ("image");
+		_tmp24_ = _tmp23_;
+		_g_free0 (structure__icons[STRUCT_TYPE_FIGURE]);
+		structure__icons[STRUCT_TYPE_FIGURE] = _tmp24_;
+		_tmp25_ = g_strdup ("image");
+		_tmp26_ = _tmp25_;
+		_g_free0 (structure__icons[STRUCT_TYPE_IMAGE]);
+		structure__icons[STRUCT_TYPE_IMAGE] = _tmp26_;
+		_tmp27_ = g_strdup ("tree_include");
+		_tmp28_ = _tmp27_;
+		_g_free0 (structure__icons[STRUCT_TYPE_INCLUDE]);
+		structure__icons[STRUCT_TYPE_INCLUDE] = _tmp28_;
 	}
+	_tmp29_ = g_strdup (structure__icons[type]);
+	result = _tmp29_;
+	return result;
 }
 
 
 gchar* structure_get_type_name (StructType type) {
 	gchar* result = NULL;
-	switch (type) {
-		case STRUCT_TYPE_PART:
-		{
-			const gchar* _tmp0_ = NULL;
-			gchar* _tmp1_;
-			_tmp0_ = _ ("Part");
-			_tmp1_ = g_strdup (_tmp0_);
-			result = _tmp1_;
-			return result;
-		}
-		case STRUCT_TYPE_CHAPTER:
-		{
-			const gchar* _tmp2_ = NULL;
-			gchar* _tmp3_;
-			_tmp2_ = _ ("Chapter");
-			_tmp3_ = g_strdup (_tmp2_);
-			result = _tmp3_;
-			return result;
-		}
-		case STRUCT_TYPE_SECTION:
-		{
-			const gchar* _tmp4_ = NULL;
-			gchar* _tmp5_;
-			_tmp4_ = _ ("Section");
-			_tmp5_ = g_strdup (_tmp4_);
-			result = _tmp5_;
-			return result;
-		}
-		case STRUCT_TYPE_SUBSECTION:
-		{
-			const gchar* _tmp6_ = NULL;
-			gchar* _tmp7_;
-			_tmp6_ = _ ("Sub-section");
-			_tmp7_ = g_strdup (_tmp6_);
-			result = _tmp7_;
-			return result;
-		}
-		case STRUCT_TYPE_SUBSUBSECTION:
-		{
-			const gchar* _tmp8_ = NULL;
-			gchar* _tmp9_;
-			_tmp8_ = _ ("Sub-sub-section");
-			_tmp9_ = g_strdup (_tmp8_);
-			result = _tmp9_;
-			return result;
-		}
-		case STRUCT_TYPE_PARAGRAPH:
-		{
-			const gchar* _tmp10_ = NULL;
-			gchar* _tmp11_;
-			_tmp10_ = _ ("Paragraph");
-			_tmp11_ = g_strdup (_tmp10_);
-			result = _tmp11_;
-			return result;
-		}
-		case STRUCT_TYPE_SUBPARAGRAPH:
-		{
-			const gchar* _tmp12_ = NULL;
-			gchar* _tmp13_;
-			_tmp12_ = _ ("Sub-paragraph");
-			_tmp13_ = g_strdup (_tmp12_);
-			result = _tmp13_;
-			return result;
-		}
-		case STRUCT_TYPE_LABEL:
-		{
-			const gchar* _tmp14_ = NULL;
-			gchar* _tmp15_;
-			_tmp14_ = _ ("Label");
-			_tmp15_ = g_strdup (_tmp14_);
-			result = _tmp15_;
-			return result;
-		}
-		case STRUCT_TYPE_TODO:
-		{
-			gchar* _tmp16_;
-			_tmp16_ = g_strdup ("TODO");
-			result = _tmp16_;
-			return result;
-		}
-		case STRUCT_TYPE_FIXME:
-		{
-			gchar* _tmp17_;
-			_tmp17_ = g_strdup ("FIXME");
-			result = _tmp17_;
-			return result;
-		}
-		case STRUCT_TYPE_TABLE:
-		{
-			const gchar* _tmp18_ = NULL;
-			gchar* _tmp19_;
-			_tmp18_ = _ ("Table");
-			_tmp19_ = g_strdup (_tmp18_);
-			result = _tmp19_;
-			return result;
-		}
-		case STRUCT_TYPE_FIGURE:
-		{
-			const gchar* _tmp20_ = NULL;
-			gchar* _tmp21_;
-			_tmp20_ = _ ("Figure");
-			_tmp21_ = g_strdup (_tmp20_);
-			result = _tmp21_;
-			return result;
-		}
-		case STRUCT_TYPE_INCLUDE:
-		{
-			const gchar* _tmp22_ = NULL;
-			gchar* _tmp23_;
-			_tmp22_ = _ ("File included");
-			_tmp23_ = g_strdup (_tmp22_);
-			result = _tmp23_;
-			return result;
-		}
-		default:
-		{
-			g_return_val_if_reached (NULL);
-		}
+	gchar* _tmp41_;
+	if (structure__names == NULL) {
+		gchar** _tmp0_ = NULL;
+		const gchar* _tmp1_ = NULL;
+		gchar* _tmp2_;
+		gchar* _tmp3_;
+		const gchar* _tmp4_ = NULL;
+		gchar* _tmp5_;
+		gchar* _tmp6_;
+		const gchar* _tmp7_ = NULL;
+		gchar* _tmp8_;
+		gchar* _tmp9_;
+		const gchar* _tmp10_ = NULL;
+		gchar* _tmp11_;
+		gchar* _tmp12_;
+		const gchar* _tmp13_ = NULL;
+		gchar* _tmp14_;
+		gchar* _tmp15_;
+		const gchar* _tmp16_ = NULL;
+		gchar* _tmp17_;
+		gchar* _tmp18_;
+		const gchar* _tmp19_ = NULL;
+		gchar* _tmp20_;
+		gchar* _tmp21_;
+		const gchar* _tmp22_ = NULL;
+		gchar* _tmp23_;
+		gchar* _tmp24_;
+		gchar* _tmp25_;
+		gchar* _tmp26_;
+		gchar* _tmp27_;
+		gchar* _tmp28_;
+		const gchar* _tmp29_ = NULL;
+		gchar* _tmp30_;
+		gchar* _tmp31_;
+		const gchar* _tmp32_ = NULL;
+		gchar* _tmp33_;
+		gchar* _tmp34_;
+		const gchar* _tmp35_ = NULL;
+		gchar* _tmp36_;
+		gchar* _tmp37_;
+		const gchar* _tmp38_ = NULL;
+		gchar* _tmp39_;
+		gchar* _tmp40_;
+		_tmp0_ = g_new0 (gchar*, STRUCT_TYPE_NB_TYPES + 1);
+		structure__names = (_vala_array_free (structure__names, structure__names_length1, (GDestroyNotify) g_free), NULL);
+		structure__names = _tmp0_;
+		structure__names_length1 = STRUCT_TYPE_NB_TYPES;
+		_structure__names_size_ = STRUCT_TYPE_NB_TYPES;
+		_tmp1_ = _ ("Part");
+		_tmp2_ = g_strdup (_tmp1_);
+		_tmp3_ = _tmp2_;
+		_g_free0 (structure__names[STRUCT_TYPE_PART]);
+		structure__names[STRUCT_TYPE_PART] = _tmp3_;
+		_tmp4_ = _ ("Chapter");
+		_tmp5_ = g_strdup (_tmp4_);
+		_tmp6_ = _tmp5_;
+		_g_free0 (structure__names[STRUCT_TYPE_CHAPTER]);
+		structure__names[STRUCT_TYPE_CHAPTER] = _tmp6_;
+		_tmp7_ = _ ("Section");
+		_tmp8_ = g_strdup (_tmp7_);
+		_tmp9_ = _tmp8_;
+		_g_free0 (structure__names[STRUCT_TYPE_SECTION]);
+		structure__names[STRUCT_TYPE_SECTION] = _tmp9_;
+		_tmp10_ = _ ("Sub-section");
+		_tmp11_ = g_strdup (_tmp10_);
+		_tmp12_ = _tmp11_;
+		_g_free0 (structure__names[STRUCT_TYPE_SUBSECTION]);
+		structure__names[STRUCT_TYPE_SUBSECTION] = _tmp12_;
+		_tmp13_ = _ ("Sub-sub-section");
+		_tmp14_ = g_strdup (_tmp13_);
+		_tmp15_ = _tmp14_;
+		_g_free0 (structure__names[STRUCT_TYPE_SUBSUBSECTION]);
+		structure__names[STRUCT_TYPE_SUBSUBSECTION] = _tmp15_;
+		_tmp16_ = _ ("Paragraph");
+		_tmp17_ = g_strdup (_tmp16_);
+		_tmp18_ = _tmp17_;
+		_g_free0 (structure__names[STRUCT_TYPE_PARAGRAPH]);
+		structure__names[STRUCT_TYPE_PARAGRAPH] = _tmp18_;
+		_tmp19_ = _ ("Sub-paragraph");
+		_tmp20_ = g_strdup (_tmp19_);
+		_tmp21_ = _tmp20_;
+		_g_free0 (structure__names[STRUCT_TYPE_SUBPARAGRAPH]);
+		structure__names[STRUCT_TYPE_SUBPARAGRAPH] = _tmp21_;
+		_tmp22_ = _ ("Label");
+		_tmp23_ = g_strdup (_tmp22_);
+		_tmp24_ = _tmp23_;
+		_g_free0 (structure__names[STRUCT_TYPE_LABEL]);
+		structure__names[STRUCT_TYPE_LABEL] = _tmp24_;
+		_tmp25_ = g_strdup ("TODO");
+		_tmp26_ = _tmp25_;
+		_g_free0 (structure__names[STRUCT_TYPE_TODO]);
+		structure__names[STRUCT_TYPE_TODO] = _tmp26_;
+		_tmp27_ = g_strdup ("FIXME");
+		_tmp28_ = _tmp27_;
+		_g_free0 (structure__names[STRUCT_TYPE_FIXME]);
+		structure__names[STRUCT_TYPE_FIXME] = _tmp28_;
+		_tmp29_ = _ ("Table");
+		_tmp30_ = g_strdup (_tmp29_);
+		_tmp31_ = _tmp30_;
+		_g_free0 (structure__names[STRUCT_TYPE_TABLE]);
+		structure__names[STRUCT_TYPE_TABLE] = _tmp31_;
+		_tmp32_ = _ ("Figure");
+		_tmp33_ = g_strdup (_tmp32_);
+		_tmp34_ = _tmp33_;
+		_g_free0 (structure__names[STRUCT_TYPE_FIGURE]);
+		structure__names[STRUCT_TYPE_FIGURE] = _tmp34_;
+		_tmp35_ = _ ("Image");
+		_tmp36_ = g_strdup (_tmp35_);
+		_tmp37_ = _tmp36_;
+		_g_free0 (structure__names[STRUCT_TYPE_IMAGE]);
+		structure__names[STRUCT_TYPE_IMAGE] = _tmp37_;
+		_tmp38_ = _ ("File included");
+		_tmp39_ = g_strdup (_tmp38_);
+		_tmp40_ = _tmp39_;
+		_g_free0 (structure__names[STRUCT_TYPE_INCLUDE]);
+		structure__names[STRUCT_TYPE_INCLUDE] = _tmp40_;
 	}
+	_tmp41_ = g_strdup (structure__names[type]);
+	result = _tmp41_;
+	return result;
 }
 
 
@@ -1209,18 +1675,40 @@ static void structure_class_init (StructureClass * klass) {
 
 
 static void structure_instance_init (Structure * self) {
+	GtkToggleButton** _tmp0_ = NULL;
 	self->priv = STRUCTURE_GET_PRIVATE (self);
+	_tmp0_ = g_new0 (GtkToggleButton*, 0 + 1);
+	self->priv->_simple_list_buttons = _tmp0_;
+	self->priv->_simple_list_buttons_length1 = 0;
+	self->priv->__simple_list_buttons_size_ = self->priv->_simple_list_buttons_length1;
+	self->priv->_document_structure = NULL;
+	self->priv->_model = NULL;
+	self->priv->_list_is_hidden = TRUE;
+	self->priv->_first_select = TRUE;
 }
 
 
 static void structure_finalize (GObject* obj) {
 	Structure * self;
 	self = STRUCTURE (obj);
-	_g_object_unref0 (self->priv->_settings);
-	_g_object_unref0 (self->priv->_tree_store);
-	_g_object_unref0 (self->priv->_tree_filter);
+	_g_object_unref0 (self->priv->_popup_menu);
+	_g_object_unref0 (self->priv->_action_all_menu);
+	_g_object_unref0 (self->priv->_action_cut);
+	_g_object_unref0 (self->priv->_action_copy);
+	_g_object_unref0 (self->priv->_action_delete);
+	_g_object_unref0 (self->priv->_action_select);
+	_g_object_unref0 (self->priv->_action_comment);
+	_g_object_unref0 (self->priv->_action_shift_left);
+	_g_object_unref0 (self->priv->_action_shift_right);
+	self->priv->_simple_list_buttons = (_vala_array_free (self->priv->_simple_list_buttons, self->priv->_simple_list_buttons_length1, (GDestroyNotify) g_object_unref), NULL);
+	_g_object_unref0 (self->priv->_vpaned);
 	_g_object_unref0 (self->priv->_tree_view);
-	self->priv->_visible_types = (g_free (self->priv->_visible_types), NULL);
+	_g_object_unref0 (self->priv->_document_structure);
+	_g_object_unref0 (self->priv->_model);
+	_g_object_unref0 (self->priv->_list_view);
+	_g_object_unref0 (self->priv->_list_view_sw);
+	_g_object_unref0 (self->priv->_list_store);
+	self->priv->_current_list_types = (g_free (self->priv->_current_list_types), NULL);
 	G_OBJECT_CLASS (structure_parent_class)->finalize (obj);
 }
 
@@ -1237,4 +1725,22 @@ GType structure_get_type (void) {
 }
 
 
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	if ((array != NULL) && (destroy_func != NULL)) {
+		int i;
+		for (i = 0; i < array_length; i = i + 1) {
+			if (((gpointer*) array)[i] != NULL) {
+				destroy_func (((gpointer*) array)[i]);
+			}
+		}
+	}
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+	_vala_array_destroy (array, array_length, destroy_func);
+	g_free (array);
+}
+
+
 
diff --git a/src/C/structure_model.c b/src/C/structure_model.c
new file mode 100644
index 0000000..95c4a8a
--- /dev/null
+++ b/src/C/structure_model.c
@@ -0,0 +1,1962 @@
+/* structure_model.c generated by valac 0.12.1, the Vala compiler
+ * generated from structure_model.vala, do not modify */
+
+/*
+ * This file is part of LaTeXila.
+ *
+ * Copyright  2011 SÃbastien Wilmet
+ *
+ * LaTeXila is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * LaTeXila is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glib.h>
+#include <glib-object.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gtk/gtk.h>
+#include <gee.h>
+
+
+#define TYPE_STRUCT_DATA (struct_data_get_type ())
+
+#define TYPE_STRUCT_TYPE (struct_type_get_type ())
+typedef struct _StructData StructData;
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+#define TYPE_STRUCT_COLUMN (struct_column_get_type ())
+
+#define TYPE_STRUCT_LIST_COLUMN (struct_list_column_get_type ())
+
+#define TYPE_STRUCTURE_MODEL (structure_model_get_type ())
+#define STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STRUCTURE_MODEL, StructureModel))
+#define STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STRUCTURE_MODEL, StructureModelClass))
+#define IS_STRUCTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STRUCTURE_MODEL))
+#define IS_STRUCTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STRUCTURE_MODEL))
+#define STRUCTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STRUCTURE_MODEL, StructureModelClass))
+
+typedef struct _StructureModel StructureModel;
+typedef struct _StructureModelClass StructureModelClass;
+typedef struct _StructureModelPrivate StructureModelPrivate;
+#define __g_node_destroy__struct_data_free0_0(var) ((var == NULL) ? NULL : (var = (_g_node_destroy__struct_data_free0_ (var), NULL)))
+#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
+
+typedef enum  {
+	STRUCT_TYPE_PART,
+	STRUCT_TYPE_CHAPTER,
+	STRUCT_TYPE_SECTION,
+	STRUCT_TYPE_SUBSECTION,
+	STRUCT_TYPE_SUBSUBSECTION,
+	STRUCT_TYPE_PARAGRAPH,
+	STRUCT_TYPE_SUBPARAGRAPH,
+	STRUCT_TYPE_LABEL,
+	STRUCT_TYPE_INCLUDE,
+	STRUCT_TYPE_IMAGE,
+	STRUCT_TYPE_TODO,
+	STRUCT_TYPE_FIXME,
+	STRUCT_TYPE_NB_COMMON_TYPES,
+	STRUCT_TYPE_TABLE,
+	STRUCT_TYPE_FIGURE,
+	STRUCT_TYPE_NB_TYPES
+} StructType;
+
+struct _StructData {
+	StructType type;
+	gchar* text;
+	GtkTextMark* start_mark;
+	GtkTextMark* end_mark;
+};
+
+typedef enum  {
+	STRUCT_COLUMN_PIXBUF,
+	STRUCT_COLUMN_TEXT,
+	STRUCT_COLUMN_TOOLTIP,
+	STRUCT_COLUMN_START_MARK,
+	STRUCT_COLUMN_END_MARK,
+	STRUCT_COLUMN_TYPE,
+	STRUCT_COLUMN_N_COLUMNS
+} StructColumn;
+
+typedef enum  {
+	STRUCT_LIST_COLUMN_PIXBUF,
+	STRUCT_LIST_COLUMN_TEXT,
+	STRUCT_LIST_COLUMN_TOOLTIP,
+	STRUCT_LIST_COLUMN_N_COLUMNS
+} StructListColumn;
+
+typedef enum  {
+	STRUCT_ERROR_GENERAL,
+	STRUCT_ERROR_DATA_OUTDATED
+} StructError;
+#define STRUCT_ERROR struct_error_quark ()
+struct _StructureModel {
+	GObject parent_instance;
+	StructureModelPrivate * priv;
+};
+
+struct _StructureModelClass {
+	GObjectClass parent_class;
+};
+
+struct _StructureModelPrivate {
+	GType* _column_types;
+	gint _column_types_length1;
+	gint __column_types_size_;
+	GNode* _tree;
+	gint _stamp;
+	GeeArrayList* _list_labels;
+	GeeArrayList* _list_includes;
+	GeeArrayList* _list_tables;
+	GeeArrayList* _list_figures;
+	GeeArrayList* _list_todos_and_fixmes;
+};
+
+
+static gpointer structure_model_parent_class = NULL;
+static GtkTreeModelIface* structure_model_gtk_tree_model_parent_iface = NULL;
+
+GType struct_data_get_type (void) G_GNUC_CONST;
+GType struct_type_get_type (void) G_GNUC_CONST;
+StructData* struct_data_dup (const StructData* self);
+void struct_data_free (StructData* self);
+void struct_data_copy (const StructData* self, StructData* dest);
+void struct_data_destroy (StructData* self);
+GType struct_column_get_type (void) G_GNUC_CONST;
+GType struct_list_column_get_type (void) G_GNUC_CONST;
+GQuark struct_error_quark (void);
+GType structure_model_get_type (void) G_GNUC_CONST;
+#define STRUCTURE_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_STRUCTURE_MODEL, StructureModelPrivate))
+enum  {
+	STRUCTURE_MODEL_DUMMY_PROPERTY
+};
+static void _struct_data_free0_ (gpointer var);
+static void _g_node_destroy__struct_data_free0_ (GNode* self);
+static void _g_node_destroy__struct_data_free0_ (GNode* self);
+StructureModel* structure_model_new (void);
+StructureModel* structure_model_construct (GType object_type);
+static void structure_model_new_stamp (StructureModel* self);
+static void structure_model_reset_simple_lists (StructureModel* self);
+static GtkTreeIter* structure_model_create_iter_at_node (StructureModel* self, GNode* node);
+static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self);
+static gboolean structure_model_iter_is_valid (StructureModel* self, GtkTreeIter* iter);
+static GNode* structure_model_get_node_from_iter (StructureModel* self, GtkTreeIter* iter);
+static gboolean structure_model_column_is_valid (StructureModel* self, gint index);
+static GType structure_model_real_get_column_type (GtkTreeModel* base, gint index);
+static gint structure_model_real_get_n_columns (GtkTreeModel* base);
+static GtkTreeModelFlags structure_model_real_get_flags (GtkTreeModel* base);
+static gboolean structure_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter);
+static gint structure_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter);
+static void structure_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val);
+gchar* structure_get_icon_from_type (StructType type);
+gchar* structure_get_type_name (StructType type);
+static gboolean structure_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent);
+static gboolean structure_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter);
+static gboolean structure_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n);
+static gboolean structure_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child);
+static gboolean structure_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, GtkTreePath* path);
+static GtkTreePath* structure_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter);
+static void structure_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter);
+static void structure_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter);
+void structure_model_add_item_at_end (StructureModel* self, StructData* item);
+gboolean structure_is_section (StructType type);
+static void structure_model_append_item (StructureModel* self, GNode* parent, StructData* item);
+void structure_model_add_item_in_middle (StructureModel* self, StructData* item);
+static gint structure_model_get_position_from_mark (GtkTextMark* mark);
+static void structure_model_insert_item_at_position (StructureModel* self, StructData* item, GNode* parent, gint pos);
+GtkTreeIter* structure_model_get_next_sibling_or_parent (StructureModel* self, GtkTreeIter* section_iter, GError** error);
+void structure_model_delete (StructureModel* self, GtkTreeIter* iter);
+static GNode* structure_model_delete_node (StructureModel* self, GNode* node);
+static void structure_model_regenerate_simple_lists (StructureModel* self);
+void structure_model_shift_right (StructureModel* self, GtkTreeIter* iter);
+static void structure_model_shift_node (StructureModel* self, GNode* node, gboolean shift_right);
+static void structure_model_reinsert_node (StructureModel* self, GNode* node, gboolean force_first_child);
+void structure_model_shift_left (StructureModel* self, GtkTreeIter* iter);
+gboolean structure_model_item_contains_subparagraph (StructureModel* self, GtkTreeIter* iter);
+static gboolean structure_model_node_contains_subparagraph (StructureModel* self, GNode* node);
+static void structure_model_insert_node (StructureModel* self, GNode* node, gboolean force_first_child);
+static void structure_model_insert_item (StructureModel* self, GNode* parent, gint pos, StructData* item);
+static void structure_model_insert_node_in_list (StructureModel* self, GNode* node, gboolean at_end);
+static void structure_model_make_children_between_marks (StructureModel* self, GNode* node);
+void structure_model_populate_list (StructureModel* self, GtkListStore* store, StructType type);
+static GeeArrayList* structure_model_get_list (StructureModel* self, StructType type);
+GtkTreePath* structure_model_get_tree_path_from_list_num (StructureModel* self, StructType list_type, gint num);
+gint structure_model_get_list_num_from_tree_iter (StructureModel* self, GtkTreeIter* tree_iter);
+static gboolean _lambda18_ (GNode* node_param, StructureModel* self);
+static gboolean __lambda18__gnode_traverse_func (GNode* node, gpointer self);
+static void structure_model_finalize (GObject* obj);
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+	return self ? g_object_ref (self) : NULL;
+}
+
+
+void struct_data_copy (const StructData* self, StructData* dest) {
+	dest->type = self->type;
+	dest->text = g_strdup (self->text);
+	dest->start_mark = _g_object_ref0 (self->start_mark);
+	dest->end_mark = _g_object_ref0 (self->end_mark);
+}
+
+
+void struct_data_destroy (StructData* self) {
+	_g_free0 ((*self).text);
+	_g_object_unref0 ((*self).start_mark);
+	_g_object_unref0 ((*self).end_mark);
+}
+
+
+StructData* struct_data_dup (const StructData* self) {
+	StructData* dup;
+	dup = g_new0 (StructData, 1);
+	struct_data_copy (self, dup);
+	return dup;
+}
+
+
+void struct_data_free (StructData* self) {
+	struct_data_destroy (self);
+	g_free (self);
+}
+
+
+GType struct_data_get_type (void) {
+	static volatile gsize struct_data_type_id__volatile = 0;
+	if (g_once_init_enter (&struct_data_type_id__volatile)) {
+		GType struct_data_type_id;
+		struct_data_type_id = g_boxed_type_register_static ("StructData", (GBoxedCopyFunc) struct_data_dup, (GBoxedFreeFunc) struct_data_free);
+		g_once_init_leave (&struct_data_type_id__volatile, struct_data_type_id);
+	}
+	return struct_data_type_id__volatile;
+}
+
+
+GType struct_column_get_type (void) {
+	static volatile gsize struct_column_type_id__volatile = 0;
+	if (g_once_init_enter (&struct_column_type_id__volatile)) {
+		static const GEnumValue values[] = {{STRUCT_COLUMN_PIXBUF, "STRUCT_COLUMN_PIXBUF", "pixbuf"}, {STRUCT_COLUMN_TEXT, "STRUCT_COLUMN_TEXT", "text"}, {STRUCT_COLUMN_TOOLTIP, "STRUCT_COLUMN_TOOLTIP", "tooltip"}, {STRUCT_COLUMN_START_MARK, "STRUCT_COLUMN_START_MARK", "start-mark"}, {STRUCT_COLUMN_END_MARK, "STRUCT_COLUMN_END_MARK", "end-mark"}, {STRUCT_COLUMN_TYPE, "STRUCT_COLUMN_TYPE", "type"}, {STRUCT_COLUMN_N_COLUMNS, "STRUCT_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
+		GType struct_column_type_id;
+		struct_column_type_id = g_enum_register_static ("StructColumn", values);
+		g_once_init_leave (&struct_column_type_id__volatile, struct_column_type_id);
+	}
+	return struct_column_type_id__volatile;
+}
+
+
+GType struct_list_column_get_type (void) {
+	static volatile gsize struct_list_column_type_id__volatile = 0;
+	if (g_once_init_enter (&struct_list_column_type_id__volatile)) {
+		static const GEnumValue values[] = {{STRUCT_LIST_COLUMN_PIXBUF, "STRUCT_LIST_COLUMN_PIXBUF", "pixbuf"}, {STRUCT_LIST_COLUMN_TEXT, "STRUCT_LIST_COLUMN_TEXT", "text"}, {STRUCT_LIST_COLUMN_TOOLTIP, "STRUCT_LIST_COLUMN_TOOLTIP", "tooltip"}, {STRUCT_LIST_COLUMN_N_COLUMNS, "STRUCT_LIST_COLUMN_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
+		GType struct_list_column_type_id;
+		struct_list_column_type_id = g_enum_register_static ("StructListColumn", values);
+		g_once_init_leave (&struct_list_column_type_id__volatile, struct_list_column_type_id);
+	}
+	return struct_list_column_type_id__volatile;
+}
+
+
+GQuark struct_error_quark (void) {
+	return g_quark_from_static_string ("struct_error-quark");
+}
+
+
+static void _struct_data_free0_ (gpointer var) {
+	(var == NULL) ? NULL : (var = (struct_data_free (var), NULL));
+}
+
+
+static gboolean _g_node_destroy__struct_data_free0__node (GNode* node, gpointer unused) {
+	_struct_data_free0_ (node->data);
+	return FALSE;
+}
+
+
+static void _g_node_destroy__struct_data_free0_ (GNode* self) {
+	g_node_traverse (self, G_POST_ORDER, G_TRAVERSE_ALL, -1, _g_node_destroy__struct_data_free0__node, NULL);
+	g_node_destroy (self);
+}
+
+
+static gpointer _struct_data_dup0 (gpointer self) {
+	return self ? struct_data_dup (self) : NULL;
+}
+
+
+StructureModel* structure_model_construct (GType object_type) {
+	StructureModel * self = NULL;
+	GType* _tmp0_ = NULL;
+	StructData _tmp1_ = {0};
+	StructData empty_data;
+	StructData* _tmp2_;
+	GNode* _tmp3_ = NULL;
+	self = (StructureModel*) g_object_new (object_type, NULL);
+	_tmp0_ = g_new0 (GType, STRUCT_COLUMN_N_COLUMNS);
+	self->priv->_column_types = (g_free (self->priv->_column_types), NULL);
+	self->priv->_column_types = _tmp0_;
+	self->priv->_column_types_length1 = STRUCT_COLUMN_N_COLUMNS;
+	self->priv->__column_types_size_ = STRUCT_COLUMN_N_COLUMNS;
+	self->priv->_column_types[STRUCT_COLUMN_PIXBUF] = G_TYPE_STRING;
+	self->priv->_column_types[STRUCT_COLUMN_TEXT] = G_TYPE_STRING;
+	self->priv->_column_types[STRUCT_COLUMN_TOOLTIP] = G_TYPE_STRING;
+	self->priv->_column_types[STRUCT_COLUMN_START_MARK] = GTK_TYPE_TEXT_MARK;
+	self->priv->_column_types[STRUCT_COLUMN_END_MARK] = GTK_TYPE_TEXT_MARK;
+	self->priv->_column_types[STRUCT_COLUMN_TYPE] = TYPE_STRUCT_TYPE;
+	empty_data = _tmp1_;
+	_tmp2_ = _struct_data_dup0 (&empty_data);
+	_tmp3_ = g_node_new (_tmp2_);
+	__g_node_destroy__struct_data_free0_0 (self->priv->_tree);
+	self->priv->_tree = _tmp3_;
+	structure_model_new_stamp (self);
+	structure_model_reset_simple_lists (self);
+	struct_data_destroy (&empty_data);
+	return self;
+}
+
+
+StructureModel* structure_model_new (void) {
+	return structure_model_construct (TYPE_STRUCTURE_MODEL);
+}
+
+
+static void structure_model_new_stamp (StructureModel* self) {
+	guint32 _tmp0_;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = g_random_int ();
+	self->priv->_stamp = (gint) _tmp0_;
+}
+
+
+static GtkTreeIter* _gtk_tree_iter_dup (GtkTreeIter* self) {
+	GtkTreeIter* dup;
+	dup = g_new0 (GtkTreeIter, 1);
+	memcpy (dup, self, sizeof (GtkTreeIter));
+	return dup;
+}
+
+
+static gpointer __gtk_tree_iter_dup0 (gpointer self) {
+	return self ? _gtk_tree_iter_dup (self) : NULL;
+}
+
+
+static GtkTreeIter* structure_model_create_iter_at_node (StructureModel* self, GNode* node) {
+	GtkTreeIter* result = NULL;
+	GtkTreeIter new_iter = {0};
+	GtkTreeIter* _tmp0_;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (node != NULL, NULL);
+	g_return_val_if_fail (node != self->priv->_tree, NULL);
+	memset (&new_iter, 0, sizeof (GtkTreeIter));
+	new_iter.stamp = self->priv->_stamp;
+	new_iter.user_data = node;
+	_tmp0_ = __gtk_tree_iter_dup0 (&new_iter);
+	result = _tmp0_;
+	return result;
+}
+
+
+static gboolean structure_model_iter_is_valid (StructureModel* self, GtkTreeIter* iter) {
+	gboolean result = FALSE;
+	GNode* _tmp0_ = NULL;
+	GNode* node;
+	StructData _tmp1_;
+	StructData _tmp2_ = {0};
+	StructData data;
+	g_return_val_if_fail (self != NULL, FALSE);
+	if ((*iter).stamp != self->priv->_stamp) {
+		result = FALSE;
+		return result;
+	}
+	if ((*iter).user_data == NULL) {
+		result = FALSE;
+		return result;
+	}
+	_tmp0_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp0_;
+	if (((StructData*) node->data) == NULL) {
+		result = FALSE;
+		return result;
+	}
+	struct_data_copy ((StructData*) node->data, &_tmp2_);
+	_tmp1_ = _tmp2_;
+	data = _tmp1_;
+	if (data.text == NULL) {
+		result = FALSE;
+		struct_data_destroy (&data);
+		return result;
+	}
+	result = TRUE;
+	struct_data_destroy (&data);
+	return result;
+}
+
+
+static gboolean structure_model_column_is_valid (StructureModel* self, gint index) {
+	gboolean result = FALSE;
+	gboolean _tmp0_ = FALSE;
+	g_return_val_if_fail (self != NULL, FALSE);
+	if (0 <= index) {
+		_tmp0_ = index < STRUCT_COLUMN_N_COLUMNS;
+	} else {
+		_tmp0_ = FALSE;
+	}
+	result = _tmp0_;
+	return result;
+}
+
+
+static GNode* structure_model_get_node_from_iter (StructureModel* self, GtkTreeIter* iter) {
+	GNode* result = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	result = (GNode*) (*iter).user_data;
+	return result;
+}
+
+
+/*************************************************************************/
+static GType structure_model_real_get_column_type (GtkTreeModel* base, gint index) {
+	StructureModel * self;
+	GType result = 0UL;
+	gboolean _tmp0_;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_column_is_valid (self, index);
+	g_return_val_if_fail (_tmp0_, G_TYPE_INVALID);
+	result = self->priv->_column_types[index];
+	return result;
+}
+
+
+static gint structure_model_real_get_n_columns (GtkTreeModel* base) {
+	StructureModel * self;
+	gint result = 0;
+	self = (StructureModel*) base;
+	result = (gint) STRUCT_COLUMN_N_COLUMNS;
+	return result;
+}
+
+
+static GtkTreeModelFlags structure_model_real_get_flags (GtkTreeModel* base) {
+	StructureModel * self;
+	GtkTreeModelFlags result = 0;
+	self = (StructureModel*) base;
+	result = 0;
+	return result;
+}
+
+
+static gboolean structure_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	gboolean _tmp2_;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_val_if_fail (_tmp0_, FALSE);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	_tmp2_ = G_NODE_IS_LEAF (node);
+	result = !_tmp2_;
+	return result;
+}
+
+
+static gint structure_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	gint result = 0;
+	GNode* node = NULL;
+	guint _tmp2_;
+	self = (StructureModel*) base;
+	if (iter == NULL) {
+		node = self->priv->_tree;
+	} else {
+		gboolean _tmp0_;
+		GNode* _tmp1_ = NULL;
+		_tmp0_ = structure_model_iter_is_valid (self, iter);
+		g_return_val_if_fail (_tmp0_, -1);
+		_tmp1_ = structure_model_get_node_from_iter (self, iter);
+		node = _tmp1_;
+	}
+	_tmp2_ = g_node_n_children (node);
+	result = (gint) _tmp2_;
+	return result;
+}
+
+
+static void structure_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val) {
+	StructureModel * self;
+	GValue _val = {0};
+	gboolean _tmp0_;
+	gboolean _tmp1_;
+	GNode* _tmp2_ = NULL;
+	GNode* node;
+	StructData _tmp3_;
+	StructData _tmp4_ = {0};
+	StructData data;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_if_fail (_tmp0_);
+	_tmp1_ = structure_model_column_is_valid (self, column);
+	g_return_if_fail (_tmp1_);
+	_tmp2_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp2_;
+	struct_data_copy ((StructData*) node->data, &_tmp4_);
+	_tmp3_ = _tmp4_;
+	data = _tmp3_;
+	switch (column) {
+		case STRUCT_COLUMN_TEXT:
+		{
+			GValue _tmp5_ = {0};
+			g_value_init (&_tmp5_, G_TYPE_STRING);
+			g_value_set_string (&_tmp5_, data.text);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp5_;
+			break;
+		}
+		case STRUCT_COLUMN_START_MARK:
+		{
+			GValue _tmp6_ = {0};
+			g_value_init (&_tmp6_, GTK_TYPE_TEXT_MARK);
+			g_value_set_object (&_tmp6_, data.start_mark);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp6_;
+			break;
+		}
+		case STRUCT_COLUMN_END_MARK:
+		{
+			GValue _tmp7_ = {0};
+			g_value_init (&_tmp7_, GTK_TYPE_TEXT_MARK);
+			g_value_set_object (&_tmp7_, data.end_mark);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp7_;
+			break;
+		}
+		case STRUCT_COLUMN_TYPE:
+		{
+			GValue _tmp8_ = {0};
+			g_value_init (&_tmp8_, TYPE_STRUCT_TYPE);
+			g_value_set_enum (&_tmp8_, data.type);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp8_;
+			break;
+		}
+		case STRUCT_COLUMN_PIXBUF:
+		{
+			gchar* _tmp9_ = NULL;
+			GValue _tmp10_ = {0};
+			_tmp9_ = structure_get_icon_from_type (data.type);
+			g_value_init (&_tmp10_, G_TYPE_STRING);
+			g_value_take_string (&_tmp10_, _tmp9_);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp10_;
+			break;
+		}
+		case STRUCT_COLUMN_TOOLTIP:
+		{
+			gchar* _tmp11_ = NULL;
+			GValue _tmp12_ = {0};
+			_tmp11_ = structure_get_type_name (data.type);
+			g_value_init (&_tmp12_, G_TYPE_STRING);
+			g_value_take_string (&_tmp12_, _tmp11_);
+			G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+			_val = _tmp12_;
+			break;
+		}
+		default:
+		{
+			g_return_if_reached ();
+		}
+	}
+	struct_data_destroy (&data);
+	if (val) {
+		*val = _val;
+	} else {
+		G_IS_VALUE (&_val) ? (g_value_unset (&_val), NULL) : NULL;
+	}
+}
+
+
+static gboolean structure_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent) {
+	StructureModel * self;
+	GtkTreeIter _iter = {0};
+	gboolean result = FALSE;
+	GNode* node = NULL;
+	gboolean _tmp2_;
+	GNode* _tmp3_ = NULL;
+	GtkTreeIter* _tmp4_ = NULL;
+	GtkTreeIter* _tmp5_;
+	self = (StructureModel*) base;
+	if (parent == NULL) {
+		node = self->priv->_tree;
+	} else {
+		gboolean _tmp0_;
+		GNode* _tmp1_ = NULL;
+		_tmp0_ = structure_model_iter_is_valid (self, parent);
+		g_return_val_if_fail (_tmp0_, FALSE);
+		_tmp1_ = structure_model_get_node_from_iter (self, parent);
+		node = _tmp1_;
+	}
+	_tmp2_ = G_NODE_IS_LEAF (node);
+	if (_tmp2_) {
+		result = FALSE;
+		if (iter) {
+			*iter = _iter;
+		}
+		return result;
+	}
+	_tmp3_ = g_node_first_child (node);
+	_tmp4_ = structure_model_create_iter_at_node (self, _tmp3_);
+	_tmp5_ = _tmp4_;
+	_iter = *_tmp5_;
+	_g_free0 (_tmp5_);
+	result = TRUE;
+	if (iter) {
+		*iter = _iter;
+	}
+	return result;
+}
+
+
+static gboolean structure_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	GNode* _tmp2_ = NULL;
+	GNode* next_node;
+	GtkTreeIter* _tmp3_ = NULL;
+	GtkTreeIter* _tmp4_;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_val_if_fail (_tmp0_, FALSE);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	_tmp2_ = g_node_next_sibling (node);
+	next_node = _tmp2_;
+	if (next_node == NULL) {
+		result = FALSE;
+		return result;
+	}
+	_tmp3_ = structure_model_create_iter_at_node (self, next_node);
+	_tmp4_ = _tmp3_;
+	*iter = *_tmp4_;
+	_g_free0 (_tmp4_);
+	result = TRUE;
+	return result;
+}
+
+
+static gboolean structure_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n) {
+	StructureModel * self;
+	GtkTreeIter _iter = {0};
+	gboolean result = FALSE;
+	GNode* node = NULL;
+	gboolean _tmp2_;
+	gboolean _tmp3_ = FALSE;
+	GNode* _tmp5_ = NULL;
+	GtkTreeIter* _tmp6_ = NULL;
+	GtkTreeIter* _tmp7_;
+	self = (StructureModel*) base;
+	if (parent == NULL) {
+		node = self->priv->_tree;
+	} else {
+		gboolean _tmp0_;
+		GNode* _tmp1_ = NULL;
+		_tmp0_ = structure_model_iter_is_valid (self, parent);
+		g_return_val_if_fail (_tmp0_, FALSE);
+		_tmp1_ = structure_model_get_node_from_iter (self, parent);
+		node = _tmp1_;
+	}
+	_tmp2_ = G_NODE_IS_LEAF (node);
+	if (_tmp2_) {
+		result = FALSE;
+		if (iter) {
+			*iter = _iter;
+		}
+		return result;
+	}
+	if (n < 0) {
+		_tmp3_ = TRUE;
+	} else {
+		guint _tmp4_;
+		_tmp4_ = g_node_n_children (node);
+		_tmp3_ = _tmp4_ <= n;
+	}
+	if (_tmp3_) {
+		result = FALSE;
+		if (iter) {
+			*iter = _iter;
+		}
+		return result;
+	}
+	_tmp5_ = g_node_nth_child (node, (guint) n);
+	_tmp6_ = structure_model_create_iter_at_node (self, _tmp5_);
+	_tmp7_ = _tmp6_;
+	_iter = *_tmp7_;
+	_g_free0 (_tmp7_);
+	result = TRUE;
+	if (iter) {
+		*iter = _iter;
+	}
+	return result;
+}
+
+
+static gboolean structure_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child) {
+	StructureModel * self;
+	GtkTreeIter _iter = {0};
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	GNode* parent_node;
+	GtkTreeIter* _tmp2_ = NULL;
+	GtkTreeIter* _tmp3_;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_iter_is_valid (self, child);
+	g_return_val_if_fail (_tmp0_, FALSE);
+	_tmp1_ = structure_model_get_node_from_iter (self, child);
+	node = _tmp1_;
+	parent_node = node->parent;
+	g_return_val_if_fail (parent_node != NULL, FALSE);
+	if (parent_node == self->priv->_tree) {
+		result = FALSE;
+		if (iter) {
+			*iter = _iter;
+		}
+		return result;
+	}
+	_tmp2_ = structure_model_create_iter_at_node (self, parent_node);
+	_tmp3_ = _tmp2_;
+	_iter = *_tmp3_;
+	_g_free0 (_tmp3_);
+	result = TRUE;
+	if (iter) {
+		*iter = _iter;
+	}
+	return result;
+}
+
+
+static gboolean structure_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, GtkTreePath* path) {
+	StructureModel * self;
+	GtkTreeIter _iter = {0};
+	gboolean result = FALSE;
+	gint _tmp0_;
+	gint depth;
+	gint* _tmp1_ = NULL;
+	gint* indices;
+	gint indices_length1;
+	gint _indices_size_;
+	GNode* node;
+	GtkTreeIter* _tmp6_ = NULL;
+	GtkTreeIter* _tmp7_;
+	self = (StructureModel*) base;
+	g_return_val_if_fail (path != NULL, FALSE);
+	_tmp0_ = gtk_tree_path_get_depth (path);
+	depth = _tmp0_;
+	g_return_val_if_fail (1 <= depth, FALSE);
+	_tmp1_ = gtk_tree_path_get_indices (path);
+	indices = _tmp1_;
+	indices_length1 = -1;
+	_indices_size_ = -1;
+	node = self->priv->_tree;
+	{
+		gint cur_depth;
+		cur_depth = 0;
+		{
+			gboolean _tmp2_;
+			_tmp2_ = TRUE;
+			while (TRUE) {
+				gint indice;
+				gboolean _tmp3_ = FALSE;
+				GNode* _tmp5_ = NULL;
+				if (!_tmp2_) {
+					cur_depth++;
+				}
+				_tmp2_ = FALSE;
+				if (!(cur_depth < depth)) {
+					break;
+				}
+				indice = indices[cur_depth];
+				if (indice < 0) {
+					_tmp3_ = TRUE;
+				} else {
+					guint _tmp4_;
+					_tmp4_ = g_node_n_children (node);
+					_tmp3_ = _tmp4_ <= indice;
+				}
+				if (_tmp3_) {
+					result = FALSE;
+					if (iter) {
+						*iter = _iter;
+					}
+					return result;
+				}
+				_tmp5_ = g_node_nth_child (node, (guint) indice);
+				node = _tmp5_;
+			}
+		}
+	}
+	_tmp6_ = structure_model_create_iter_at_node (self, node);
+	_tmp7_ = _tmp6_;
+	_iter = *_tmp7_;
+	_g_free0 (_tmp7_);
+	result = TRUE;
+	if (iter) {
+		*iter = _iter;
+	}
+	return result;
+}
+
+
+static GtkTreePath* structure_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	GtkTreePath* result = NULL;
+	gboolean _tmp0_;
+	GtkTreePath* _tmp1_ = NULL;
+	GtkTreePath* path;
+	GNode* _tmp2_ = NULL;
+	GNode* node;
+	self = (StructureModel*) base;
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_val_if_fail (_tmp0_, NULL);
+	_tmp1_ = gtk_tree_path_new ();
+	path = _tmp1_;
+	_tmp2_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp2_;
+	while (TRUE) {
+		gboolean _tmp3_;
+		gint _tmp4_;
+		gint pos;
+		_tmp3_ = G_NODE_IS_ROOT (node);
+		if (!(!_tmp3_)) {
+			break;
+		}
+		_tmp4_ = g_node_child_position (node->parent, node);
+		pos = _tmp4_;
+		gtk_tree_path_prepend_index (path, pos);
+		node = node->parent;
+	}
+	result = path;
+	return result;
+}
+
+
+static void structure_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	self = (StructureModel*) base;
+}
+
+
+static void structure_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter) {
+	StructureModel * self;
+	self = (StructureModel*) base;
+}
+
+
+/*************************************************************************/
+void structure_model_add_item_at_end (StructureModel* self, StructData* item) {
+	GNode* parent;
+	StructType item_depth;
+	g_return_if_fail (self != NULL);
+	parent = self->priv->_tree;
+	item_depth = (*item).type;
+	while (TRUE) {
+		GNode* _tmp0_ = NULL;
+		GNode* last_child;
+		StructType cur_depth;
+		gboolean _tmp1_ = FALSE;
+		_tmp0_ = g_node_last_child (parent);
+		last_child = _tmp0_;
+		if (last_child == NULL) {
+			break;
+		}
+		cur_depth = (*((StructData*) last_child->data)).type;
+		if (item_depth <= cur_depth) {
+			_tmp1_ = TRUE;
+		} else {
+			gboolean _tmp2_;
+			_tmp2_ = structure_is_section (cur_depth);
+			_tmp1_ = !_tmp2_;
+		}
+		if (_tmp1_) {
+			break;
+		}
+		parent = last_child;
+	}
+	structure_model_append_item (self, parent, item);
+}
+
+
+void structure_model_add_item_in_middle (StructureModel* self, StructData* item) {
+	gboolean _tmp0_;
+	gint _tmp1_;
+	gint pos;
+	GNode* cur_parent;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = G_NODE_IS_LEAF (self->priv->_tree);
+	if (_tmp0_) {
+		structure_model_append_item (self, self->priv->_tree, item);
+		return;
+	}
+	_tmp1_ = structure_model_get_position_from_mark ((*item).start_mark);
+	pos = _tmp1_;
+	cur_parent = self->priv->_tree;
+	while (TRUE) {
+		GNode* _tmp2_ = NULL;
+		GNode* cur_child;
+		gint child_index;
+		_tmp2_ = g_node_first_child (cur_parent);
+		cur_child = _tmp2_;
+		child_index = 0;
+		while (TRUE) {
+			gint _tmp3_;
+			gint cur_pos;
+			GNode* _tmp6_ = NULL;
+			GNode* next_child;
+			_tmp3_ = structure_model_get_position_from_mark ((*((StructData*) cur_child->data)).start_mark);
+			cur_pos = _tmp3_;
+			if (cur_pos > pos) {
+				GNode* _tmp4_ = NULL;
+				GNode* prev_child;
+				gboolean _tmp5_;
+				if (child_index == 0) {
+					structure_model_insert_item_at_position (self, item, cur_parent, child_index);
+					return;
+				}
+				_tmp4_ = g_node_prev_sibling (cur_child);
+				prev_child = _tmp4_;
+				_tmp5_ = G_NODE_IS_LEAF (prev_child);
+				if (_tmp5_) {
+					structure_model_insert_item_at_position (self, item, cur_parent, child_index);
+					return;
+				}
+				cur_parent = prev_child;
+				break;
+			}
+			_tmp6_ = g_node_next_sibling (cur_child);
+			next_child = _tmp6_;
+			if (next_child == NULL) {
+				gboolean _tmp7_;
+				_tmp7_ = G_NODE_IS_LEAF (cur_child);
+				if (_tmp7_) {
+					structure_model_insert_item_at_position (self, item, cur_parent, child_index + 1);
+					return;
+				}
+				cur_parent = cur_child;
+				break;
+			}
+			cur_child = next_child;
+			child_index++;
+		}
+	}
+}
+
+
+GtkTreeIter* structure_model_get_next_sibling_or_parent (StructureModel* self, GtkTreeIter* section_iter, GError** error) {
+	GtkTreeIter* result = NULL;
+	gboolean _tmp0_;
+	GNode* _tmp2_ = NULL;
+	GNode* cur_node;
+	gboolean _tmp3_;
+	GError * _inner_error_ = NULL;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = structure_model_iter_is_valid (self, section_iter);
+	if (!_tmp0_) {
+		GError* _tmp1_ = NULL;
+		_tmp1_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_GENERAL, "iter is not valid.");
+		_inner_error_ = _tmp1_;
+		if (_inner_error_->domain == STRUCT_ERROR) {
+			g_propagate_error (error, _inner_error_);
+			return NULL;
+		} else {
+			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return NULL;
+		}
+	}
+	_tmp2_ = structure_model_get_node_from_iter (self, section_iter);
+	cur_node = _tmp2_;
+	_tmp3_ = structure_is_section ((*((StructData*) cur_node->data)).type);
+	if (!_tmp3_) {
+		GError* _tmp4_ = NULL;
+		_tmp4_ = g_error_new_literal (STRUCT_ERROR, STRUCT_ERROR_GENERAL, "iter is not a section.");
+		_inner_error_ = _tmp4_;
+		if (_inner_error_->domain == STRUCT_ERROR) {
+			g_propagate_error (error, _inner_error_);
+			return NULL;
+		} else {
+			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+			g_clear_error (&_inner_error_);
+			return NULL;
+		}
+	}
+	while (TRUE) {
+		gboolean _tmp5_ = FALSE;
+		GNode* _tmp6_ = NULL;
+		GNode* next_sibling_node;
+		if (cur_node != NULL) {
+			_tmp5_ = cur_node != self->priv->_tree;
+		} else {
+			_tmp5_ = FALSE;
+		}
+		if (!_tmp5_) {
+			break;
+		}
+		_tmp6_ = g_node_next_sibling (cur_node);
+		next_sibling_node = _tmp6_;
+		if (next_sibling_node != NULL) {
+			GtkTreeIter* _tmp7_ = NULL;
+			_tmp7_ = structure_model_create_iter_at_node (self, next_sibling_node);
+			result = _tmp7_;
+			return result;
+		}
+		cur_node = cur_node->parent;
+	}
+	result = NULL;
+	return result;
+}
+
+
+void structure_model_delete (StructureModel* self, GtkTreeIter* iter) {
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	GNode* _tmp2_ = NULL;
+	GNode* _tmp3_;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_if_fail (_tmp0_);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	_tmp2_ = structure_model_delete_node (self, node);
+	_tmp3_ = _tmp2_;
+	__g_node_destroy__struct_data_free0_0 (_tmp3_);
+	structure_model_regenerate_simple_lists (self);
+}
+
+
+void structure_model_shift_right (StructureModel* self, GtkTreeIter* iter) {
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	StructType type;
+	StructType new_type;
+	GNode* _tmp2_ = NULL;
+	GNode* new_parent;
+	gint new_pos = 0;
+	gboolean _tmp3_ = FALSE;
+	GNode* _tmp5_ = NULL;
+	GNode* node_unlinked;
+	GNode* _tmp6_;
+	GNode* _tmp7_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_if_fail (_tmp0_);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	type = (*((StructData*) node->data)).type;
+	g_return_if_fail (type < STRUCT_TYPE_SUBPARAGRAPH);
+	new_type = type + 1;
+	_tmp2_ = g_node_prev_sibling (node);
+	new_parent = _tmp2_;
+	if (new_parent == NULL) {
+		_tmp3_ = TRUE;
+	} else {
+		_tmp3_ = new_type <= (*((StructData*) new_parent->data)).type;
+	}
+	if (_tmp3_) {
+		gint _tmp4_;
+		new_parent = node->parent;
+		_tmp4_ = g_node_child_position (new_parent, node);
+		new_pos = _tmp4_;
+	} else {
+		new_pos = -1;
+	}
+	_tmp5_ = structure_model_delete_node (self, node);
+	node_unlinked = _tmp5_;
+	structure_model_shift_node (self, node_unlinked, TRUE);
+	_tmp6_ = node_unlinked;
+	node_unlinked = NULL;
+	_tmp7_ = g_node_insert (new_parent, new_pos, _tmp6_);
+	node = _tmp7_;
+	structure_model_reinsert_node (self, node, FALSE);
+	__g_node_destroy__struct_data_free0_0 (node_unlinked);
+}
+
+
+void structure_model_shift_left (StructureModel* self, GtkTreeIter* iter) {
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	StructType type;
+	gboolean _tmp2_ = FALSE;
+	StructType new_type;
+	GNode* new_parent = NULL;
+	gint new_pos = 0;
+	GNode* parent;
+	gboolean _tmp3_ = FALSE;
+	GNode* _tmp6_ = NULL;
+	GNode* sibling;
+	GNode* _tmp7_ = NULL;
+	GNode* node_unlinked;
+	GNode* _tmp11_;
+	GNode* _tmp12_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_if_fail (_tmp0_);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	type = (*((StructData*) node->data)).type;
+	if (STRUCT_TYPE_PART < type) {
+		_tmp2_ = type <= STRUCT_TYPE_SUBPARAGRAPH;
+	} else {
+		_tmp2_ = FALSE;
+	}
+	g_return_if_fail (_tmp2_);
+	new_type = type - 1;
+	parent = node->parent;
+	if (parent == self->priv->_tree) {
+		_tmp3_ = TRUE;
+	} else {
+		_tmp3_ = (*((StructData*) parent->data)).type < new_type;
+	}
+	if (_tmp3_) {
+		gint _tmp4_;
+		new_parent = parent;
+		_tmp4_ = g_node_child_position (parent, node);
+		new_pos = _tmp4_;
+	} else {
+		gint _tmp5_;
+		new_parent = parent->parent;
+		_tmp5_ = g_node_child_position (new_parent, parent);
+		new_pos = _tmp5_ + 1;
+	}
+	_tmp6_ = g_node_next_sibling (node);
+	sibling = _tmp6_;
+	_tmp7_ = structure_model_delete_node (self, node);
+	node_unlinked = _tmp7_;
+	structure_model_shift_node (self, node_unlinked, FALSE);
+	while (TRUE) {
+		GNode* _tmp8_ = NULL;
+		GNode* next_sibling;
+		GNode* _tmp9_ = NULL;
+		GNode* new_child;
+		GNode* _tmp10_;
+		if (!(sibling != NULL)) {
+			break;
+		}
+		if ((*((StructData*) sibling->data)).type <= new_type) {
+			break;
+		}
+		_tmp8_ = g_node_next_sibling (sibling);
+		next_sibling = _tmp8_;
+		_tmp9_ = structure_model_delete_node (self, sibling);
+		new_child = _tmp9_;
+		_tmp10_ = new_child;
+		new_child = NULL;
+		g_node_append (node_unlinked, _tmp10_);
+		sibling = next_sibling;
+		__g_node_destroy__struct_data_free0_0 (new_child);
+	}
+	_tmp11_ = node_unlinked;
+	node_unlinked = NULL;
+	_tmp12_ = g_node_insert (new_parent, new_pos, _tmp11_);
+	node = _tmp12_;
+	structure_model_reinsert_node (self, node, FALSE);
+	__g_node_destroy__struct_data_free0_0 (node_unlinked);
+}
+
+
+gboolean structure_model_item_contains_subparagraph (StructureModel* self, GtkTreeIter* iter) {
+	gboolean result = FALSE;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	gboolean _tmp2_;
+	g_return_val_if_fail (self != NULL, FALSE);
+	_tmp0_ = structure_model_iter_is_valid (self, iter);
+	g_return_val_if_fail (_tmp0_, FALSE);
+	_tmp1_ = structure_model_get_node_from_iter (self, iter);
+	node = _tmp1_;
+	_tmp2_ = structure_model_node_contains_subparagraph (self, node);
+	result = _tmp2_;
+	return result;
+}
+
+
+static gboolean structure_model_node_contains_subparagraph (StructureModel* self, GNode* node) {
+	gboolean result = FALSE;
+	StructType type;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* child;
+	g_return_val_if_fail (self != NULL, FALSE);
+	g_return_val_if_fail (node != NULL, FALSE);
+	type = (*((StructData*) node->data)).type;
+	if (type == STRUCT_TYPE_SUBPARAGRAPH) {
+		result = TRUE;
+		return result;
+	}
+	_tmp0_ = structure_is_section (type);
+	if (!_tmp0_) {
+		result = FALSE;
+		return result;
+	}
+	_tmp1_ = g_node_first_child (node);
+	child = _tmp1_;
+	while (TRUE) {
+		gboolean _tmp2_;
+		GNode* _tmp3_ = NULL;
+		if (!(child != NULL)) {
+			break;
+		}
+		_tmp2_ = structure_model_node_contains_subparagraph (self, child);
+		if (_tmp2_) {
+			result = TRUE;
+			return result;
+		}
+		_tmp3_ = g_node_next_sibling (child);
+		child = _tmp3_;
+	}
+	result = FALSE;
+	return result;
+}
+
+
+static void structure_model_insert_node (StructureModel* self, GNode* node, gboolean force_first_child) {
+	GtkTreeIter* _tmp0_ = NULL;
+	GtkTreeIter* _tmp1_;
+	GtkTreeIter _tmp2_;
+	GtkTreeIter item_iter;
+	GtkTreePath* _tmp3_ = NULL;
+	GtkTreePath* item_path;
+	GNode* parent;
+	gboolean _tmp4_ = FALSE;
+	gboolean first_child;
+	gboolean _tmp6_ = FALSE;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (node != NULL);
+	structure_model_new_stamp (self);
+	_tmp0_ = structure_model_create_iter_at_node (self, node);
+	_tmp1_ = _tmp0_;
+	_tmp2_ = *_tmp1_;
+	_g_free0 (_tmp1_);
+	item_iter = _tmp2_;
+	_tmp3_ = gtk_tree_model_get_path ((GtkTreeModel*) self, &item_iter);
+	item_path = _tmp3_;
+	gtk_tree_model_row_inserted ((GtkTreeModel*) self, item_path, &item_iter);
+	parent = node->parent;
+	if (parent != self->priv->_tree) {
+		guint _tmp5_;
+		_tmp5_ = g_node_n_children (parent);
+		_tmp4_ = _tmp5_ == 1;
+	} else {
+		_tmp4_ = FALSE;
+	}
+	first_child = _tmp4_;
+	if (force_first_child) {
+		_tmp6_ = TRUE;
+	} else {
+		_tmp6_ = first_child;
+	}
+	if (_tmp6_) {
+		GtkTreeIter* _tmp7_ = NULL;
+		GtkTreeIter* _tmp8_;
+		GtkTreeIter _tmp9_;
+		GtkTreeIter parent_iter;
+		GtkTreePath* _tmp10_ = NULL;
+		GtkTreePath* parent_path;
+		_tmp7_ = structure_model_create_iter_at_node (self, parent);
+		_tmp8_ = _tmp7_;
+		_tmp9_ = *_tmp8_;
+		_g_free0 (_tmp8_);
+		parent_iter = _tmp9_;
+		_tmp10_ = gtk_tree_model_get_path ((GtkTreeModel*) self, &parent_iter);
+		parent_path = _tmp10_;
+		gtk_tree_model_row_has_child_toggled ((GtkTreeModel*) self, parent_path, &parent_iter);
+		_gtk_tree_path_free0 (parent_path);
+	}
+	_gtk_tree_path_free0 (item_path);
+}
+
+
+static GNode* g_node_unlink_vala (GNode* self) {
+	GNode* result = NULL;
+	void* ptr;
+	void* _tmp0_;
+	g_return_val_if_fail (self != NULL, NULL);
+	ptr = self;
+	g_node_unlink (self);
+	_tmp0_ = ptr;
+	ptr = NULL;
+	result = (GNode*) _tmp0_;
+	return result;
+}
+
+
+static GNode* structure_model_delete_node (StructureModel* self, GNode* node) {
+	GNode* result = NULL;
+	GtkTreeIter* _tmp0_ = NULL;
+	GtkTreeIter* iter;
+	GtkTreePath* _tmp1_ = NULL;
+	GtkTreePath* path;
+	GNode* parent;
+	GNode* _tmp2_ = NULL;
+	GNode* node_unlinked;
+	gboolean _tmp3_ = FALSE;
+	g_return_val_if_fail (self != NULL, NULL);
+	g_return_val_if_fail (node != NULL, NULL);
+	structure_model_new_stamp (self);
+	_tmp0_ = structure_model_create_iter_at_node (self, node);
+	iter = _tmp0_;
+	g_return_val_if_fail (iter != NULL, NULL);
+	_tmp1_ = gtk_tree_model_get_path ((GtkTreeModel*) self, iter);
+	path = _tmp1_;
+	parent = node->parent;
+	_tmp2_ = g_node_unlink_vala (node);
+	node_unlinked = _tmp2_;
+	gtk_tree_model_row_deleted ((GtkTreeModel*) self, path);
+	if (parent != self->priv->_tree) {
+		guint _tmp4_;
+		_tmp4_ = g_node_n_children (parent);
+		_tmp3_ = _tmp4_ == 0;
+	} else {
+		_tmp3_ = FALSE;
+	}
+	if (_tmp3_) {
+		GtkTreeIter* _tmp5_ = NULL;
+		GtkTreeIter* _tmp6_;
+		GtkTreeIter _tmp7_;
+		GtkTreeIter parent_iter;
+		GtkTreePath* _tmp8_ = NULL;
+		GtkTreePath* parent_path;
+		_tmp5_ = structure_model_create_iter_at_node (self, parent);
+		_tmp6_ = _tmp5_;
+		_tmp7_ = *_tmp6_;
+		_g_free0 (_tmp6_);
+		parent_iter = _tmp7_;
+		_tmp8_ = gtk_tree_model_get_path ((GtkTreeModel*) self, &parent_iter);
+		parent_path = _tmp8_;
+		gtk_tree_model_row_has_child_toggled ((GtkTreeModel*) self, parent_path, &parent_iter);
+		_gtk_tree_path_free0 (parent_path);
+	}
+	result = node_unlinked;
+	_gtk_tree_path_free0 (path);
+	_g_free0 (iter);
+	return result;
+}
+
+
+static void structure_model_shift_node (StructureModel* self, GNode* node, gboolean shift_right) {
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* child;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (node != NULL);
+	_tmp0_ = structure_is_section ((*((StructData*) node->data)).type);
+	if (!_tmp0_) {
+		return;
+	}
+	if (shift_right) {
+		if ((*((StructData*) node->data)).type != STRUCT_TYPE_SUBPARAGRAPH) {
+			(*((StructData*) node->data)).type = (*((StructData*) node->data)).type + 1;
+		}
+	} else {
+		if ((*((StructData*) node->data)).type != STRUCT_TYPE_PART) {
+			(*((StructData*) node->data)).type = (*((StructData*) node->data)).type - 1;
+		}
+	}
+	_tmp1_ = g_node_first_child (node);
+	child = _tmp1_;
+	while (TRUE) {
+		GNode* _tmp2_ = NULL;
+		if (!(child != NULL)) {
+			break;
+		}
+		structure_model_shift_node (self, child, shift_right);
+		_tmp2_ = g_node_next_sibling (child);
+		child = _tmp2_;
+	}
+}
+
+
+static void structure_model_reinsert_node (StructureModel* self, GNode* node, gboolean force_first_child) {
+	GNode* _tmp0_ = NULL;
+	GNode* child;
+	gboolean first_child;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (node != NULL);
+	structure_model_insert_node (self, node, force_first_child);
+	_tmp0_ = g_node_first_child (node);
+	child = _tmp0_;
+	first_child = TRUE;
+	while (TRUE) {
+		GNode* _tmp1_ = NULL;
+		if (!(child != NULL)) {
+			break;
+		}
+		structure_model_reinsert_node (self, child, first_child);
+		_tmp1_ = g_node_next_sibling (child);
+		child = _tmp1_;
+		first_child = FALSE;
+	}
+}
+
+
+static void structure_model_insert_item_at_position (StructureModel* self, StructData* item, GNode* parent, gint pos) {
+	gboolean _tmp4_ = FALSE;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (parent != NULL);
+	if (pos > 0) {
+		GNode* _tmp0_ = NULL;
+		GNode* prev;
+		gboolean _tmp1_;
+		gboolean prev_is_section;
+		gboolean _tmp2_;
+		gboolean item_is_section;
+		gboolean _tmp3_ = FALSE;
+		_tmp0_ = g_node_nth_child (parent, (guint) (pos - 1));
+		prev = _tmp0_;
+		_tmp1_ = structure_is_section ((*((StructData*) prev->data)).type);
+		prev_is_section = _tmp1_;
+		_tmp2_ = structure_is_section ((*item).type);
+		item_is_section = _tmp2_;
+		if (prev_is_section) {
+			_tmp3_ = !item_is_section;
+		} else {
+			_tmp3_ = FALSE;
+		}
+		if (_tmp3_) {
+			structure_model_append_item (self, prev, item);
+			return;
+		}
+	}
+	if (parent != self->priv->_tree) {
+		gboolean _tmp5_;
+		_tmp5_ = structure_is_section ((*((StructData*) parent->data)).type);
+		_tmp4_ = !_tmp5_;
+	} else {
+		_tmp4_ = FALSE;
+	}
+	if (_tmp4_) {
+		GNode* grand_parent;
+		gint _tmp6_;
+		gint parent_pos;
+		grand_parent = parent->parent;
+		_tmp6_ = g_node_child_position (grand_parent, parent);
+		parent_pos = _tmp6_;
+		structure_model_insert_item (self, grand_parent, parent_pos + 1, item);
+		return;
+	}
+	structure_model_insert_item (self, parent, pos, item);
+}
+
+
+static void structure_model_append_item (StructureModel* self, GNode* parent, StructData* item) {
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (parent != NULL);
+	structure_model_insert_item (self, parent, -1, item);
+}
+
+
+static void structure_model_insert_item (StructureModel* self, GNode* parent, gint pos, StructData* item) {
+	StructData* _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* new_node;
+	gboolean append;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (parent != NULL);
+	g_return_if_fail ((*item).text != NULL);
+	_tmp0_ = _struct_data_dup0 (item);
+	_tmp1_ = g_node_insert_data (parent, pos, _tmp0_);
+	new_node = _tmp1_;
+	structure_model_insert_node (self, new_node, FALSE);
+	append = pos == (-1);
+	structure_model_insert_node_in_list (self, new_node, append);
+	if (!append) {
+		structure_model_make_children_between_marks (self, new_node);
+	}
+}
+
+
+static void structure_model_make_children_between_marks (StructureModel* self, GNode* node) {
+	StructData _tmp0_;
+	StructData _tmp1_ = {0};
+	StructData data;
+	gint _tmp2_;
+	gint end_mark_pos;
+	GNode* _tmp3_ = NULL;
+	GNode* sibling;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (node != NULL);
+	struct_data_copy ((StructData*) node->data, &_tmp1_);
+	_tmp0_ = _tmp1_;
+	data = _tmp0_;
+	if (data.end_mark == NULL) {
+		struct_data_destroy (&data);
+		return;
+	}
+	_tmp2_ = structure_model_get_position_from_mark (data.end_mark);
+	end_mark_pos = _tmp2_;
+	_tmp3_ = g_node_next_sibling (node);
+	sibling = _tmp3_;
+	while (TRUE) {
+		StructData _tmp4_;
+		StructData _tmp5_ = {0};
+		StructData sibling_data;
+		gboolean _tmp6_;
+		gint _tmp7_;
+		gint sibling_pos;
+		GNode* _tmp8_ = NULL;
+		GNode* sibling_unlinked;
+		GNode* _tmp9_;
+		GNode* _tmp10_ = NULL;
+		GNode* new_child;
+		GNode* _tmp11_ = NULL;
+		if (!(sibling != NULL)) {
+			break;
+		}
+		struct_data_copy ((StructData*) sibling->data, &_tmp5_);
+		_tmp4_ = _tmp5_;
+		sibling_data = _tmp4_;
+		_tmp6_ = structure_is_section (sibling_data.type);
+		if (_tmp6_) {
+			struct_data_destroy (&sibling_data);
+			break;
+		}
+		_tmp7_ = structure_model_get_position_from_mark (sibling_data.start_mark);
+		sibling_pos = _tmp7_;
+		if (end_mark_pos <= sibling_pos) {
+			struct_data_destroy (&sibling_data);
+			break;
+		}
+		_tmp8_ = structure_model_delete_node (self, sibling);
+		sibling_unlinked = _tmp8_;
+		_tmp9_ = sibling_unlinked;
+		sibling_unlinked = NULL;
+		_tmp10_ = g_node_append (node, _tmp9_);
+		new_child = _tmp10_;
+		structure_model_insert_node (self, new_child, FALSE);
+		_tmp11_ = g_node_next_sibling (node);
+		sibling = _tmp11_;
+		__g_node_destroy__struct_data_free0_0 (sibling_unlinked);
+		struct_data_destroy (&sibling_data);
+	}
+	struct_data_destroy (&data);
+}
+
+
+static gint structure_model_get_position_from_mark (GtkTextMark* mark) {
+	gint result = 0;
+	GtkTextIter iter = {0};
+	GtkTextBuffer* _tmp0_ = NULL;
+	GtkTextBuffer* _tmp1_;
+	GtkTextBuffer* doc;
+	GtkTextIter _tmp2_ = {0};
+	gint _tmp3_;
+	g_return_val_if_fail (mark != NULL, 0);
+	_tmp0_ = gtk_text_mark_get_buffer (mark);
+	_tmp1_ = _g_object_ref0 (_tmp0_);
+	doc = _tmp1_;
+	gtk_text_buffer_get_iter_at_mark (doc, &_tmp2_, mark);
+	iter = _tmp2_;
+	_tmp3_ = gtk_text_iter_get_offset (&iter);
+	result = _tmp3_;
+	_g_object_unref0 (doc);
+	return result;
+}
+
+
+/*************************************************************************/
+void structure_model_populate_list (StructureModel* self, GtkListStore* store, StructType type) {
+	GeeArrayList* _tmp0_ = NULL;
+	GeeArrayList* list;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (store != NULL);
+	_tmp0_ = structure_model_get_list (self, type);
+	list = _tmp0_;
+	g_return_if_fail (list != NULL);
+	{
+		GeeArrayList* _tmp1_;
+		GeeArrayList* _node_list;
+		gint _tmp2_;
+		gint _node_size;
+		gint _node_index;
+		_tmp1_ = _g_object_ref0 (list);
+		_node_list = _tmp1_;
+		_tmp2_ = gee_collection_get_size ((GeeCollection*) _node_list);
+		_node_size = _tmp2_;
+		_node_index = -1;
+		while (TRUE) {
+			gpointer _tmp3_ = NULL;
+			GNode* node;
+			StructData _tmp4_;
+			StructData _tmp5_ = {0};
+			StructData data;
+			GtkTreeIter iter = {0};
+			GtkTreeIter _tmp6_ = {0};
+			gchar* _tmp7_ = NULL;
+			gchar* _tmp8_;
+			gchar* _tmp9_ = NULL;
+			gchar* _tmp10_;
+			_node_index = _node_index + 1;
+			if (!(_node_index < _node_size)) {
+				break;
+			}
+			_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) _node_list, _node_index);
+			node = (GNode*) _tmp3_;
+			struct_data_copy ((StructData*) node->data, &_tmp5_);
+			_tmp4_ = _tmp5_;
+			data = _tmp4_;
+			gtk_list_store_append (store, &_tmp6_);
+			iter = _tmp6_;
+			_tmp7_ = structure_get_icon_from_type (data.type);
+			_tmp8_ = _tmp7_;
+			_tmp9_ = structure_get_type_name (data.type);
+			_tmp10_ = _tmp9_;
+			gtk_list_store_set (store, &iter, STRUCT_LIST_COLUMN_PIXBUF, _tmp8_, STRUCT_LIST_COLUMN_TEXT, data.text, STRUCT_LIST_COLUMN_TOOLTIP, _tmp10_, -1, -1);
+			_g_free0 (_tmp10_);
+			_g_free0 (_tmp8_);
+			struct_data_destroy (&data);
+		}
+		_g_object_unref0 (_node_list);
+	}
+	_g_object_unref0 (list);
+}
+
+
+GtkTreePath* structure_model_get_tree_path_from_list_num (StructureModel* self, StructType list_type, gint num) {
+	GtkTreePath* result = NULL;
+	GeeArrayList* _tmp0_ = NULL;
+	GeeArrayList* list;
+	gboolean _tmp1_ = FALSE;
+	gpointer _tmp3_ = NULL;
+	GtkTreeIter* _tmp4_ = NULL;
+	GtkTreeIter* _tmp5_;
+	GtkTreePath* _tmp6_ = NULL;
+	GtkTreePath* _tmp7_;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = structure_model_get_list (self, list_type);
+	list = _tmp0_;
+	g_return_val_if_fail (list != NULL, NULL);
+	if (0 <= num) {
+		gint _tmp2_;
+		_tmp2_ = gee_collection_get_size ((GeeCollection*) list);
+		_tmp1_ = num < _tmp2_;
+	} else {
+		_tmp1_ = FALSE;
+	}
+	g_return_val_if_fail (_tmp1_, NULL);
+	_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) list, num);
+	_tmp4_ = structure_model_create_iter_at_node (self, (GNode*) _tmp3_);
+	_tmp5_ = _tmp4_;
+	_tmp6_ = gtk_tree_model_get_path ((GtkTreeModel*) self, _tmp5_);
+	_tmp7_ = _tmp6_;
+	_g_free0 (_tmp5_);
+	result = _tmp7_;
+	_g_object_unref0 (list);
+	return result;
+}
+
+
+gint structure_model_get_list_num_from_tree_iter (StructureModel* self, GtkTreeIter* tree_iter) {
+	gint result = 0;
+	gboolean _tmp0_;
+	GNode* _tmp1_ = NULL;
+	GNode* node;
+	GeeArrayList* _tmp2_ = NULL;
+	GeeArrayList* list;
+	g_return_val_if_fail (self != NULL, 0);
+	_tmp0_ = structure_model_iter_is_valid (self, tree_iter);
+	g_return_val_if_fail (_tmp0_, -1);
+	_tmp1_ = structure_model_get_node_from_iter (self, tree_iter);
+	node = _tmp1_;
+	_tmp2_ = structure_model_get_list (self, (*((StructData*) node->data)).type);
+	list = _tmp2_;
+	g_return_val_if_fail (list != NULL, -1);
+	{
+		gint num;
+		num = 0;
+		{
+			gboolean _tmp3_;
+			_tmp3_ = TRUE;
+			while (TRUE) {
+				gint _tmp4_;
+				gpointer _tmp5_ = NULL;
+				if (!_tmp3_) {
+					num++;
+				}
+				_tmp3_ = FALSE;
+				_tmp4_ = gee_collection_get_size ((GeeCollection*) list);
+				if (!(num < _tmp4_)) {
+					break;
+				}
+				_tmp5_ = gee_abstract_list_get ((GeeAbstractList*) list, num);
+				if (((GNode*) _tmp5_) == node) {
+					result = num;
+					_g_object_unref0 (list);
+					return result;
+				}
+			}
+		}
+	}
+	g_return_val_if_reached (-1);
+	_g_object_unref0 (list);
+}
+
+
+static void structure_model_insert_node_in_list (StructureModel* self, GNode* node, gboolean at_end) {
+	StructData _tmp0_;
+	StructData _tmp1_ = {0};
+	StructData item;
+	gboolean _tmp2_;
+	GeeArrayList* _tmp3_ = NULL;
+	GeeArrayList* list;
+	gint _tmp4_;
+	gint mark_pos;
+	gint i = 0;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (node != NULL);
+	struct_data_copy ((StructData*) node->data, &_tmp1_);
+	_tmp0_ = _tmp1_;
+	item = _tmp0_;
+	_tmp2_ = structure_is_section (item.type);
+	if (_tmp2_) {
+		struct_data_destroy (&item);
+		return;
+	}
+	_tmp3_ = structure_model_get_list (self, item.type);
+	list = _tmp3_;
+	g_return_if_fail (list != NULL);
+	if (at_end) {
+		gee_abstract_collection_add ((GeeAbstractCollection*) list, node);
+		_g_object_unref0 (list);
+		struct_data_destroy (&item);
+		return;
+	}
+	_tmp4_ = structure_model_get_position_from_mark (item.start_mark);
+	mark_pos = _tmp4_;
+	{
+		gboolean _tmp5_;
+		i = 0;
+		_tmp5_ = TRUE;
+		while (TRUE) {
+			gint _tmp6_;
+			gpointer _tmp7_ = NULL;
+			gint _tmp8_;
+			gint cur_mark_pos;
+			if (!_tmp5_) {
+				i++;
+			}
+			_tmp5_ = FALSE;
+			_tmp6_ = gee_collection_get_size ((GeeCollection*) list);
+			if (!(i < _tmp6_)) {
+				break;
+			}
+			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) list, i);
+			_tmp8_ = structure_model_get_position_from_mark ((*((StructData*) ((GNode*) _tmp7_)->data)).start_mark);
+			cur_mark_pos = _tmp8_;
+			if (cur_mark_pos > mark_pos) {
+				break;
+			}
+		}
+	}
+	gee_abstract_list_insert ((GeeAbstractList*) list, i, node);
+	_g_object_unref0 (list);
+	struct_data_destroy (&item);
+}
+
+
+static gboolean _lambda18_ (GNode* node_param, StructureModel* self) {
+	gboolean result = FALSE;
+	GNode* node;
+	StructType type;
+	gboolean _tmp0_;
+	g_return_val_if_fail (node_param != NULL, FALSE);
+	node = (GNode*) node_param;
+	type = (*((StructData*) node->data)).type;
+	_tmp0_ = structure_is_section (type);
+	if (!_tmp0_) {
+		GeeArrayList* _tmp1_ = NULL;
+		GeeArrayList* list;
+		_tmp1_ = structure_model_get_list (self, type);
+		list = _tmp1_;
+		g_return_val_if_fail (list != NULL, TRUE);
+		gee_abstract_collection_add ((GeeAbstractCollection*) list, node);
+		_g_object_unref0 (list);
+	}
+	result = FALSE;
+	return result;
+}
+
+
+static gboolean __lambda18__gnode_traverse_func (GNode* node, gpointer self) {
+	gboolean result;
+	result = _lambda18_ (node, self);
+	return result;
+}
+
+
+static void structure_model_regenerate_simple_lists (StructureModel* self) {
+	g_return_if_fail (self != NULL);
+	structure_model_reset_simple_lists (self);
+	g_node_traverse (self->priv->_tree, G_PRE_ORDER, G_TRAVERSE_ALL, -1, __lambda18__gnode_traverse_func, self);
+}
+
+
+static void structure_model_reset_simple_lists (StructureModel* self) {
+	GeeArrayList* _tmp0_ = NULL;
+	GeeArrayList* _tmp1_ = NULL;
+	GeeArrayList* _tmp2_ = NULL;
+	GeeArrayList* _tmp3_ = NULL;
+	GeeArrayList* _tmp4_ = NULL;
+	g_return_if_fail (self != NULL);
+	_tmp0_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->_list_labels);
+	self->priv->_list_labels = _tmp0_;
+	_tmp1_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->_list_includes);
+	self->priv->_list_includes = _tmp1_;
+	_tmp2_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->_list_tables);
+	self->priv->_list_tables = _tmp2_;
+	_tmp3_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->_list_figures);
+	self->priv->_list_figures = _tmp3_;
+	_tmp4_ = gee_array_list_new (G_TYPE_POINTER, NULL, NULL, NULL);
+	_g_object_unref0 (self->priv->_list_todos_and_fixmes);
+	self->priv->_list_todos_and_fixmes = _tmp4_;
+}
+
+
+static GeeArrayList* structure_model_get_list (StructureModel* self, StructType type) {
+	GeeArrayList* result = NULL;
+	gboolean _tmp0_;
+	g_return_val_if_fail (self != NULL, NULL);
+	_tmp0_ = structure_is_section (type);
+	if (_tmp0_) {
+		result = NULL;
+		return result;
+	}
+	switch (type) {
+		case STRUCT_TYPE_LABEL:
+		{
+			GeeArrayList* _tmp1_;
+			_tmp1_ = _g_object_ref0 (self->priv->_list_labels);
+			result = _tmp1_;
+			return result;
+		}
+		case STRUCT_TYPE_INCLUDE:
+		{
+			GeeArrayList* _tmp2_;
+			_tmp2_ = _g_object_ref0 (self->priv->_list_includes);
+			result = _tmp2_;
+			return result;
+		}
+		case STRUCT_TYPE_TABLE:
+		{
+			GeeArrayList* _tmp3_;
+			_tmp3_ = _g_object_ref0 (self->priv->_list_tables);
+			result = _tmp3_;
+			return result;
+		}
+		case STRUCT_TYPE_FIGURE:
+		case STRUCT_TYPE_IMAGE:
+		{
+			GeeArrayList* _tmp4_;
+			_tmp4_ = _g_object_ref0 (self->priv->_list_figures);
+			result = _tmp4_;
+			return result;
+		}
+		case STRUCT_TYPE_TODO:
+		case STRUCT_TYPE_FIXME:
+		{
+			GeeArrayList* _tmp5_;
+			_tmp5_ = _g_object_ref0 (self->priv->_list_todos_and_fixmes);
+			result = _tmp5_;
+			return result;
+		}
+		default:
+		{
+			result = NULL;
+			return result;
+		}
+	}
+}
+
+
+static void structure_model_class_init (StructureModelClass * klass) {
+	structure_model_parent_class = g_type_class_peek_parent (klass);
+	g_type_class_add_private (klass, sizeof (StructureModelPrivate));
+	G_OBJECT_CLASS (klass)->finalize = structure_model_finalize;
+}
+
+
+static void structure_model_gtk_tree_model_interface_init (GtkTreeModelIface * iface) {
+	structure_model_gtk_tree_model_parent_iface = g_type_interface_peek_parent (iface);
+	iface->get_column_type = (GType (*)(GtkTreeModel* ,gint)) structure_model_real_get_column_type;
+	iface->get_n_columns = (gint (*)(GtkTreeModel*)) structure_model_real_get_n_columns;
+	iface->get_flags = (GtkTreeModelFlags (*)(GtkTreeModel*)) structure_model_real_get_flags;
+	iface->iter_has_child = (gboolean (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_iter_has_child;
+	iface->iter_n_children = (gint (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_iter_n_children;
+	iface->get_value = (void (*)(GtkTreeModel* ,GtkTreeIter* ,gint ,GValue*)) structure_model_real_get_value;
+	iface->iter_children = (gboolean (*)(GtkTreeModel* ,GtkTreeIter* ,GtkTreeIter*)) structure_model_real_iter_children;
+	iface->iter_next = (gboolean (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_iter_next;
+	iface->iter_nth_child = (gboolean (*)(GtkTreeModel* ,GtkTreeIter* ,GtkTreeIter* ,gint)) structure_model_real_iter_nth_child;
+	iface->iter_parent = (gboolean (*)(GtkTreeModel* ,GtkTreeIter* ,GtkTreeIter*)) structure_model_real_iter_parent;
+	iface->get_iter = (gboolean (*)(GtkTreeModel* ,GtkTreeIter* ,GtkTreePath*)) structure_model_real_get_iter;
+	iface->get_path = (GtkTreePath* (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_get_path;
+	iface->ref_node = (void (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_ref_node;
+	iface->unref_node = (void (*)(GtkTreeModel* ,GtkTreeIter*)) structure_model_real_unref_node;
+}
+
+
+static void structure_model_instance_init (StructureModel * self) {
+	self->priv = STRUCTURE_MODEL_GET_PRIVATE (self);
+}
+
+
+static void structure_model_finalize (GObject* obj) {
+	StructureModel * self;
+	self = STRUCTURE_MODEL (obj);
+	self->priv->_column_types = (g_free (self->priv->_column_types), NULL);
+	__g_node_destroy__struct_data_free0_0 (self->priv->_tree);
+	_g_object_unref0 (self->priv->_list_labels);
+	_g_object_unref0 (self->priv->_list_includes);
+	_g_object_unref0 (self->priv->_list_tables);
+	_g_object_unref0 (self->priv->_list_figures);
+	_g_object_unref0 (self->priv->_list_todos_and_fixmes);
+	G_OBJECT_CLASS (structure_model_parent_class)->finalize (obj);
+}
+
+
+GType structure_model_get_type (void) {
+	static volatile gsize structure_model_type_id__volatile = 0;
+	if (g_once_init_enter (&structure_model_type_id__volatile)) {
+		static const GTypeInfo g_define_type_info = { sizeof (StructureModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) structure_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (StructureModel), 0, (GInstanceInitFunc) structure_model_instance_init, NULL };
+		static const GInterfaceInfo gtk_tree_model_info = { (GInterfaceInitFunc) structure_model_gtk_tree_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
+		GType structure_model_type_id;
+		structure_model_type_id = g_type_register_static (G_TYPE_OBJECT, "StructureModel", &g_define_type_info, 0);
+		g_type_add_interface_static (structure_model_type_id, GTK_TYPE_TREE_MODEL, &gtk_tree_model_info);
+		g_once_init_leave (&structure_model_type_id__volatile, structure_model_type_id);
+	}
+	return structure_model_type_id__volatile;
+}
+
+
+
diff --git a/src/C/symbols.c b/src/C/symbols.c
index fe86142..6f0a23b 100644
--- a/src/C/symbols.c
+++ b/src/C/symbols.c
@@ -1,4 +1,4 @@
-/* symbols.c generated by valac 0.12.0, the Vala compiler
+/* symbols.c generated by valac 0.12.1, the Vala compiler
  * generated from symbols.vala, do not modify */
 
 /*
@@ -65,7 +65,7 @@ typedef struct _SymbolsCategoryInfo SymbolsCategoryInfo;
 typedef struct _SymbolsSymbolInfo SymbolsSymbolInfo;
 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
-typedef struct _Block5Data Block5Data;
+typedef struct _Block6Data Block6Data;
 
 #define TYPE_MOST_USED_SYMBOLS (most_used_symbols_get_type ())
 #define MOST_USED_SYMBOLS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MOST_USED_SYMBOLS, MostUsedSymbols))
@@ -153,7 +153,7 @@ struct _SymbolsSymbolInfo {
 	gchar* package_required;
 };
 
-struct _Block5Data {
+struct _Block6Data {
 	int _ref_count_;
 	Symbols * self;
 	GtkIconView* categories_view;
@@ -206,19 +206,19 @@ GdkPixbuf* utils_get_pixbuf_from_stock (const gchar* stock_id, GtkIconSize size)
 static GtkListStore* symbols_get_symbol_store (Symbols* self, SymbolsSymbolInfo* symbols, int symbols_length1);
 void symbols_reload_most_used_symbols (void);
 static void symbols_create_icon_views (Symbols* self);
-static Block5Data* block5_data_ref (Block5Data* _data5_);
-static void block5_data_unref (Block5Data* _data5_);
+static Block6Data* block6_data_ref (Block6Data* _data6_);
+static void block6_data_unref (Block6Data* _data6_);
 GtkWidget* utils_add_scrollbar (GtkWidget* child);
-static void _lambda65_ (Symbols* self);
+static void _lambda75_ (Symbols* self);
 GType most_used_symbols_get_type (void) G_GNUC_CONST;
 MostUsedSymbols* most_used_symbols_get_default (void);
 void most_used_symbols_clear (MostUsedSymbols* self);
-static void __lambda65__gtk_button_clicked (GtkButton* _sender, gpointer self);
-static void _lambda66_ (Block5Data* _data5_);
+static void __lambda75__gtk_button_clicked (GtkButton* _sender, gpointer self);
+static void _lambda76_ (Block6Data* _data6_);
 static void _gtk_tree_path_free0_ (gpointer var);
 static void _g_list_free__gtk_tree_path_free0_ (GList* self);
-static void __lambda66__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
-static void _lambda67_ (Block5Data* _data5_);
+static void __lambda76__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
+static void _lambda77_ (Block6Data* _data6_);
 GType document_tab_get_type (void) G_GNUC_CONST;
 DocumentTab* main_window_get_active_tab (MainWindow* self);
 GType document_get_type (void) G_GNUC_CONST;
@@ -226,7 +226,7 @@ Document* main_window_get_active_document (MainWindow* self);
 GType document_view_get_type (void) G_GNUC_CONST;
 DocumentView* main_window_get_active_view (MainWindow* self);
 void most_used_symbols_add_symbol (MostUsedSymbols* self, const gchar* id, const gchar* command, const gchar* package);
-static void __lambda67__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
+static void __lambda77__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
 static void symbols_insert_symbol (GtkListStore* symbol_store, gint index, SymbolsSymbolInfo* symbol);
 static gchar* symbols_get_symbol_id (const gchar* path);
 GType most_used_symbol_get_type (void) G_GNUC_CONST;
@@ -418,24 +418,24 @@ Symbols* symbols_new (MainWindow* main_window) {
 }
 
 
-static Block5Data* block5_data_ref (Block5Data* _data5_) {
-	g_atomic_int_inc (&_data5_->_ref_count_);
-	return _data5_;
+static Block6Data* block6_data_ref (Block6Data* _data6_) {
+	g_atomic_int_inc (&_data6_->_ref_count_);
+	return _data6_;
 }
 
 
-static void block5_data_unref (Block5Data* _data5_) {
-	if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
-		_g_object_unref0 (_data5_->self);
-		_g_object_unref0 (_data5_->button);
-		_g_object_unref0 (_data5_->symbol_view);
-		_g_object_unref0 (_data5_->categories_view);
-		g_slice_free (Block5Data, _data5_);
+static void block6_data_unref (Block6Data* _data6_) {
+	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
+		_g_object_unref0 (_data6_->self);
+		_g_object_unref0 (_data6_->button);
+		_g_object_unref0 (_data6_->symbol_view);
+		_g_object_unref0 (_data6_->categories_view);
+		g_slice_free (Block6Data, _data6_);
 	}
 }
 
 
-static void _lambda65_ (Symbols* self) {
+static void _lambda75_ (Symbols* self) {
 	MostUsedSymbols* _tmp0_ = NULL;
 	MostUsedSymbols* _tmp1_;
 	gtk_list_store_clear (symbols_mus_store);
@@ -446,8 +446,8 @@ static void _lambda65_ (Symbols* self) {
 }
 
 
-static void __lambda65__gtk_button_clicked (GtkButton* _sender, gpointer self) {
-	_lambda65_ (self);
+static void __lambda75__gtk_button_clicked (GtkButton* _sender, gpointer self) {
+	_lambda75_ (self);
 }
 
 
@@ -467,15 +467,15 @@ static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
 }
 
 
-static void _lambda66_ (Block5Data* _data5_) {
+static void _lambda76_ (Block6Data* _data6_) {
 	Symbols * self;
 	GList* _tmp0_ = NULL;
 	GList* selected_items;
 	gconstpointer _tmp1_ = NULL;
 	GtkTreePath* _tmp2_;
 	GtkTreePath* path;
-	self = _data5_->self;
-	_tmp0_ = gtk_icon_view_get_selected_items (_data5_->categories_view);
+	self = _data6_->self;
+	_tmp0_ = gtk_icon_view_get_selected_items (_data6_->categories_view);
 	selected_items = _tmp0_;
 	_tmp1_ = g_list_nth_data (selected_items, (guint) 0);
 	_tmp2_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp1_);
@@ -485,11 +485,11 @@ static void _lambda66_ (Block5Data* _data5_) {
 		gint num;
 		_tmp3_ = gtk_tree_path_get_indices (path);
 		num = _tmp3_[0];
-		gtk_icon_view_set_model (_data5_->symbol_view, (GtkTreeModel*) symbols_symbols_stores[num]);
+		gtk_icon_view_set_model (_data6_->symbol_view, (GtkTreeModel*) symbols_symbols_stores[num]);
 		if (num == (symbols_symbols_stores_length1 - 1)) {
-			gtk_widget_show ((GtkWidget*) _data5_->button);
+			gtk_widget_show ((GtkWidget*) _data6_->button);
 		} else {
-			gtk_widget_hide ((GtkWidget*) _data5_->button);
+			gtk_widget_hide ((GtkWidget*) _data6_->button);
 		}
 	}
 	_gtk_tree_path_free0 (path);
@@ -497,12 +497,12 @@ static void _lambda66_ (Block5Data* _data5_) {
 }
 
 
-static void __lambda66__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
-	_lambda66_ (self);
+static void __lambda76__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
+	_lambda76_ (self);
 }
 
 
-static void _lambda67_ (Block5Data* _data5_) {
+static void _lambda77_ (Block6Data* _data6_) {
 	Symbols * self;
 	DocumentTab* _tmp0_ = NULL;
 	GList* _tmp1_ = NULL;
@@ -516,19 +516,19 @@ static void _lambda67_ (Block5Data* _data5_) {
 	GtkTreeIter _tmp6_ = {0};
 	GtkTreeIter iter;
 	gboolean _tmp7_ = FALSE;
-	self = _data5_->self;
+	self = _data6_->self;
 	_tmp0_ = main_window_get_active_tab (self->priv->main_window);
 	if (_tmp0_ == NULL) {
-		g_signal_emit_by_name (_data5_->symbol_view, "unselect-all");
+		g_signal_emit_by_name (_data6_->symbol_view, "unselect-all");
 		return;
 	}
-	_tmp1_ = gtk_icon_view_get_selected_items (_data5_->symbol_view);
+	_tmp1_ = gtk_icon_view_get_selected_items (_data6_->symbol_view);
 	selected_items = _tmp1_;
-	g_signal_emit_by_name (_data5_->symbol_view, "unselect-all");
+	g_signal_emit_by_name (_data6_->symbol_view, "unselect-all");
 	_tmp2_ = g_list_nth_data (selected_items, (guint) 0);
 	_tmp3_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp2_);
 	path = _tmp3_;
-	_tmp4_ = gtk_icon_view_get_model (_data5_->symbol_view);
+	_tmp4_ = gtk_icon_view_get_model (_data6_->symbol_view);
 	_tmp5_ = _g_object_ref0 (_tmp4_);
 	model = _tmp5_;
 	iter = _tmp6_;
@@ -583,54 +583,54 @@ static void _lambda67_ (Block5Data* _data5_) {
 }
 
 
-static void __lambda67__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
-	_lambda67_ (self);
+static void __lambda77__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
+	_lambda77_ (self);
 }
 
 
 static void symbols_create_icon_views (Symbols* self) {
-	Block5Data* _data5_;
+	Block6Data* _data6_;
 	GtkIconView* _tmp0_ = NULL;
 	GtkIconView* _tmp1_ = NULL;
 	GtkWidget* _tmp2_ = NULL;
 	GtkWidget* sw;
 	GtkButton* _tmp3_ = NULL;
 	g_return_if_fail (self != NULL);
-	_data5_ = g_slice_new0 (Block5Data);
-	_data5_->_ref_count_ = 1;
-	_data5_->self = g_object_ref (self);
+	_data6_ = g_slice_new0 (Block6Data);
+	_data6_->_ref_count_ = 1;
+	_data6_->self = g_object_ref (self);
 	_tmp0_ = (GtkIconView*) gtk_icon_view_new_with_model ((GtkTreeModel*) symbols_categories_store);
-	_data5_->categories_view = g_object_ref_sink (_tmp0_);
-	gtk_icon_view_set_pixbuf_column (_data5_->categories_view, (gint) SYMBOLS_CATEGORY_COLUMN_ICON);
-	gtk_icon_view_set_text_column (_data5_->categories_view, (gint) SYMBOLS_CATEGORY_COLUMN_NAME);
-	gtk_icon_view_set_selection_mode (_data5_->categories_view, GTK_SELECTION_SINGLE);
-	gtk_icon_view_set_orientation (_data5_->categories_view, GTK_ORIENTATION_HORIZONTAL);
-	gtk_icon_view_set_spacing (_data5_->categories_view, 5);
-	gtk_icon_view_set_row_spacing (_data5_->categories_view, 0);
-	gtk_icon_view_set_column_spacing (_data5_->categories_view, 0);
-	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _data5_->categories_view, FALSE, FALSE, (guint) 0);
-	gtk_widget_show ((GtkWidget*) _data5_->categories_view);
+	_data6_->categories_view = g_object_ref_sink (_tmp0_);
+	gtk_icon_view_set_pixbuf_column (_data6_->categories_view, (gint) SYMBOLS_CATEGORY_COLUMN_ICON);
+	gtk_icon_view_set_text_column (_data6_->categories_view, (gint) SYMBOLS_CATEGORY_COLUMN_NAME);
+	gtk_icon_view_set_selection_mode (_data6_->categories_view, GTK_SELECTION_SINGLE);
+	gtk_icon_view_set_orientation (_data6_->categories_view, GTK_ORIENTATION_HORIZONTAL);
+	gtk_icon_view_set_spacing (_data6_->categories_view, 5);
+	gtk_icon_view_set_row_spacing (_data6_->categories_view, 0);
+	gtk_icon_view_set_column_spacing (_data6_->categories_view, 0);
+	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _data6_->categories_view, FALSE, FALSE, (guint) 0);
+	gtk_widget_show ((GtkWidget*) _data6_->categories_view);
 	_tmp1_ = (GtkIconView*) gtk_icon_view_new_with_model ((GtkTreeModel*) symbols_symbols_stores[0]);
-	_data5_->symbol_view = g_object_ref_sink (_tmp1_);
-	gtk_icon_view_set_pixbuf_column (_data5_->symbol_view, (gint) SYMBOLS_SYMBOL_COLUMN_PIXBUF);
-	gtk_icon_view_set_tooltip_column (_data5_->symbol_view, (gint) SYMBOLS_SYMBOL_COLUMN_TOOLTIP);
-	gtk_icon_view_set_selection_mode (_data5_->symbol_view, GTK_SELECTION_SINGLE);
-	gtk_icon_view_set_spacing (_data5_->symbol_view, 0);
-	gtk_icon_view_set_row_spacing (_data5_->symbol_view, 0);
-	gtk_icon_view_set_column_spacing (_data5_->symbol_view, 0);
-	_tmp2_ = utils_add_scrollbar ((GtkWidget*) _data5_->symbol_view);
+	_data6_->symbol_view = g_object_ref_sink (_tmp1_);
+	gtk_icon_view_set_pixbuf_column (_data6_->symbol_view, (gint) SYMBOLS_SYMBOL_COLUMN_PIXBUF);
+	gtk_icon_view_set_tooltip_column (_data6_->symbol_view, (gint) SYMBOLS_SYMBOL_COLUMN_TOOLTIP);
+	gtk_icon_view_set_selection_mode (_data6_->symbol_view, GTK_SELECTION_SINGLE);
+	gtk_icon_view_set_spacing (_data6_->symbol_view, 0);
+	gtk_icon_view_set_row_spacing (_data6_->symbol_view, 0);
+	gtk_icon_view_set_column_spacing (_data6_->symbol_view, 0);
+	_tmp2_ = utils_add_scrollbar ((GtkWidget*) _data6_->symbol_view);
 	sw = _tmp2_;
 	gtk_box_pack_start ((GtkBox*) self, sw, TRUE, TRUE, (guint) 0);
 	gtk_widget_show_all (sw);
 	_tmp3_ = (GtkButton*) gtk_button_new_from_stock (GTK_STOCK_CLEAR);
-	_data5_->button = g_object_ref_sink (_tmp3_);
-	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _data5_->button, FALSE, FALSE, (guint) 2);
-	g_signal_connect_object (_data5_->button, "clicked", (GCallback) __lambda65__gtk_button_clicked, self, 0);
-	g_signal_connect_data (_data5_->categories_view, "selection-changed", (GCallback) __lambda66__gtk_icon_view_selection_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
-	g_signal_connect_data (_data5_->symbol_view, "selection-changed", (GCallback) __lambda67__gtk_icon_view_selection_changed, block5_data_ref (_data5_), (GClosureNotify) block5_data_unref, 0);
+	_data6_->button = g_object_ref_sink (_tmp3_);
+	gtk_box_pack_start ((GtkBox*) self, (GtkWidget*) _data6_->button, FALSE, FALSE, (guint) 2);
+	g_signal_connect_object (_data6_->button, "clicked", (GCallback) __lambda75__gtk_button_clicked, self, 0);
+	g_signal_connect_data (_data6_->categories_view, "selection-changed", (GCallback) __lambda76__gtk_icon_view_selection_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
+	g_signal_connect_data (_data6_->symbol_view, "selection-changed", (GCallback) __lambda77__gtk_icon_view_selection_changed, block6_data_ref (_data6_), (GClosureNotify) block6_data_unref, 0);
 	_g_object_unref0 (sw);
-	block5_data_unref (_data5_);
-	_data5_ = NULL;
+	block6_data_unref (_data6_);
+	_data6_ = NULL;
 }
 
 
diff --git a/src/C/tab_info_bar.c b/src/C/tab_info_bar.c
index 0328df3..85c2805 100644
--- a/src/C/tab_info_bar.c
+++ b/src/C/tab_info_bar.c
@@ -1,4 +1,4 @@
-/* tab_info_bar.c generated by valac 0.12.0, the Vala compiler
+/* tab_info_bar.c generated by valac 0.12.1, the Vala compiler
  * generated from tab_info_bar.vala, do not modify */
 
 /*
@@ -61,8 +61,8 @@ enum  {
 TabInfoBar* tab_info_bar_new (const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
 TabInfoBar* tab_info_bar_construct (GType object_type, const gchar* primary_msg, const gchar* secondary_msg, GtkMessageType msg_type);
 void tab_info_bar_add_ok_button (TabInfoBar* self);
-static void _lambda17_ (gint response_id, TabInfoBar* self);
-static void __lambda17__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
+static void _lambda22_ (gint response_id, TabInfoBar* self);
+static void __lambda22__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self);
 void tab_info_bar_add_stock_button_with_text (TabInfoBar* self, const gchar* text, const gchar* stock_id, gint response_id);
 
 
@@ -188,22 +188,22 @@ TabInfoBar* tab_info_bar_new (const gchar* primary_msg, const gchar* secondary_m
 }
 
 
-static void _lambda17_ (gint response_id, TabInfoBar* self) {
+static void _lambda22_ (gint response_id, TabInfoBar* self) {
 	if (response_id == GTK_RESPONSE_OK) {
 		gtk_object_destroy ((GtkObject*) self);
 	}
 }
 
 
-static void __lambda17__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
-	_lambda17_ (response_id, self);
+static void __lambda22__gtk_info_bar_response (GtkInfoBar* _sender, gint response_id, gpointer self) {
+	_lambda22_ (response_id, self);
 }
 
 
 void tab_info_bar_add_ok_button (TabInfoBar* self) {
 	g_return_if_fail (self != NULL);
 	gtk_info_bar_add_button ((GtkInfoBar*) self, GTK_STOCK_OK, (gint) GTK_RESPONSE_OK);
-	g_signal_connect_object ((GtkInfoBar*) self, "response", (GCallback) __lambda17__gtk_info_bar_response, self, 0);
+	g_signal_connect_object ((GtkInfoBar*) self, "response", (GCallback) __lambda22__gtk_info_bar_response, self, 0);
 }
 
 
diff --git a/src/C/templates.c b/src/C/templates.c
index 5c1ccdf..ed0d20c 100644
--- a/src/C/templates.c
+++ b/src/C/templates.c
@@ -1,4 +1,4 @@
-/* templates.c generated by valac 0.12.0, the Vala compiler
+/* templates.c generated by valac 0.12.1, the Vala compiler
  * generated from templates.vala, do not modify */
 
 /*
@@ -63,6 +63,7 @@ typedef struct _MainWindow MainWindow;
 typedef struct _MainWindowClass MainWindowClass;
 typedef struct _Block10Data Block10Data;
 #define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
+#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
 
 #define TYPE_DOCUMENT_TAB (document_tab_get_type ())
 #define DOCUMENT_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT_TAB, DocumentTab))
@@ -83,7 +84,6 @@ typedef struct _DocumentTabClass DocumentTabClass;
 
 typedef struct _Document Document;
 typedef struct _DocumentClass DocumentClass;
-#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
 
 struct _Templates {
 	GObject parent_instance;
@@ -113,8 +113,11 @@ typedef enum  {
 struct _Block10Data {
 	int _ref_count_;
 	Templates * self;
+	GtkDialog* dialog;
+	GtkVPaned* vpaned;
 	GtkIconView* icon_view_default_templates;
 	GtkIconView* icon_view_personal_templates;
+	MainWindow* parent;
 };
 
 
@@ -139,11 +142,17 @@ static Block10Data* block10_data_ref (Block10Data* _data10_);
 static void block10_data_unref (Block10Data* _data10_);
 static GtkIconView* templates_create_icon_view (Templates* self, GtkListStore* store);
 static GtkWidget* templates_get_dialog_component (Templates* self, const gchar* title, GtkWidget* widget);
-static void _lambda68_ (Block10Data* _data10_);
+static void _lambda78_ (Block10Data* _data10_);
 static void templates_on_icon_view_selection_changed (Templates* self, GtkIconView* icon_view, GtkIconView* other_icon_view);
-static void __lambda68__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
-static void _lambda69_ (Block10Data* _data10_);
-static void __lambda69__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
+static void __lambda78__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
+static void _lambda79_ (Block10Data* _data10_);
+static void __lambda79__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self);
+static void _lambda80_ (GtkTreePath* path, Block10Data* _data10_);
+static void templates_open_template (Templates* self, MainWindow* main_window, GtkTreeModel* model, GtkTreePath* path);
+static void templates_close_dialog_new (Templates* self, GtkDialog* dialog, GtkVPaned* vpaned);
+static void __lambda80__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self);
+static void _lambda81_ (GtkTreePath* path, Block10Data* _data10_);
+static void __lambda81__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self);
 static void _gtk_tree_path_free0_ (gpointer var);
 static void _g_list_free__gtk_tree_path_free0_ (GList* self);
 GType document_tab_get_type (void) G_GNUC_CONST;
@@ -308,7 +317,7 @@ static Templates* templates_construct (GType object_type) {
 	g_key_file_load_from_file (key_file, self->priv->rc_file, G_KEY_FILE_NONE, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_key_file_free0 (key_file);
-		goto __catch8_g_error;
+		goto __catch9_g_error;
 	}
 	_tmp43_ = g_key_file_get_string_list (key_file, APP_NAME, "names", &_tmp42_, &_inner_error_);
 	names = _tmp43_;
@@ -316,7 +325,7 @@ static Templates* templates_construct (GType object_type) {
 	_names_size_ = _tmp42_;
 	if (_inner_error_ != NULL) {
 		_g_key_file_free0 (key_file);
-		goto __catch8_g_error;
+		goto __catch9_g_error;
 	}
 	_tmp45_ = g_key_file_get_string_list (key_file, APP_NAME, "icons", &_tmp44_, &_inner_error_);
 	icons = _tmp45_;
@@ -325,7 +334,7 @@ static Templates* templates_construct (GType object_type) {
 	if (_inner_error_ != NULL) {
 		names = (_vala_array_free (names, names_length1, (GDestroyNotify) g_free), NULL);
 		_g_key_file_free0 (key_file);
-		goto __catch8_g_error;
+		goto __catch9_g_error;
 	}
 	self->priv->nb_personal_templates = names_length1;
 	{
@@ -367,8 +376,8 @@ static Templates* templates_construct (GType object_type) {
 	icons = (_vala_array_free (icons, icons_length1, (GDestroyNotify) g_free), NULL);
 	names = (_vala_array_free (names, names_length1, (GDestroyNotify) g_free), NULL);
 	_g_key_file_free0 (key_file);
-	goto __finally8;
-	__catch8_g_error:
+	goto __finally9;
+	__catch9_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -377,7 +386,7 @@ static Templates* templates_construct (GType object_type) {
 		_g_error_free0 (e);
 		return self;
 	}
-	__finally8:
+	__finally9:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -423,32 +432,63 @@ static void block10_data_unref (Block10Data* _data10_) {
 		_g_object_unref0 (_data10_->self);
 		_g_object_unref0 (_data10_->icon_view_personal_templates);
 		_g_object_unref0 (_data10_->icon_view_default_templates);
+		_g_object_unref0 (_data10_->vpaned);
+		_g_object_unref0 (_data10_->dialog);
+		_g_object_unref0 (_data10_->parent);
 		g_slice_free (Block10Data, _data10_);
 	}
 }
 
 
-static void _lambda68_ (Block10Data* _data10_) {
+static void _lambda78_ (Block10Data* _data10_) {
 	Templates * self;
 	self = _data10_->self;
 	templates_on_icon_view_selection_changed (self, _data10_->icon_view_default_templates, _data10_->icon_view_personal_templates);
 }
 
 
-static void __lambda68__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
-	_lambda68_ (self);
+static void __lambda78__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
+	_lambda78_ (self);
 }
 
 
-static void _lambda69_ (Block10Data* _data10_) {
+static void _lambda79_ (Block10Data* _data10_) {
 	Templates * self;
 	self = _data10_->self;
 	templates_on_icon_view_selection_changed (self, _data10_->icon_view_personal_templates, _data10_->icon_view_default_templates);
 }
 
 
-static void __lambda69__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
-	_lambda69_ (self);
+static void __lambda79__gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) {
+	_lambda79_ (self);
+}
+
+
+static void _lambda80_ (GtkTreePath* path, Block10Data* _data10_) {
+	Templates * self;
+	self = _data10_->self;
+	g_return_if_fail (path != NULL);
+	templates_open_template (self, _data10_->parent, (GtkTreeModel*) self->priv->default_store, path);
+	templates_close_dialog_new (self, _data10_->dialog, _data10_->vpaned);
+}
+
+
+static void __lambda80__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self) {
+	_lambda80_ (path, self);
+}
+
+
+static void _lambda81_ (GtkTreePath* path, Block10Data* _data10_) {
+	Templates * self;
+	self = _data10_->self;
+	g_return_if_fail (path != NULL);
+	templates_open_template (self, _data10_->parent, (GtkTreeModel*) self->priv->personal_store, path);
+	templates_close_dialog_new (self, _data10_->dialog, _data10_->vpaned);
+}
+
+
+static void __lambda81__gtk_icon_view_item_activated (GtkIconView* _sender, GtkTreePath* path, gpointer self) {
+	_lambda81_ (path, self);
 }
 
 
@@ -472,7 +512,6 @@ void templates_show_dialog_new (Templates* self, MainWindow* parent) {
 	Block10Data* _data10_;
 	const gchar* _tmp0_ = NULL;
 	GtkDialog* _tmp1_ = NULL;
-	GtkDialog* dialog;
 	GSettings* _tmp2_ = NULL;
 	GSettings* settings;
 	gint w = 0;
@@ -481,7 +520,6 @@ void templates_show_dialog_new (Templates* self, MainWindow* parent) {
 	GtkBox* _tmp4_;
 	GtkBox* content_area;
 	GtkVPaned* _tmp5_ = NULL;
-	GtkVPaned* vpaned;
 	gint _tmp6_;
 	GtkIconView* _tmp7_ = NULL;
 	const gchar* _tmp8_ = NULL;
@@ -491,47 +529,47 @@ void templates_show_dialog_new (Templates* self, MainWindow* parent) {
 	const gchar* _tmp11_ = NULL;
 	GtkWidget* _tmp12_ = NULL;
 	gint _tmp13_;
-	gint _tmp28_;
-	gint _tmp29_;
-	gint _tmp30_;
 	g_return_if_fail (self != NULL);
 	g_return_if_fail (parent != NULL);
 	_data10_ = g_slice_new0 (Block10Data);
 	_data10_->_ref_count_ = 1;
 	_data10_->self = g_object_ref (self);
+	_data10_->parent = _g_object_ref0 (parent);
 	_tmp0_ = _ ("New File...");
-	_tmp1_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp0_, (GtkWindow*) parent, GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL, NULL);
-	dialog = g_object_ref_sink (_tmp1_);
+	_tmp1_ = (GtkDialog*) gtk_dialog_new_with_buttons (_tmp0_, (GtkWindow*) _data10_->parent, GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL, NULL);
+	_data10_->dialog = g_object_ref_sink (_tmp1_);
 	_tmp2_ = g_settings_new ("org.gnome.latexila.state.window");
 	settings = _tmp2_;
 	g_settings_get (settings, "new-file-dialog-size", "(ii)", &w, &h);
-	gtk_window_set_default_size ((GtkWindow*) dialog, w, h);
-	gtk_widget_set_size_request ((GtkWidget*) dialog, 0, 0);
-	_tmp3_ = gtk_dialog_get_content_area (dialog);
+	gtk_window_set_default_size ((GtkWindow*) _data10_->dialog, w, h);
+	gtk_widget_set_size_request ((GtkWidget*) _data10_->dialog, 0, 0);
+	_tmp3_ = gtk_dialog_get_content_area (_data10_->dialog);
 	_tmp4_ = _g_object_ref0 (GTK_BOX (_tmp3_));
 	content_area = _tmp4_;
 	_tmp5_ = (GtkVPaned*) gtk_vpaned_new ();
-	vpaned = g_object_ref_sink (_tmp5_);
-	gtk_box_pack_start (content_area, (GtkWidget*) vpaned, TRUE, TRUE, (guint) 0);
+	_data10_->vpaned = g_object_ref_sink (_tmp5_);
+	gtk_box_pack_start (content_area, (GtkWidget*) _data10_->vpaned, TRUE, TRUE, (guint) 0);
 	_tmp6_ = g_settings_get_int (settings, "new-file-dialog-paned-position");
-	gtk_paned_set_position ((GtkPaned*) vpaned, _tmp6_);
+	gtk_paned_set_position ((GtkPaned*) _data10_->vpaned, _tmp6_);
 	_tmp7_ = templates_create_icon_view (self, self->priv->default_store);
 	_data10_->icon_view_default_templates = _tmp7_;
 	_tmp8_ = _ ("Default templates");
 	_tmp9_ = templates_get_dialog_component (self, _tmp8_, (GtkWidget*) _data10_->icon_view_default_templates);
 	component = _tmp9_;
-	gtk_paned_pack1 ((GtkPaned*) vpaned, component, TRUE, TRUE);
+	gtk_paned_pack1 ((GtkPaned*) _data10_->vpaned, component, TRUE, TRUE);
 	_tmp10_ = templates_create_icon_view (self, self->priv->personal_store);
 	_data10_->icon_view_personal_templates = _tmp10_;
 	_tmp11_ = _ ("Your personal templates");
 	_tmp12_ = templates_get_dialog_component (self, _tmp11_, (GtkWidget*) _data10_->icon_view_personal_templates);
 	_g_object_unref0 (component);
 	component = _tmp12_;
-	gtk_paned_pack2 ((GtkPaned*) vpaned, component, FALSE, TRUE);
+	gtk_paned_pack2 ((GtkPaned*) _data10_->vpaned, component, FALSE, TRUE);
 	gtk_widget_show_all ((GtkWidget*) content_area);
-	g_signal_connect_data (_data10_->icon_view_default_templates, "selection-changed", (GCallback) __lambda68__gtk_icon_view_selection_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
-	g_signal_connect_data (_data10_->icon_view_personal_templates, "selection-changed", (GCallback) __lambda69__gtk_icon_view_selection_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
-	_tmp13_ = gtk_dialog_run (dialog);
+	g_signal_connect_data (_data10_->icon_view_default_templates, "selection-changed", (GCallback) __lambda78__gtk_icon_view_selection_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
+	g_signal_connect_data (_data10_->icon_view_personal_templates, "selection-changed", (GCallback) __lambda79__gtk_icon_view_selection_changed, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
+	g_signal_connect_data (_data10_->icon_view_default_templates, "item-activated", (GCallback) __lambda80__gtk_icon_view_item_activated, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
+	g_signal_connect_data (_data10_->icon_view_personal_templates, "item-activated", (GCallback) __lambda81__gtk_icon_view_item_activated, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
+	_tmp13_ = gtk_dialog_run (_data10_->dialog);
 	if (_tmp13_ == GTK_RESPONSE_ACCEPT) {
 		GList* _tmp14_ = NULL;
 		GList* selected_items;
@@ -541,14 +579,6 @@ void templates_show_dialog_new (Templates* self, MainWindow* parent) {
 		gconstpointer _tmp19_ = NULL;
 		GtkTreePath* _tmp20_;
 		GtkTreePath* path;
-		GtkTreeIter _tmp21_ = {0};
-		GtkTreeIter iter;
-		gchar* _tmp22_;
-		gchar* contents;
-		gboolean _tmp23_ = FALSE;
-		DocumentTab* _tmp26_ = NULL;
-		DocumentTab* tab;
-		Document* _tmp27_ = NULL;
 		_tmp14_ = gtk_icon_view_get_selected_items (_data10_->icon_view_default_templates);
 		selected_items = _tmp14_;
 		_tmp15_ = _g_object_ref0 (GTK_TREE_MODEL (self->priv->default_store));
@@ -567,48 +597,80 @@ void templates_show_dialog_new (Templates* self, MainWindow* parent) {
 		_tmp19_ = g_list_nth_data (selected_items, (guint) 0);
 		_tmp20_ = _gtk_tree_path_copy0 ((GtkTreePath*) ((GtkTreePath*) _tmp19_));
 		path = _tmp20_;
-		iter = _tmp21_;
-		_tmp22_ = g_strdup ("");
-		contents = _tmp22_;
-		if (path != NULL) {
-			GtkTreeIter _tmp24_ = {0};
-			gboolean _tmp25_;
-			_tmp25_ = gtk_tree_model_get_iter (model, &_tmp24_, path);
-			iter = _tmp24_;
-			_tmp23_ = _tmp25_;
-		} else {
-			_tmp23_ = FALSE;
-		}
-		if (_tmp23_) {
-			gtk_tree_model_get (model, &iter, TEMPLATES_TEMPLATE_COLUMN_CONTENTS, &contents, -1, -1);
-		}
-		_tmp26_ = main_window_create_tab (parent, TRUE);
-		tab = _tmp26_;
-		_tmp27_ = document_tab_get_document (tab);
-		document_set_contents (_tmp27_, contents);
-		_g_object_unref0 (tab);
-		_g_free0 (contents);
+		templates_open_template (self, _data10_->parent, model, path);
 		_gtk_tree_path_free0 (path);
 		_g_object_unref0 (model);
 		__g_list_free__gtk_tree_path_free0_0 (selected_items);
 	}
-	gtk_window_get_size ((GtkWindow*) dialog, &_tmp28_, &_tmp29_);
-	w = _tmp28_;
-	h = _tmp29_;
-	g_settings_set (settings, "new-file-dialog-size", "(ii)", w, h);
-	_tmp30_ = gtk_paned_get_position ((GtkPaned*) vpaned);
-	g_settings_set_int (settings, "new-file-dialog-paned-position", _tmp30_);
-	gtk_object_destroy ((GtkObject*) dialog);
+	templates_close_dialog_new (self, _data10_->dialog, _data10_->vpaned);
 	_g_object_unref0 (component);
-	_g_object_unref0 (vpaned);
 	_g_object_unref0 (content_area);
 	_g_object_unref0 (settings);
-	_g_object_unref0 (dialog);
 	block10_data_unref (_data10_);
 	_data10_ = NULL;
 }
 
 
+static void templates_open_template (Templates* self, MainWindow* main_window, GtkTreeModel* model, GtkTreePath* path) {
+	GtkTreeIter _tmp0_ = {0};
+	GtkTreeIter iter;
+	gchar* _tmp1_;
+	gchar* contents;
+	gboolean _tmp2_ = FALSE;
+	DocumentTab* _tmp5_ = NULL;
+	DocumentTab* tab;
+	Document* _tmp6_ = NULL;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (main_window != NULL);
+	g_return_if_fail (model != NULL);
+	iter = _tmp0_;
+	_tmp1_ = g_strdup ("");
+	contents = _tmp1_;
+	if (path != NULL) {
+		GtkTreeIter _tmp3_ = {0};
+		gboolean _tmp4_;
+		_tmp4_ = gtk_tree_model_get_iter (model, &_tmp3_, path);
+		iter = _tmp3_;
+		_tmp2_ = _tmp4_;
+	} else {
+		_tmp2_ = FALSE;
+	}
+	if (_tmp2_) {
+		gtk_tree_model_get (model, &iter, TEMPLATES_TEMPLATE_COLUMN_CONTENTS, &contents, -1, -1);
+	}
+	_tmp5_ = main_window_create_tab (main_window, TRUE);
+	tab = _tmp5_;
+	_tmp6_ = document_tab_get_document (tab);
+	document_set_contents (_tmp6_, contents);
+	_g_object_unref0 (tab);
+	_g_free0 (contents);
+}
+
+
+static void templates_close_dialog_new (Templates* self, GtkDialog* dialog, GtkVPaned* vpaned) {
+	gint w = 0;
+	gint h = 0;
+	gint _tmp0_;
+	gint _tmp1_;
+	GSettings* _tmp2_ = NULL;
+	GSettings* settings;
+	gint _tmp3_;
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (dialog != NULL);
+	g_return_if_fail (vpaned != NULL);
+	gtk_window_get_size ((GtkWindow*) dialog, &_tmp0_, &_tmp1_);
+	w = _tmp0_;
+	h = _tmp1_;
+	_tmp2_ = g_settings_new ("org.gnome.latexila.state.window");
+	settings = _tmp2_;
+	g_settings_set (settings, "new-file-dialog-size", "(ii)", w, h);
+	_tmp3_ = gtk_paned_get_position ((GtkPaned*) vpaned);
+	g_settings_set_int (settings, "new-file-dialog-paned-position", _tmp3_);
+	gtk_object_destroy ((GtkObject*) dialog);
+	_g_object_unref0 (settings);
+}
+
+
 static GtkWidget* templates_get_dialog_component (Templates* self, const gchar* title, GtkWidget* widget) {
 	GtkWidget* result = NULL;
 	GtkVBox* _tmp0_ = NULL;
@@ -903,14 +965,14 @@ static void templates_add_template_from_string (Templates* self, GtkListStore* s
 	_g_free0 (_tmp1_);
 	pixbuf = _tmp5_;
 	if (_inner_error_ != NULL) {
-		goto __catch9_g_error;
+		goto __catch10_g_error;
 	}
 	gtk_list_store_append (store, &_tmp6_);
 	iter = _tmp6_;
 	gtk_list_store_set (store, &iter, TEMPLATES_TEMPLATE_COLUMN_PIXBUF, pixbuf, TEMPLATES_TEMPLATE_COLUMN_ICON_ID, icon_id, TEMPLATES_TEMPLATE_COLUMN_NAME, name, TEMPLATES_TEMPLATE_COLUMN_CONTENTS, contents, -1, -1);
 	_g_object_unref0 (pixbuf);
-	goto __finally9;
-	__catch9_g_error:
+	goto __finally10;
+	__catch10_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -918,7 +980,7 @@ static void templates_add_template_from_string (Templates* self, GtkListStore* s
 		fprintf (stderr, "Warning: impossible to load the icon of the template: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally9:
+	__finally10:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -941,12 +1003,12 @@ static void templates_add_template_from_file (Templates* self, GtkListStore* sto
 	contents = _tmp0_;
 	if (_inner_error_ != NULL) {
 		_g_free0 (contents);
-		goto __catch10_g_error;
+		goto __catch11_g_error;
 	}
 	templates_add_template_from_string (self, store, name, icon_id, contents);
 	_g_free0 (contents);
-	goto __finally10;
-	__catch10_g_error:
+	goto __finally11;
+	__catch11_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -954,7 +1016,7 @@ static void templates_add_template_from_file (Templates* self, GtkListStore* sto
 		fprintf (stderr, "Warning: impossible to load the template \"%s\": %s\n", name, e->message);
 		_g_error_free0 (e);
 	}
-	__finally10:
+	__finally11:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -1029,18 +1091,18 @@ static void templates_add_personal_template (Templates* self, const gchar* conte
 		g_file_make_directory_with_parents (parent, NULL, &_inner_error_);
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (parent);
-			goto __catch11_g_error;
+			goto __catch12_g_error;
 		}
 	}
 	_tmp7_ = strlen (contents);
 	g_file_replace_contents (file, contents, (gsize) _tmp7_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &_inner_error_);
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (parent);
-		goto __catch11_g_error;
+		goto __catch12_g_error;
 	}
 	_g_object_unref0 (parent);
-	goto __finally11;
-	__catch11_g_error:
+	goto __finally12;
+	__catch12_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1048,7 +1110,7 @@ static void templates_add_personal_template (Templates* self, const gchar* conte
 		fprintf (stderr, "Warning: impossible to save templates: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally11:
+	__finally12:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (file);
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -1095,17 +1157,17 @@ static void templates_save_rc_file (Templates* self) {
 		g_file_delete (_tmp1_, NULL, &_inner_error_);
 		_g_object_unref0 (_tmp1_);
 		if (_inner_error_ != NULL) {
-			goto __catch12_g_error;
+			goto __catch13_g_error;
 		}
-		goto __finally12;
-		__catch12_g_error:
+		goto __finally13;
+		__catch13_g_error:
 		{
 			GError * e;
 			e = _inner_error_;
 			_inner_error_ = NULL;
 			_g_error_free0 (e);
 		}
-		__finally12:
+		__finally13:
 		if (_inner_error_ != NULL) {
 			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 			g_clear_error (&_inner_error_);
@@ -1161,7 +1223,7 @@ static void templates_save_rc_file (Templates* self) {
 			_g_object_unref0 (file);
 			_g_free0 (key_file_data);
 			_g_key_file_free0 (key_file);
-			goto __catch13_g_error;
+			goto __catch14_g_error;
 		}
 	}
 	_tmp14_ = strlen (key_file_data);
@@ -1171,14 +1233,14 @@ static void templates_save_rc_file (Templates* self) {
 		_g_object_unref0 (file);
 		_g_free0 (key_file_data);
 		_g_key_file_free0 (key_file);
-		goto __catch13_g_error;
+		goto __catch14_g_error;
 	}
 	_g_object_unref0 (parent);
 	_g_object_unref0 (file);
 	_g_free0 (key_file_data);
 	_g_key_file_free0 (key_file);
-	goto __finally13;
-	__catch13_g_error:
+	goto __finally14;
+	__catch14_g_error:
 	{
 		GError * e;
 		e = _inner_error_;
@@ -1186,7 +1248,7 @@ static void templates_save_rc_file (Templates* self) {
 		fprintf (stderr, "Warning: impossible to save templates: %s\n", e->message);
 		_g_error_free0 (e);
 	}
-	__finally13:
+	__finally14:
 	if (_inner_error_ != NULL) {
 		_g_object_unref0 (model);
 		icons = (_vala_array_free (icons, icons_length1, (GDestroyNotify) g_free), NULL);
@@ -1258,18 +1320,18 @@ static void templates_save_contents (Templates* self) {
 			g_file_make_directory_with_parents (parent, NULL, &_inner_error_);
 			if (_inner_error_ != NULL) {
 				_g_object_unref0 (parent);
-				goto __catch14_g_error;
+				goto __catch15_g_error;
 			}
 		}
 		_tmp12_ = strlen (contents);
 		g_file_replace_contents (file, contents, (gsize) _tmp12_, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL, &_inner_error_);
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (parent);
-			goto __catch14_g_error;
+			goto __catch15_g_error;
 		}
 		_g_object_unref0 (parent);
-		goto __finally14;
-		__catch14_g_error:
+		goto __finally15;
+		__catch15_g_error:
 		{
 			GError * e;
 			e = _inner_error_;
@@ -1277,7 +1339,7 @@ static void templates_save_contents (Templates* self) {
 			fprintf (stderr, "Warning: impossible to save the template: %s\n", e->message);
 			_g_error_free0 (e);
 		}
-		__finally14:
+		__finally15:
 		if (_inner_error_ != NULL) {
 			_g_object_unref0 (file);
 			_g_free0 (contents);
diff --git a/src/C/utils.c b/src/C/utils.c
index 2f40295..ae849db 100644
--- a/src/C/utils.c
+++ b/src/C/utils.c
@@ -1,4 +1,4 @@
-/* utils.c generated by valac 0.12.0, the Vala compiler
+/* utils.c generated by valac 0.12.1, the Vala compiler
  * generated from utils.vala, do not modify */
 
 /*
@@ -47,6 +47,7 @@
 typedef struct _BuildJob BuildJob;
 typedef struct _BuildTool BuildTool;
 #define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
+#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
 
 typedef enum  {
 	POST_PROCESSOR_TYPE_ALL_OUTPUT = 0,
@@ -104,12 +105,15 @@ gchar* build_tools_get_post_processor_name_from_type (PostProcessorType type);
 void utils_delete_file (GFile* file);
 gboolean utils_tree_model_iter_prev (GtkTreeModel* model, GtkTreeIter* iter);
 void utils_set_entry_error (GtkWidget* entry, gboolean _error_);
-gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set);
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter);
 GdkPixbuf* utils_get_pixbuf_from_stock (const gchar* stock_id, GtkIconSize size);
 GtkButton* utils_get_toolbar_button (const gchar* stock_id);
 GtkButton* _utils_get_toolbar_button_impl (const gchar* stock_id, gboolean toggle);
 GtkToggleButton* utils_get_toolbar_toggle_button (const gchar* stock_id);
 gboolean utils_char_is_escaped (const gchar* text, glong index);
+gchar* utils_get_relative_path (GFile* origin, GFile* target, GFile* common_dir);
+static void _g_object_unref0_ (gpointer var);
+static void _g_list_free__g_object_unref0_ (GList* self);
 
 
 void utils_flush_queue (void) {
@@ -287,7 +291,7 @@ gchar* utils_get_dirname_for_display (GFile* location) {
 	_tmp0_ = g_file_find_enclosing_mount (location, NULL, &_inner_error_);
 	mount = _tmp0_;
 	if (_inner_error_ != NULL) {
-		goto __catch45_g_error;
+		goto __catch47_g_error;
 	}
 	_tmp1_ = g_mount_get_name (mount);
 	_tmp2_ = g_strdup (_tmp1_);
@@ -329,8 +333,8 @@ gchar* utils_get_dirname_for_display (GFile* location) {
 	_g_free0 (_tmp4_);
 	_g_free0 (mount_name);
 	_g_object_unref0 (mount);
-	goto __finally45;
-	__catch45_g_error:
+	goto __finally47;
+	__catch47_g_error:
 	{
 		GError * e;
 		gchar* _tmp12_ = NULL;
@@ -352,7 +356,7 @@ gchar* utils_get_dirname_for_display (GFile* location) {
 		_g_error_free0 (e);
 		return result;
 	}
-	__finally45:
+	__finally47:
 	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 	g_clear_error (&_inner_error_);
 	return NULL;
@@ -608,10 +612,10 @@ void utils_delete_file (GFile* file) {
 	g_return_if_fail (file != NULL);
 	g_file_delete (file, NULL, &_inner_error_);
 	if (_inner_error_ != NULL) {
-		goto __catch46_g_error;
+		goto __catch48_g_error;
 	}
-	goto __finally46;
-	__catch46_g_error:
+	goto __finally48;
+	__catch48_g_error:
 	{
 		GError * e;
 		gchar* _tmp0_ = NULL;
@@ -624,7 +628,7 @@ void utils_delete_file (GFile* file) {
 		_g_free0 (_tmp1_);
 		_g_error_free0 (e);
 	}
-	__finally46:
+	__finally48:
 	if (_inner_error_ != NULL) {
 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 		g_clear_error (&_inner_error_);
@@ -679,13 +683,12 @@ void utils_set_entry_error (GtkWidget* entry, gboolean _error_) {
 }
 
 
-gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set) {
-	GtkTreeIter _iter_to_set = {0};
+gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter) {
+	GtkTreeIter _iter = {0};
 	gint result = 0;
 	GtkTreeSelection* _tmp0_ = NULL;
 	GtkTreeSelection* _tmp1_;
 	GtkTreeSelection* select;
-	GtkTreeIter iter = {0};
 	GtkTreeIter _tmp2_ = {0};
 	gboolean _tmp3_;
 	g_return_val_if_fail (view != NULL, 0);
@@ -693,7 +696,7 @@ gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set) {
 	_tmp1_ = _g_object_ref0 (_tmp0_);
 	select = _tmp1_;
 	_tmp3_ = gtk_tree_selection_get_selected (select, NULL, &_tmp2_);
-	iter = _tmp2_;
+	_iter = _tmp2_;
 	if (_tmp3_) {
 		GtkTreeModel* _tmp4_ = NULL;
 		GtkTreeModel* _tmp5_;
@@ -701,28 +704,25 @@ gint utils_get_selected_row (GtkTreeView* view, GtkTreeIter* iter_to_set) {
 		GtkTreePath* _tmp6_ = NULL;
 		GtkTreePath* path;
 		gint* _tmp7_ = NULL;
-		if ((&_iter_to_set) != NULL) {
-			_iter_to_set = iter;
-		}
 		_tmp4_ = gtk_tree_view_get_model (view);
 		_tmp5_ = _g_object_ref0 (_tmp4_);
 		model = _tmp5_;
-		_tmp6_ = gtk_tree_model_get_path (model, &iter);
+		_tmp6_ = gtk_tree_model_get_path (model, &_iter);
 		path = _tmp6_;
 		_tmp7_ = gtk_tree_path_get_indices (path);
 		result = _tmp7_[0];
 		_gtk_tree_path_free0 (path);
 		_g_object_unref0 (model);
 		_g_object_unref0 (select);
-		if (iter_to_set) {
-			*iter_to_set = _iter_to_set;
+		if (iter) {
+			*iter = _iter;
 		}
 		return result;
 	}
 	result = -1;
 	_g_object_unref0 (select);
-	if (iter_to_set) {
-		*iter_to_set = _iter_to_set;
+	if (iter) {
+		*iter = _iter;
 	}
 	return result;
 }
@@ -826,4 +826,222 @@ gboolean utils_char_is_escaped (const gchar* text, glong index) {
 }
 
 
+static void _g_object_unref0_ (gpointer var) {
+	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
+}
+
+
+static void _g_list_free__g_object_unref0_ (GList* self) {
+	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
+	g_list_free (self);
+}
+
+
+gchar* utils_get_relative_path (GFile* origin, GFile* target, GFile* common_dir) {
+	gchar* result = NULL;
+	GFile* origin_dir = NULL;
+	gboolean _tmp0_;
+	GFile* _tmp3_ = NULL;
+	GFile* target_parent;
+	gboolean _tmp4_;
+	GList* target_dirs;
+	GList* origin_dirs;
+	guint dir_index;
+	guint nb_common_dirs;
+	gchar* _tmp22_;
+	gchar* relative_path;
+	guint _tmp23_;
+	guint nb_remaining_origin_dirs;
+	gchar* _tmp35_ = NULL;
+	gchar* _tmp36_;
+	gchar* _tmp37_;
+	g_return_val_if_fail (origin != NULL, NULL);
+	g_return_val_if_fail (target != NULL, NULL);
+	g_return_val_if_fail (common_dir != NULL, NULL);
+	_tmp0_ = g_file_equal (origin, common_dir);
+	if (_tmp0_) {
+		GFile* _tmp1_;
+		_tmp1_ = _g_object_ref0 (origin);
+		_g_object_unref0 (origin_dir);
+		origin_dir = _tmp1_;
+	} else {
+		GFile* _tmp2_ = NULL;
+		_tmp2_ = g_file_get_parent (origin);
+		_g_object_unref0 (origin_dir);
+		origin_dir = _tmp2_;
+	}
+	_tmp3_ = g_file_get_parent (target);
+	target_parent = _tmp3_;
+	g_return_val_if_fail (origin_dir != NULL, NULL);
+	g_return_val_if_fail (target_parent != NULL, NULL);
+	_tmp4_ = g_file_equal (target_parent, origin_dir);
+	if (_tmp4_) {
+		gchar* _tmp5_ = NULL;
+		_tmp5_ = g_file_get_basename (target);
+		result = _tmp5_;
+		_g_object_unref0 (target_parent);
+		_g_object_unref0 (origin_dir);
+		return result;
+	}
+	target_dirs = NULL;
+	origin_dirs = NULL;
+	while (TRUE) {
+		gboolean _tmp6_ = FALSE;
+		GFile* _tmp8_;
+		GFile* _tmp9_ = NULL;
+		if (target_parent != NULL) {
+			gboolean _tmp7_;
+			_tmp7_ = g_file_equal (target_parent, common_dir);
+			_tmp6_ = !_tmp7_;
+		} else {
+			_tmp6_ = FALSE;
+		}
+		if (!_tmp6_) {
+			break;
+		}
+		_tmp8_ = _g_object_ref0 (target_parent);
+		target_dirs = g_list_prepend (target_dirs, _tmp8_);
+		_tmp9_ = g_file_get_parent (target_parent);
+		_g_object_unref0 (target_parent);
+		target_parent = _tmp9_;
+	}
+	while (TRUE) {
+		gboolean _tmp10_ = FALSE;
+		GFile* _tmp12_;
+		GFile* _tmp13_ = NULL;
+		if (origin_dir != NULL) {
+			gboolean _tmp11_;
+			_tmp11_ = g_file_equal (origin_dir, common_dir);
+			_tmp10_ = !_tmp11_;
+		} else {
+			_tmp10_ = FALSE;
+		}
+		if (!_tmp10_) {
+			break;
+		}
+		_tmp12_ = _g_object_ref0 (origin_dir);
+		origin_dirs = g_list_prepend (origin_dirs, _tmp12_);
+		_tmp13_ = g_file_get_parent (origin_dir);
+		_g_object_unref0 (origin_dir);
+		origin_dir = _tmp13_;
+	}
+	dir_index = (guint) 0;
+	while (TRUE) {
+		gboolean _tmp14_ = FALSE;
+		guint _tmp15_;
+		gconstpointer _tmp17_ = NULL;
+		GFile* _tmp18_;
+		GFile* cur_target_dir;
+		gconstpointer _tmp19_ = NULL;
+		GFile* _tmp20_;
+		GFile* cur_origin_dir;
+		gboolean _tmp21_;
+		_tmp15_ = g_list_length (target_dirs);
+		if (dir_index < _tmp15_) {
+			guint _tmp16_;
+			_tmp16_ = g_list_length (origin_dirs);
+			_tmp14_ = dir_index < _tmp16_;
+		} else {
+			_tmp14_ = FALSE;
+		}
+		if (!_tmp14_) {
+			break;
+		}
+		_tmp17_ = g_list_nth_data (target_dirs, dir_index);
+		_tmp18_ = _g_object_ref0 ((GFile*) _tmp17_);
+		cur_target_dir = _tmp18_;
+		_tmp19_ = g_list_nth_data (origin_dirs, dir_index);
+		_tmp20_ = _g_object_ref0 ((GFile*) _tmp19_);
+		cur_origin_dir = _tmp20_;
+		_tmp21_ = g_file_equal (cur_target_dir, cur_origin_dir);
+		if (!_tmp21_) {
+			_g_object_unref0 (cur_origin_dir);
+			_g_object_unref0 (cur_target_dir);
+			break;
+		}
+		dir_index++;
+		_g_object_unref0 (cur_origin_dir);
+		_g_object_unref0 (cur_target_dir);
+	}
+	nb_common_dirs = dir_index;
+	_tmp22_ = g_strdup ("");
+	relative_path = _tmp22_;
+	_tmp23_ = g_list_length (origin_dirs);
+	nb_remaining_origin_dirs = _tmp23_ - nb_common_dirs;
+	{
+		guint i;
+		i = (guint) 0;
+		{
+			gboolean _tmp24_;
+			_tmp24_ = TRUE;
+			while (TRUE) {
+				gchar* _tmp25_;
+				if (!_tmp24_) {
+					i++;
+				}
+				_tmp24_ = FALSE;
+				if (!(i < nb_remaining_origin_dirs)) {
+					break;
+				}
+				_tmp25_ = g_strconcat (relative_path, "../", NULL);
+				_g_free0 (relative_path);
+				relative_path = _tmp25_;
+			}
+		}
+	}
+	{
+		guint i;
+		i = nb_common_dirs;
+		{
+			gboolean _tmp26_;
+			_tmp26_ = TRUE;
+			while (TRUE) {
+				guint _tmp27_;
+				gconstpointer _tmp28_ = NULL;
+				GFile* _tmp29_;
+				GFile* cur_target_dir;
+				gchar* _tmp30_ = NULL;
+				gchar* _tmp31_;
+				gchar* _tmp32_;
+				gchar* _tmp33_;
+				gchar* _tmp34_;
+				if (!_tmp26_) {
+					i++;
+				}
+				_tmp26_ = FALSE;
+				_tmp27_ = g_list_length (target_dirs);
+				if (!(i < _tmp27_)) {
+					break;
+				}
+				_tmp28_ = g_list_nth_data (target_dirs, i);
+				_tmp29_ = _g_object_ref0 ((GFile*) _tmp28_);
+				cur_target_dir = _tmp29_;
+				_tmp30_ = g_file_get_basename (cur_target_dir);
+				_tmp31_ = _tmp30_;
+				_tmp32_ = g_strconcat (_tmp31_, "/", NULL);
+				_tmp33_ = _tmp32_;
+				_tmp34_ = g_strconcat (relative_path, _tmp33_, NULL);
+				_g_free0 (relative_path);
+				relative_path = _tmp34_;
+				_g_free0 (_tmp33_);
+				_g_free0 (_tmp31_);
+				_g_object_unref0 (cur_target_dir);
+			}
+		}
+	}
+	_tmp35_ = g_file_get_basename (target);
+	_tmp36_ = _tmp35_;
+	_tmp37_ = g_strconcat (relative_path, _tmp36_, NULL);
+	_g_free0 (relative_path);
+	relative_path = _tmp37_;
+	_g_free0 (_tmp36_);
+	result = relative_path;
+	__g_list_free__g_object_unref0_0 (origin_dirs);
+	__g_list_free__g_object_unref0_0 (target_dirs);
+	_g_object_unref0 (target_parent);
+	_g_object_unref0 (origin_dir);
+	return result;
+}
+
+
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]