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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 15 Feb 2011 19:31:35 +0100
changeset 890
b4736e256f8c
parent 889
65585df1d52c
child 892
754efacb0fbb

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

QScintilla/SpellChecker.py file | annotate | diff | comparison | revisions
--- a/QScintilla/SpellChecker.py	Sat Feb 12 19:22:28 2011 +0100
+++ b/QScintilla/SpellChecker.py	Tue Feb 15 19:31:35 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