Stargate Rewritten

Stargate Rewritten

241 Downloads

Incorrect indentation breaks config loading

EpicKnarvik97 opened this issue ยท 1 comments

commented

The current code in legacy-config-migration has a strange bug regarding indentation. When the configuration is saved, any comment blocks above another comment block with one empty line in between ends up with zero indentation. When loading, because of the 0 indentation, everything afterwards, one of these comment blocks is treated as part of the comment block. This only ends once something else with 0 indentation is encountered.

This bug prevents many configuration values from being loaded. It's easy to patch this by just adding a hashtag to the line between the comment blocks, but robustness is required. As users can edit their configurations themselves, it is likely some users will encounter this problem, even if the internal configuration is corrected.

commented

It seems that in convertCommentsToYAMLMappings, as the indentation is taken from the current line, all comments with an empty line below it will have 0 indentation.