Skip to content

Commit 25d94e1

Browse files
committed
Fix broken spacing for each row of completion area
1 parent 6ee0a0f commit 25d94e1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

render.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ func (r *Render) renderCompletion(buf *Buffer, completions *CompletionManager) {
130130
}
131131

132132
selected := completions.selected - completions.verticalScroll
133+
cursorColumnSpacing := cursor
134+
133135
r.out.SetColor(White, Cyan, false)
134136
for i := 0; i < windowHeight; i++ {
135-
r.out.CursorDown(1)
137+
alignNextLine(r, cursorColumnSpacing)
138+
136139
if i == selected {
137140
r.out.SetColor(r.selectedSuggestionTextColor, r.selectedSuggestionBGColor, true)
138141
} else {
@@ -286,3 +289,10 @@ func clamp(high, low, x float64) float64 {
286289
return x
287290
}
288291
}
292+
293+
func alignNextLine(r *Render, col int) {
294+
r.out.CursorDown(1)
295+
r.out.WriteStr("\r")
296+
r.out.CursorForward(col)
297+
298+
}

0 commit comments

Comments
 (0)