We should read back the language dictionary setting from the spell class before updating status bar

This commit is contained in:
Veronica K. B. Olsen
2019-11-15 21:39:06 +01:00
parent 653c7bbe80
commit e841e0211a
5 changed files with 14 additions and 7 deletions
+4 -4
View File
@@ -29,6 +29,7 @@ class NWSpellCheck():
def __init__(self):
self.mainConf = nw.CONFIG
self.projectDict = None
self.spellLanguage = None
return
def setLanguage(self, theLang, projectDict=None):
@@ -45,11 +46,10 @@ class NWSpellCheck():
newWord = newWord.strip()
self.PROJW.append(newWord)
try:
with open(self.projectDict,mode="w+",encoding="utf-8") as outFile:
for pWord in self.PROJW:
outFile.write("%s\n" % pWord)
with open(self.projectDict,mode="a+",encoding="utf-8") as outFile:
outFile.write("%s\n" % newWord)
except Exception as e:
logger.error("Failed to write to project word list at %s" % str(self.projectDict))
logger.error("Failed to add word to project word list %s" % str(self.projectDict))
logger.error(str(e))
return