feat: Add fallback node for custom placement
This commit is contained in:
@@ -75,7 +75,12 @@ return function(parent, data, template, required_type)
|
||||
|
||||
if append.position == "after" then
|
||||
local child_node = nodes:matching_child_nodes(parent, append.child_name)[1]
|
||||
if child_node ~= nil then
|
||||
if not child_node and append.fallback then
|
||||
local fallback = nodes:matching_child_nodes(parent, append.fallback)[1]
|
||||
if fallback then
|
||||
row_to_place, col_to_place, _, _ = fallback:range()
|
||||
end
|
||||
else
|
||||
row_to_place, col_to_place, _, _ = child_node:range()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user