diff options
author | John Church <[email protected]> | 2016-07-20 16:36:21 +0100 |
---|---|---|
committer | monsta <[email protected]> | 2016-08-12 21:53:41 +0300 |
commit | 0a50b2121cf6227ecd1fc6a821932de4694f5978 (patch) | |
tree | dc5f959f822f2c314c8acaff75ccf3bb5d689dd6 /plugins/spell | |
parent | e4ad8f86366cbd72f773e756404fc751be55e784 (diff) | |
download | pluma-0a50b2121cf6227ecd1fc6a821932de4694f5978.tar.bz2 pluma-0a50b2121cf6227ecd1fc6a821932de4694f5978.tar.xz |
When 'Always autocheck' option is selected turn on Autocheck for new documents
Diffstat (limited to 'plugins/spell')
-rw-r--r-- | plugins/spell/pluma-spell-plugin.c | 21 |
1 files changed, 20 insertions, 1 deletions
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); |