Skip to content

Commit 26097a4

Browse files
fix: reduce code background priority in nofile buffers
## Details Default priority for extmarks will prevent most other highlights from showing above the ones from this plugin. In most cases this is fine, but in lsp signature help docs this ends up overwriting the active parameter highlight. Active parameter highlights are set with a priority of `vim.hl.priorities.user` which defaults to 200, so the new default on nofile buffers is set just below at 175.
1 parent b2b1353 commit 26097a4

6 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
- handle double width glyph checkboxes [#553](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/553)
1515
[f58c05f](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/f58c05f349d6e7650f4b40b0df1514400f0c10de)
16+
- link icons following long checkboxes [#564](https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/564)
17+
[b2b1353](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/b2b135347e299ffbf7f4123fb7811899b0c9f4b8)
1618

1719
### Collaborator Shoutouts
1820

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,7 @@ require('render-markdown').setup({
932932
buftype = {
933933
nofile = {
934934
render_modes = true,
935+
code = { priority = 175 },
935936
padding = { highlight = 'NormalFloat' },
936937
sign = { enabled = false },
937938
},

doc/render-markdown.txt

Lines changed: 2 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: 2025 December 02
1+
*render-markdown.txt* For NVIM v0.11.5 Last change: 2025 December 11
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -998,6 +998,7 @@ Default Configuration ~
998998
buftype = {
999999
nofile = {
10001000
render_modes = true,
1001+
code = { priority = 175 },
10011002
padding = { highlight = 'NormalFloat' },
10021003
sign = { enabled = false },
10031004
},

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

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

lua/render-markdown/settings.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ M.overrides.default = {
14091409
buftype = {
14101410
nofile = {
14111411
render_modes = true,
1412+
code = { priority = 175 },
14121413
padding = { highlight = 'NormalFloat' },
14131414
sign = { enabled = false },
14141415
},

tests/util.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function M.highlight(kind)
7979
local priority ---@type integer?
8080
local highlight ---@type string
8181
if kind == 'code' then
82+
priority = vim.bo.buftype == 'nofile' and 175 or nil
8283
highlight = 'RmCodeInline'
8384
elseif kind == 'inline' then
8485
highlight = 'RmInlineHighlight'
@@ -312,6 +313,7 @@ end
312313
function M.code.bg()
313314
---@type vim.api.keyset.set_extmark
314315
return {
316+
priority = vim.bo.buftype == 'nofile' and 175 or nil,
315317
hl_eol = true,
316318
hl_group = 'RmCode',
317319
}

0 commit comments

Comments
 (0)