# HG changeset patch # User wenzelm # Date 1397410369 -7200 # Node ID 7f6f5665a96ed6e35969daf208cc61d660add54a # Parent 5b6c3d69942a969e2f2a8f4462e59da29f686b7c special treatment for '' ligature in TeX, which counts as word separator diff -r 5b6c3d69942a -r 7f6f5665a96e src/Tools/jEdit/src/spell_checker.scala --- a/src/Tools/jEdit/src/spell_checker.scala Sun Apr 13 19:20:03 2014 +0200 +++ b/src/Tools/jEdit/src/spell_checker.scala Sun Apr 13 19:32:49 2014 +0200 @@ -138,6 +138,9 @@ val result = new mutable.ListBuffer[Text.Range] var offset = 0 + def apostrophe(c: Int): Boolean = + c == '\'' && (offset + 1 == text.length || text(offset + 1) != '\'') + @tailrec def scan(pred: Int => Boolean) { if (offset < text.length) { @@ -152,7 +155,7 @@ while (offset < text.length) { scan(c => !Character.isLetter(c)) val start = offset - scan(c => Character.isLetterOrDigit(c) || c == '\'') + scan(c => Character.isLetterOrDigit(c) || apostrophe(c)) val stop = offset if (stop - start >= 2 && !check(text.substring(start, stop))) result += Text.Range(start, stop)