It looks like current TAdvMemo only support up to 2 levels of code folding. If the code contains 3 or more levels, it fails to address the parents at upper levels . Example with code below
then it will fail to find folding node for procedure Level1.
Could you please check and fix this problem.