feat: show shortcut key hint (#193)

This commit is contained in:
yetone
2024-08-24 20:29:46 +08:00
committed by GitHub
parent 0e07128b56
commit 9ac9f827ba
2 changed files with 92 additions and 1 deletions

View File

@@ -11,9 +11,12 @@ local M = {
}
M.input_ns = api.nvim_create_namespace("avante_input")
M.hint_ns = api.nvim_create_namespace("avante_hint")
M.setup = function()
local normal = api.nvim_get_hl(0, { name = "Normal" })
local normal_float = api.nvim_get_hl(0, { name = "NormalFloat" })
api.nvim_set_hl(0, M.REVERSED_NORMAL, { fg = normal.bg })
api.nvim_set_hl(0, M.TITLE, { fg = "#1e222a", bg = "#98c379" })
api.nvim_set_hl(0, M.REVERSED_TITLE, { fg = "#98c379" })
@@ -22,7 +25,8 @@ M.setup = function()
api.nvim_set_hl(0, M.THRIDTITLE, { fg = "#ABB2BF", bg = "#353B45" })
api.nvim_set_hl(0, M.REVERSED_THRIDTITLE, { fg = "#353B45" })
local normal_float = api.nvim_get_hl(0, { name = "NormalFloat" })
api.nvim_set_hl(M.hint_ns, "NormalFloat", { fg = normal_float.fg, bg = normal_float.bg })
api.nvim_set_hl(M.input_ns, "NormalFloat", { fg = normal_float.fg, bg = normal_float.bg })
api.nvim_set_hl(M.input_ns, "FloatBorder", { fg = normal.fg, bg = normal.bg })
end