From e9b5711bc16331ee7de21573f82999053131a9ff Mon Sep 17 00:00:00 2001 From: John Church Date: Wed, 20 Jul 2016 16:36:21 +0100 Subject: When 'Always autocheck' option is selected turn on Autocheck for new documents --- plugins/spell/pluma-spell-plugin.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/spell/pluma-spell-plugin.c b/plugins/spell/pluma-spell-plugin.c index b3079bcc..d856dd7b 100644 --- a/plugins/spell/pluma-spell-plugin.c +++ b/plugins/spell/pluma-spell-plugin.c @@ -1041,7 +1041,12 @@ set_auto_spell (PlumaWindow *window, g_return_if_fail (active_view != NULL); autospell = pluma_automatic_spell_checker_new (doc, spell); - pluma_automatic_spell_checker_attach_view (autospell, active_view); + + if (doc == pluma_window_get_active_document (window)) + { + pluma_automatic_spell_checker_attach_view (autospell, active_view); + } + pluma_automatic_spell_checker_recheck_all (autospell); } } @@ -1292,9 +1297,23 @@ tab_added_cb (PlumaWindow *window, gpointer useless) { PlumaDocument *doc; + gchar *uri; + WindowData *data; doc = pluma_tab_get_document (tab); + g_object_get(G_OBJECT(doc), "uri", &uri, NULL); + + if (!uri) + { + data = g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + + set_auto_spell_from_metadata (window, doc, data->action_group); + + g_free(uri); + } + g_signal_connect (doc, "loaded", G_CALLBACK (on_document_loaded), window); -- cgit v1.2.1