commit c37f59b

delthas  ·  2024-07-24 15:32:27 +0000 UTC
parent a601d8e
Show an ellipsis when more completions are available
1 files changed,  +6, -1
+6, -1
 1@@ -610,8 +610,13 @@ func (e *Editor) Draw(vx *Vaxis, x0, y int, hint string) {
 2 		if display == nil {
 3 			display = completion.Text[completion.StartIdx:]
 4 		}
 5+		var unselectable bool
 6 		if completion.Async != nil {
 7 			display = []rune("Loading...")
 8+			unselectable = true
 9+		} else if (ci == 0 && autoOff > 0) || (ci == autoCount-1 && autoOff+autoCount < len(e.autoCache)) {
10+			display = []rune("...")
11+			unselectable = true
12 		}
13 
14 		x := autoX
15@@ -627,7 +632,7 @@ func (e *Editor) Draw(vx *Vaxis, x0, y int, hint string) {
16 			} else {
17 				s.Attribute |= vaxis.AttrDim
18 			}
19-			if completion.Async != nil {
20+			if unselectable {
21 				s.Attribute |= vaxis.AttrItalic
22 			}
23 			dx, di := printCluster(vx, x, y, x0+e.width, display[i:], s)