Skip to content

Commit c1d3f9e

Browse files
committed
chore(mention): escape chars in mention pattern
1 parent 0c7f72e commit c1d3f9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/opencode/ui/input_window.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ function M.remove_mention(mention_name, windows)
220220
local lines = vim.api.nvim_buf_get_lines(windows.input_buf, 0, -1, false)
221221
for i, line in ipairs(lines) do
222222
local mention_key = config.get_key_for_function('input_window', 'mention')
223-
local updated_line = line:gsub(mention_key .. mention_name, '')
223+
local pattern = vim.pesc(mention_key .. mention_name)
224+
local updated_line = line:gsub(pattern, '')
224225
if updated_line ~= line then
225226
lines[i] = updated_line
226227
end

0 commit comments

Comments
 (0)