Skip to content

Commit 1327150

Browse files
feat: configurable indent extmark priority
## Details Allows `indent.priority` to be configured which determines the priority value used for indent extmarks. Default value is set to 0, which is the value that was previously hard coded. This means no changes should occur out of the box for users, but allows users to modify the value to work better with their configuration.
1 parent b977c94 commit 1327150

File tree

6 files changed

+16
-3
lines changed

6 files changed

+16
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,8 @@ require('render-markdown').setup({
812812
skip_heading = false,
813813
-- Prefix added when indenting, one per level.
814814
icon = '',
815+
-- Priority to assign to extmarks.
816+
priority = 0,
815817
-- Applied to icon.
816818
highlight = 'RenderMarkdownIndent',
817819
},
@@ -1543,6 +1545,8 @@ require('render-markdown').setup({
15431545
skip_heading = false,
15441546
-- Prefix added when indenting, one per level.
15451547
icon = '',
1548+
-- Priority to assign to extmarks.
1549+
priority = 0,
15461550
-- Applied to icon.
15471551
highlight = 'RenderMarkdownIndent',
15481552
},

doc/render-markdown.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For NVIM v0.11.2 Last change: 2025 July 09
1+
*render-markdown.txt* For NVIM v0.11.2 Last change: 2025 July 14
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -878,6 +878,8 @@ Default Configuration ~
878878
skip_heading = false,
879879
-- Prefix added when indenting, one per level.
880880
icon = '▎',
881+
-- Priority to assign to extmarks.
882+
priority = 0,
881883
-- Applied to icon.
882884
highlight = 'RenderMarkdownIndent',
883885
},
@@ -1585,6 +1587,8 @@ Indent Configuration ~
15851587
skip_heading = false,
15861588
-- Prefix added when indenting, one per level.
15871589
icon = '▎',
1590+
-- Priority to assign to extmarks.
1591+
priority = 0,
15881592
-- Applied to icon.
15891593
highlight = 'RenderMarkdownIndent',
15901594
},

lua/render-markdown/config/indent.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
---@field skip_level integer
44
---@field skip_heading boolean
55
---@field icon string
6+
---@field priority integer
67
---@field highlight string
78

89
---@class render.md.indent.Cfg
@@ -26,6 +27,8 @@ M.default = {
2627
skip_heading = false,
2728
-- Prefix added when indenting, one per level.
2829
icon = '',
30+
-- Priority to assign to extmarks.
31+
priority = 0,
2932
-- Applied to icon.
3033
highlight = 'RenderMarkdownIndent',
3134
}
@@ -37,6 +40,7 @@ function M.validate(spec)
3740
spec:type('skip_level', 'number')
3841
spec:type('skip_heading', 'boolean')
3942
spec:type('icon', 'string')
43+
spec:type('priority', 'number')
4044
spec:type('highlight', 'string')
4145
spec:check()
4246
end

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '8.6.0'
8+
M.version = '8.6.1'
99

1010
function M.check()
1111
M.start('version')

lua/render-markdown/render/markdown/section.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Render:run()
3838
local line = self:indent():line(false, self.data.level_change):get()
3939
for row = start_row, end_row do
4040
self.marks:add(false, row, 0, {
41-
priority = 0,
41+
priority = self.config.priority,
4242
virt_text = line,
4343
virt_text_pos = 'inline',
4444
})

lua/render-markdown/types.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
---@field skip_level? integer
175175
---@field skip_heading? boolean
176176
---@field icon? string
177+
---@field priority? integer
177178
---@field highlight? string
178179

179180
---@alias render.md.injection.UserConfigs table<string, render.md.injection.UserConfig>

0 commit comments

Comments
 (0)