1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-02-03 22:35:52 +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)
drawscrn(scrntop, scrnleft)
else
drawrow(cursy, scrnleft, @editstr)
fin
curson curson
localchange = FALSE localchange = FALSE
break break
is keydelete is keydelete
if curscol > 0 if curscol > 0
curscol-- memcpy(@editchars[curscol - 1], @editchars[curscol], MAXLNLEN - curscol)
memcpy(@editchars[curscol], @editchars[curscol + 1], MAXLNLEN - 1 - curscol)
editchars[MAXLNLEN - 1] = keyspace editchars[MAXLNLEN - 1] = keyspace
cursoff cursoff
if curshpos(curscol) if curshpos(curscol - 1)
drawscrn(scrntop, scrnleft) drawscrn(scrntop, scrnleft)
else else
drawrow(cursy, scrnleft, @editstr) drawrow(cursy, scrnleft, @editstr)
fin fin
curson 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()