summaryrefslogtreecommitdiff
path: root/internal/client
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-02-03 17:30:23 +0200
committerKyren223 <Kyren223@proton.me>2025-02-03 17:30:23 +0200
commitc0013eba3791c80c2d9d51c1fa5ac228242bd5c4 (patch)
tree253f390355ae9e50de2ac37ecb042852373beed9 /internal/client
parenta6cb16570e8245c572d9f7800bc38f6f7384ac35 (diff)
Fixed instances where viminput would still show the terminal background
Diffstat (limited to 'internal/client')
-rw-r--r--internal/client/ui/viminput/viminput.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/client/ui/viminput/viminput.go b/internal/client/ui/viminput/viminput.go
index 22f6bfd..a24eef8 100644
--- a/internal/client/ui/viminput/viminput.go
+++ b/internal/client/ui/viminput/viminput.go
@@ -14,6 +14,7 @@ import (
)
var (
+ BackgroundStyle = lipgloss.NewStyle().Background(colors.Background)
CursorStyle = lipgloss.NewStyle().Background(colors.White).Foreground(colors.Background)
InactiveCursorStyle = lipgloss.NewStyle()
VisualStyle = lipgloss.NewStyle().Background(colors.DarkGray)
@@ -144,7 +145,7 @@ func (m Model) View() string {
} else {
builder.WriteString(string(line[:m.cursorColumn]))
builder.WriteString(cursorStyle.Render(string(line[m.cursorColumn])))
- builder.WriteString(string(line[m.cursorColumn+1:]))
+ builder.WriteString(BackgroundStyle.Render(string(line[m.cursorColumn+1:])))
}
builder.WriteByte('\n')
@@ -187,7 +188,7 @@ func (m Model) View() string {
if len(line) != 0 {
cursorChar := string(line[m.cursorColumn])
builder.WriteString(cursorStyle.Render(cursorChar))
- builder.WriteString(string(line[m.cursorColumn+1:]))
+ builder.WriteString(BackgroundStyle.Render(string(line[m.cursorColumn+1:])))
} else {
builder.WriteString(cursorStyle.Render(" "))
}
@@ -210,7 +211,7 @@ func (m Model) View() string {
builder.WriteString(VisualStyle.Render(string(line[safeUpper])))
}
safeLower := min(safeUpper+1, len(line))
- builder.WriteString(string(line[safeLower:]))
+ builder.WriteString(BackgroundStyle.Render(string(line[safeLower:])))
if m.cursorColumn == len(line) {
builder.WriteString(cursorStyle.Render(" "))
@@ -226,7 +227,7 @@ func (m Model) View() string {
} else {
builder.WriteString(VisualStyle.Render(string(line[:m.cursorColumn])))
builder.WriteString(cursorStyle.Render(string(line[m.cursorColumn])))
- builder.WriteString(string(line[m.cursorColumn+1:]))
+ builder.WriteString(BackgroundStyle.Render(string(line[m.cursorColumn+1:])))
}
} else if m.cursorLine == i {
// cursor line, highlight after cursor col
@@ -251,7 +252,7 @@ func (m Model) View() string {
builder.WriteString(VisualStyle.Render(" "))
} else {
builder.WriteString(VisualStyle.Render(string(line[:m.vcol+1])))
- builder.WriteString(string(line[m.vcol+1:]))
+ builder.WriteString(BackgroundStyle.Render(string(line[m.vcol+1:])))
}
}