1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-08-14 18:27:25 +00:00

Fix line edit changed flag

This commit is contained in:
David Schmenk
2019-12-20 10:20:09 -08:00
parent 3d91e4175b
commit 3161692d4a

View File

@@ -1313,16 +1313,16 @@ def editkey(key)
end end
def editline(key) def editline(key)
word undoline word undoline
byte localchange, editstr[], editlen, editchars[MAXLNLEN+1] byte undopos, localchange, editstr[], editlen, editchars[MAXLNLEN+1]
localchange = FALSE
if (editkey(key)) if (editkey(key))
localchange = TRUE undopos = curscol
undoline = txtlinbuf=>[cursrow] undoline = txtlinbuf=>[cursrow]
editlen = MAXLNLEN
memset(@editchars, $A0A0, MAXLNLEN) memset(@editchars, $A0A0, MAXLNLEN)
memcpy(@editchars, undoline + 1, ^undoline) memcpy(@editchars, undoline + 1, ^undoline)
editlen = MAXLNLEN
txtlinbuf=>[cursrow] = @editstr txtlinbuf=>[cursrow] = @editstr
localchange = FALSE
repeat repeat
when key when key
is keyctrld is keyctrld
@@ -1331,27 +1331,32 @@ def editline(key)
cursoff cursoff
drawrow(cursy, scrnleft, @editstr) drawrow(cursy, scrnleft, @editstr)
curson curson
localchange = TRUE
break break
is keyctrlr is keyctrlr
memset(@editchars, $A0A0, MAXLNLEN) memset(@editchars, $A0A0, MAXLNLEN)
memcpy(@editchars, undoline + 1, ^undoline) memcpy(@editchars, undoline + 1, ^undoline)
cursoff cursoff
drawrow(cursy, scrnleft, @editstr) if curshpos(undopos)
curson
localchange = FALSE
break
is keydelete
if curscol > 0
curscol--
memcpy(@editchars[curscol], @editchars[curscol + 1], MAXLNLEN - 1 - curscol)
editchars[MAXLNLEN - 1] = keyspace
cursoff
if curshpos(curscol)
drawscrn(scrntop, scrnleft) drawscrn(scrntop, scrnleft)
else else
drawrow(cursy, scrnleft, @editstr) drawrow(cursy, scrnleft, @editstr)
fin fin
curson curson
localchange = FALSE
break
is keydelete
if curscol > 0
memcpy(@editchars[curscol - 1], @editchars[curscol], MAXLNLEN - curscol)
editchars[MAXLNLEN - 1] = keyspace
cursoff
if curshpos(curscol - 1)
drawscrn(scrntop, scrnleft)
else
drawrow(cursy, scrnleft, @editstr)
fin
curson
localchange = TRUE
fin fin
break break
otherwise otherwise
@@ -1371,6 +1376,7 @@ def editline(key)
drawrow(cursy, scrnleft, @editstr) drawrow(cursy, scrnleft, @editstr)
fin fin
curson curson
localchange = TRUE
break break
wend wend
key = keyin() key = keyin()