Skip to content

Commit

Permalink
Fix find/next prev mistake functionality after MappedWstring refactor…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
Predelnik committed Jan 28, 2019
1 parent 11ed6ea commit 7c5eabf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SpellChecker.cpp
Expand Up @@ -70,7 +70,7 @@ void SpellChecker::find_next_mistake() {
if (check_text(view, text, CheckTextMode::find_first))
break;

iterator_pos += text.to_original_index(index);
iterator_pos += (text.to_original_index(index) - from);
}

if (to == doc_length) {
Expand Down Expand Up @@ -110,7 +110,7 @@ void SpellChecker::find_prev_mistake() {
if (check_text(view, text, CheckTextMode::find_last))
break;

iterator_pos -= (4096 - text.to_original_index(offset));
iterator_pos -= (4096 - (text.to_original_index(offset) - from));
} else
--iterator_pos;

Expand Down

0 comments on commit 7c5eabf

Please sign in to comment.