Correctly set file and lines on newly created sub-directives

This commit is contained in:
Jamie Cameron
2020-06-22 20:32:15 -07:00
parent afdad02d75
commit 8ca1cb35a6

View File

@@ -291,6 +291,11 @@ splice(@$lref, $section->{'line'}, $oldlen, @newlines);
&renumber($conf, $section->{'eline'}, $section->{'file'},
scalar(@newlines)-$oldlen);
$section->{'eline'} = $section->{'line'} + scalar(@newlines) - 1;
my $i = 1;
foreach my $m (@{$section->{'members'}}) {
$m->{'line'} = $m->{'eline'} = $section->{'line'} + $i++;
$m->{'file'} = $section->{'file'};
}
}
# renumber(&conf, line, file, offset)