From 692e10d8251ccc0d6aa35fa24a65dc9c67d7209e Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 18 Dec 2024 18:48:02 +0200 Subject: Fixed extra newline due to placeholder issues --- internal/client/ui/core/chat/chat.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'internal/client/ui/core') diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index 463f65a..70d6654 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -8,6 +8,13 @@ import ( "github.com/kyren223/eko/internal/client/ui/viminput" ) +var ( + ViBlurredBorder = lipgloss.NewStyle(). + BorderStyle(lipgloss.RoundedBorder()).UnsetBorderBottom() + ViFocusedBorder = lipgloss.NewStyle(). + BorderStyle(lipgloss.ThickBorder()).UnsetBorderBottom() +) + type Model struct { vi viminput.Model focus bool @@ -31,7 +38,17 @@ func (m Model) Init() tea.Cmd { } func (m Model) View() string { - return m.vi.View() + input := m.vi.View() + + if m.locked { + input = ViFocusedBorder.Render(input) + } else { + input = ViBlurredBorder.Render(input) + } + + result := input + + return result } func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { -- cgit v1.3.1