more predictable cursor behaviour on line insert / delete
This commit is contained in:
parent
96f9475b7f
commit
8ce0a6438c
|
@ -345,7 +345,7 @@ class SyntBlock(Synt):
|
|||
pcur.EndLine()
|
||||
def OnInsertNewLine(syntAfter, psel):
|
||||
self.InsertLineAfter(syntAfter, None)
|
||||
psel.Inc(pcur.pwVert) # does nothing because we need to reproject
|
||||
# psel.Inc(pcur.pwVert) # does nothing because we need to reproject
|
||||
PwButtonHidden(pcur.pwVert, "[insert new line]", None, OnInsertNewLine, pcur.dxindent)
|
||||
for syntLine in self.rgsynt:
|
||||
pwKey = PwKeyHandler(pcur.pwVert, self.HandleKey)
|
||||
|
@ -371,11 +371,10 @@ class SyntBlock(Synt):
|
|||
def HandleKey(self, pwKey, pov, psel, key):
|
||||
if ansi.FEnter(key):
|
||||
self.InsertLineAfter(pwKey.pwChild.Value(), None)
|
||||
psel.Inc(pwKey.PwParent())
|
||||
return True
|
||||
elif key == ansi.K_DEL and pwKey.pwChild.RgpwChild()[0] == psel.PwSelected(pwKey):
|
||||
psel.Inc(pwKey.PwParent())
|
||||
self.RemoveLine(pwKey.pwChild.Value())
|
||||
return True
|
||||
return False
|
||||
|
||||
def Eval(self, env):
|
||||
|
|
Loading…
Reference in a new issue