Skip to content

Commit 7b96f5d

Browse files
allow block folding (#385)
1 parent 1fecadc commit 7b96f5d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lua/orgmode/org/indent.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ local get_matches = ts_utils.memoize_by_buf_tick(function(bufnr)
4141
end
4242
end
4343

44-
if type == 'paragraph' or type == 'drawer' or type == 'property_drawer' then
44+
if type == 'paragraph' or type == 'drawer' or type == 'property_drawer' or type == 'block' then
4545
opts.indent_type = 'other'
4646
local parent = node:parent()
4747
while parent and parent:type() ~= 'section' do
@@ -88,7 +88,7 @@ local function foldexpr()
8888
return '>' .. match.stars
8989
end
9090

91-
if match.type == 'drawer' or match.type == 'property_drawer' then
91+
if match.type == 'drawer' or match.type == 'property_drawer' or match.type == 'block' then
9292
if match.line_nr == vim.v.lnum then
9393
return 'a1'
9494
end

queries/org/org_indent.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
(body (paragraph) @OrgParagraph)
44
(body (drawer) @OrgDrawer)
55
(section (property_drawer) @OrgPropertyDrawer)
6+
(block) @OrgBlock

0 commit comments

Comments
 (0)