QScintilla/SpellChecker.py

changeset 890
b4736e256f8c
parent 791
9ec2ac20e54e
child 945
8cd4d08fa9f6
child 1510
e75ecf2bd9dd
equal deleted inserted replaced
889:65585df1d52c 890:b4736e256f8c
283 283
284 if atEnd: 284 if atEnd:
285 pos = self.editor.positionBefore(pos) 285 pos = self.editor.positionBefore(pos)
286 286
287 if pos >= 0 and self.__checkRegion(pos): 287 if pos >= 0 and self.__checkRegion(pos):
288 pos0 = pos
289 pos1 = -1
288 if not self.editor.charAt(pos).isalnum(): 290 if not self.editor.charAt(pos).isalnum():
289 pos = self.editor.positionBefore(pos) 291 line, index = self.editor.lineIndexFromPosition(pos)
292 self.editor.clearIndicator(self.indicator, line, index, line, index + 1)
293 pos1 = self.editor.positionAfter(pos)
294 pos0 = self.editor.positionBefore(pos)
290 295
291 if self.editor.charAt(pos).isalnum(): 296 for pos in [pos0, pos1]:
292 line, index = self.editor.lineIndexFromPosition(pos) 297 if self.editor.charAt(pos).isalnum():
293 word = self.editor.getWord(line, index, useWordChars = False) 298 line, index = self.editor.lineIndexFromPosition(pos)
294 if len(word) >= self.minimumWordSize: 299 word = self.editor.getWord(line, index, useWordChars = False)
295 ok = spell.check(word) 300 if len(word) >= self.minimumWordSize:
301 ok = spell.check(word)
302 else:
303 ok = True
296 start, end = \ 304 start, end = \
297 self.editor.getWordBoundaries(line, index, useWordChars = False) 305 self.editor.getWordBoundaries(line, index, useWordChars = False)
298 if ok: 306 if ok:
299 self.editor.clearIndicator(self.indicator, line, start, line, end) 307 self.editor.clearIndicator(self.indicator, line, start, line, end)
300 else: 308 else:

eric ide

mercurial