[gnome-text-editor] spellcheck: skip past .utf8 entries
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] spellcheck: skip past .utf8 entries
- Date: Thu, 1 Jul 2021 21:55:39 +0000 (UTC)
commit 1be4ffef30dd013e1077ee8a17c99a129be02738
Author: Christian Hergert <chergert redhat com>
Date: Thu Jul 1 14:54:30 2021 -0700
spellcheck: skip past .utf8 entries
We just want the first part anyway, and we'll get that after the .utf8
entry from GLib.
src/editor-spell-provider.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/src/editor-spell-provider.c b/src/editor-spell-provider.c
index b46c64b..5e282c8 100644
--- a/src/editor-spell-provider.c
+++ b/src/editor-spell-provider.c
@@ -219,6 +219,13 @@ editor_spell_provider_get_default_code (EditorSpellProvider *self)
{
for (guint i = 0; langs[i]; i++)
{
+ /* Skip past things like "thing.utf8" since we'll
+ * prefer to just have "thing" as it ensures we're
+ * more likely to get code matches elsewhere.
+ */
+ if (strchr (langs[i], '.') != NULL)
+ continue;
+
if (editor_spell_provider_supports_language (self, langs[i]))
return langs[i];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]