aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-03-18 12:52:58 +0100
committerChristian Clason <ch.clason+github@icloud.com>2025-03-18 14:22:08 +0100
commit91773710145e1fb0f67264e1b2e33de7c446ca01 (patch)
treee91d46755097d897c5a6df462878a8d56966a951
parent6623b4e0509bd169557e0f41fa3763d0787af86b (diff)
downloadrneovim-91773710145e1fb0f67264e1b2e33de7c446ca01.tar.gz
rneovim-91773710145e1fb0f67264e1b2e33de7c446ca01.tar.bz2
rneovim-91773710145e1fb0f67264e1b2e33de7c446ca01.zip
fix(help): remove runnable code virtual text
Problem: Virtual text indicating runnable code examples in help files is intrusive and non-configurable (and often denotes actually non-working examples). Solution: Remove virtual text.
-rw-r--r--runtime/ftplugin/help.lua5
1 files changed, 0 insertions, 5 deletions
diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua
index e19571454d..1833e70ff9 100644
--- a/runtime/ftplugin/help.lua
+++ b/runtime/ftplugin/help.lua
@@ -82,9 +82,7 @@ local query = vim.treesitter.query.parse(
]]
)
local root = parser:parse()[1]:root()
-local run_message_ns = vim.api.nvim_create_namespace('nvim.vimdoc.run_message')
-vim.api.nvim_buf_clear_namespace(0, run_message_ns, 0, -1)
for _, match, metadata in query:iter_matches(root, 0, 0, -1) do
for id, nodes in pairs(match) do
local name = query.captures[id]
@@ -92,9 +90,6 @@ for _, match, metadata in query:iter_matches(root, 0, 0, -1) do
local start, _, end_ = node:parent():range()
if name == 'code' then
- vim.api.nvim_buf_set_extmark(0, run_message_ns, start, 0, {
- virt_text = { { 'Run with `g==`', 'LspCodeLens' } },
- })
local code = vim.treesitter.get_node_text(node, 0)
local lang_node = match[metadata[id].lang][1] --[[@as TSNode]]
local lang = vim.treesitter.get_node_text(lang_node, 0)