From 24aef1ffef29ebffb9fca31156bfdf799c764a3d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 21 Dec 2012 16:29:59 -0800 Subject: [PATCH] Fix word-boundary checking for edit box spellchecking --- aegisub/src/subs_edit_ctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index 3cdf73427..bd4bf34c3 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -479,7 +479,7 @@ void SubsTextEditCtrl::OnSetThesLanguage(wxCommandEvent &event) { std::pair SubsTextEditCtrl::GetBoundsOfWordAtPosition(int pos) { int len = 0; for (auto const& tok : tokenized_line) { - if ((int)tok.length > pos) { + if (len + (int)tok.length > pos) { if (tok.type == agi::ass::DialogueTokenType::WORD) return std::make_pair(len, tok.length); return std::make_pair(0, 0);