Some improvements to the spell checker to deal with empty lines in user or project dictionaries. maintenance

Mon, 23 Jan 2017 11:54:21 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 23 Jan 2017 11:54:21 +0100
branch
maintenance
changeset 5440
d22ed5a4374f
parent 5438
5971091376ef
child 5447
852016bbdedb

Some improvements to the spell checker to deal with empty lines in user or project dictionaries.
(grafted from 7ae65fa937a3ab45b9bb6923a512b3c414bb76c1)

Dictionaries/words.dic file | annotate | diff | comparison | revisions
QScintilla/SpellChecker.py file | annotate | diff | comparison | revisions
QScintilla/SpellingDictionaryEditDialog.py file | annotate | diff | comparison | revisions
--- a/Dictionaries/words.dic	Sat Jan 21 12:26:12 2017 +0100
+++ b/Dictionaries/words.dic	Mon Jan 23 11:54:21 2017 +0100
@@ -1,6 +1,5 @@
-
+Eric6
+IDE
 detlev
 offenbachs
-Eric5
-IDE
 unapplied
\ No newline at end of file
--- a/QScintilla/SpellChecker.py	Sat Jan 21 12:26:12 2017 +0100
+++ b/QScintilla/SpellChecker.py	Mon Jan 23 11:54:21 2017 +0100
@@ -119,7 +119,7 @@
         if isException:
             dicFile = Preferences.getEditor("SpellCheckingPersonalExcludeList")
             if not dicFile:
-                dicFile = SpellChecker.getDefaultPath(False)
+                dicFile = SpellChecker.getDefaultPath(True)
         else:
             dicFile = Preferences.getEditor("SpellCheckingPersonalWordList")
             if not dicFile:
@@ -195,7 +195,8 @@
         
         @param size minimum word size (integer)
         """
-        self.minimumWordSize = size
+        if size > 0:
+            self.minimumWordSize = size
     
     def __getNextWord(self, pos, endPosition):
         """
--- a/QScintilla/SpellingDictionaryEditDialog.py	Sat Jan 21 12:26:12 2017 +0100
+++ b/QScintilla/SpellingDictionaryEditDialog.py	Mon Jan 23 11:54:21 2017 +0100
@@ -35,7 +35,9 @@
         
         self.infoLabel.setText(info)
         
-        self.__model = QStringListModel(data.splitlines(), self)
+        self.__model = QStringListModel(
+            [line.strip() for line in data.splitlines() if line.strip()],
+            self)
         self.__model.sort(0)
         self.__proxyModel = QSortFilterProxyModel(self)
         self.__proxyModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
@@ -65,4 +67,5 @@
         @return data of the dialog (string)
         """
         return os.linesep.join(
-            [line for line in self.__model.stringList() if line])
+            [line.strip() for line in self.__model.stringList()
+             if line.strip()]) + os.linesep

eric ide

mercurial