1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-10 06:30:41 +00:00

Remove #$%&! TAB characters

This commit is contained in:
Dave Schmenk 2019-12-17 11:01:05 -08:00
parent 1afb559849
commit ae5ea36e87

View File

@ -555,8 +555,8 @@ def drawscrn(toprow, ofst)#0
lofst = flags & gutter
if lofst
drawgutter(toprow, ofst)
fin
drawgutter(toprow, ofst)
fin
//
// Draw text
//
@ -596,25 +596,25 @@ def cursoff#0
if flags & showcurs
^cursptr = underchr
if flags & gutter
scrnptr = txtscrn[cursy]
*scrnptr = *scrnptr | $8080
^(scrnptr+2) = ^(scrnptr+2) | $80
fin
scrnptr = txtscrn[cursy]
*scrnptr = *scrnptr | $8080
^(scrnptr+2) = ^(scrnptr+2) | $80
fin
flags = flags & ~showcurs
fin
end
def curson#0
byte lofst
byte lofst
word scrnptr
if !(flags & showcurs)
lofst = flags & gutter
if lofst
scrnptr = txtscrn[cursy]
*scrnptr = *scrnptr & $7F7F
^(scrnptr+2) = ^(scrnptr+2) & $7F
fin
lofst = flags & gutter
if lofst
scrnptr = txtscrn[cursy]
*scrnptr = *scrnptr & $7F7F
^(scrnptr+2) = ^(scrnptr+2) & $7F
fin
cursptr = txtscrn[cursy] + lofst + cursx
underchr = ^cursptr
^cursptr = curschr
@ -637,40 +637,40 @@ def redraw#0
curson
end
def curshpos(hpos)#1
byte needredraw
needredraw = TRUE
if hpos < 0; hpos = 0; fin
if hpos > MAXLNLEN; hpos = MAXLNLEN; fin
byte needredraw
needredraw = TRUE
if hpos < 0; hpos = 0; fin
if hpos > MAXLNLEN; hpos = MAXLNLEN; fin
curscol = hpos
cursx = curscol - scrnleft
if cursx > scrnright
cursx = scrnright
scrnleft = curscol - scrnright
elsif cursx < 0
cursx = curscol - scrnleft
if cursx > scrnright
cursx = scrnright
scrnleft = curscol - scrnright
elsif cursx < 0
cursx = 0
scrnleft = curscol
else
needredraw = FALSE
needredraw = FALSE
fin
return needredraw
end
def cursvpos(vpos)#1
byte needredraw
byte needredraw
needredraw = TRUE
needredraw = TRUE
if vpos < 0; vpos = 0; fin
if vpos > numlines - 1; vpos = numlines - 1; fin
cursrow = vpos
cursy = cursrow - scrntop
if cursy > scrnbottom
cursy = scrnbottom
scrntop = cursrow - scrnbottom
elsif cursy < 0
cursy = scrnbottom
scrntop = cursrow - scrnbottom
elsif cursy < 0
cursy = 0
scrntop = cursrow
else
needredraw = FALSE
needredraw = FALSE
fin
return needredraw
end
@ -719,15 +719,15 @@ def cursup#0
fin
end
def pgup#0
cursoff
if cursvpos(cursrow - pgjmp)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
cursoff
if cursvpos(cursrow - pgjmp)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
end
def cursdown#0
if cursrow < numlines - 1
@ -746,15 +746,15 @@ def cursdown#0
fin
end
def pgdown#0
cursoff
if cursvpos(cursrow + pgjmp)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
cursoff
if cursvpos(cursrow + pgjmp)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
end
def cursleft#0
if curscol > 0
@ -770,15 +770,15 @@ def cursleft#0
fin
end
def pgleft#0
cursoff
if curshpos(curscol - 8)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
cursoff
if curshpos(curscol - 8)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
end
def cursright#0
if curscol < MAXLNLEN
@ -794,15 +794,15 @@ def cursright#0
fin
end
def pgright#0
cursoff
if curshpos(curscol + 8)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
cursoff
if curshpos(curscol + 8)
drawscrn(scrntop, scrnleft)
else
if flags & selection
drawgutter(scrntop, scrnleft)
fin
fin
curson
end
//
// Find string in text
@ -835,8 +835,8 @@ def findtxt#0
// Search from current pos to end
//
if findline(txtlinbuf=>[cursrow], curscol + 2)
return
fin
return
fin
for f = cursrow + 1 to numlines - 1
if findline(txtlinbuf=>[f], 1)
cursvpos(f)
@ -909,7 +909,7 @@ def keyin3
is keyenter
key = keyctrlf; break
is keytab
key = keydetab; break
key = keydetab; break
is $80 | '\\'
key = keydelete; break // Delete
//
@ -963,7 +963,7 @@ def keyin2e
is keyenter
key = keyctrlf; break
is keytab
key = keydetab; break
key = keydetab; break
wend
fin
return key
@ -1186,13 +1186,13 @@ def undentsel#0
redraw
end
def autoindent(strptr)#0
byte i
for i = 1 to ^strptr
if ^(strptr + i) <> keyspace
break
byte i
for i = 1 to ^strptr
if ^(strptr + i) <> keyspace
break
fin
next
next
curshpos(i - 1)
end
def openline(row)
@ -1279,7 +1279,7 @@ def editline(key)
byte editstr[MAXLNLEN+1], localchange, need
word undoline
localchange = FALSE
localchange = FALSE
if (editkey(key))
localchange = TRUE
memset(@editstr + 1, $A0A0, MAXLNLEN)
@ -1289,21 +1289,21 @@ def editline(key)
repeat
if key >= keyspace
if key == keydelete
if curscol > 0
if curscol <= editstr
memcpy(@editstr[curscol], @editstr[curscol + 1], editstr - curscol)
editstr--
fin
cursoff
if curshpos(curscol - 1)
drawscrn(scrntop, scrnleft)
else
drawrow(cursy, scrnleft, @editstr)
fin
curson
fin
if curscol > 0
if curscol <= editstr
memcpy(@editstr[curscol], @editstr[curscol + 1], editstr - curscol)
editstr--
fin
cursoff
if curshpos(curscol - 1)
drawscrn(scrntop, scrnleft)
else
drawrow(cursy, scrnleft, @editstr)
fin
curson
fin
elsif curscol < MAXLNLEN
curscol++
curscol++
if flags & insmode
if editstr < MAXLNLEN or editstr.MAXLNLEN == keyspace
editstr++
@ -1347,21 +1347,21 @@ def editline(key)
cursoff
drawrow(cursy, scrnleft, @editstr)
curson
localchange = FALSE
localchange = FALSE
fin
key = keyin()
until not editkey(key)
if localchange
flags = flags | changed
delstr(undoline)
if editstr
txtlinbuf=>[cursrow] = newstr(@editstr)
else
txtlinbuf=>[cursrow] = @nullstr
fin
else
txtlinbuf=>[cursrow] = undoline
fin
flags = flags | changed
delstr(undoline)
if editstr
txtlinbuf=>[cursrow] = newstr(@editstr)
else
txtlinbuf=>[cursrow] = @nullstr
fin
else
txtlinbuf=>[cursrow] = undoline
fin
fin
return key
end
@ -1415,10 +1415,10 @@ def editmode#0
is keyctrlo
openline(cursrow)
if cursrow
autoindent(txtlinbuf=>[cursrow - 1])
else
curshpos(0)
fin
autoindent(txtlinbuf=>[cursrow - 1])
else
curshpos(0)
fin
redraw
break
is keyenter
@ -1427,7 +1427,7 @@ def editmode#0
else
openline(cursrow + 1)
fin
autoindent(txtlinbuf=>[cursrow])
autoindent(txtlinbuf=>[cursrow])
cursvpos(cursrow + 1)
redraw
break
@ -1436,26 +1436,26 @@ def editmode#0
redraw
break
is keytab
if flags & insmode
indentsel
cursoff
if not ^(txtlinbuf=>[cursrow])
curshpos((curscol + 2) & $FE)
if flags & insmode
indentsel
cursoff
if not ^(txtlinbuf=>[cursrow])
curshpos((curscol + 2) & $FE)
else
autoindent(txtlinbuf=>[cursrow])
fin
curson
break
fin
fin
curson
break
fin
is keydetab
undentsel
cursoff
if not ^(txtlinbuf=>[cursrow])
curshpos((curscol - 2) & $FFFE)
else
autoindent(txtlinbuf=>[cursrow])
fin
curson
cursoff
if not ^(txtlinbuf=>[cursrow])
curshpos((curscol - 2) & $FFFE)
else
autoindent(txtlinbuf=>[cursrow])
fin
curson
break
is keyctrly
flags = flags ^ insmode
@ -1579,27 +1579,27 @@ def cmdmode#0
findtxt
return
is 'T' // Toggle upper/lower case display
if ^cmdptr
when toupper(^(cmdptr + 1))
is 'G' // Gutter view
flags = flags ^ gutter
if flags & gutter
scrnwidth = 36
scrnright = 35
else
scrnwidth = 40
scrnright = 39
fin
break
is 'C' // Lower case chip (Apple ][/][+ only)
if flags & uppercase
txtlower
else
txtupper
fin
break
wend
fin
if ^cmdptr
when toupper(^(cmdptr + 1))
is 'G' // Gutter view
flags = flags ^ gutter
if flags & gutter
scrnwidth = 36
scrnright = 35
else
scrnwidth = 40
scrnright = 39
fin
break
is 'C' // Lower case chip (Apple ][/][+ only)
if flags & uppercase
txtlower
else
txtupper
fin
break
wend
fin
return
is 'G' // Goto line #
line = strtonum(cmdptr)
@ -1610,7 +1610,7 @@ def cmdmode#0
is 'E' // Edit mode
is 0
return
is 'A' // Append file
is 'A' // Append file
readtxt(cmdptr, numlines)
flags = flags | changed
break
@ -1662,7 +1662,7 @@ def cmdmode#0
if perr
puts("ERROR: $")
putb(perr)
putln
putln
fin
loop
end