yglu icon indicating copy to clipboard operation
yglu copied to clipboard

Mixing of !for based loops and usual sequences breaks order

Open elchupanebrej opened this issue 4 years ago • 1 comments

When I do:

seq: !-
  - first
  - second

after_seq: !-
  - pre-last
  - last

extended_seq:
  - !for .seq: !()
      - !? $
  - next
  - other next
  - !for .after_seq: !()
      - !? $

I expect the next output:

extended_seq:
  - first
  - second
  - next
  - other next
  - pre-last
  - last

But I get:

extended_seq:
  - next
  - other next
  - first
  - second
  - pre-last
  - last

elchupanebrej avatar Dec 14 '21 08:12 elchupanebrej

I'm willing to fix this but it's difficult to find the time these days. As a workaround, you can create another for/sequence for the intermediate items:

seq: !-
  - first
  - second

nexts: !- 
  - next
  - other next
  
after_seq: !-
  - pre-last
  - last

extended_seq:
  - !for .seq: !()
      - !? $
  - !for .nexts: !()
      - !? $
  - !for .after_seq: !()
      - !? $

lbovet avatar Jan 16 '22 13:01 lbovet