Skip to content

Commit 4da2159

Browse files
benlubasgithub-actions[bot]
authored andcommitted
chore: autoformat with stylua
1 parent 3cc135b commit 4da2159

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

lua/neorg/modules/core/esupports/hop/module.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -958,19 +958,19 @@ module.private = {
958958
end
959959
callback(
960960
"{"
961-
.. lib.when(
962-
parsed_link_information.link_file_text --[[@as boolean]],
963-
lib.lazy_string_concat(":", parsed_link_information.link_file_text, ":"),
964-
""
965-
)
966-
.. prefix
967-
.. most_similar.text
968-
.. "}"
969-
.. lib.when(
970-
parsed_link_information.link_description --[[@as boolean]],
971-
lib.lazy_string_concat("[", parsed_link_information.link_description, "]"),
972-
""
973-
)
961+
.. lib.when(
962+
parsed_link_information.link_file_text --[[@as boolean]],
963+
lib.lazy_string_concat(":", parsed_link_information.link_file_text, ":"),
964+
""
965+
)
966+
.. prefix
967+
.. most_similar.text
968+
.. "}"
969+
.. lib.when(
970+
parsed_link_information.link_description --[[@as boolean]],
971+
lib.lazy_string_concat("[", parsed_link_information.link_description, "]"),
972+
""
973+
)
974974
)
975975
end,
976976
}

lua/neorg/modules/core/integrations/treesitter/module.lua

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ module.public = {
938938
end,
939939
}
940940

941-
942941
--[[
943942
-- attribution notice:
944943
-- The below public functions are originally licensed under Apache v2 taken from:
@@ -1008,31 +1007,31 @@ end
10081007
---@param allow_switch_parents? boolean allow switching parents if last node
10091008
---@param allow_next_parent? boolean allow next parent if last node and next parent without children
10101009
module.public.get_next_node = function(node, allow_switch_parents, allow_next_parent)
1011-
local destination_node ---@type TSNode?
1012-
local parent = node:parent()
1013-
1014-
if not parent then
1015-
return
1016-
end
1017-
local found_pos = 0
1018-
for i = 0, parent:named_child_count() - 1, 1 do
1019-
if parent:named_child(i) == node then
1020-
found_pos = i
1021-
break
1010+
local destination_node ---@type TSNode?
1011+
local parent = node:parent()
1012+
1013+
if not parent then
1014+
return
1015+
end
1016+
local found_pos = 0
1017+
for i = 0, parent:named_child_count() - 1, 1 do
1018+
if parent:named_child(i) == node then
1019+
found_pos = i
1020+
break
1021+
end
10221022
end
1023-
end
1024-
if parent:named_child_count() > found_pos + 1 then
1025-
destination_node = parent:named_child(found_pos + 1)
1026-
elseif allow_switch_parents then
1027-
local next_node = module.public.get_next_node(parent)
1028-
if next_node and next_node:named_child_count() > 0 then
1029-
destination_node = next_node:named_child(0)
1030-
elseif next_node and allow_next_parent then
1031-
destination_node = next_node
1023+
if parent:named_child_count() > found_pos + 1 then
1024+
destination_node = parent:named_child(found_pos + 1)
1025+
elseif allow_switch_parents then
1026+
local next_node = module.public.get_next_node(parent)
1027+
if next_node and next_node:named_child_count() > 0 then
1028+
destination_node = next_node:named_child(0)
1029+
elseif next_node and allow_next_parent then
1030+
destination_node = next_node
1031+
end
10321032
end
1033-
end
10341033

1035-
return destination_node
1034+
return destination_node
10361035
end
10371036

10381037
module.on_event = function(event)

0 commit comments

Comments
 (0)