Previously, the line after the layer change would also contain the z height.
If not found, the could would break the per-line reading, and skip to the next layer.
However, if the code doesn't contain the Z on the first gcode line of the layer, this would cause it to skip past all layers, until there was a layer with the Z in the first line (so this also explains the 'late' pauses).
I just ignored the optimization and made it a continue.
I checked, and I don't think there's any way this causes the postproc.-gcode to be inserted twice, since it returns the complete data after insering it once.
CURA-6965
It would detect the height of the raft by looking at what the first Z coordinate is that it encounters on layer 0. This Z coordinate also includes the initial layer height though. If you pause lower than the initial layer height (but higher than 0), you'd expect to pause in the initial layer.
Because we can't set the temperature and we don't know the correct temperature to set it back to, we will just retract further in order to prevent damage to the material.
Contributes to issue CURA-5491.
Instead of deriving this from the g-code flavour, just use the actual settings that are made to control these two properties.
Contributes to issue CURA-5491.
There is no such command to disable only the E stepper drivers. This command M84 gets interpreted as disabling ALL stepper drivers, which on some printers would cause the print bed to fall down.
It has to iterate over all layers and do string comparison to find the index back. Instead we just keep track of the index so this should improve performance a bit.
Instead of making lots of nested if statements, use the if statements as an interruption check. This reduces the indentation a lot and makes it easier to read in my opinion. It also makes it easier to add stuff to these checks.