summaryrefslogtreecommitdiff
path: root/plugins/spell/pluma-spell-plugin.c
diff options
context:
space:
mode:
authorJohn Church <[email protected]>2016-07-20 16:36:21 +0100
committermonsta <[email protected]>2016-08-12 21:46:37 +0300
commite9b5711bc16331ee7de21573f82999053131a9ff (patch)
tree48df993e24fcd0a24af41aefb180747d08e6441c /plugins/spell/pluma-spell-plugin.c
parent01e91d300b73e178130cf41d5356122bb8146212 (diff)
downloadpluma-e9b5711bc16331ee7de21573f82999053131a9ff.tar.bz2
pluma-e9b5711bc16331ee7de21573f82999053131a9ff.tar.xz
When 'Always autocheck' option is selected turn on Autocheck for new documents
Diffstat (limited to 'plugins/spell/pluma-spell-plugin.c')
-rw-r--r--plugins/spell/pluma-spell-plugin.c21
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);