This one is gonna be a bit hard to wrap your head around but the example should show the "bug"
We have a folder with the files
MainSkin.ini
└A.inc
└B.inc
└C.inc
In the skin, the meters are color coded to represent it easier, A is RED, C is GREEN, B is BLUE
MainSkin.ini
First let's start with the code as is
Code: Select all
[Rainmeter]
@IncludeA=A.inc
@IncludeB=B.inc
Code: Select all
[Rainmeter]
[MeterA]
@IncludeC=C.inc
[MeterA2]
@IncludeB=B.inc
Code: Select all
[Rainmeter]
[MeterA]
[MeterC1]
[MeterC2]
[MeterC3]
[MeterA2]
@IncludeB=B.inc
Code: Select all
[Rainmeter]
[MeterA]
[MeterC1]
[MeterC2]
[MeterC3]
[MeterA2]
[MeterB]
ACCCAB
The Rainmeter log debugs the loads for those files in that order too, ACB
And that's how it should work by the logic imposed by the wording on the docs and what humans would assume with recursive actions of this kind... except it dosen't, that's why I made this report, when Rainmeter gets to
Code: Select all
[Rainmeter]
[MeterA]
@IncludeC=C.inc
@IncludeB=B.inc
; [MeterA2] is in limbo
This ends up being what Rainmeter currently dose right now
Code: Select all
[Rainmeter]
[MeterA]
[MeterC1]
[MeterC2]
[MeterC3]
[MeterB]
[MeterA2]
I wanted to give a suggestion here but I genuinely have no idea how to fix this. When I found this out my very first reaction was a loud WHYYYYYY???? and laughing at my screen.
Most likely binary tree where the sections are resolved first and the @Includes get their branches later can be a solution for this? (If my assumption that Rainmeter reads @Includes line by line is correct and dosen't read sections before @Includes, I blame Microsoft if it reads sections before @Includes). Maybe make an agent for @Include and for every file that gets @Included, spawn an agent in them too instead of a global "we'll add them later" list?
I know the solution is to just include [MeterB] in MainSkin.ini after the 2 @Includes, but the logic for the implementation is still flawed and it's what I wanted to point out, the docs are too correct in saying When Rainmeter reaches an @include line, it reads the given file, placing all unique options into any existing sections, then places the remainder of the included file after the section in which it was called.
And to give credits, this was submitted by Gabe on Discord