Fixed an issue with the spell checker not showing the correct indicator. 5_0_x

Tue, 15 Feb 2011 19:32:31 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 15 Feb 2011 19:32:31 +0100
branch
5_0_x
changeset 891
83dce36263b1
parent 886
bb59d644fca6
child 895
d8deb8c8e907

Fixed an issue with the spell checker not showing the correct indicator.

QScintilla/SpellChecker.py file | annotate | diff | comparison | revisions
diff -r bb59d644fca6 -r 83dce36263b1 QScintilla/SpellChecker.py
--- a/QScintilla/SpellChecker.py	Mon Feb 07 19:06:59 2011 +0100
+++ b/QScintilla/SpellChecker.py	Tue Feb 15 19:32:31 2011 +0100
@@ -285,14 +285,22 @@
             pos = self.editor.positionBefore(pos)
         
         if pos >= 0 and self.__checkRegion(pos):
+            pos0 = pos
+            pos1 = -1
             if not self.editor.charAt(pos).isalnum():
-                pos = self.editor.positionBefore(pos)
+                line, index = self.editor.lineIndexFromPosition(pos)
+                self.editor.clearIndicator(self.indicator, line, index, line, index + 1)
+                pos1 = self.editor.positionAfter(pos)
+                pos0 = self.editor.positionBefore(pos)
             
-            if self.editor.charAt(pos).isalnum():
-                line, index = self.editor.lineIndexFromPosition(pos)
-                word = self.editor.getWord(line, index, useWordChars = False)
-                if len(word) >= self.minimumWordSize:
-                    ok = spell.check(word)
+            for pos in [pos0, pos1]:
+                if self.editor.charAt(pos).isalnum():
+                    line, index = self.editor.lineIndexFromPosition(pos)
+                    word = self.editor.getWord(line, index, useWordChars = False)
+                    if len(word) >= self.minimumWordSize:
+                        ok = spell.check(word)
+                    else:
+                        ok = True
                     start, end = \
                         self.editor.getWordBoundaries(line, index, useWordChars = False)
                     if ok:

eric ide

mercurial