GNOME Bugzilla – Bug 668911
modelines: Support Emacs' Text mode
Last modified: 2019-03-23 20:33:14 UTC
It would be nice if the modelines plugin could recognize `mode: Text`. The result would be that the GeditDocument's language would be unset, thus using the "Plain Text" highlight mode.
Created attachment 207122 [details] [review] Fix (Adds a check for language "text" and handles it specially.)
Review of attachment 207122 [details] [review]: ::: plugins/modelines/modeline-parser.c @@ -747,2 +749,3 @@ } + doc = GEDIT_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); the prev code was simply using, GTK_SOURCE_BUFFER (buffer), so I guess you can simply have GEDIT_DOCUMENT (buffer), no need to go through the view @@ +757,3 @@ GtkSourceLanguage *language; manager = gedit_get_language_manager (); manager could be local to the "else" scope @@ -759,1 +761,1 @@ - if (language != NULL) + if (g_ascii_strcasecmp(options.language_id, "text") == 0) space before (
Created attachment 207127 [details] [review] Fix (Adds a check for language "text" and handles it specially.)
Fixed. Thanks!