Skip to content

Commit da6a7b2

Browse files
feat: add priority option for dash
## Details Request: #579
1 parent acddb80 commit da6a7b2

10 files changed

Lines changed: 26 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- add priority to code background [#563](https://github.com/MeanderingProgrammer/render-markdown.nvim/pull/563)
1010
- add more default link icons [#565](https://github.com/MeanderingProgrammer/render-markdown.nvim/pull/565)
1111
- add more YouTube domains [#569](https://github.com/MeanderingProgrammer/render-markdown.nvim/pull/569)
12+
- allow html.comment.text to be a function [#574](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/574)
13+
[acddb80](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/acddb80d9a12e33c03ca288de39c9963396f358a)
1214

1315
### Bug Fixes
1416

@@ -24,6 +26,7 @@
2426

2527
- @Lutetium-Vanadium
2628
- @chrisgrieser
29+
- @yzoug
2730

2831
## 8.10.0 (2025-11-08)
2932

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ require('render-markdown').setup({
549549
-- Amount of margin to add to the left of dash.
550550
-- If a float < 1 is provided it is treated as a percentage of available window space.
551551
left_margin = 0,
552+
-- Priority to assign to dash.
553+
priority = nil,
552554
-- Highlight for the whole line generated from the icon.
553555
highlight = 'RenderMarkdownDash',
554556
},
@@ -1247,6 +1249,8 @@ require('render-markdown').setup({
12471249
-- Amount of margin to add to the left of dash.
12481250
-- If a float < 1 is provided it is treated as a percentage of available window space.
12491251
left_margin = 0,
1252+
-- Priority to assign to dash.
1253+
priority = nil,
12501254
-- Highlight for the whole line generated from the icon.
12511255
highlight = 'RenderMarkdownDash',
12521256
},

benches/medium_spec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ describe('medium.md', function()
88
util.less_than(util.setup('temp/medium.md'), 20)
99
util.num_marks(base_marks)
1010

11-
util.less_than(util.move_down(3), 0.5)
11+
util.less_than(util.move_down(3), 1)
1212
util.num_marks(base_marks + 2)
1313

14-
util.less_than(util.modify(), 2.5)
14+
util.less_than(util.modify(), 5)
1515
util.num_marks(base_marks + 2)
1616
end)
1717
end)

benches/medium_table_spec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ describe('medium-table.md', function()
88
util.less_than(util.setup('temp/medium-table.md'), 100)
99
util.num_marks(base_marks)
1010

11-
util.less_than(util.move_down(1), 0.5)
11+
util.less_than(util.move_down(1), 1)
1212
util.num_marks(base_marks + 1)
1313

14-
util.less_than(util.modify(), 7.5)
14+
util.less_than(util.modify(), 10)
1515
util.num_marks(base_marks + 1)
1616
end)
1717
end)

benches/readme_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ local util = require('benches.util')
55
describe('README.md', function()
66
it('default', function()
77
local base_marks = 114
8-
util.less_than(util.setup('README.md'), 40)
8+
util.less_than(util.setup('README.md'), 50)
99
util.num_marks(base_marks)
1010

11-
util.less_than(util.move_down(1), 0.5)
11+
util.less_than(util.move_down(1), 1)
1212
util.num_marks(base_marks + 2)
1313

14-
util.less_than(util.modify(), 5)
14+
util.less_than(util.modify(), 10)
1515
util.num_marks(base_marks + 2)
1616
end)
1717
end)

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.5 Last change: 2026 January 02
1+
*render-markdown.txt* For NVIM v0.11.5 Last change: 2026 January 03
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -615,6 +615,8 @@ Default Configuration ~
615615
-- Amount of margin to add to the left of dash.
616616
-- If a float < 1 is provided it is treated as a percentage of available window space.
617617
left_margin = 0,
618+
-- Priority to assign to dash.
619+
priority = nil,
618620
-- Highlight for the whole line generated from the icon.
619621
highlight = 'RenderMarkdownDash',
620622
},
@@ -1305,6 +1307,8 @@ Dashed Line Configuration ~
13051307
-- Amount of margin to add to the left of dash.
13061308
-- If a float < 1 is provided it is treated as a percentage of available window space.
13071309
left_margin = 0,
1310+
-- Priority to assign to dash.
1311+
priority = nil,
13081312
-- Highlight for the whole line generated from the icon.
13091313
highlight = 'RenderMarkdownDash',
13101314
},

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

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

lua/render-markdown/render/markdown/dash.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ end
5656
---@param row integer
5757
function Render:dash(line, row)
5858
self.marks:add(self.config, 'dash', row, 0, {
59+
priority = self.config.priority,
5960
virt_text = line:get(),
6061
virt_text_pos = 'overlay',
6162
})

lua/render-markdown/settings.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ M.dash = {}
638638
---@field icon string
639639
---@field width render.md.dash.Width
640640
---@field left_margin number
641+
---@field priority? integer
641642
---@field highlight string
642643

643644
---@class (exact) render.md.dash.Context
@@ -670,6 +671,8 @@ M.dash.default = {
670671
-- Amount of margin to add to the left of dash.
671672
-- If a float < 1 is provided it is treated as a percentage of available window space.
672673
left_margin = 0,
674+
-- Priority to assign to dash.
675+
priority = nil,
673676
-- Highlight for the whole line generated from the icon.
674677
highlight = 'RenderMarkdownDash',
675678
}
@@ -686,6 +689,7 @@ function M.dash.schema()
686689
},
687690
},
688691
left_margin = { type = 'number' },
692+
priority = { optional = true, type = 'number' },
689693
highlight = { type = 'string' },
690694
})
691695
end

lua/render-markdown/types.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
---@field icon? string
142142
---@field width? render.md.dash.Width
143143
---@field left_margin? number
144+
---@field priority? integer
144145
---@field highlight? string
145146

146147
---@class (exact) render.md.document.UserConfig: render.md.base.UserConfig

0 commit comments

Comments
 (0)