Impliment self replication/copy
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import copy
|
||||
from importlib.abc import InspectLoader
|
||||
from PyQt6.QtGui import QColor, QFont
|
||||
from trycast import trycast
|
||||
@@ -601,7 +600,7 @@ def parseText(frag: Fragment) -> list[Fragment]:
|
||||
results.append(frag)
|
||||
return results
|
||||
if start > 0:
|
||||
newFrag = copy.copy(frag)
|
||||
newFrag = Fragment(frag)
|
||||
newFrag.setText(text[:start])
|
||||
results.append(newFrag)
|
||||
frag.setText(text[start:])
|
||||
@@ -623,7 +622,7 @@ def parseText(frag: Fragment) -> list[Fragment]:
|
||||
end = text.find("}")
|
||||
token = text[1:end]
|
||||
frag.setText(text[end + 1 :])
|
||||
newFrag = copy.copy(frag)
|
||||
newFrag = Fragment(frag)
|
||||
oldFont = QFont(frag.font())
|
||||
if token == "bc":
|
||||
results.append(Fragment(": ", boldFont, color=baseColor))
|
||||
@@ -729,7 +728,7 @@ def parseText(frag: Fragment) -> list[Fragment]:
|
||||
wref = fields[1]
|
||||
else:
|
||||
raise NotImplementedError(f"Unknown code: {token} in {org}")
|
||||
newFrag = copy.copy(frag)
|
||||
newFrag = Fragment(frag)
|
||||
newFrag.setText(htext)
|
||||
newFrag.setWRef(wref)
|
||||
newFrag.setTarget(target)
|
||||
|
||||
Reference in New Issue
Block a user