Skip to content

Commit 35c37ca

Browse files
feat: apply dash rendering to top and bottom of plus / minus metadata
1 parent cb90caf commit 35c37ca

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Pre-release
44

5+
### Features
6+
7+
- chechbox scope highlight [cb90caf](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/cb90caf64951b5b7515def7783b32e73883e374c)
8+
59
### Bug Fixes
610

711
- only set option value if it changes [#186](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/186)

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ require('render-markdown').setup({
153153
] @heading)
154154
(setext_heading) @heading
155155
156-
(thematic_break) @dash
156+
[
157+
(thematic_break)
158+
(minus_metadata)
159+
(plus_metadata)
160+
] @dash
157161
158162
(fenced_code_block) @code
159163

doc/render-markdown.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ Default Configuration ~
201201
] @heading)
202202
(setext_heading) @heading
203203

204-
(thematic_break) @dash
204+
[
205+
(thematic_break)
206+
(minus_metadata)
207+
(plus_metadata)
208+
] @dash
205209

206210
(fenced_code_block) @code
207211

lua/render-markdown/health.lua

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

66
---@private
7-
M.version = '7.2.5'
7+
M.version = '7.2.6'
88

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

lua/render-markdown/init.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ M.default_config = {
228228
] @heading)
229229
(setext_heading) @heading
230230
231-
(thematic_break) @dash
231+
[
232+
(thematic_break)
233+
(minus_metadata)
234+
(plus_metadata)
235+
] @dash
232236
233237
(fenced_code_block) @code
234238

lua/render-markdown/render/dash.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@ end
2626
function Render:render()
2727
local width = self.dash.width
2828
width = type(width) == 'number' and width or self.context:get_width()
29+
local virt_text = { self.dash.icon:rep(width), self.dash.highlight }
2930

30-
self.marks:add(true, self.info.start_row, 0, {
31-
virt_text = { { self.dash.icon:rep(width), self.dash.highlight } },
31+
local start_row, end_row = self.info.start_row, self.info.end_row - 1
32+
self.marks:add(true, start_row, 0, {
33+
virt_text = { virt_text },
3234
virt_text_pos = 'overlay',
3335
})
36+
if end_row > start_row then
37+
self.marks:add(true, end_row, 0, {
38+
virt_text = { virt_text },
39+
virt_text_pos = 'overlay',
40+
})
41+
end
3442
end
3543

3644
return Render

0 commit comments

Comments
 (0)