[geany/geany] 6c31ed: Re-highlight type keywords on notebook page switch

Matthew Brush git-noreply at xxxxx
Thu Jul 26 00:02:42 UTC 2012


Branch:      refs/heads/document-messages
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Tue, 03 Jan 2012 18:21:09
Commit:      6c31ed4bc0ae52282ae8c696ee8c80ec5c352be6
             https://github.com/geany/geany/commit/6c31ed4bc0ae52282ae8c696ee8c80ec5c352be6

Log Message:
-----------
Re-highlight type keywords on notebook page switch


Modified Paths:
--------------
    src/callbacks.c
    src/document.c
    src/document.h

Modified: src/callbacks.c
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -621,6 +621,7 @@ G_MODULE_EXPORT void on_notebook1_switch_page_after(GtkNotebook *notebook, GtkNo
 		ui_document_show_hide(doc); /* update the document menu */
 		build_menu_update(doc);
 		sidebar_update_tag_list(doc, FALSE);
+		document_highlight_tags(doc);
 
 		/* We delay the check to avoid weird fast, unintended switching of notebook pages when
 		 * the 'file has changed' dialog is shown while the switch event is not yet completely


Modified: src/document.c
17 files changed, 12 insertions(+), 5 deletions(-)
===================================================================
@@ -523,9 +523,9 @@ static GeanyDocument *document_create(const gchar *utf8_filename)
 		new_idx = documents_array->len;
 		g_ptr_array_add(documents_array, doc);
 	}
-	
+
 	doc = documents[new_idx];
-	
+
 	/* initialize default document settings */
 	doc->priv = g_new0(GeanyDocumentPrivate, 1);
 	doc->index = new_idx;
@@ -2215,9 +2215,6 @@ void document_update_tags(GeanyDocument *doc)
 {
 	guchar *buffer_ptr;
 	gsize len;
-	GString *keywords_str;
-	gchar *keywords;
-	gint keyword_idx;
 
 	g_return_if_fail(DOC_VALID(doc));
 	g_return_if_fail(app->tm_workspace != NULL);
@@ -2276,6 +2273,16 @@ void document_update_tags(GeanyDocument *doc)
 	tm_source_file_buffer_update(doc->tm_file, buffer_ptr, len, TRUE);
 
 	sidebar_update_tag_list(doc, TRUE);
+	document_highlight_tags(doc);
+}
+
+
+/* Re-highlights type keywords without re-parsing the whole document. */
+void document_highlight_tags(GeanyDocument *doc)
+{
+	GString *keywords_str;
+	gchar *keywords;
+	gint keyword_idx;
 
 	/* some filetypes support type keywords (such as struct names), but not
 	 * necessarily all filetypes for a particular scintilla lexer.  this


Modified: src/document.h
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -237,6 +237,8 @@ void document_replace_sel(GeanyDocument *doc, const gchar *find_text, const gcha
 
 void document_update_tag_list_in_idle(GeanyDocument *doc);
 
+void document_highlight_tags(GeanyDocument *doc);
+
 void document_set_encoding(GeanyDocument *doc, const gchar *new_encoding);
 
 gboolean document_check_disk_status(GeanyDocument *doc, gboolean force);


@@ Diff output truncated at 100000 characters. @@


--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list