From 9e534f053d0bc020a7423a1dde5e2469d0bc7810 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 11 Jul 2021 17:09:18 +0200 Subject: [PATCH] Improved spellcheck inside '' --- src/source_spellcheck.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/source_spellcheck.cpp b/src/source_spellcheck.cpp index a0a787f..591478c 100644 --- a/src/source_spellcheck.cpp +++ b/src/source_spellcheck.cpp @@ -491,8 +491,16 @@ bool Source::SpellCheckView::is_word_iter(const Gtk::TextIter &iter) { return false; if(Glib::Unicode::isalpha(*iter)) return true; - if(*iter == '\'') + if(*iter == '\'') { + if(string_tag && iter.has_tag(string_tag)) { + auto start = iter; + if(!start.begins_tag(string_tag)) + start.backward_to_tag_toggle(string_tag); + if(*start == '\'') + return false; + } return !is_code_iter(iter); + } return false; }