mirror of
https://github.com/neovim/neovim.git
synced 2026-07-31 12:49:11 +00:00
fix(help): g==: 'No code block found' #40990
Problem:
The code block query relied on a bug fixed in commit
7ed5609439, where a trailing newline was
not included in a node's text.
Solution:
Fix the query to expect the newline.
This commit is contained in:
@@ -82,7 +82,7 @@ local function runnables()
|
||||
(language) @_lang
|
||||
.
|
||||
(code) @code
|
||||
(#any-of? @_lang "lua" "vim")
|
||||
(#any-of? @_lang "lua\n" "vim\n")
|
||||
(#set! @code lang @_lang))
|
||||
]]
|
||||
)
|
||||
@@ -110,9 +110,9 @@ local function runnables()
|
||||
local code_block = code_blocks[pos]
|
||||
if not code_block then
|
||||
vim.print('No code block found')
|
||||
elseif code_block.lang == 'lua' then
|
||||
elseif code_block.lang == 'lua\n' then
|
||||
vim.cmd.lua(code_block.code)
|
||||
elseif code_block.lang == 'vim' then
|
||||
elseif code_block.lang == 'vim\n' then
|
||||
vim.cmd(code_block.code)
|
||||
end
|
||||
end, { buf = 0 })
|
||||
|
||||
Reference in New Issue
Block a user