Skip to content

Commit

Permalink
feat(indent): adapt indentation of nestable detached modifiers when a…
Browse files Browse the repository at this point in the history
… detached modifier extension is found

basically just indents further than the `( )` in e.g. a list now
  • Loading branch information
vhyrro committed Feb 25, 2023
1 parent 3a64c73 commit 56e59da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/neorg/modules/core/norg/esupports/indent/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ module.config.public = {
return 0
end

if list:named_child(1):type() == "detached_modifier_extension" then
return module.required["core.integrations.treesitter"].get_node_range(list:named_child(2)).column_start
+ module.required["core.integrations.treesitter"]
.get_node_text(list:named_child(2))
:match("^%s*")
:len()
end

return module.required["core.integrations.treesitter"].get_node_range(list:named_child(1)).column_start
end,
},
Expand Down

0 comments on commit 56e59da

Please sign in to comment.