1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-06-26 06:29:28 +00:00

Improve indenting on mis-aligned lines

This commit is contained in:
David Schmenk 2020-01-21 08:39:26 -08:00
parent 5581bfb052
commit c74af19505
3 changed files with 13 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1192,7 +1192,7 @@ def pastesel#0
fin
end
def indentsel#0
byte indentstr[MAXLNLEN+1], l
byte indentstr[MAXLNLEN+1], j, l
word firstsel, lastsel, i
freesel
@ -1204,6 +1204,18 @@ def indentsel#0
indentstr[0] = l + 2
indentstr[1] = keyspace
indentstr[2] = keyspace
//
// Align indent
//
for j = 3 to indentstr[0]
if indentstr[j] <> keyspace
if j & 1 == 0
indentstr[0]--
memcpy(@indentstr + 1, @indentstr + 2, indentstr[0])
fin
break
fin
next
delstr(txtlinbuf=>[i])
txtlinbuf=>[i] = newstr(@indentstr)
flags = flags | changed