mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-08 07:31:32 +00:00
Improve indenting on mis-aligned lines
This commit is contained in:
parent
5581bfb052
commit
c74af19505
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user