From cafae88f43242f99e52ba2ac451164e40e9f6f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:15:27 +0800 Subject: [PATCH] issues/561 --- LunaTranslator/LunaTranslator/gui/translatorUI.py | 4 ++-- LunaTranslator/LunaTranslator/translator/basetranslator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index 0a3868cd..733e7960 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -156,13 +156,13 @@ class QUnFrameWindow(resizableframeless): self.translate_text.mergeCurrentCharFormat( color, globalconfig['miaobianwidth']) elif globalconfig['zitiyangshi'] ==0: self.translate_text.simplecharformat(color) - elif globalconfig['zitiyangshi'] ==3: + elif globalconfig['zitiyangshi'] ==3: self.translate_text.simplecharformat(color) if iter_context: iter_res_status,iter_context_class=iter_context if iter_res_status==3: - self.translate_text.append(text,hira,origin) + self.translate_text.append(' ',hira,origin) self.saveiterclasspointer[iter_context_class]={'curr':self.translate_text.getcurrpointer()+len(text),'start':self.translate_text.getcurrpointer()} else: self.translate_text.deletebetween(self.saveiterclasspointer[iter_context_class]['start'],self.saveiterclasspointer[iter_context_class]['curr']) diff --git a/LunaTranslator/LunaTranslator/translator/basetranslator.py b/LunaTranslator/LunaTranslator/translator/basetranslator.py index aaf3fccc..8e627085 100644 --- a/LunaTranslator/LunaTranslator/translator/basetranslator.py +++ b/LunaTranslator/LunaTranslator/translator/basetranslator.py @@ -276,8 +276,8 @@ class basetrans(commonbase): if isinstance(res,types.GeneratorType): def _iterget(): rid=self.requestid - __callback('',3) - for _res in res: + for i,_res in enumerate(res): + if i==0:__callback('',3) if self.requestid!=rid:break __callback(_res,1) __callback('',2)