fix(defaults): visual hash (#) on text with "?"

Problem:
The default "#" mapping fails on the following example after v$h# with
cursor at start of the first line:

    aa?/\bb
    aa
    aa?/\bb

Solution:
Also escape "?".
This commit is contained in:
Justin M. Keyes 2023-07-08 15:28:13 +02:00
parent 7c077a3c2b
commit 6318edadc3

View File

@ -1029,7 +1029,7 @@ function vim._init_default_mappings()
local esc_chunks = vim
.iter(chunks)
:map(function(v)
return vim.fn.escape(v, [[/\]])
return vim.fn.escape(v, [[?/\]])
end)
:totable()
local esc_pat = table.concat(esc_chunks, [[\n]])