mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
fix: fn.exists() typos (#34390)
Problem: `exists()` checks should test for being equal to 1 rather than truthy, and extui check can be more restrictive. Solution: Adjust `exists()` guards to equal 1 and use `matchparen#CursorMoved`.
This commit is contained in:
@@ -98,7 +98,7 @@ function M.cmdline_pos(pos)
|
||||
if curpos[1] ~= M.row + 1 or curpos[2] ~= promptlen + pos then
|
||||
curpos[1], curpos[2] = M.row + 1, promptlen + pos
|
||||
-- Add matchparen highlighting to non-prompt part of cmdline.
|
||||
if pos > 0 and fn.exists('#matchparen') then
|
||||
if pos > 0 and fn.exists('#matchparen#CursorMoved') == 1 then
|
||||
api.nvim_win_set_cursor(ext.wins.cmd, { curpos[1], curpos[2] - 1 })
|
||||
vim._with({ win = ext.wins.cmd, wo = { eventignorewin = '' } }, function()
|
||||
api.nvim_exec_autocmds('CursorMoved', {})
|
||||
|
||||
Reference in New Issue
Block a user