commit d47a847

delthas  ·  2024-07-02 22:26:08 +0000 UTC
parent bf679b4
Fix autocompletion highlight
1 files changed,  +3, -3
+3, -3
 1@@ -572,21 +572,21 @@ func (e *Editor) Draw(vx *Vaxis, x0, y int, hint string) {
 2 		}
 3 	}
 4 
 5-	for i, completion := range e.autoCache[autoOff : autoOff+autoCount] {
 6+	for ci, completion := range e.autoCache[autoOff : autoOff+autoCount] {
 7 		display := completion.Display
 8 		if display == nil {
 9 			display = completion.Text[completion.StartIdx:]
10 		}
11 
12 		x := autoX
13-		y := y - i - 1
14+		y := y - ci - 1
15 		i := 0
16 		for i < len(display) {
17 			s := vaxis.Style{
18 				Background: vaxis.IndexColor(0),
19 				Attribute:  vaxis.AttrReverse,
20 			}
21-			if i+autoOff == e.autoCacheIdx {
22+			if ci+autoOff == e.autoCacheIdx {
23 				s.Attribute |= vaxis.AttrBold
24 			} else {
25 				s.Attribute |= vaxis.AttrDim