mirror of
https://github.com/ash-project/igniter.git
synced 2024-09-20 05:22:52 +12:00
fix: use length of path for insertion point, instead of node equality
This commit is contained in:
parent
11e948af6c
commit
bfe50c6cac
1 changed files with 2 additions and 2 deletions
|
@ -149,7 +149,7 @@ defmodule Igniter.Code.Common do
|
||||||
cond do
|
cond do
|
||||||
upwards && extendable_block?(upwards.node) ->
|
upwards && extendable_block?(upwards.node) ->
|
||||||
{:__block__, _, upwards_code} = upwards.node
|
{:__block__, _, upwards_code} = upwards.node
|
||||||
index = Enum.find_index(upwards_code, &(&1 == zipper.node))
|
index = Enum.count(zipper.path.left || [])
|
||||||
|
|
||||||
to_insert =
|
to_insert =
|
||||||
if extendable_block?(new_code) do
|
if extendable_block?(new_code) do
|
||||||
|
@ -170,7 +170,7 @@ defmodule Igniter.Code.Common do
|
||||||
|
|
||||||
super_upwards && extendable_block?(super_upwards.node) ->
|
super_upwards && extendable_block?(super_upwards.node) ->
|
||||||
{:__block__, _, upwards_code} = super_upwards.node
|
{:__block__, _, upwards_code} = super_upwards.node
|
||||||
index = Enum.find_index(upwards_code, &(&1 == zipper.supertree.node))
|
index = Enum.count(zipper.supertree.path.left || [])
|
||||||
|
|
||||||
to_insert =
|
to_insert =
|
||||||
if extendable_block?(new_code) do
|
if extendable_block?(new_code) do
|
||||||
|
|
Loading…
Reference in a new issue