mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 01:51:52 +00:00
fix(help): g==: 'No code block found' #40990
Problem: The code block query relied on a bug fixed in commit7ed5609439, where a trailing newline was not included in a node's text. Solution: Fix the query to expect the newline. (cherry picked from commitfdc09be03c)
This commit is contained in:
committed by
github-actions[bot]
parent
78d001cff7
commit
b6832a53b4
@@ -78,7 +78,7 @@ local function runnables()
|
||||
(language) @_lang
|
||||
.
|
||||
(code) @code
|
||||
(#any-of? @_lang "lua" "vim")
|
||||
(#any-of? @_lang "lua\n" "vim\n")
|
||||
(#set! @code lang @_lang))
|
||||
]]
|
||||
)
|
||||
@@ -106,9 +106,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