[gtksourceview: 1/2] docu: complete language guessing example




commit e4fadea33fb8be9610fbaf320fb9511f15cc567d
Author: Günther Wagner <info gunibert de>
Date:   Tue Jan 18 21:39:29 2022 +0100

    docu: complete language guessing example

 gtksourceview/gtksourcelanguagemanager.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/gtksourcelanguagemanager.c b/gtksourceview/gtksourcelanguagemanager.c
index 43fd19e5..ebd0e5ad 100644
--- a/gtksourceview/gtksourcelanguagemanager.c
+++ b/gtksourceview/gtksourcelanguagemanager.c
@@ -614,7 +614,9 @@ pick_lang_for_mime_type (GtkSourceLanguageManager *lm,
  *
  * ```c
  * GtkSourceLanguage *lang;
- * lang = gtk_source_language_manager_guess_language (filename, NULL);
+ * GtkSourceLanguageManager *manager;
+ * lm = gtk_source_language_manager_get_default ();
+ * lang = gtk_source_language_manager_guess_language (manager, filename, NULL);
  * gtk_source_buffer_set_language (buffer, lang);
  * ```
  *
@@ -622,6 +624,7 @@ pick_lang_for_mime_type (GtkSourceLanguageManager *lm,
  *
  * ```c
  * GtkSourceLanguage *lang = NULL;
+ * GtkSourceLanguageManager *manager;
  * gboolean result_uncertain;
  * gchar *content_type;
  *
@@ -632,6 +635,7 @@ pick_lang_for_mime_type (GtkSourceLanguageManager *lm,
  *     content_type = NULL;
  *   }
  *
+ * manager = gtk_source_language_manager_get_default ();
  * lang = gtk_source_language_manager_guess_language (manager, filename, content_type);
  * gtk_source_buffer_set_language (buffer, lang);
  *


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