fix: follow the prev slash command strategy (#1835)

This commit is contained in:
yetone
2025-04-08 20:01:57 +08:00
committed by GitHub
parent 6631b791ee
commit 87ea15bb94

View File

@@ -2574,8 +2574,7 @@ function Sidebar:create_input_container(opts)
return
end
local has_cmp = pcall(require, "cmp")
if request:sub(1, 1) == "/" and not has_cmp then
if request:sub(1, 1) == "/" then
local command, args = request:match("^/(%S+)%s*(.*)")
if command == nil then
self:update_content("Invalid command", { focus = false, scroll = false })