fix paste

This commit is contained in:
Jeremy Penner 2020-08-02 13:13:25 -04:00
parent d4a7f6fbc9
commit 0f02d48e65

View file

@ -367,18 +367,19 @@ class SyntBlock(Synt):
self.rgsynt.remove(synt)
def HandleKey(self, pwKey, pov, psel, key):
synt = pwKey.pwChild.Value()
if ansi.FEnter(key):
isyntInsert = self.rgsynt.index(pwKey.pwChild.Value()) + 1
isyntInsert = self.rgsynt.index(synt) + 1
self.InsertLineAt(isyntInsert)
clevelVert = psel.CLevelChild(pwKey.PwParent())
pwVert = psel.PwSelected(pov.PwProjected(), clevelVert - 1)
psel.Inc(pwVert)
elif (key == ansi.K_DEL or key == ansi.K_CTRL('x')) and pwKey.pwChild.RgpwChild()[0] == psel.PwSelected(pwKey):
self.RemoveLine(pwKey.pwChild.Value(), psel)
self.RemoveLine(synt, psel)
elif key == ansi.K_CTRL('c') and pwKey.pwChild.RgpwChild()[0] == psel.PwSelected(pwKey):
psel.syntClipboard = synt.DeepClone().WithParent(None)
elif key == ansi.K_CTRL('v') and psel.syntClipboard:
isyntInsert = self.rgsynt.index(pwKey.pwChild.Value())
isyntInsert = self.rgsynt.index(synt)
self.InsertLineAt(isyntInsert, psel.syntClipboard.DeepClone())
else:
return False