We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9de0d97 commit d6f0978Copy full SHA for d6f0978
1 file changed
lua/helpview/parsers/vimdoc.lua
@@ -390,7 +390,20 @@ end
390
---@param text string[]
391
---@param range helpview.parsed.range
392
vimdoc.hl = function (buffer, _, text, range)
393
- if vim.fn.hlexists(text[1]) == 0 then
+ local can_run, output = pcall(
394
+ vim.api.nvim_exec2,
395
+ string.format("hi %s", text[1] or "123"),
396
+ { output = true }
397
+ )
398
+
399
+ if can_run == false then
400
+ return;
401
+ end
402
403
+ ---@type string The actual group name(group names are case-insensitive).
404
+ local actual_group = string.match(output.output, "^[a-zA-Z0-9_.@-]+") or "";
405
406
+ if actual_group ~= text[1] then
407
return;
408
end
409
0 commit comments