Skip to content

Commit

Permalink
Fix replacement blocks not inheriting the start line number of the co…
Browse files Browse the repository at this point in the history
…ntainer they're replacing

Resolves #579
  • Loading branch information
colinodell committed Oct 17, 2020
1 parent 45d47d4 commit f585d37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi

## [Unreleased][unreleased]

### Fixed

- Fixed replacement blocks not inheriting the start line number of the container they're replacing (#579)

## [1.5.5] - 2020-09-13

### Changed
Expand Down
1 change: 1 addition & 0 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public function addBlock(AbstractBlock $block)
public function replaceContainerBlock(AbstractBlock $replacement)
{
$this->blockCloser->closeUnmatchedBlocks();
$replacement->setStartLine($this->container->getStartLine());
$this->container->replaceWith($replacement);

if ($this->tip === $this->container) {
Expand Down

0 comments on commit f585d37

Please sign in to comment.