Skip to content

Commit ad05586

Browse files
fix: check if highlighter is active before computing concealed regions
## Details Issue: #300 While we report inactive highlights in the healthcheck we may as well handle the case when highlights are not active accurately. To do this all we need to do is check if highlights are active for the buffer before iterating through the highlighter query.
1 parent be3e3ab commit ad05586

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

doc/render-markdown.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2025 January 15
1+
*render-markdown.txt* For 0.10.0 Last change: 2025 January 16
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/core/conceal.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ function Conceal:compute(context)
8686
if not self:enabled() then
8787
return
8888
end
89+
if vim.treesitter.highlighter.active[self.buf] == nil then
90+
return
91+
end
8992
local parser = vim.treesitter.get_parser(self.buf)
9093
context:parse(parser)
9194
parser:for_each_tree(function(tree, language_tree)

lua/render-markdown/health.lua

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

77
---@private
8-
M.version = '7.8.8'
8+
M.version = '7.8.9'
99

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

0 commit comments

Comments
 (0)