]> git.lyx.org Git - lyx.git/commitdiff
Recheck whole buffer after word has been added to/removed from document dic.
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 21 Aug 2021 13:18:30 +0000 (15:18 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 21 Aug 2021 13:18:30 +0000 (15:18 +0200)
src/Text3.cpp

index fcccdd3d4878235180c849115c31a59092d19bfe..b1bf879a55a02755b840d76cd03eb3e1c898fc97 100644 (file)
@@ -2755,13 +2755,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        cur.recordUndoBufferParams();
                        bv->buffer().params().spellignore().push_back(wl);
                        cur.recordUndo();
-                       // trigger re-check
-                       WordLangTuple wl;
-                       docstring_list suggestions;
-                       Paragraph const & par = cur.paragraph();
-                       pos_type from = cur.pos();
-                       pos_type to = from;
-                       par.spellCheck(from, to, wl, suggestions, true, true);
+                       // trigger re-check of whole buffer
+                       ParagraphList & pars = bv->buffer().paragraphs();
+                       ParagraphList::iterator pit = pars.begin();
+                       ParagraphList::iterator pend = pars.end();
+                       for (; pit != pend; ++pit)
+                               pit->requestSpellCheck();
                }
                break;
        }
@@ -2794,13 +2793,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                        cur.recordUndoBufferParams();
                        bv->buffer().params().spellignore().erase(it);
                        cur.recordUndo();
-                       // trigger re-check
-                       WordLangTuple wl;
-                       docstring_list suggestions;
-                       Paragraph const & par = cur.paragraph();
-                       pos_type from = cur.pos();
-                       pos_type to = from;
-                       par.spellCheck(from, to, wl, suggestions, true, true);
+                       // trigger re-check of whole buffer
+                       ParagraphList & pars = bv->buffer().paragraphs();
+                       ParagraphList::iterator pit = pars.begin();
+                       ParagraphList::iterator pend = pars.end();
+                       for (; pit != pend; ++pit)
+                               pit->requestSpellCheck();
                }
                break;
        }