Skip to content

Commit 6aa19e9

Browse files
feature: Add separate backgrounds for H3-H6 instead of sharing
## Details Requested: #70
1 parent 634f003 commit 6aa19e9

File tree

5 files changed

+55
-13
lines changed

5 files changed

+55
-13
lines changed

Diff for: README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,14 @@ require('render-markdown').setup({
199199
signs = { '󰫎 ' },
200200
-- The 'level' is used to index into the array using a clamp
201201
-- Highlight for the heading icon and extends through the entire line
202-
backgrounds = { 'RenderMarkdownH1Bg', 'RenderMarkdownH2Bg', 'RenderMarkdownH3Bg' },
202+
backgrounds = {
203+
'RenderMarkdownH1Bg',
204+
'RenderMarkdownH2Bg',
205+
'RenderMarkdownH3Bg',
206+
'RenderMarkdownH4Bg',
207+
'RenderMarkdownH5Bg',
208+
'RenderMarkdownH6Bg',
209+
},
203210
-- The 'level' is used to index into the array using a clamp
204211
-- Highlight for the heading and sign icons
205212
foregrounds = {
@@ -414,7 +421,14 @@ require('render-markdown').setup({
414421
signs = { '󰫎 ' },
415422
-- The 'level' is used to index into the array using a clamp
416423
-- Highlight for the heading icon and extends through the entire line
417-
backgrounds = { 'RenderMarkdownH1Bg', 'RenderMarkdownH2Bg', 'RenderMarkdownH3Bg' },
424+
backgrounds = {
425+
'RenderMarkdownH1Bg',
426+
'RenderMarkdownH2Bg',
427+
'RenderMarkdownH3Bg',
428+
'RenderMarkdownH4Bg',
429+
'RenderMarkdownH5Bg',
430+
'RenderMarkdownH6Bg',
431+
},
418432
-- The 'level' is used to index into the array using a clamp
419433
-- Highlight for the heading and sign icons
420434
foregrounds = {
@@ -658,7 +672,10 @@ The table below shows all the highlight groups with their default link
658672
| RenderMarkdownH6 | @markup.heading.6.markdown | H6 icons |
659673
| RenderMarkdownH1Bg | DiffAdd | H1 background line |
660674
| RenderMarkdownH2Bg | DiffChange | H2 background line |
661-
| RenderMarkdownH3Bg | DiffDelete | H3-H6 background line |
675+
| RenderMarkdownH3Bg | DiffDelete | H3 background line |
676+
| RenderMarkdownH4Bg | DiffDelete | H4 background line |
677+
| RenderMarkdownH5Bg | DiffDelete | H5 background line |
678+
| RenderMarkdownH6Bg | DiffDelete | H6 background line |
662679
| RenderMarkdownCode | ColorColumn | Code block background |
663680
| RenderMarkdownBullet | Normal | List item bullet points |
664681
| RenderMarkdownQuote | @markup.quote | Block quote marker |

Diff for: doc/render-markdown.txt

+23-3
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,14 @@ Full Default Configuration ~
239239
signs = { '󰫎 ' },
240240
-- The 'level' is used to index into the array using a clamp
241241
-- Highlight for the heading icon and extends through the entire line
242-
backgrounds = { 'RenderMarkdownH1Bg', 'RenderMarkdownH2Bg', 'RenderMarkdownH3Bg' },
242+
backgrounds = {
243+
'RenderMarkdownH1Bg',
244+
'RenderMarkdownH2Bg',
245+
'RenderMarkdownH3Bg',
246+
'RenderMarkdownH4Bg',
247+
'RenderMarkdownH5Bg',
248+
'RenderMarkdownH6Bg',
249+
},
243250
-- The 'level' is used to index into the array using a clamp
244251
-- Highlight for the heading and sign icons
245252
foregrounds = {
@@ -453,7 +460,14 @@ HEADINGS *render-markdown-setup-headings*
453460
signs = { '󰫎 ' },
454461
-- The 'level' is used to index into the array using a clamp
455462
-- Highlight for the heading icon and extends through the entire line
456-
backgrounds = { 'RenderMarkdownH1Bg', 'RenderMarkdownH2Bg', 'RenderMarkdownH3Bg' },
463+
backgrounds = {
464+
'RenderMarkdownH1Bg',
465+
'RenderMarkdownH2Bg',
466+
'RenderMarkdownH3Bg',
467+
'RenderMarkdownH4Bg',
468+
'RenderMarkdownH5Bg',
469+
'RenderMarkdownH6Bg',
470+
},
457471
-- The 'level' is used to index into the array using a clamp
458472
-- Highlight for the heading and sign icons
459473
foregrounds = {
@@ -717,7 +731,13 @@ The table below shows all the highlight groups with their default link
717731

718732
RenderMarkdownH2Bg DiffChange H2 background line
719733

720-
RenderMarkdownH3Bg DiffDelete H3-H6 background line
734+
RenderMarkdownH3Bg DiffDelete H3 background line
735+
736+
RenderMarkdownH4Bg DiffDelete H4 background line
737+
738+
RenderMarkdownH5Bg DiffDelete H5 background line
739+
740+
RenderMarkdownH6Bg DiffDelete H6 background line
721741

722742
RenderMarkdownCode ColorColumn Code block background
723743

Diff for: lua/render-markdown/colors.lua

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ M.colors = {
2727
H1Bg = 'DiffAdd',
2828
H2Bg = 'DiffChange',
2929
H3Bg = 'DiffDelete',
30+
H4Bg = 'DiffDelete',
31+
H5Bg = 'DiffDelete',
32+
H6Bg = 'DiffDelete',
3033
-- General
3134
Code = 'ColorColumn',
3235
Bullet = 'Normal',

Diff for: lua/render-markdown/init.lua

+8-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,14 @@ M.default_config = {
211211
signs = { '󰫎 ' },
212212
-- The 'level' is used to index into the array using a clamp
213213
-- Highlight for the heading icon and extends through the entire line
214-
backgrounds = { 'RenderMarkdownH1Bg', 'RenderMarkdownH2Bg', 'RenderMarkdownH3Bg' },
214+
backgrounds = {
215+
'RenderMarkdownH1Bg',
216+
'RenderMarkdownH2Bg',
217+
'RenderMarkdownH3Bg',
218+
'RenderMarkdownH4Bg',
219+
'RenderMarkdownH5Bg',
220+
'RenderMarkdownH6Bg',
221+
},
215222
-- The 'level' is used to index into the array using a clamp
216223
-- Highlight for the heading and sign icons
217224
foregrounds = {

Diff for: tests/util.lua

+1-6
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ M.prefix = 'RenderMarkdown'
4545
M.heading = function(row, level)
4646
local icons = { '󰲡 ', ' 󰲣 ', ' 󰲥 ', ' 󰲧 ', ' 󰲩 ', ' 󰲫 ' }
4747
local foreground = string.format('%sH%d', M.prefix, level)
48-
local background
49-
if level < 3 then
50-
background = string.format('%sH%dBg', M.prefix, level)
51-
else
52-
background = string.format('%sH3Bg', M.prefix)
53-
end
48+
local background = string.format('%sH%dBg', M.prefix, level)
5449
local sign_mark = {
5550
row = { row, row },
5651
col = { 0, level },

0 commit comments

Comments
 (0)