improve: support to customize the spinners (#2397)
This commit is contained in:
@@ -558,6 +558,48 @@ M._defaults = {
|
||||
align = "center", -- left, center, right for title
|
||||
rounded = true,
|
||||
},
|
||||
spinner = {
|
||||
editing = {
|
||||
"⡀",
|
||||
"⠄",
|
||||
"⠂",
|
||||
"⠁",
|
||||
"⠈",
|
||||
"⠐",
|
||||
"⠠",
|
||||
"⢀",
|
||||
"⣀",
|
||||
"⢄",
|
||||
"⢂",
|
||||
"⢁",
|
||||
"⢈",
|
||||
"⢐",
|
||||
"⢠",
|
||||
"⣠",
|
||||
"⢤",
|
||||
"⢢",
|
||||
"⢡",
|
||||
"⢨",
|
||||
"⢰",
|
||||
"⣰",
|
||||
"⢴",
|
||||
"⢲",
|
||||
"⢱",
|
||||
"⢸",
|
||||
"⣸",
|
||||
"⢼",
|
||||
"⢺",
|
||||
"⢹",
|
||||
"⣹",
|
||||
"⢽",
|
||||
"⢻",
|
||||
"⣻",
|
||||
"⢿",
|
||||
"⣿",
|
||||
},
|
||||
generating = { "·", "✢", "✳", "∗", "✻", "✽" },
|
||||
thinking = { "🤯", "🙄" },
|
||||
},
|
||||
input = {
|
||||
prefix = "> ",
|
||||
height = 6, -- Height of the input window in vertical layout
|
||||
|
||||
@@ -89,8 +89,8 @@ function Sidebar:new(id)
|
||||
chat_history = nil,
|
||||
current_state = nil,
|
||||
state_timer = nil,
|
||||
state_spinner_chars = { "·", "✢", "✳", "∗", "✻", "✽" },
|
||||
thinking_spinner_chars = { "🤯", "🙄" },
|
||||
state_spinner_chars = Config.windows.spinner.generating,
|
||||
thinking_spinner_chars = Config.windows.spinner.thinking,
|
||||
state_spinner_idx = 1,
|
||||
state_extmark_id = nil,
|
||||
scroll = true,
|
||||
|
||||
@@ -44,47 +44,7 @@ function PromptInput:new(opts)
|
||||
obj.close_on_submit = opts.close_on_submit or false
|
||||
obj.win_opts = opts.win_opts
|
||||
obj.default_value = opts.default_value
|
||||
obj.spinner_chars = {
|
||||
"⡀",
|
||||
"⠄",
|
||||
"⠂",
|
||||
"⠁",
|
||||
"⠈",
|
||||
"⠐",
|
||||
"⠠",
|
||||
"⢀",
|
||||
"⣀",
|
||||
"⢄",
|
||||
"⢂",
|
||||
"⢁",
|
||||
"⢈",
|
||||
"⢐",
|
||||
"⢠",
|
||||
"⣠",
|
||||
"⢤",
|
||||
"⢢",
|
||||
"⢡",
|
||||
"⢨",
|
||||
"⢰",
|
||||
"⣰",
|
||||
"⢴",
|
||||
"⢲",
|
||||
"⢱",
|
||||
"⢸",
|
||||
"⣸",
|
||||
"⢼",
|
||||
"⢺",
|
||||
"⢹",
|
||||
"⣹",
|
||||
"⢽",
|
||||
"⢻",
|
||||
"⣻",
|
||||
"⢿",
|
||||
"⣿",
|
||||
"⣶",
|
||||
"⣤",
|
||||
"⣀",
|
||||
}
|
||||
obj.spinner_chars = Config.windows.spinner.editing
|
||||
obj.spinner_index = 1
|
||||
obj.spinner_timer = nil
|
||||
obj.spinner_active = false
|
||||
|
||||
Reference in New Issue
Block a user