File tree Expand file tree Collapse file tree 6 files changed +17
-1
lines changed Expand file tree Collapse file tree 6 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -775,6 +775,7 @@ require('render-markdown').setup({
775775 return nil
776776 end ,
777777 highlight = ' RenderMarkdownWikiLink' ,
778+ scope_highlight = nil ,
778779 },
779780 -- Define custom destination patterns so icons can quickly inform you of what a link
780781 -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
@@ -1503,6 +1504,7 @@ require('render-markdown').setup({
15031504 return nil
15041505 end ,
15051506 highlight = ' RenderMarkdownWikiLink' ,
1507+ scope_highlight = nil ,
15061508 },
15071509 -- Define custom destination patterns so icons can quickly inform you of what a link
15081510 -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
Original file line number Diff line number Diff line change @@ -841,6 +841,7 @@ Default Configuration ~
841841 return nil
842842 end,
843843 highlight = 'RenderMarkdownWikiLink',
844+ scope_highlight = nil,
844845 },
845846 -- Define custom destination patterns so icons can quickly inform you of what a link
846847 -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
@@ -1549,6 +1550,7 @@ Link Configuration ~
15491550 return nil
15501551 end,
15511552 highlight = 'RenderMarkdownWikiLink',
1553+ scope_highlight = nil,
15521554 },
15531555 -- Define custom destination patterns so icons can quickly inform you of what a link
15541556 -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
Original file line number Diff line number Diff line change 2525--- @field icon string
2626--- @field body fun ( ctx : render.md.link.Context ): render.md.mark.Text | string ?
2727--- @field highlight string
28+ --- @field scope_highlight ? string
2829
2930--- @class (exact ) render.md.link.custom.Config
3031--- @field pattern string
@@ -74,6 +75,7 @@ M.default = {
7475 return nil
7576 end ,
7677 highlight = ' RenderMarkdownWikiLink' ,
78+ scope_highlight = nil ,
7779 },
7880 -- Define custom destination patterns so icons can quickly inform you of what a link
7981 -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple
@@ -118,6 +120,7 @@ function M.validate(spec)
118120 wiki :type (' icon' , ' string' )
119121 wiki :type (' body' , ' function' )
120122 wiki :type (' highlight' , ' string' )
123+ wiki :type (' scope_highlight' , { ' string' , ' nil' })
121124 wiki :check ()
122125 end )
123126 spec :nested (' custom' , function (patterns )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55local M = {}
66
77--- @private
8- M .version = ' 8.7.5 '
8+ M .version = ' 8.7.6 '
99
1010function M .check ()
1111 M .start (' versions' )
Original file line number Diff line number Diff line change @@ -54,6 +54,14 @@ function Render:run()
5454 virt_text = { icon },
5555 virt_text_pos = ' inline' ,
5656 })
57+ -- apply scope highlight
58+ local highlight = self .config .scope_highlight
59+ if highlight then
60+ self .marks :add (' link' , row , start_col , {
61+ end_col = end_col ,
62+ hl_group = highlight ,
63+ })
64+ end
5765 -- hide destination if there is an alias
5866 if alias then
5967 self :hide (start_col , # destination + 1 )
Original file line number Diff line number Diff line change 216216--- @field icon ? string
217217--- @field body ? fun ( ctx : render.md.link.Context ): render.md.mark.Text | string ?
218218--- @field highlight ? string
219+ --- @field scope_highlight ? string
219220
220221--- @class (exact ) render.md.link.custom.UserConfig
221222--- @field pattern ? string
You can’t perform that action at this time.
0 commit comments