From d832518ec6b4604c27d8ce9c9587a4641f2337fe Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Thu, 13 Mar 2025 09:11:08 +0800 Subject: fix(lua): vim.hl.on_yank highlights wrong region with yi' (#32850) Problem: yi' don't highlight last character since https://github.com/neovim/neovim/commit/8ce504820af04194a41acbe1f4c61cf12bd5feb5. Solution: Always use `opts.inclusive=true`, since calculation of `"]` (`b_op_end`) have taken `inclusive` into account. --- runtime/lua/vim/hl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/hl.lua') diff --git a/runtime/lua/vim/hl.lua b/runtime/lua/vim/hl.lua index 070748d31e..a2b06c9727 100644 --- a/runtime/lua/vim/hl.lua +++ b/runtime/lua/vim/hl.lua @@ -182,7 +182,7 @@ function M.on_yank(opts) vim.api.nvim__ns_set(yank_ns, { wins = { winid } }) M.range(bufnr, yank_ns, higroup, "'[", "']", { regtype = event.regtype, - inclusive = event.inclusive, + inclusive = true, priority = opts.priority or M.priorities.user, timeout = opts.timeout or 150, }) -- cgit