loopier / animatron

Animatron for Godot 4.x <
15 stars 1 forks source link

`/def` is not correctly parsed in the editor #11

Open loopier opened 10 months ago

loopier commented 10 months ago

When selected text includes a /def but it's not the only contents of the selections, it includes all text as part of the /def. For example:

/def /ma actor anim scale
  /load $anim
  /create $actor $anim
  /scale $actor $scale

/ma ma mama 0.5

puts the last command inside the /def.

Text should be split in blocks -- separated by empty lines.

loopier commented 10 months ago

This is mostly solved in https://github.com/loopier/animatron/commit/9f8965fa66cf9e1e6632d536b2ba8e276d9e9b2d

But when there's a regular command in either end of a /def without being separated by an emty line, the parser doesn't separate the blocks:

# OK
/alo x 1

/def /bla a b
  /dosomething $a $b

# OK
/def /bla a b
  /dosomething $a $b

/alo x 1

# gets everything as 1 block
/alo x 1
/def /bla a b
  /dosomething $a $b

# gets everything as 1 block
/def /bla a b
  /dosomething $a $b
/alo x 1