Skip to content

Commit 996ec12

Browse files
feat: add priority to sign configuration
## Details Request: #601 Allows user to define a custom priority to use for signs to decide which ones should be shown, defaults to nil.
1 parent 99bfa5d commit 996ec12

6 files changed

Lines changed: 16 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,8 @@ require('render-markdown').setup({
847847
sign = {
848848
-- Turn on / off sign rendering.
849849
enabled = true,
850+
-- Priority to assign to sign.
851+
priority = nil,
850852
-- Applies to background of sign text.
851853
highlight = 'RenderMarkdownSign',
852854
},
@@ -1642,6 +1644,8 @@ require('render-markdown').setup({
16421644
sign = {
16431645
-- Turn on / off sign rendering.
16441646
enabled = true,
1647+
-- Priority to assign to sign.
1648+
priority = nil,
16451649
-- Applies to background of sign text.
16461650
highlight = 'RenderMarkdownSign',
16471651
},

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.6 Last change: 2026 January 28
1+
*render-markdown.txt* For NVIM v0.11.6 Last change: 2026 January 29
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -913,6 +913,8 @@ Default Configuration ~
913913
sign = {
914914
-- Turn on / off sign rendering.
915915
enabled = true,
916+
-- Priority to assign to sign.
917+
priority = nil,
916918
-- Applies to background of sign text.
917919
highlight = 'RenderMarkdownSign',
918920
},
@@ -1686,6 +1688,8 @@ Sign Configuration ~
16861688
sign = {
16871689
-- Turn on / off sign rendering.
16881690
enabled = true,
1691+
-- Priority to assign to sign.
1692+
priority = nil,
16891693
-- Applies to background of sign text.
16901694
highlight = 'RenderMarkdownSign',
16911695
},

lua/render-markdown/health.lua

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

88
---@private
9-
M.version = '8.11.3'
9+
M.version = '8.11.4'
1010

1111
function M.check()
1212
M.start('versions')

lua/render-markdown/render/base.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function Base:sign(config, enabled, text, highlight)
6363
sign_highlight = colors.combine(highlight, sign_highlight)
6464
end
6565
self.marks:start(config, 'sign', self.node, {
66+
priority = sign.priority,
6667
sign_text = text,
6768
sign_hl_group = sign_highlight,
6869
})

lua/render-markdown/settings.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,12 +1750,15 @@ M.sign = {}
17501750

17511751
---@class (exact) render.md.sign.Config
17521752
---@field enabled boolean
1753+
---@field priority? integer
17531754
---@field highlight string
17541755

17551756
---@type render.md.sign.Config
17561757
M.sign.default = {
17571758
-- Turn on / off sign rendering.
17581759
enabled = true,
1760+
-- Priority to assign to sign.
1761+
priority = nil,
17591762
-- Applies to background of sign text.
17601763
highlight = 'RenderMarkdownSign',
17611764
}
@@ -1766,6 +1769,7 @@ function M.sign.schema()
17661769
return {
17671770
record = {
17681771
enabled = { type = 'boolean' },
1772+
priority = { optional = true, type = 'number' },
17691773
highlight = { type = 'string' },
17701774
},
17711775
}

lua/render-markdown/types.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293

294294
---@class (exact) render.md.sign.UserConfig
295295
---@field enabled? boolean
296+
---@field priority? integer
296297
---@field highlight? string
297298

298299
---@alias render.md.window.UserConfigs table<string, render.md.window.UserConfig>

0 commit comments

Comments
 (0)