Skip to content

Commit 7358b0c

Browse files
chore: add priority to code schema
1 parent ed40f13 commit 7358b0c

6 files changed

Lines changed: 12 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ require('render-markdown').setup({
507507
inline_right = '',
508508
-- Padding to add to the left & right of inline code.
509509
inline_pad = 0,
510-
-- Priority to assign to highlight for code blocks.
510+
-- Priority to assign to code background highlight.
511511
priority = nil,
512512
-- Highlight for code blocks.
513513
highlight = 'RenderMarkdownCode',
@@ -1174,7 +1174,7 @@ require('render-markdown').setup({
11741174
inline_right = '',
11751175
-- Padding to add to the left & right of inline code.
11761176
inline_pad = 0,
1177-
-- Priority to assign to highlight for code blocks.
1177+
-- Priority to assign to code background highlight.
11781178
priority = nil,
11791179
-- Highlight for code blocks.
11801180
highlight = 'RenderMarkdownCode',

doc/render-markdown.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For NVIM v0.11.5 Last change: 2025 November 17
1+
*render-markdown.txt* For NVIM v0.11.5 Last change: 2025 December 02
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -573,8 +573,8 @@ Default Configuration ~
573573
inline_right = '',
574574
-- Padding to add to the left & right of inline code.
575575
inline_pad = 0,
576-
-- Priority to assign to highlight for code blocks.
577-
priority = nil,
576+
-- Priority to assign to code background highlight.
577+
priority = nil,
578578
-- Highlight for code blocks.
579579
highlight = 'RenderMarkdownCode',
580580
-- Highlight for code info section, after the language.
@@ -1234,8 +1234,8 @@ Code Block Configuration ~
12341234
inline_right = '',
12351235
-- Padding to add to the left & right of inline code.
12361236
inline_pad = 0,
1237-
-- Priority to assign to highlight for code blocks.
1238-
priority = nil,
1237+
-- Priority to assign to code background highlight.
1238+
priority = nil,
12391239
-- Highlight for code blocks.
12401240
highlight = 'RenderMarkdownCode',
12411241
-- Highlight for code info section, after the language.

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.10.3'
9+
M.version = '8.10.4'
1010

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

lua/render-markdown/render/inline/code.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ end
2323
function Render:run()
2424
local highlight = self.config.highlight_inline
2525
self.marks:over(self.config, 'code_background', self.node, {
26-
hl_group = highlight,
2726
priority = self.config.priority,
27+
hl_group = highlight,
2828
})
2929
self:padding(highlight, true)
3030
self:padding(highlight, false)

lua/render-markdown/render/markdown/code.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ function Render:background(start_row, end_row)
225225
for row = start_row, end_row do
226226
self.marks:add(self.config, 'code_background', row, col, {
227227
end_row = row + 1,
228+
priority = self.config.priority,
228229
hl_group = self.config.highlight,
229230
hl_eol = true,
230-
priority = self.config.priority,
231231
})
232232
if not padding:empty() and win_col > 0 then
233233
-- overwrite anything beyond width with padding

lua/render-markdown/settings.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ M.code.default = {
511511
inline_right = '',
512512
-- Padding to add to the left & right of inline code.
513513
inline_pad = 0,
514-
-- Priority to assign to highlight for code blocks.
514+
-- Priority to assign to code background highlight.
515515
priority = nil,
516516
-- Highlight for code blocks.
517517
highlight = 'RenderMarkdownCode',
@@ -562,6 +562,7 @@ function M.code.schema()
562562
inline_left = { type = 'string' },
563563
inline_right = { type = 'string' },
564564
inline_pad = { type = 'number' },
565+
priority = { optional = true, type = 'number' },
565566
highlight = { type = 'string' },
566567
highlight_info = { type = 'string' },
567568
highlight_language = { optional = true, type = 'string' },

0 commit comments

Comments
 (0)