Skip to content

Commit

Permalink
Don't execute some Node-related commands when no Node is active
Browse files Browse the repository at this point in the history
For example when the `NagView` is active.
  • Loading branch information
Guldoman committed May 22, 2023
1 parent 5eed889 commit 89c59cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/core/commands/root.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ for _, dir in ipairs { "left", "right", "up", "down" } do
end

command.add(function()
local node = core.root_view:get_active_node()
local node = core.root_view:get_active_node(true)
if not node then return false end
local sx, sy = node:get_locked_size()
return not sx and not sy, node
end, t)
Expand All @@ -124,7 +125,7 @@ command.add(nil, {
command.add(function(node)
if not Node:is_extended_by(node) then node = nil end
-- No node was specified, use the active one
node = node or core.root_view:get_active_node()
node = node or core.root_view:get_active_node(true)
if not node then return false end
return true, node
end,
Expand Down

0 comments on commit 89c59cf

Please sign in to comment.